@tmustier/pi-nes 0.2.16 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -118,8 +118,13 @@ impl Mapper for MMC1Mapper {
|
|
|
118
118
|
fn map(&self, address: u32) -> u32 {
|
|
119
119
|
let bank: u32;
|
|
120
120
|
let mut offset = address & 0x3FFF;
|
|
121
|
-
let
|
|
122
|
-
let
|
|
121
|
+
let prg_low = (self.prg_bank_register.load() as u32) & 0x0F;
|
|
122
|
+
let prg_high = if self.program_bank_num > 16 {
|
|
123
|
+
((self.chr_bank0_register.load() as u32) & 0x10) >> 4
|
|
124
|
+
} else {
|
|
125
|
+
0
|
|
126
|
+
};
|
|
127
|
+
let mut bank_num = (prg_high << 4) | prg_low;
|
|
123
128
|
if self.program_bank_num > 0 {
|
|
124
129
|
bank_num %= self.program_bank_num as u32;
|
|
125
130
|
}
|