Fix the ROM's enable byte location

This commit is contained in:
pjht 2023-01-28 08:19:43 -06:00
parent 9ea9461935
commit c2b1a2a74d
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -81,8 +81,8 @@ impl Card for Rom {
match address { match address {
(0..=0xEF) => NullableResult::Ok(self.ram[address as usize]), (0..=0xEF) => NullableResult::Ok(self.ram[address as usize]),
(0xF0..=0xF1) => NullableResult::Ok(u16_get_be_byte(self.start, address - 0xF0)), (0xF0..=0xF1) => NullableResult::Ok(u16_get_be_byte(self.start, address - 0xF0)),
0xF2 => NullableResult::Ok(self.enabled as u8), 0xF3 => NullableResult::Ok(self.enabled as u8),
(0xFE..=0xFF) => NullableResult::Ok(u16_get_be_byte(ID, address - 0xFE)), (0xFE..=0xFF) => NullableResult::Ok(u16_get_be_byte(0x1, address - 0xFE)),
_ => NullableResult::Null, _ => NullableResult::Null,
} }
} }
@ -95,7 +95,7 @@ impl Card for Rom {
(0xF0..=0xF1) => { (0xF0..=0xF1) => {
self.start = u16_set_be_byte(self.start, address - 0xF0, data); self.start = u16_set_be_byte(self.start, address - 0xF0, data);
} }
0xF2 => { 0xF3 => {
self.enabled = data > 0; self.enabled = data > 0;
} }
_ => (), _ => (),