From f759fdd48c02945cf636c79997d9f05b7cda7e2b Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Fri, 3 Feb 2023 08:55:03 +1100 Subject: [PATCH] dont let the game know about the speedup --- src/processor/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 {