Fix NES mapper selection

This commit is contained in:
sanni 2022-11-18 10:46:13 +01:00
parent 4fad4463e9
commit 46dd333bd4
3 changed files with 15 additions and 16 deletions

View File

@ -4,8 +4,8 @@
This project represents a community-driven effort to provide This project represents a community-driven effort to provide
an easy to build and easy to modify cartridge dumper. an easy to build and easy to modify cartridge dumper.
Date: 12.11.2022 Date: 18.11.2022
Version: 11.3 Version: 11.4
SD lib: https://github.com/greiman/SdFat SD lib: https://github.com/greiman/SdFat
LCD lib: https://github.com/olikraus/u8g2 LCD lib: https://github.com/olikraus/u8g2
@ -15,7 +15,7 @@
RTC lib: https://github.com/adafruit/RTClib RTC lib: https://github.com/adafruit/RTClib
Frequency lib: https://github.com/PaulStoffregen/FreqCount Frequency lib: https://github.com/PaulStoffregen/FreqCount
Compiled with Arduino IDE 2.0.1 Compiled with Arduino IDE 2.0.2
Thanks to: Thanks to:
MichlK - ROM Reader for Super Nintendo MichlK - ROM Reader for Super Nintendo
@ -38,7 +38,7 @@
jiyunomegami, splash5, Kreeblah, ramapcsx2, PsyK0p4T, Dakkaron, majorpbx, Pickle, sdhizumi, jiyunomegami, splash5, Kreeblah, ramapcsx2, PsyK0p4T, Dakkaron, majorpbx, Pickle, sdhizumi,
Uzlopak, sakman55, Tombo89, scrap-a, borti4938, vogelfreiheit, CaitSith2, Modman, Uzlopak, sakman55, Tombo89, scrap-a, borti4938, vogelfreiheit, CaitSith2, Modman,
philenotfound, karimhadjsalem, nsx0r, ducky92, niklasweber, Lesserkuma, BacteriaMage, philenotfound, karimhadjsalem, nsx0r, ducky92, niklasweber, Lesserkuma, BacteriaMage,
vpelletier vpelletier, Ancyker
And to nocash for figuring out the secrets of the SFC Nintendo Power cartridge. And to nocash for figuring out the secrets of the SFC Nintendo Power cartridge.
@ -57,7 +57,7 @@
**********************************************************************************/ **********************************************************************************/
char ver[5] = "11.3"; char ver[5] = "11.4";
//****************************************** //******************************************
// !!! CHOOSE HARDWARE VERSION !!! // !!! CHOOSE HARDWARE VERSION !!!

View File

@ -1415,7 +1415,6 @@ void readROM_MD() {
compareCRC("32x.txt", 0, 1, 0); compareCRC("32x.txt", 0, 1, 0);
else else
compareCRC("md.txt", 0, 1, 0); compareCRC("md.txt", 0, 1, 0);
} }
/****************************************** /******************************************

View File

@ -566,7 +566,7 @@ void getMapping() {
} }
} }
if (database.available()) { if (database.available()) {
browseDatabase = false; browseDatabase = true;
} else { } else {
// File searched until end but nothing found // File searched until end but nothing found
println_Msg(F("")); println_Msg(F(""));
@ -2921,7 +2921,7 @@ void readPRG(boolean readrom) {
case 154: // 128K case 154: // 128K
case 206: // 32/64/128K case 206: // 32/64/128K
banks = int_pow(2, prgsize) * 2; banks = int_pow(2, prgsize) * 2;
for (int i = 0; i < banks-2; i += 2) { for (int i = 0; i < banks - 2; i += 2) {
write_prg_byte(0x8000, 6); write_prg_byte(0x8000, 6);
write_prg_byte(0x8001, i); write_prg_byte(0x8001, i);
write_prg_byte(0x8000, 7); write_prg_byte(0x8000, 7);
@ -2931,8 +2931,8 @@ void readPRG(boolean readrom) {
} }
} }
for (word address = 0x4000; address < 0x8000; address += 512) { for (word address = 0x4000; address < 0x8000; address += 512) {
dumpPRG(base, address); dumpPRG(base, address);
} }
break; break;
case 79: case 79:
@ -3066,7 +3066,7 @@ void readPRG(boolean readrom) {
} }
} }
break; break;
case 111: case 111:
banks = int_pow(2, prgsize) / 2; banks = int_pow(2, prgsize) / 2;
for (int i = 0; i < banks; i++) { for (int i = 0; i < banks; i++) {
@ -3152,7 +3152,7 @@ void readPRG(boolean readrom) {
} }
} }
break; break;
case 226: case 226:
banks = int_pow(2, prgsize); banks = int_pow(2, prgsize);
for (int i = 0; i < banks; i += 2) { for (int i = 0; i < banks; i += 2) {
@ -3163,16 +3163,16 @@ void readPRG(boolean readrom) {
} }
} }
break; break;
case 228: case 228:
banks = int_pow(2, prgsize); banks = int_pow(2, prgsize);
for (int i = 0; i < banks; i += 2) { // up to 1024k PRG for (int i = 0; i < banks; i += 2) { // up to 1024k PRG
write_prg_byte(0x8000 + ((i & 0x3F) << 6), 0); write_prg_byte(0x8000 + ((i & 0x3F) << 6), 0);
for (word address = 0x0; address < 0x8000; address += 512) { for (word address = 0x0; address < 0x8000; address += 512) {
dumpPRG(base, address); dumpPRG(base, address);
} }
} }
if (prgsize > 6) { // reading the 3rd 512k PRG chip (Action 52) if (prgsize > 6) { // reading the 3rd 512k PRG chip (Action 52)
for (int i = 0; i < 32; i += 2) { for (int i = 0; i < 32; i += 2) {
write_prg_byte(0x9800 + ((i & 0x1F) << 6), 0); write_prg_byte(0x9800 + ((i & 0x1F) << 6), 0);
for (word address = 0x0; address < 0x8000; address += 512) { for (word address = 0x0; address < 0x8000; address += 512) {
@ -3992,7 +3992,7 @@ void readCHR(boolean readrom) {
} }
} }
break; break;
case 228: case 228:
banks = int_pow(2, chrsize) / 2; banks = int_pow(2, chrsize) / 2;
for (int i = 0; i < banks; i++) { for (int i = 0; i < banks; i++) {