Maelstrom Patch for Arcade Cab


7 posts
by GuardianBob » Fri Feb 08, 2013 7:37 pm
So I'm building a full sized arcade cabinet. As a result I needed to modify Maelstrom to work without a full keyboard. (I'm going to have buttons encoded into keyboard commands via a microprocessor.) I have a patch here that does all this and adds support for SDL backed by Dispmanx.

This adds:
  • Compatibility with SDL backed by Dispmanx
  • 16:9 aspect ratio
  • Screen saver like about screen
  • Credit processing
  • New high score entering method

Keys:
  • C - Add credit
  • Left/Right - Rotate left/right in game
  • Up - Thrust
  • P - Play (main menu) or if you have credits add life
  • Q - Quit from the main menu
  • Z - Zap high scores from the main menu

Use the SDL backed by Dispmanx, it helps a lot.

How to use: (Raspbian
Install SDL backed by Dispmanx - viewtopic.php?f=78&t=25146
Get the Maelstrom source (tar.gz) - http://www.libsdl.org/projects/Maelstrom/source.html
Copy the source and patch to the pi user home directory, run:
Code: Select all
tar -xvzf Maelstrom-3.0.6.tar.gz
cd Maelstrom-3.0.6
patch -p1 < ~/maelstrom.pi.patch
./configure
make
sudo make install
/usr/local/bin/Maelstrom


You should be good to go at that point.

Edit - I just found a problem, I'm working on it now. I'll update my patch ASAP
Posts: 15
Joined: Mon Feb 04, 2013 1:41 pm
by GuardianBob » Fri Feb 08, 2013 9:42 pm
Okay tracked down my problem, the 16:9 ratio, apparently the status line is causing issues.

Here's the patch file.
Attachments
maelstrom.pi.zip
(7.85 KiB) Downloaded 87 times
Posts: 15
Joined: Mon Feb 04, 2013 1:41 pm
by GuardianBob » Sat Feb 09, 2013 5:45 pm
FYI - I'm working on stereo sound so my stupid TV will play the sound via HDMI. I'm sick and tired of the analog sound.
Posts: 15
Joined: Mon Feb 04, 2013 1:41 pm
by HBrydon » Sat Feb 09, 2013 7:03 pm
Posts: 7
Joined: Fri Oct 26, 2012 3:29 pm
by GuardianBob » Sat Feb 09, 2013 9:01 pm
HBrydon wrote:Does this fix the problem:

http://elinux.org/R-Pi_Troubleshooting# ... MI_monitor


That topic identifies the problem but does not give a solution. The issue is some games have mono sound, so like aplay with a mono wav file, it won't play through HDMI (the TV simply mutes the output). So the solution would be to convert the sound to stereo. Normally that wouldn't be a problem; however, in the case of Maelstrom the sound is being converted, sample by sample, from the Macintosh snd format to wav. Since the original is mono, the wav is mono, leaving me in a lurch, if I'm going to maintain compatibility.

I'm going to have to rewrite the snd to wav converter to up sample the sound to stereo, as SDL simply plays the sound it gets.

The other option is to convert the snd format to wav format, and simply up sample the sounds by hand, but that is a less appealing right now. (That said it is quite a bit easier.)
Posts: 15
Joined: Mon Feb 04, 2013 1:41 pm
by GuardianBob » Sat Feb 09, 2013 11:45 pm
Got something working, but boy is it an ugly hack.

Basically, I'm changing the number of channels when loading, doubling the conversion rate, and using that to handle the left/right frame parts. It would likely sound horrid on headphones, but it works nicely in my case.
Posts: 15
Joined: Mon Feb 04, 2013 1:41 pm
by GuardianBob » Sun Feb 10, 2013 3:25 am
As promised here's my stereo sound patch.

After thinking about it for a while, it isn't that ugly of a hack and should sound alright using headphones. I'm sure an audiophile would say I'm committing a huge sin, but I don't care, it works.
Attachments
Maelstrom.stereo.zip
(1.01 KiB) Downloaded 83 times
Posts: 15
Joined: Mon Feb 04, 2013 1:41 pm