From 39fe4411d6fbca7e980115c64344559ff81ace7a Mon Sep 17 00:00:00 2001 From: John Breaux Date: Thu, 31 Aug 2023 22:41:24 -0500 Subject: [PATCH] cpu.rs: Properly pause during multistep --- src/cpu.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cpu.rs b/src/cpu.rs index 508187a..8236546 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -431,6 +431,9 @@ impl CPU { //let speed = 1.0 / steps as f64; for _ in 0..steps { self.tick(screen)?; + if self.flags.is_paused() { + break; + } } self.delay = self.delay.saturating_sub(1); self.sound = self.sound.saturating_sub(1);