ChanServ changed the topic of ##yamahasynths to: Channel dedicated to questions and discussion of Yamaha FM Synthesizer internals and corresponding REing. Discussion of synthesis methods similar to the Yamaha line of chips, Sound Blasters + clones, PCM chips like RF5C68, and CD theory of operation are also on-topic. Channel logs: https://freenode.irclog.whitequark.org/~h~yamahasynths
kode54 has joined ##yamahasynths
ej5 has joined ##yamahasynths
ej5 has quit [Read error: Connection reset by peer]
<Lord_Nightmare>
i have a guess that they fixed a bug in sonic 2's sound driver and in the process broke something way worse
<Lord_Nightmare>
and it was fixed by the final sonic 3 release
<Lord_Nightmare>
if you diff the z80 and 68k-side sound code you might even be able to spot the bug
<superctr>
afaik sonic 3's sound driver is not derived from sonic 2
<superctr>
though it's obviously unfinished in the proto
<ValleyBell>
When a sound effect finishes playing, it restores the FM instrument playing on that channel.
<ValleyBell>
In order to do that, it switches to the "music" Z80 bank.
<ValleyBell>
But they forgot to make a bankswitch back to the SFX bank after that, so any SFX track that processes sequence data in the same frame that will be playing garbage data.
<ValleyBell>
Sonic 3's sound driver is derived from a stock SMPS Z80 driver. It's completely different from Sonic 2's driver.
<Lord_Nightmare>
is the bug patchable? is that the only major change between the beta and the final sonic 3?
<ValleyBell>
Yes, the bug is patchable and I posted a patched driver in the post I linked.
<ValleyBell>
It isn't the only change between the proto and final Sonic 3.
<ValleyBell>
PAL music speed fix is missing and none of the SFX-specific code is there.
<cr1901_modern>
ValleyBell: Thanks for the explanation... that sounds like fun. Is there a "priority" for which channels/tracks get replaced with sound effects when the game needs to play a sound effect but all channels are in use?
<cr1901_modern>
IIRC in GEMS, no particular track is tied to a single channel- it's a "first come, first serve" basis
<cr1901_modern>
(also, bank switching shit like that is why I want to do a 68k sound driver)
<ValleyBell>
cr1901_modern: The SMPS sound priority system is simple. There is one global SFX priority byte.
<ValleyBell>
Issue a sound effect -> compare its priority with the current priority byte
<ValleyBell>
(prio of issued S.E.) < (current priority byte in sound RAM) -> ignore
<ValleyBell>
issues >= current -> play and set new priority
<ValleyBell>
The priority byte is also reset whenever *any* SMPS track ends.
<ValleyBell>
So if 2 SFX overlap and one finishes earlier, the latter one might be cut off by a low-priority effect.