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 {