Add support for Beggar Prince rev.1

Fixes cart size, rom header provides wrong values
This commit is contained in:
PsyK0p4T 2023-01-31 00:57:19 +01:00 committed by GitHub
parent b453bf85a8
commit a2c94b7215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -732,6 +732,11 @@ void getCartInfo_MD() {
} }
} }
// Beggar Prince rev.1 Check
if ((cartSize == 0x4ED02021) && (chksum == 0x3E08)) {
cartSize = 0x400000;
}
// Sonic & Knuckles Check // Sonic & Knuckles Check
SnKmode = 0; SnKmode = 0;
if (chksum == 0xDFB3) { if (chksum == 0xDFB3) {
@ -853,8 +858,7 @@ void getCartInfo_MD() {
// 4 = 128KB (2045 Blocks) Sega CD Backup RAM Cart // 4 = 128KB (2045 Blocks) Sega CD Backup RAM Cart
// 6 = 512KB (8189 Blocks) Ultra CD Backup RAM Cart (Aftermarket) // 6 = 512KB (8189 Blocks) Ultra CD Backup RAM Cart (Aftermarket)
word bramCheck = readWord_MD(0x00); word bramCheck = readWord_MD(0x00);
if ((((bramCheck & 0xFF) == 0x04) && ((chksum & 0xFF) == 0x04)) if ((((bramCheck & 0xFF) == 0x04) && ((chksum & 0xFF) == 0x04)) || (((bramCheck & 0xFF) == 0x06) && ((chksum & 0xFF) == 0x06))) {
|| (((bramCheck & 0xFF) == 0x06) && ((chksum & 0xFF) == 0x06))) {
unsigned long p = 1 << (bramCheck & 0xFF); unsigned long p = 1 << (bramCheck & 0xFF);
bramSize = p * 0x2000L; bramSize = p * 0x2000L;
} }