diff --git a/src/processor/mod.rs b/src/processor/mod.rs index 94b99c7..7dfd81d 100644 --- a/src/processor/mod.rs +++ b/src/processor/mod.rs @@ -64,7 +64,7 @@ impl CPU { } fn increment_timers(&mut self, cycles: u8) { - let secs = (cycles * 4) as f64 / (CLOCK_SPEED * SPEEDUP); + let secs = (cycles * 4) as f64 / CLOCK_SPEED; self.vblank_timer += secs; if self.vblank_remaining > 0 { @@ -94,7 +94,7 @@ impl CPU { self.memory.set(0xFF05, val); } } - spin_sleep::sleep(Duration::from_secs_f64(secs)); + spin_sleep::sleep(Duration::from_secs_f64(secs / SPEEDUP)); } fn next_opcode(&mut self) -> u8 {