It is a common problem when ripping VGMs from a game to find that you are unable to rip them without sound effects (SFX) playing. This page describes a general-purpose hack which will allow most Master System games' music to be ripped without SFX playing.
[checksum] ROM[66]=fb,18,fe
What the hell is that? Don't worry, I have all the steps described below...
Open Meka's folder. It should look a bit like the one to the right only with more cool stuff in it. (I've even assumed you have Windows set to hide file extensions, possibly the most lame option possible.) You need to open the meka.nam file in a text editor. What's one of those? Notepad. Here's the easy way:
Now you have the meka.nam file open, you need to find the game you're ripping music from. Try pressing F3 to bring up the Find dialogue.
At the start of the line is a 16-letter code - a checksum - which identifies the game in Meka. You need to select and then copy this to the clipboard (Ctrl+C).
If you find your game has more than one entry, you might have to try all of them in turn until they work. For now, grab the first one.
Now you need to open meka.pat in the text editor. (You can open it in the existing window, we don't need it any more so long as you already copied the checksum.) Then go down to the bottom and add this:
[checksum] ROM[66]=fb,18,fe
except instead of "checksum" you have to paste the checksum of the game. I suggest you also add a comment to remind you what game it was - you can add a comment by starting the line with a semicolon ";" and then you can write anything you like after it.
Now save the file by choosing Save from the File menu. An important step, it must be said, and easy to mess up because Notepad (in Windows 98) doesn't save when you press Ctrl+S.
Now open the game in Meka and quickly start a new game and wait until the music's playing. Once it's going, press Pause (mapped to the Space Bar by default). If all goes according to plan, two things should happen:
If the music stops, sorry, this hack didn't work. Delete it from meka.pat and go about your business. If it doesn't... hooray! Here's the procedure:
The save/load is because this hack permanently freezes the game. Whatever you do, don't save a frozen game!
Finally, delete the section from meka.pat when you've finished because you don't want the Pause button to freeze the game when you're playing it normally.
1. Nothing happens when I press Pause
Check you got the checksum right. Check you saved the meka.pat file. If the game has more than one entry, try other checksums. Note that this only works for Master System games (and the few MS mode GG games), that is games with extension .sms. It might work with SG-1000 and SC-3000 games, I'm not sure. It definitely doesn't work with GG games.
2. The music stops when I press Pause
You obviously weren't listening. I said already that if this happens, sorry, the hack doesn't work. It works with almost all games, just not the one you chose.
3. The game requires me to use the pause button sometimes
Then you have to remove the hack (to temporarily remove it, put a semicolon at
the start of the ROM[66]=fb,18,fe
line and save), play to the bit where
you save in the instructions above, save, quit Meka, put it back (remove the
semicolon and save), load Meka, load the game. Hopefully that makes sense.
All SMS games have to have a pause button handler at offset 0x0066 in the file - when Pause is pressed, execution goes there, and the game has no choice in the matter (it can't turn it off). So I know that this is somewhere I can put code and it will always run when Pause is pressed.
Virtually every game relies on the Vertical Blanking Interrupt (VBlank) for timing and as a result is very likely to use it for timing updates to the sound output. Therefore, so long as VBlank interrupts are enabled, the sound will still update whenever there is a VBlank, even if the rest of the code doesn't run.
(Actually, I don't know why games do this. The sound code doesn't need to go in the VBlank, unless the framerate is so bad it destroys the music otherwise, so it could equally well be in the out-of-VBlank main loop. It's probably there because there will be several busy-loops for various game elements.)
So, if I put some code at offset 0x0066 that turns on VBlank interrupts and then hangs the game, it'll (hopefully) give me constantly updating sound (music) without any SFX being triggered (hung gameplay). Here's some code to do that:
When converted to machine code, that's:
fb ; ei 18 fe ; jr -2
So, we can write fb 18 fe
at offset $66 using the meka.pat entry
described above.
Things to note:
ei
though, because it is quite common for a game to di
in the VBlank handler but ei
out of it.
jp addr
, which is three bytes. It could possibly be a jr offset
, which is two, or just a retn
or rst $xx
which is one, but these seem very unlikely to me.