From b5727da45b275e98b66ea93eb440b0c07cb5bb48 Mon Sep 17 00:00:00 2001 From: pjht Date: Thu, 1 Feb 2024 18:45:38 -0600 Subject: [PATCH] EmuState::update_fp now properly handles powered off state --- src/state.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/state.rs b/src/state.rs index deb994d..e7376eb 100644 --- a/src/state.rs +++ b/src/state.rs @@ -99,16 +99,19 @@ impl EmuState { self.update_fp(); } else { self.audio_tx.send(AudioMessage::FanOff).unwrap(); - self.running = false; - self.fp_state.set_status(Status::empty()); - self.fp_state.set_addr(0); - self.fp_state.set_data(0); + self.update_fp(); } } } } pub fn update_fp(&mut self) { + if !self.fp_state.power() { + self.fp_state.set_addr(0); + self.fp_state.set_data(0); + self.fp_state.set_status(Status::empty()); + return; + } let cycle = self.cpu.get_mem_cycle(); self.fp_state.set_status(cycle.get_status()); match cycle {