The SEGA Sound Engine

While not all of SEGA's games use this system, the majority do.

Typically the Memory Trigger is located at C??0-C??5, D??0-D??5 (RAM). If you find an area in ram where the values change in time to the music, you are in the general area of the trigger if it exists. This is true of most games, though not all. For games using this engine, the main trigger will have a value of $80 (hex) the majority of the time, changing only when an sfx is played or the music changes. The SEGA sound engine uses the same trigger in ram to play sfx and music. Other engines may feature a different implementation.

Very frequently, the value will be at D003, DC03, DD03, DE03 - with the first and last being more common. The value $80 signifies the engine is playing back a track of silence. Typically values for the engine work like this:

$00-7F Reset/reinitialize the engine (Stops Music). It will do this every frame unless the value in ram is changed back to $80
$80 Plays back silence. It is the default value, so it does not interfere in music playback. This value is written after every value. Technically, it indicates only that bit 7 is set, and so the sound engine is "on".
$81+ Typically the first track starts at $81, but this is not necessarily so. Some games may mix the values of sfx and music together. Commonly, $81-8F will be music, and values after the last music value will be sfx. Early games do not have valid values that go above A0/B0/C0. Later games may have values that go to D0. $BF/CF/DF-FF These values will also reset/reinitialize the sound engine.\\

It's likely that SEGA released official source code and documentation regarding its sound engine. Games by SIMS and Minato Giken also use a very similar implementation.

Assuming the value is at DE03 (where it is matter less than the order of values), DE00 would normally be the area allocated for FM code, whether or not it is used. The value is then followed by several 00 bytes. The next few also serve as triggers for music, and usually the value for songs and sfx is loaded there before being loaded into the trigger. Accessing the trigger directly is often the most efficient method for control.

Jump tables will often be used to access songs/sfx. Usually it is something simple such as the song value being used as an offset for a table of addresses that are then loaded and redirect the program counter.




Return to top
0.171s