Skip to content

Commit

Permalink
Update NES.ino - added mapper 552
Browse files Browse the repository at this point in the history
added mapper 552
  • Loading branch information
nsx0r authored Aug 28, 2024
1 parent 6cbc8a5 commit e04188d
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions Cart_Reader/NES.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e04188d

Please sign in to comment.