diff --git a/src/main.rs b/src/main.rs index 37514c9..b7f3d4f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 => {