V25D: Fixed Derby Stallion 96 (thanks to skaman and tamanegi_taro)

This commit is contained in:
sanni 2017-06-10 07:46:05 +02:00 committed by GitHub
parent 876190b17e
commit 4958b83e48
2 changed files with 28 additions and 5 deletions

View File

@ -2,8 +2,8 @@
Cartridge Reader for Arduino Mega2560 Cartridge Reader for Arduino Mega2560
Author: sanni Author: sanni
Date: 2017-06-06 Date: 2017-06-10
Version: V25C Version: V25D
SD lib: https://github.com/greiman/SdFat SD lib: https://github.com/greiman/SdFat
LCD lib: https://github.com/adafruit/Adafruit_SSD1306 LCD lib: https://github.com/adafruit/Adafruit_SSD1306
@ -34,7 +34,7 @@
YamaArashi - GBA flashrom bank switch command YamaArashi - GBA flashrom bank switch command
**********************************************************************************/ **********************************************************************************/
char ver[5] = "V25C"; char ver[5] = "V25D";
/****************************************** /******************************************
Define Output Define Output

View File

@ -841,8 +841,31 @@ void readROM_SNES() {
print_Error(F("Can't create file on SD"), true); print_Error(F("Can't create file on SD"), true);
} }
// Check if LoROM or HiROM... //Dump Derby Stallion '96 (Japan) Actual Size is 24Mb
if (romType == LO) { if ((romType == LO) && (numBanks == 128) && (strcmp("CC86", checksumStr) == 0)) {
// Read Banks 0x00-0x3F for the 1st/2nd MB
for (int currBank = 0; currBank < 64; currBank++) {
// Dump the bytes to SD 512B at a time
for (long currByte = 32768; currByte < 65536; currByte += 512) {
for (int c = 0; c < 512; c++) {
sdBuffer[c] = readBank_SNES(currBank, currByte + c);
}
myFile.write(sdBuffer, 512);
}
}
//Read Bank 0x80-9F for the 3rd MB
for (int currBank = 128; currBank < 160; currBank++) {
// Dump the bytes to SD 512B at a time
for (long currByte = 32768; currByte < 65536; currByte += 512) {
for (int c = 0; c < 512; c++) {
sdBuffer[c] = readBank_SNES(currBank, currByte + c);
}
myFile.write(sdBuffer, 512);
}
}
}
//Dump Low-type ROM
else if (romType == LO) {
// Read up to 96 banks starting at bank 0×00. // Read up to 96 banks starting at bank 0×00.
for (int currBank = 0; currBank < numBanks; currBank++) { for (int currBank = 0; currBank < numBanks; currBank++) {
// Dump the bytes to SD 512B at a time // Dump the bytes to SD 512B at a time