fengb / fundude

Gameboy emulator: Zig -> wasm
https://fengb.github.io/fundude/
MIT License
181 stars 8 forks source link

"Consistent" frame advance #32

Open fengb opened 4 years ago

fengb commented 4 years ago

Holdover from https://github.com/fengb/fundude/issues/30

Prior implementation simply ran a Gameboy frame every requestAnimationFrame(). This worked wonders for 60hz monitors, but it's really silly for 144hz.

Potential solution:

  1. expose stepTime()
  2. set MAX_SKIP_MS to be exactly 1 frame (16.742706 ms)
  3. profit!