emu-rs / rustual-boy

Rustual Boy - A Virtual Boy emulator.
https://rustualboy.com/
Apache License 2.0
232 stars 30 forks source link

Adjust sweep modification period. #9

Closed torokati44 closed 7 years ago

torokati44 commented 7 years ago

You said in the Ep.019 stream (at around 01:13:30) that these timer interval - clock tick count numbers are weird, but kind of round.

Now, if we divide 19200 by 100, the result in binary will have exactly two ones in it next to each other. It's a nice, simple, round number, looking at it this way. This is not true for 153610, but it is for 153600, hence my guess that it would be the correct number. This in itself looks like it could let the actual hardware be simpler when checking for these two particular numbers.

Another reason why I think this might be closer is that 20e6 / 19200 is 1041.6 recurring, which is about 0.0064 percent off of the (most likely rounded) figure in the documentation, 1041.6 (not recurring). 20e6 / 153600 is 130.2083 recurring, which has the same 0.0064 percent error compared to the 130.2 in the docs. Unlike 153610.

However, please note that this is entirely a shot in the dark, so I understand if you don't trust my intuition without further proof, but to me, it seemed totally logical.

yupferris commented 7 years ago

Seeing as my value was somewhat speculative as well, I don't see how the logic is any worse than mine, though as it's also speculation I'm not sure it's any better. However, I appreciate the detailed explanation! I grabbed your fork and gave it a shot, and it still sounds correct to me, so in the spirit of encouraging contributions I'll happily accept this. Thanks! :)