diff --git a/Cart_Reader/NES.ino b/Cart_Reader/NES.ino index 922d659f..a9b8aea6 100644 --- a/Cart_Reader/NES.ino +++ b/Cart_Reader/NES.ino @@ -101,7 +101,7 @@ static const struct mapper_NES PROGMEM mapsize[] = { { 78, 3, 3, 5, 5, 0, 0 }, // irem 74hc161/32 { 79, 1, 2, 2, 3, 0, 0 }, // NINA-03/06 by AVE [UNLICENSED] { 80, 3, 3, 5, 6, 0, 1 }, // taito x1-005 [prgram r/w] - { 82, 3, 5, 5, 6, 0, 1 }, // taito x1-017 [prgram r/w] + { 82, 3, 3, 5, 6, 0, 1 }, // taito x1-017 wrong bank order [prgram r/w] // 84 - bad mapper, not used { 85, 3, 5, 0, 5, 0, 1 }, // vrc7 [sram r/w] { 86, 3, 3, 4, 4, 0, 0 }, // jaleco jf-13 (moero pro yakyuu) @@ -174,7 +174,8 @@ static const struct mapper_NES PROGMEM mapsize[] = { { 246, 5, 5, 7, 7, 0, 0 }, // C&E Feng Shen Bang [UNLICENSED] // 248 - bad mapper, not used { 255, 4, 7, 5, 8, 0, 0 }, // 110-in-1 multicart (same as 225) [UNLICENSED] - { 446, 0, 8, 0, 0, 0, 0 } // Mindkids SMD172B_FGPA submapper 0 & 1 + { 446, 0, 8, 0, 0, 0, 0 }, // Mindkids SMD172B_FGPA submapper 0 & 1 + { 552, 0, 5, 0, 6, 0, 0 } // Taito X1-017 actual bank order }; const char _file_name_no_number_fmt[] PROGMEM = "%s.%s"; @@ -2734,18 +2735,24 @@ void readPRG(bool readrom) { break; case 446: - { - banks = int_pow(2, prgsize) * 2; - write_prg_byte(0x5003, 0); - write_prg_byte(0x5005, 0); - for (uint8_t i = 0; i < banks; i++) { // 8192 for 64MiB - write_prg_byte(0x5002, i >> 8); // outer bank LSB - write_prg_byte(0x5001, i); // outer bank MSB - write_prg_byte(0x8000, 0); - dumpBankPRG(0x0, 0x2000, base); - } - break; + banks = int_pow(2, prgsize) * 2; + write_prg_byte(0x5003, 0); + write_prg_byte(0x5005, 0); + for (uint8_t i = 0; i < banks; i++) { // 8192 for 64MiB + write_prg_byte(0x5002, i >> 8); // outer bank LSB + write_prg_byte(0x5001, i); // outer bank MSB + write_prg_byte(0x8000, 0); + dumpBankPRG(0x0, 0x2000, base); } + break; + + case 552: + banks = int_pow(2, prgsize) * 2; + for (size_t i = 0; i < banks; i++) { + write_prg_byte(0x7EFA, ((i & 0x01) << 5) | ((i & 0x02) << 3) | ((i & 0x04) << 1) | ((i & 0x08) >> 2) | ((i & 0x10) >> 3) | ((i & 0x20) >> 5)); // PRG Bank 0 ($8000-$9FFF) + dumpBankPRG(0x0, 0x2000, base); // 8K Banks ($8000-$BFFF) + } + break; } if (!readrom) { myFile.flush(); @@ -3294,6 +3301,7 @@ void readCHR(bool readrom) { case 80: // 128K/256K case 82: // 128K/256K case 207: // 128K [CART SOMETIMES NEEDS POWERCYCLE] + case 552: banks = int_pow(2, chrsize) * 2; write_prg_byte(0x7EF6, 0x00); // CHR mode [2x 2KiB banks at $0000-$0FFF] for (size_t i = 0; i < banks; i += 2) {