ekeeke / Genesis-Plus-GX

An enhanced port of Genesis Plus - accurate & portable Sega 8/16 bit emulator
Other
698 stars 199 forks source link

Solomon no Kagi (Mark III) - Missing FM Music Channels and SFX #409

Closed MadoKage closed 2 years ago

MadoKage commented 2 years ago

PSG Music and SFX works fine, however the latest dev build made the FM music not play all the channels and the sound effects don't play properly.

ekeeke commented 2 years ago

Found the commit where this bug was introduced: https://github.com/ekeeke/Genesis-Plus-GX/commit/1e0d2dad8f967ed9dae95841ad0b707a6d881aa4

I will need to further analyze what was wrong in this one.

ekeeke commented 2 years ago

Fixed in https://github.com/ekeeke/Genesis-Plus-GX/commit/e4c53348d9e99cfdff6389d81a1912c40d1cc036

There was a stupid bug introduced in above commit: the attack rates table was increased to 17x16 (= 272) elements but the index used to address this table was left to a 8-bit value, resulting in an overflow for the highest attack rate (14.3), which would therefore use the lowest attack rate (i.e infinite rate) values.

MadoKage commented 2 years ago

Thank you for the fix :D but it only fixed the music, some of the sound effects still don't play right, like creating/destroying a block, picking up items and firing a fireball along with hitting enemies with it, that's pretty much the only sound issues.

ekeeke commented 2 years ago

Finally had some time to look into it: I indeed forgot about a specific edge case when I improved the accuracy of EG transitions (cf. https://github.com/ekeeke/Genesis-Plus-GX/commit/8acd9def6d1fd7d10add309982d625d3ecd18ca8).

This should be now completely fixed by https://github.com/ekeeke/Genesis-Plus-GX/commit/4a899e8262f2f2180db8799245ce9c7881068ad3