From 7f40da559545165528f0690be76c7909b8afa7ec Mon Sep 17 00:00:00 2001 From: nsx0r Date: Thu, 11 May 2023 21:01:12 +0200 Subject: [PATCH] [NES] Fixed mapper 228 [NES] Fixed mapper 228 --- Cart_Reader/NES.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cart_Reader/NES.ino b/Cart_Reader/NES.ino index d4a8bc8..7d245a6 100644 --- a/Cart_Reader/NES.ino +++ b/Cart_Reader/NES.ino @@ -3593,13 +3593,14 @@ void readPRG(bool readrom) { case 228: banks = int_pow(2, prgsize); + write_prg_byte(0x8000, 0); for (int i = 0; i < banks; i += 2) { // up to 1024k PRG write_prg_byte(0x8000 + ((i & 0x3F) << 6), 0); for (word address = 0x0; address < 0x8000; address += 512) { dumpPRG(base, address); } } - if (prgsize > 6) { // reading the 3rd 512k PRG chip (Action 52) + if (prgsize > 5) { // reading the 3rd 512k PRG chip (Action 52) for (int i = 0; i < 32; i += 2) { write_prg_byte(0x9800 + ((i & 0x1F) << 6), 0); for (word address = 0x0; address < 0x8000; address += 512) { @@ -4665,8 +4666,9 @@ void readCHR(bool readrom) { case 228: banks = int_pow(2, chrsize) / 2; + write_prg_byte(0x8000, 0); for (int i = 0; i < banks; i++) { - write_prg_byte((0x8000 + (i & 0x3C)) >> 2, (i & 0x03)); + write_prg_byte(0x8000 + ((i & 0x3C) >> 2), i & 0x03); for (word address = 0x0; address < 0x2000; address += 512) { dumpCHR(address); }