made mapper module to support the various NES cartridge types in the furyte, MMC1 support added

This commit is contained in:
2026-08-09 14:03:08 -05:00
parent a54d3ccc09
commit b4504bf9ce
5 changed files with 180 additions and 23 deletions
+3 -1
View File
@@ -23,7 +23,7 @@ impl Bus for NesBus {
0x2000..=0x3FFF => 0, //PPU registers stub, temporal
0x4000..=0x401F => 0, //APU controller stub, temporal
0x4020..=0x5FFF => 0, //Expansion ROM stub. temporal
0x6000..=0x7FFF => 0, //SRAM stub, no reading saves for you :3
0x6000..=0x7FFF => self.cart.read_prg_ram(address), // SRAM reads from the cartridge
0x8000..=0xFFFF => self.cart.read_prg(address), // this is te space PRG Rom gets "loaded" to in real hardware
}
}
@@ -31,6 +31,8 @@ impl Bus for NesBus {
fn write(&mut self, address: u16, value: u8) {
match address {
0x0000..=0x1FFF => self.ram[(address & 0x07FF) as usize] = value,
0x6000..=0x7FFF => self.cart.write_prg_ram(address, value),
0x8000..=0xFFFF => self.cart.write_prg(address, value),
_ => {} // Everything else dropped for now
}
}