You probably saw in an updated reply a ways back that I was having trouble with esreal's sonic3 driver port related to music, so I am disassembling the sonic 3 driver and I like what I see. Expect the howto section to utilized my disassembly in both sonic1 and sonic2 and I learned some new things about z80 pointers, they are 15 bit byte swapped, not 16 bit absolute byte swapped and are relative to the bank they are in. They work like gameboy pointers in a way. The ones you have mostly worked with so far have the high 16th bit set, which I have no idea what it is for though the sonic 3 driver seems to unset it prior to reading the offset.
Well, did you notice that every once in a while a dac sample pointer doesn't have that big set? This is why I say we have not a 16 bit absolute pointer, but a 15 bit bank relative with an unknown high bit flag.
I am getting close to ready to release the asm form of the driver.
In other words we had it wrong but still got done what we needed to. The music should be aligned to a location in 8000h bank space, not to a physical loation in the rom itself, yet we did that unknowingly by aligning to the rom, though now we know. Want to add new music or sounds outside a bank? simply add a new bank and align to that (the pointers may not match the lower half of the rom address but they are legit to the z80)
Update: This thing is totally amazing, remember how the sonic 1 driver and sonic 2 driver had to be reloaded via the interrupts? I just saw Z80 interrupt code in the sonic 3 driver that does just that. And even more, the driver even uses space in the same bank it is in to copy and execute Z80 code and reset the Z80 via the Z80 which is very weird.
You can now download all currently up-to-date versions of the Sonic 3 Driver disassembly on Mediafire via my Mediapro account:Sonic 3 Sound Driver Disassembly files
Well, did you notice that every once in a while a dac sample pointer doesn't have that big set? This is why I say we have not a 16 bit absolute pointer, but a 15 bit bank relative with an unknown high bit flag.
I am getting close to ready to release the asm form of the driver.
In other words we had it wrong but still got done what we needed to. The music should be aligned to a location in 8000h bank space, not to a physical loation in the rom itself, yet we did that unknowingly by aligning to the rom, though now we know. Want to add new music or sounds outside a bank? simply add a new bank and align to that (the pointers may not match the lower half of the rom address but they are legit to the z80)
Update: This thing is totally amazing, remember how the sonic 1 driver and sonic 2 driver had to be reloaded via the interrupts? I just saw Z80 interrupt code in the sonic 3 driver that does just that. And even more, the driver even uses space in the same bank it is in to copy and execute Z80 code and reset the Z80 via the Z80 which is very weird.
You can now download all currently up-to-date versions of the Sonic 3 Driver disassembly on Mediafire via my Mediapro account:Sonic 3 Sound Driver Disassembly files
This post has been edited by kram1024: 10 March 2011 - 10:31 AM


