Closed gyurco closed 2 years ago
I haven't had the time to simulate your comments in #4 or this commit. So I am going to take your word for it and merge it. The fact that part of the counter is free running seems to be a constant across Yamaha designs and it actually makes sense because it lets the CPU reload the counter without breaking the period. If the CPU reloaded all bits, the interrupt interval would have some variability.
In this commit I didn't touch the flagen bits, only the off-by-one error of the timer overflow. On a PC (Adlib or Soundblaster cards) the timer seems to be used only for card detection, as the IRQ line is not connected to the ISA bus, and the PC has a timer chip anyway.
Fixes: #4