diff options
author | Determinant <[email protected]> | 2017-11-23 00:32:02 -0500 |
---|---|---|
committer | Determinant <[email protected]> | 2017-11-23 00:32:02 -0500 |
commit | 9f51c12bc8c85c49eea616897905767e57eea726 (patch) | |
tree | caf8fe92b617f853d8c4064aeed3271a025ba02e /src | |
parent | e20edaf0647c2e8650c6fb631bd154dbaad82981 (diff) |
correct the initial mapping for mapper 1
Diffstat (limited to 'src')
-rw-r--r-- | src/mapper.rs | 4 |
1 files 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); |