There is no general guide to find memory triggers that works with every game, you maybe the
guide on SMSPower can help you.
Anyway, I always use MESS' debugger to search for such things.
For this game, the sound driver runs on the Z80, so interrupted the emulation and while the "maincpu" (68000) is active, I set a watchpoint over a part of the Z80 RAM area.
Code:
wpset A00000,100,w
(Values are hexadecimal by default. The whole Z80 RAM area is A00000 to A01FFF actually, but I didn't want to risk slowdowns, so I picked just the first 0x100 bytes.)
The important thing here is, that the 68k processor asks the Z80 to play music and sound effects. It does this by writing to the Z80 RAM area, so if you find out what values it writes there and where it writes them, you can find some memory triggers.
Common locations are: (Z80 RAM offsets, 68k address is A0xxxx)
- 1C0A, values are 80+ (usual SMPS sound driver, 1C0B is also possible but mainly used for SFX)
- 1FFC, values are 00+ (Wonderboy sound driver?, found in the Tiny Toon Adventures 3 pirate)
GEMS is a
bit lot more complicated, so I left it out here.
THIS game however has the memory trigger at 0004/0005. Also it works in a pretty weird way.
The value at 0004 seems to identify the routine that has to be called and must be a multiple of 2. (00 = do nothing [default], 02 = Stop Music, 04 = Play Music, 06 = Play SFX, 0E = ??)
0005 is the parameter, i.e. sound or music ID.
(Note: Finding this out wasn't trivial in this case.)
So if you're using MESS to log VGMs, you can play a song this way:
1. Interrupt the emulation and open the debugger. (see Input (general) -> User Interface -> Break in Debugger to change/view the key)
2. In the debugging window, click Debug -> Run to Next CPU until it shows "Z80" in the window's title.
3. type this into the small command line: (xx - music number)
Code:
b@0004 = 04; b@0005 = xx
4. press enter to execute it and press F5 to continue the emulation.
If you want to play another song, you can just execute the line above with a different number. As long as the disassembly window shows "Z80" in its title, you don't even need to stop the emulation.
To stop the music, execute:
Code:
b@0004 = 02
The only music IDs that seem to work are 00..09 (actual music) and 0C (some voice).
Note: If you use Kega Fusion, you should have success by hex-editing save states. I find the command line of MESS a lot more comfortable though.