diff --git a/src/processor/memory/mmio/serial.rs b/src/processor/memory/mmio/serial.rs index 1fe785e..f7500d2 100644 --- a/src/processor/memory/mmio/serial.rs +++ b/src/processor/memory/mmio/serial.rs @@ -35,11 +35,15 @@ pub struct Serial { output_byte: u8, bits_remaining: u8, control: SerialControl, + is_connected: bool, } impl Serial { pub fn tick(&mut self, steps: usize) -> bool { let mut will_interrupt = false; + if !self.is_connected { + return false; + } for _ in 0..steps { if self.control.transfer_in_progress { self.output_byte = self.output_byte << 1 | self.byte >> 7; @@ -98,6 +102,7 @@ impl Default for Serial { output_byte: 0, bits_remaining: 7, control: SerialControl::default(), + is_connected: false, } } }