diff --git a/src/bus.rs b/src/bus.rs index af6d4f1..b1941a2 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -106,7 +106,8 @@ impl Bus { 0xFF00..=0xFF7F => { // IO Registers match addr { - // 0xFF01 => + 0xFF01 => self.serial.next, + 0xFF02 => self.serial.control.into(), 0xFF07 => self.timer.control.into(), 0xFF0F => self.interrupt.flag.into(), 0xFF11 => self.sound.ch1.sound_duty.into(), @@ -176,6 +177,8 @@ impl Bus { 0xFF00..=0xFF7F => { // IO Registers match addr { + 0xFF01 => self.serial.next = byte, + 0xFF02 => self.serial.control = byte.into(), 0xFF07 => self.timer.control = byte.into(), 0xFF0F => self.interrupt.flag = byte.into(), 0xFF11 => self.sound.ch1.sound_duty = byte.into(), diff --git a/src/serial.rs b/src/serial.rs index 0e87eb2..618660d 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -1,7 +1,7 @@ #[derive(Debug, Clone, Copy, Default)] pub struct Serial { - next: u8, - control: SerialControl, + pub next: u8, + pub control: SerialControl, } #[derive(Debug, Clone, Copy, Default)]