aaronsgiles / ymfm

BSD-licensed Yamaha FM sound cores (OPM, OPN, OPL, and others)
BSD 3-Clause "New" or "Revised" License
273 stars 41 forks source link

ymf262 timer issue #41

Closed elyosh closed 2 years ago

elyosh commented 2 years ago

According to the datasheet it seems that the timer period is not handled correctly on ymf262 : if the timer is set to 255 it should overflow immediately whereas currently it will overflow after 80us.

YMF262:

ymf262_timer

YM3812:

ym3812_timer
OBattler commented 2 years ago

The YMF289B datasheet implies the same should be true for it as well.

elyosh commented 2 years ago

Closing since it was verified on real hardware that this is an error in the YMF262 datasheet, the timer actually behaves like with the YM3812.

Detected a YMF262 OPL3 on port 0x388 Testing timer 1 with value 255 Timer overflow after 99 microseconds Testing timer 1 with value 127 Timer overflow after 11374 microseconds Testing timer 2 with value 255 Timer overflow after 187 microseconds Testing timer 2 with value 127 Timer overflow after 45334 microseconds

aaronsgiles commented 2 years ago

Thanks for the reports and follow-ups. Glad this issue was resolved completely while I was on vacation. 😁