From eba530437f341df711e0ce3b331cd047a24573be Mon Sep 17 00:00:00 2001 From: nsx0r Date: Tue, 6 Dec 2022 16:48:53 +0100 Subject: [PATCH] added NES mappers 46+52+212 added NES mappers 46+52+212 --- Cart_Reader/NES.ino | 75 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/Cart_Reader/NES.ino b/Cart_Reader/NES.ino index e29a408..dbb9bf3 100644 --- a/Cart_Reader/NES.ino +++ b/Cart_Reader/NES.ino @@ -60,8 +60,10 @@ static const byte PROGMEM mapsize[] = { 37, 4, 4, 6, 6, 0, 0, // (super mario bros + tetris + world cup) 42, 0, 3, 0, 5, 0, 0, // hacked FDS games converted to cartridge [UNLICENSED] 45, 3, 6, 0, 8, 0, 0, // ga23c asic multicart [UNLICENSED] + 46, 1, 6, 0, 8, 0, 0, // Rumble Station [UNLICENSED] 47, 4, 4, 6, 6, 0, 0, // (super spike vball + world cup) 48, 3, 4, 6, 6, 0, 0, // taito tc0690 + 52, 0, 3, 0, 3, 0, 0, // Realtec 8213 [UNLICENSED] 58, 1, 6, 1, 6, 0, 0, // BMC-GKB (C)NROM-based multicarts, duplicate of mapper 213 [UNLICENSED] 60, 2, 2, 3, 3, 0, 0, // Reset-based NROM-128 4-in-1 multicarts [UNLICENSED] 62, 7, 7, 8, 8, 0, 0, // K-1017P [UNLICENSED] @@ -123,6 +125,7 @@ static const byte PROGMEM mapsize[] = { 206, 1, 3, 2, 4, 0, 0, // dxrom 207, 4, 4, 5, 5, 0, 0, // taito x1-005 variant (fudou myouou den) 210, 3, 5, 5, 6, 0, 0, // namco 175/340 + 212, 0, 3, 0, 4, 0, 0, // BMC Super HiK 300-in-1 [UNLICENSED] 213, 1, 6, 1, 6, 0, 0, // BMC-GKB (C)NROM-based multicarts, duplicate of mapper 58 [UNLICENSED] 225, 4, 7, 5, 8, 0, 0, // ET-4310 (FC) + K-1010 (NES) [UNLICENSED] 226, 6, 7, 0, 0, 0, 0, // BMC-76IN1, BMC-SUPER42IN1, BMC-GHOSTBUSTERS63IN1 [UNLICENSED] @@ -2849,17 +2852,29 @@ void readPRG(boolean readrom) { dumpPRG(base, address); } break; - - case 62: - banks = int_pow(2, prgsize) / 2; + + case 46: + banks = int_pow(2, prgsize) / 2; // 32k banks for (int i = 0; i < banks; i++) { - write_prg_byte(0x8000 + (i * 512) + ((i & 32) << 1), 0x00); + write_prg_byte(0x6000, (i & 0x1E) >> 1); // high bits + write_prg_byte(0x8000, i & 0x01); // low bit for (word address = 0x0; address < 0x8000; address += 512) { dumpPRG(base, address); } } break; + case 52: + banks = int_pow(2, prgsize) ; + write_prg_byte(0xA001, 0x80); // enable WRAM write + for (int i = 0; i < banks; i++) { + write_prg_byte(0x6000, (i & 0x07) | 0x08); + for (word address = 0x0; address < 0x4000; address += 512) { + dumpPRG(base, address); + } + } + break; + case 58: case 213: banks = int_pow(2, prgsize) / 2; @@ -2883,6 +2898,16 @@ void readPRG(boolean readrom) { } } break; + + case 62: + banks = int_pow(2, prgsize) / 2; + for (int i = 0; i < banks; i++) { + write_prg_byte(0x8000 + (i * 512) + ((i & 32) << 1), 0x00); + for (word address = 0x0; address < 0x8000; address += 512) { + dumpPRG(base, address); + } + } + break; case 66: // 64K/128K banks = int_pow(2, prgsize) / 2; @@ -3274,6 +3299,16 @@ void readPRG(boolean readrom) { } } break; + + case 212: + banks = int_pow(2, prgsize); + for (int i = 0; i < banks; i++) { + write_prg_byte(0x8000 + (i & 0x07), 0); + for (word address = 0x0; address < 0x4000; address += 512) { + dumpPRG(base, address); + } + } + break; case 225: case 255: @@ -3790,6 +3825,28 @@ void readCHR(boolean readrom) { } } break; + + case 46: + banks = int_pow(2, chrsize); // 8k banks + for (int i = 0; i < banks; i++) { + write_prg_byte(0x6000, (i & 0x78) << 1); // high bits + write_prg_byte(0x8000, (i & 0x07) << 4); // low bits + for (word address = 0x0; address < 0x2000; address += 512) { + dumpCHR(address); + } + } + break; + + case 52: + banks = int_pow(2, chrsize); + write_prg_byte(0xA001, 0x80); // enable WRAM write + for (int i = 0; i < banks; i++) { + write_prg_byte(0x6000, (i & 0x04) << 2 | (i & 0x03) << 4 | 0x40); + for (word address = 0x0; address < 0x1000; address += 512) { + dumpCHR(address); + } + } + break; case 58: case 213: @@ -4162,6 +4219,16 @@ void readCHR(boolean readrom) { } } break; + + case 212: + banks = int_pow(2, chrsize) / 2; + for (int i = 0; i < banks; i++) { + write_prg_byte(0x8000 + (i & 0x07), 0); + for (word address = 0x0; address < 0x2000; address += 512) { + dumpCHR(address); + } + } + break; case 225: case 255: