diff --git a/src/main.rs b/src/main.rs index 290de02..7ee8380 100644 --- a/src/main.rs +++ b/src/main.rs @@ -308,7 +308,6 @@ impl eframe::App for AltairEmulator { if self.running { self.run_cpu_cycle(); } - let old_fan_enabled = self.options.fan_enabled; if let Some(option_window) = self.option_window.as_mut() { if option_window.draw(ctx, &mut self.options) { self.option_window = None; @@ -320,14 +319,13 @@ impl eframe::App for AltairEmulator { .send(AudioMessage::SetVolume(self.options.volume)) .unwrap(); } - } - if (old_fan_enabled != self.options.fan_enabled) && self.fp_state.power() { - if self.options.fan_enabled { + if self.options.fan_enabled && self.fp_state.power() { self.audio_tx.send(AudioMessage::FanOn).unwrap(); } else { self.audio_tx.send(AudioMessage::FanOff).unwrap(); } } + if self.running { ctx.request_repaint(); }