From bc0923d1ac0222188dc1440fe5848015bebf9093 Mon Sep 17 00:00:00 2001 From: nsx0r Date: Wed, 2 Nov 2022 07:44:25 +0100 Subject: [PATCH] actually fix all NAMCOT mappers similar to 206 actually fix all NAMCOT mappers similar to 206 --- Cart_Reader/NES.ino | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/Cart_Reader/NES.ino b/Cart_Reader/NES.ino index bf4d5c3..dac59ba 100644 --- a/Cart_Reader/NES.ino +++ b/Cart_Reader/NES.ino @@ -2913,16 +2913,20 @@ void readPRG(boolean readrom) { case 88: case 95: case 154: // 128K + case 206: // 32/64/128K banks = int_pow(2, prgsize) * 2; - for (int i = 0; i < banks; i += 2) { - write_prg_byte(0x8000, 6); // PRG ROM Command ($8000-$9FFF) - write_prg_byte(0x8001, i); // PRG Bank - write_prg_byte(0x8000, 7); // PRG ROM Command ($A000-$BFFF) - write_prg_byte(0x8001, i + 1); // PRG Bank - for (word address = 0x0; address < 0x4000; address += 512) { // 8K Banks ($8000-$BFFF) + for (int i = 0; i < banks-2; i += 2) { + write_prg_byte(0x8000, 6); + write_prg_byte(0x8001, i); + write_prg_byte(0x8000, 7); + write_prg_byte(0x8001, i | 1); + for (word address = 0x0; address < 0x4000; address += 512) { dumpPRG(base, address); } } + for (word address = 0x4000; address < 0x8000; address += 512) { + dumpPRG(base, address); + } break; case 79: @@ -3110,22 +3114,6 @@ void readPRG(boolean readrom) { } } break; - - case 206: - banks = int_pow(2, prgsize) * 2; - for (int i = 0; i < banks-2; i += 2) { - write_prg_byte(0x8000, 6); - write_prg_byte(0x8001, i); - write_prg_byte(0x8000, 7); - write_prg_byte(0x8001, i | 1); - for (word address = 0x0; address < 0x4000; address += 512) { - dumpPRG(base, address); - } - } - for (word address = 0x4000; address < 0x8000; address += 512) { - dumpPRG(base, address); - } - break; case 210: // 128K/256K banks = int_pow(2, prgsize) * 2;