mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-11 07:25:07 +01:00
commit
e806b39658
@ -722,6 +722,7 @@ void getCartInfo_MD() {
|
|||||||
SnKmode = 0;
|
SnKmode = 0;
|
||||||
if (chksum == 0xDFB3) {
|
if (chksum == 0xDFB3) {
|
||||||
char id[15];
|
char id[15];
|
||||||
|
memset(id, 0, 15);
|
||||||
|
|
||||||
// Get ID
|
// Get ID
|
||||||
for (byte c = 0; c < 14; c += 2) {
|
for (byte c = 0; c < 14; c += 2) {
|
||||||
@ -738,6 +739,7 @@ void getCartInfo_MD() {
|
|||||||
//Sonic & Knuckles ID:GM MK-1563 -00
|
//Sonic & Knuckles ID:GM MK-1563 -00
|
||||||
if (!strcmp("GM MK-1563 -00", id)) {
|
if (!strcmp("GM MK-1563 -00", id)) {
|
||||||
char labelLockon[17];
|
char labelLockon[17];
|
||||||
|
memset(labelLockon, 0, 17);
|
||||||
|
|
||||||
// Get labelLockon
|
// Get labelLockon
|
||||||
for (byte c = 0; c < 16; c += 2) {
|
for (byte c = 0; c < 16; c += 2) {
|
||||||
@ -754,6 +756,7 @@ void getCartInfo_MD() {
|
|||||||
// check Lock-on game presence
|
// check Lock-on game presence
|
||||||
if (!(strcmp("SEGA MEGA DRIVE ", labelLockon) & strcmp("SEGA GENESIS ", labelLockon))) {
|
if (!(strcmp("SEGA MEGA DRIVE ", labelLockon) & strcmp("SEGA GENESIS ", labelLockon))) {
|
||||||
char idLockon[15];
|
char idLockon[15];
|
||||||
|
memset(idLockon, 0, 15);
|
||||||
|
|
||||||
// Lock-on cart checksum
|
// Lock-on cart checksum
|
||||||
chksumLockon = readWord_MD(0x1000C7);
|
chksumLockon = readWord_MD(0x1000C7);
|
||||||
@ -772,10 +775,10 @@ void getCartInfo_MD() {
|
|||||||
idLockon[c + 1] = loByte;
|
idLockon[c + 1] = loByte;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(strncmp("GM 00001009-0", idLockon, 13) & strncmp("GM 00004049-0", idLockon, 13))) {
|
if (!strncmp("GM 00001009-0", idLockon, 13) || !strncmp("GM 00004049-0", idLockon, 13)) {
|
||||||
//Sonic1 ID:GM 00001009-0? or GM 00004049-0?
|
//Sonic1 ID:GM 00001009-0? or GM 00004049-0?
|
||||||
SnKmode = 2;
|
SnKmode = 2;
|
||||||
} else if (!(strcmp("GM 00001051-00", idLockon) & strcmp("GM 00001051-01", idLockon) & strcmp("GM 00001051-02", idLockon))) {
|
} else if (!strcmp("GM 00001051-00", idLockon) || !strcmp("GM 00001051-01", idLockon) || !strcmp("GM 00001051-02", idLockon)) {
|
||||||
//Sonic2 ID:GM 00001051-00 or GM 00001051-01 or GM 00001051-02
|
//Sonic2 ID:GM 00001051-00 or GM 00001051-01 or GM 00001051-02
|
||||||
SnKmode = 3;
|
SnKmode = 3;
|
||||||
|
|
||||||
@ -1376,20 +1379,14 @@ void readROM_MD() {
|
|||||||
display_Update();
|
display_Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate and compare CRC32 with nointro
|
|
||||||
if (is32x)
|
|
||||||
//database, crcString, renamerom, offset
|
|
||||||
compareCRC("32x.txt", 0, 1, 0);
|
|
||||||
else
|
|
||||||
compareCRC("md.txt", 0, 1, 0);
|
|
||||||
|
|
||||||
// More checksums
|
// More checksums
|
||||||
if (SnKmode >= 2) {
|
if (SnKmode >= 2) {
|
||||||
|
print_Msg(F("Lock-on checksum..."));
|
||||||
if (chksumLockon == calcCKSLockon) {
|
if (chksumLockon == calcCKSLockon) {
|
||||||
println_Msg(F("Checksum2 OK"));
|
println_Msg(F("OK"));
|
||||||
display_Update();
|
display_Update();
|
||||||
} else {
|
} else {
|
||||||
print_Msg(F("Checksum2 Error: "));
|
print_Msg(F("Error"));
|
||||||
char calcsumStr[5];
|
char calcsumStr[5];
|
||||||
sprintf(calcsumStr, "%04X", calcCKSLockon);
|
sprintf(calcsumStr, "%04X", calcCKSLockon);
|
||||||
println_Msg(calcsumStr);
|
println_Msg(calcsumStr);
|
||||||
@ -1398,11 +1395,12 @@ void readROM_MD() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SnKmode == 3) {
|
if (SnKmode == 3) {
|
||||||
|
print_Msg(F("Adittional checksum..."));
|
||||||
if (chksumSonic2 == calcCKSSonic2) {
|
if (chksumSonic2 == calcCKSSonic2) {
|
||||||
println_Msg(F("Checksum3 OK"));
|
println_Msg(F("OK"));
|
||||||
display_Update();
|
display_Update();
|
||||||
} else {
|
} else {
|
||||||
print_Msg(F("Checksum3 Error: "));
|
print_Msg(F("Error"));
|
||||||
char calcsumStr[5];
|
char calcsumStr[5];
|
||||||
sprintf(calcsumStr, "%04X", calcCKSSonic2);
|
sprintf(calcsumStr, "%04X", calcCKSSonic2);
|
||||||
println_Msg(calcsumStr);
|
println_Msg(calcsumStr);
|
||||||
@ -1410,6 +1408,14 @@ void readROM_MD() {
|
|||||||
display_Update();
|
display_Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate and compare CRC32 with nointro
|
||||||
|
if (is32x)
|
||||||
|
//database, crcString, renamerom, offset
|
||||||
|
compareCRC("32x.txt", 0, 1, 0);
|
||||||
|
else
|
||||||
|
compareCRC("md.txt", 0, 1, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user