Previous Thread
Next Thread
Print Thread
Joined: Jul 2007
Posts: 10
U
Member
OP Offline
Member
U
Joined: Jul 2007
Posts: 10
It's that time of year again: the summer. This is the time when I often get bored and work on my projects.

This year, I've decided to reverse-engineer the music drivers for games that M1 does not yet support.

First up is Super Pang (as well as its prequel, Pang). These offsets should be the same for all releases, even some of the bootlegs. The Z80 machine code is semi-fucked up, so I can't get it decoded and working in other environments, so I leave you with this code.

Note that this only works for the YM2413 code, and does not work with the OKI sound bank, although there is already an extractor for that.

0x788E - init address. Song ID is stored in a. Song IDs are 0x20-0x3F, SFX are 0x00-0x1F.
0x7800 - play address. ugetab found this one out.

Secondly, the SMPS driver for Megadrive/Genesis games. This info ONLY APPLIES to the Z80 builds. It's actually pretty simple, just write the song number you want to play to 0x1C0A (in Z80 space) after all the hardware has been initialized and the code is up and running. This works on Chaotix as well, which runs the main music driver on the Z80.


taking over m1, one z80 at a time
Joined: Mar 2001
Posts: 16,614
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,614
For Megadrive games I actually insert 68k code stubs that init the driver, run it per frame (if it's not Z80 resident), and change song numbers. (The stubs end with a special illegal opcode that means "halt the 68k"). That works well for GEMS, and I also have Sonic 2 working, but the PCM in Sonic 2 plays at the wrong speed (way too slow) and I haven't gotten a handle on why.

If you want to actually hack on some of this stuff PM me and I'll send you the source.

Last edited by R. Belmont; 07/09/08 03:43 PM.

Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
0 members (), 27 guests, and 2 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,837
Posts116,231
Members4,921
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.5