From a2c94b72150978f55d45c7d5b278969d5a53c67b Mon Sep 17 00:00:00 2001 From: PsyK0p4T <87064902+PsyK0p4T@users.noreply.github.com> Date: Tue, 31 Jan 2023 00:57:19 +0100 Subject: [PATCH] Add support for Beggar Prince rev.1 Fixes cart size, rom header provides wrong values --- Cart_Reader/MD.ino | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Cart_Reader/MD.ino b/Cart_Reader/MD.ino index aa534af..ae89b73 100644 --- a/Cart_Reader/MD.ino +++ b/Cart_Reader/MD.ino @@ -732,6 +732,11 @@ void getCartInfo_MD() { } } + // Beggar Prince rev.1 Check + if ((cartSize == 0x4ED02021) && (chksum == 0x3E08)) { + cartSize = 0x400000; + } + // Sonic & Knuckles Check SnKmode = 0; if (chksum == 0xDFB3) { @@ -853,8 +858,7 @@ void getCartInfo_MD() { // 4 = 128KB (2045 Blocks) Sega CD Backup RAM Cart // 6 = 512KB (8189 Blocks) Ultra CD Backup RAM Cart (Aftermarket) word bramCheck = readWord_MD(0x00); - if ((((bramCheck & 0xFF) == 0x04) && ((chksum & 0xFF) == 0x04)) - || (((bramCheck & 0xFF) == 0x06) && ((chksum & 0xFF) == 0x06))) { + if ((((bramCheck & 0xFF) == 0x04) && ((chksum & 0xFF) == 0x04)) || (((bramCheck & 0xFF) == 0x06) && ((chksum & 0xFF) == 0x06))) { unsigned long p = 1 << (bramCheck & 0xFF); bramSize = p * 0x2000L; } @@ -2674,4 +2678,4 @@ void readRealtec_MD() { //****************************************** // End of File -//****************************************** \ No newline at end of file +//******************************************