mohanson / gameboy

Full featured Cross-platform GameBoy emulator by Rust. Forever boys!.
MIT License
1.36k stars 79 forks source link

fix frame timing drift bug on slow boxes #21

Closed ethanpailes closed 4 years ago

ethanpailes commented 4 years ago

This patch fixes an issue where our target frame time could slowly drift out of sync with reality if we were consistantly missing frames, allowing the game to run at superspeed once we stopped missing frames. This was particularly noticable on my toaster of a macbook when the CPU heated up and the os started throttling, and also seemed to come up when the emulator was suspended as I shifted focus elsewhere.

Fixes #20