Sound Hacking/Sega Consoles

From vgmrips
Jump to: navigation, search

Sega MegaDrive/Genesis sound hacks

Simple Triggers

These are simple memory triggers. Setting the respective bytes in 68000 or Z80 RAM will cause the game to immediately play a song or sound effect.

See BlastEm's page for instructions on how to use these in that emulator.

Game Sound Driver Music Trigger + Comments
Bill's Tomato Game Krisalis/Shaun Hollingworth maincpu.w@FF900E = xxxx

0001/0002 = stop sound, 0003~00D0 = music
Note: The trigger selects the "module pattern". Thus some values can start playback mid-song.

Chuck Rock Krisalis/Shaun Hollingworth maincpu.w@FF0014 = xxxx

0001 = stop sound, 0002~0043 = music
Note: The trigger selects the "module pattern". Thus some values can start playback mid-song.

Sonic The Hedgehog SMPS 68k maincpu.b@FFF009 = xx

00/E4 = stop sound, 81~93 = music, A0~D0 = SFX, E1 = SEGA speech

Sonic The Hedgehog 2 SMPS Z80 genesis_snd_z80.b@1B88 = xx

00/FD = stop sound, 81~9F = music, A0~F3 = SFX, FA = SEGA speech

Sonic The Hedgehog 3 SMPS Z80 genesis_snd_z80.b@1C0A = xx

E2 = stop sound, 01~32 = music, 33~DB = SFX, FF = SEGA speech

Spider-Man vs. The Kingpin unknown custom play SFX: maincpu.b@FFE6EC = xx, values 00~31

pause music: genesis_snd_z80.b@000A = 00
resume music: genesis_snd_z80.b@000A = FF
silence sound: genesis_snd_z80.b@000B = FF
Music can not be triggered and requires a function call of 000DE8 or 000E0E with the song address on the stack.

Advanced Hacks

This section contains ROM patches for playing songs/SFX, as well as hacking information like ROM/RAM offsets and sound driver RAM layouts.

Adventures of Rocky and Bullwinkle and Friends, The

ROM patch to play a certain song at the SEGA screen:

offset  hex patch       description
03C29E  05 A4 -> 00 02  ; ignore bad ROM checksum
04C0F7  03    -> xx     ; where xx = sound IF
068B9C  6A    -> 60     ; make it freeze on the SEGA screen

The PlaySong function is located at ROM offset 05618A.

Baby's Day Out

ROM patch to play a certain song at the SEGA screen:

offset  hex bytes       ASM code            description
019FC4  41F9 00FF 0408  LEA     $FF0408.L, A0
019FCA  4210            CLR.B   (A0)
019FCC  4A10            TST.B   (A0)
019FCE  67FC            BEQ     $019FCC     ; wait for Vertical Interrupt
019FD0  4EB8 1612       JSR     $001612.W   ; call Play Music (skipping the "stop" part)
019FD4  xxxx            DC.W    #id         ; "song ID" parameter for PlayMusic
019FD6  60FE            BRA     *           ; freeze game

Hacking information:

PlayMusic routine:  001608 (stops music, waits for frame to finish, then starts music)
GemsStart routine:  005CC4 (start GEMS sequence)
GemsStop routine:   005D06 (stop all GEMS sequences)
GEMS command area:  A01B40~A01B7F

Bill's Tomato Game

Hacking information:

Note: Almost every value is a 2-byte word. (Big Endian)

Sound RAM:      FF9000
NTSC/PAL Mode:  FF9006/07 (01 - NTSC, enables extra delay, 00 - PAL)
NTSC Delay Cntr:FF9008/09 (counts 0..5 in NTSC mode, unused in PAL mode)
Pause Enable:   FF900A/0B (01 - pause sound driver)
PlayMusic Slot: FF900E/0F (value is 01+)
Tempo Countdown:FF9010/11
Cur. Pattern:   FF9012/13
Cur. Row:       FF9014/15
Tempo:          FF902C/2D
Playing State:  FF902E
                -> 00 - playing
                -> FF - paused
Track RAM:      FF903A (0C bytes per track, 6 tracks)
Total Frames:   FF90B0/B1
Frames in Sec.: FF90B2/B3
Total Seconds:  FF90B4/B5

Sound Driver Init routine: 0F91AA
Sound Driver Update routine: 0F928A


Track RAM
---------
00/01 - some Tick Counter
02/03 - Ticks until next event
04 - Event Type??
05 - Event Data
06 - ??
07-0B - unused (00)

Newman/Haas IndyCar featuring Nigel Mansell

ROM patch to play a song on the title screen:

offset  hex bytes       ASM code        description
1C8C72  4E71            NOP             ; skip SEGA screen
1CA4B6  4E71            NOP             ; skip license screen
1C8A8E  4E71            NOP             ; skip Aklaim screen
1C018E  303C 00xx       MOVE.W  #xx, D0 ; set song ID to play (0..5)
1C01A0  60FE            BRA     *       ; freeze game after starting the song (to prevent screen changes etc.)

General ROM locations:

StopMusic:		070000
PlayMusic:		070004 (Register D0 = sound ID)
UpdateMusic:		070008
LoadZ80Driver:		07000C
SilencePSG:		070014
UpdateSFX:		07001C
StopSFX:		070028
DoCarEngineSFX:		070030
Music Pointer Lists:	07173C (20h bytes per song, 6 songs)
Sound RAM:		FF8400

Sound IDs:

00 - Main Theme
01 - Racing BGM
02 - Qualified
03 - Hard Luck
04 - Race Results
05 - Ending