From eae635e5f6a86de8e55802b635d058d5ee22449a Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 30 Aug 2024 16:06:39 +0200 Subject: [PATCH] Do not spam status updates on mouse movement --- core/src/emulator/mod.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/emulator/mod.rs b/core/src/emulator/mod.rs index 2519040..a6aecff 100644 --- a/core/src/emulator/mod.rs +++ b/core/src/emulator/mod.rs @@ -154,18 +154,24 @@ impl Tickable for Emulator { self.cpu.bus.mouse_update_abs(x, y); } EmulatorCommand::Quit => return Ok(0), - EmulatorCommand::InsertFloppy(image) => self.cpu.bus.iwm.disk_insert(&image), + EmulatorCommand::InsertFloppy(image) => { + self.cpu.bus.iwm.disk_insert(&image); + self.status_update()?; + } EmulatorCommand::Run => { info!("Running"); self.run = true; + self.status_update()?; } EmulatorCommand::Stop => { info!("Stopped"); self.run = false; + self.status_update()?; } EmulatorCommand::Step => { if !self.run { self.step()?; + self.status_update()?; } } EmulatorCommand::ToggleBreakpoint(addr) => { @@ -176,11 +182,13 @@ impl Tickable for Emulator { self.breakpoints.push(addr); info!("Breakpoint set: ${:06X}", addr); } + self.status_update()?; } EmulatorCommand::BusWrite(start, data) => { for (i, d) in data.into_iter().enumerate() { self.cpu.bus.write(start + (i as Address), d); } + self.status_update()?; } EmulatorCommand::Disassemble(addr, len) => { self.disassemble(addr, len)?; @@ -195,7 +203,6 @@ impl Tickable for Emulator { } } } - self.status_update()?; } if self.run {