better io handling

This commit is contained in:
Alex Janka 2023-02-06 14:24:04 +11:00
parent 5d788fe9c1
commit 94bb1a2bfb

View file

@ -103,7 +103,7 @@ impl Memory {
0x0..0x8000 => {
// rom access
// todo - switchable rom banks
if self.bootrom_enabled && (address as usize) < self.bootrom.len() {
if self.bootrom_enabled && ((address as usize) < self.bootrom.len()) {
return self.bootrom[address as usize];
} else {
return self.rom[address as usize];
@ -126,6 +126,9 @@ impl Memory {
return 0x0;
}
0xFF00..0xFF4C => {
if address == 0xFF00 {
return 0xFF;
}
return self.io[(address - 0xFF00) as usize];
}
0xFF4C..0xFF80 => {