From 84da646ac998de7d257d194718689d0b52e9df7b Mon Sep 17 00:00:00 2001 From: nsx0r Date: Wed, 19 Oct 2022 14:43:42 +0200 Subject: [PATCH] added NES mapper 62 added NES mapper 62, tested working with a multicart using K-1017P PCB also expanded max PRG size for these big multicarts --- Cart_Reader/NES.ino | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Cart_Reader/NES.ino b/Cart_Reader/NES.ino index eeaae29..6cef359 100644 --- a/Cart_Reader/NES.ino +++ b/Cart_Reader/NES.ino @@ -59,6 +59,7 @@ static const byte PROGMEM mapsize[] = { 45, 3, 6, 0, 8, 0, 0, // ga23c asic multicart [UNLICENSED] 47, 4, 4, 6, 6, 0, 0, // (super spike vball + world cup) 48, 3, 4, 6, 6, 0, 0, // taito tc0690 + 62, 7, 7, 8, 8, 0, 0, // K-1017P [UNLICENSED] 64, 2, 3, 4, 5, 0, 0, // tengen rambo-1 [UNLICENSED] 65, 3, 4, 5, 6, 0, 0, // irem h-3001 66, 2, 3, 2, 3, 0, 0, // gxrom/mhrom @@ -148,9 +149,9 @@ byte mapcount = (sizeof(mapsize) / sizeof(mapsize[0])) / 7; boolean mapfound = false; byte mapselect; -int PRG[] = { 16, 32, 64, 128, 256, 512, 1024 }; +int PRG[] = { 16, 32, 64, 128, 256, 512, 1024, 2048 }; byte prglo = 0; // Lowest Entry -byte prghi = 6; // Highest Entry +byte prghi = 7; // Highest Entry int CHR[] = { 0, 8, 16, 32, 64, 128, 256, 512, 1024 }; byte chrlo = 0; // Lowest Entry @@ -3219,7 +3220,17 @@ void readPRG(boolean readrom) { dumpPRG(base, address); } 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; for (int i = 0; i < banks; i++) { // 64K/128K @@ -3817,6 +3828,16 @@ void readCHR(boolean readrom) { } } break; + + case 62: + banks = int_pow(2, chrsize) / 2; + for (int i = 0; i < banks; i++) { + write_prg_byte(0x8000 + (i / 4), i & 3); + for (word address = 0x0; address < 0x2000; address += 512) { + dumpCHR(address); + } + } + break; case 67: // 128K banks = int_pow(2, chrsize) * 2;