Added SDD1 aupport (for star ocean) based on MichIK code and method

This commit is contained in:
Scott Smith 2016-07-30 15:32:22 -04:00
parent ec1347fd8a
commit 343c95ae8c

View File

@ -392,6 +392,9 @@ void getCartInfo_SNES() {
println_Msg(F("SA1 RAM BATT")); println_Msg(F("SA1 RAM BATT"));
romType = SA; romType = SA;
} }
else if (romChips == 69) {
println_Msg(F("SDD1 BATT"));
}
else if (romChips == 227) else if (romChips == 227)
println_Msg(F("RAM GBoy")); println_Msg(F("RAM GBoy"));
else if (romChips == 246) else if (romChips == 246)
@ -500,6 +503,14 @@ boolean checkcart_SNES() {
// Check RomChips // Check RomChips
romChips = readBank_SNES(0, 65494); romChips = readBank_SNES(0, 65494);
if (romChips == 69)
{
romSize = 48;
numBanks = 96;
romType = HI;
}
else
{
// Check RomSize // Check RomSize
byte romSizeExp = readBank_SNES(0, 65495) - 7; byte romSizeExp = readBank_SNES(0, 65495) - 7;
romSize = 1; romSize = 1;
@ -512,6 +523,7 @@ boolean checkcart_SNES() {
else { else {
numBanks = (long(romSize) * 1024 * 1024 / 8) / (32768 + (long(romType) * 32768)); numBanks = (long(romSize) * 1024 * 1024 / 8) / (32768 + (long(romType) * 32768));
} }
}
//Check SD card for alt config //Check SD card for alt config
checkAltConf(); checkAltConf();
@ -803,7 +815,7 @@ void readROM_SNES() {
} }
} }
// Dump High-type ROM // Dump High-type ROM
else if ((romType == HI) || (romType == SA) || (romType == EX)) { else if (((romType == HI) || (romType == SA) || (romType == EX)) && (romChips != 69)) {
println_Msg(F("Dumping HiRom...")); println_Msg(F("Dumping HiRom..."));
display_Update(); display_Update();
@ -816,6 +828,42 @@ void readROM_SNES() {
} }
} }
} }
// Dump SDD1 High-type ROM
else if ((romType == HI) && (romChips == 69)) {
println_Msg(F("Dumping SDD1 HiRom..."));
display_Update();
controlIn_SNES();
byte initialSOMap = readBank_SNES(0, 18439);
for (int currMemmap=0; currMemmap < (numBanks / 16); currMemmap++) {
dataOut();
controlOut_SNES();
writeBank_SNES(0, 18439, currMemmap);
dataIn();
controlIn_SNES();
for (int currBank = 240; currBank < 256; currBank++) {
for (long currByte = 0; currByte < 65536; currByte += 512) {
for (unsigned long c = 0; c < 512; c++) {
sdBuffer[c] = readBank_SNES(currBank, currByte + c);
}
myFile.write(sdBuffer, 512);
}
}
}
dataOut();
controlOut_SNES();
writeBank_SNES(0, 18439, initialSOMap);
dataIn();
controlIn_SNES();
}
// Close the file: // Close the file:
myFile.close(); myFile.close();