Merge pull request #435 from PsyK0p4T/master

Game Gear crc file usage added
This commit is contained in:
sanni 2022-07-25 13:21:11 +02:00 committed by GitHub
commit 02a7b42052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2455 additions and 2430 deletions

View File

@ -66,7 +66,12 @@ void _smsMenu() {
// Change working dir to root // Change working dir to root
sd.chdir("/"); sd.chdir("/");
readROM_SMS(); readROM_SMS();
compareCRC("sms.txt", 0, 0); if (retrode_mode && !retrode_mode_sms) {
compareCRC("gg.txt", 0, 0);
}
else {
compareCRC("sms.txt", 0, 0);
}
#ifdef global_log #ifdef global_log
save_log(); save_log();
#endif #endif
@ -487,7 +492,7 @@ void getCartInfo_SMS() {
} }
display_Clear(); display_Clear();
println_Msg(F("SMS Header not found")); println_Msg(F("SMS/GG Header not found"));
println_Msg(F(" ")); println_Msg(F(" "));
print_Msg(F("Name: ")); print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
@ -501,7 +506,12 @@ void getCartInfo_SMS() {
// Header found // Header found
else { else {
display_Clear(); display_Clear();
println_Msg(F("SMS Header Info")); if (retrode_mode && !retrode_mode_sms) {
println_Msg(F("GG Header Info"));
}
else {
println_Msg(F("SMS Header Info"));
}
println_Msg(F(" ")); println_Msg(F(" "));
print_Msg(F("Name: ")); print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
@ -525,11 +535,21 @@ void getCartInfo_SMS() {
void readROM_SMS() { void readROM_SMS() {
// Get name, add extension and convert to char array for sd lib // Get name, add extension and convert to char array for sd lib
strcpy(fileName, romName); strcpy(fileName, romName);
strcat(fileName, ".SMS"); if (retrode_mode && !retrode_mode_sms) {
strcat(fileName, ".gg");
}
else {
strcat(fileName, ".sms");
}
// create a new folder // create a new folder
EEPROM_readAnything(0, foldern); EEPROM_readAnything(0, foldern);
sprintf(folder, "SMS/ROM/%s/%d", romName, foldern); if (retrode_mode && !retrode_mode_sms) {
sprintf(folder, "GG/ROM/%s/%d", romName, foldern);
}
else {
sprintf(folder, "SMS/ROM/%s/%d", romName, foldern);
}
sd.mkdir(folder, true); sd.mkdir(folder, true);
sd.chdir(folder); sd.chdir(folder);
@ -604,11 +624,16 @@ void readROM_SMS() {
void readSRAM_SMS() { void readSRAM_SMS() {
// Get name, add extension and convert to char array for sd lib // Get name, add extension and convert to char array for sd lib
strcpy(fileName, romName); strcpy(fileName, romName);
strcat(fileName, ".SAV"); strcat(fileName, ".sav");
// create a new folder // create a new folder
EEPROM_readAnything(0, foldern); EEPROM_readAnything(0, foldern);
sprintf(folder, "SMS/SAVE/%s/%d", romName, foldern); if (retrode_mode && !retrode_mode_sms) {
sprintf(folder, "GG/SAVE/%s/%d", romName, foldern);
}
else {
sprintf(folder, "SMS/SAVE/%s/%d", romName, foldern);
}
sd.mkdir(folder, true); sd.mkdir(folder, true);
sd.chdir(folder); sd.chdir(folder);