EmuState::update_fp now properly handles powered off state

This commit is contained in:
pjht 2024-02-01 18:45:38 -06:00
parent 46119048c2
commit b5727da45b
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -99,16 +99,19 @@ impl EmuState {
self.update_fp(); self.update_fp();
} else { } else {
self.audio_tx.send(AudioMessage::FanOff).unwrap(); self.audio_tx.send(AudioMessage::FanOff).unwrap();
self.running = false; self.update_fp();
self.fp_state.set_status(Status::empty());
self.fp_state.set_addr(0);
self.fp_state.set_data(0);
} }
} }
} }
} }
pub fn update_fp(&mut self) { 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(); let cycle = self.cpu.get_mem_cycle();
self.fp_state.set_status(cycle.get_status()); self.fp_state.set_status(cycle.get_status());
match cycle { match cycle {