deltabeard / Peanut-GB

A Game Boy (DMG) emulator single header library written in C99. Performance is prioritised over accuracy.
https://projects.deltabeard.com/peanutgb/
325 stars 41 forks source link

serial: clarify equation used to produce cycle number #8

Closed deltabeard closed 6 years ago

deltabeard commented 6 years ago

The equation used is 4194304 / (8192 / 8) = 4096, where 8 is due to transmitting one byte at a time instead of one bit. It is therefore not a magic number as mentioned in https://github.com/deltabeard/peanut-gb/blob/11d0fdf6bde8d04cee690f523d0dd3d839ea73ab/gameboy.h#L82 .

The magic number 40 currently used will have to be looked into. I'm not convinced it is correct since it actually increases the transfer rate of the serial connection.

deltabeard commented 6 years ago

7c595f8c0eeffd48d5f6f3cd130eca94d7c8550e