From 9f51c12bc8c85c49eea616897905767e57eea726 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 23 Nov 2017 00:32:02 -0500 Subject: correct the initial mapping for mapper 1 --- src/mapper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapper.rs b/src/mapper.rs index e09419f..93c6fa9 100644 --- a/src/mapper.rs +++ b/src/mapper.rs @@ -56,7 +56,7 @@ impl<'a, C> Mapper1<'a, C> where C: Cartridge { prg_nbank, chr_nbank, load_reg: 0x10, - ctl_reg: 0, + ctl_reg: 0x0c, prg_banks: [null; 2], chr_banks: [core::mem::uninitialized(), core::mem::uninitialized()], @@ -64,7 +64,7 @@ impl<'a, C> Mapper1<'a, C> where C: Cartridge { { let c = &mut m.cart; m.prg_banks[0] = &*c.get_bank(0, 0x4000, BankType::PrgRom); - m.prg_banks[1] = &*c.get_bank(0x4000, 0x4000, BankType::PrgRom); + m.prg_banks[1] = &*c.get_bank((prg_nbank - 1) << 14, 0x4000, BankType::PrgRom); m.chr_banks[0] = &mut *c.get_bank(0, 0x1000, BankType::ChrRom); m.chr_banks[1] = &mut *c.get_bank(0x1000, 0x1000, BankType::ChrRom); m.sram = &mut *c.get_bank(0, 0x2000, BankType::Sram); -- cgit v1.2.3-70-g09d2