Closed hyano closed 2 years ago
Thanks for this PR. Can you point me to some examples I can look at to see this behavior?
@aaronsgiles Thanks for your reply.
I know "The Castle" for PC-8801mkIISR (Japanese retro PC) is one of the examples which has a potential bug in sound driver. It uses register A4h for all FM channels by BUG.
Sound pitch is not corrupted on the real PC88. But on the emulator which doesn't emulate the behavior this PR mentions, pitch becomes incorrect. I think major FM sound engines including fm.c support this.
Attach is a vgm file of "The Castle" for PC-88. thecastle_vgm.zip You can check ths sound with it.
And, you can compare with the following captured video from real HW. https://www.youtube.com/watch?v=i6UmloQvhRQ
Other references:
Ok, thank you for the documentation and VGM example. I think this fix is good.
This patch fixes the behavior of registers A4-A6h and AC-AEh in OPN. In real chip, there is one latch for each of A4-A6h and AC-AEh.
In some games, if this behavior is not reproduced, a bug in the sound driver causes incorrect pitch.
Although this patch is little bit redundant, it uses unused registers for latching as same as the original implementation. Please modify, if you have better idea.