mirror of
https://github.com/sanni/cartreader.git
synced 2024-12-26 04:51:52 +01:00
Only use the lower half of bramCheck.
Was reading 0x0104 and 0x0704 from a Japanese RAM cart, when B2 /MRES and B27 /VRES were not connected.
This commit is contained in:
parent
c9938b177f
commit
9a77da1e66
@ -575,8 +575,11 @@ 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 == 0x0004) && (chksum == 0x0004)) || ((bramCheck == 0x0006) && (chksum == 0x0006)))
|
||||
bramSize = pow(2, bramCheck) * 0x2000;
|
||||
if ( (((bramCheck & 0xFF) == 0x04) && ((chksum & 0xFF) == 0x04))
|
||||
|| (((bramCheck & 0xFF) == 0x06) && ((chksum & 0xFF) == 0x06))) {
|
||||
unsigned long p = 1 << (bramCheck & 0xFF);
|
||||
bramSize = p * 0x2000L;
|
||||
}
|
||||
if (saveType != 4) { // NOT SERIAL EEPROM
|
||||
// Check if cart has sram
|
||||
saveType = 0;
|
||||
@ -720,8 +723,10 @@ void getCartInfo_MD() {
|
||||
print_Msg_PaddedHexByte(bramCheck >> 8);
|
||||
print_Msg_PaddedHexByte(bramCheck & 0x00ff);
|
||||
println_Msg(F(""));
|
||||
print_Msg(F("bramSize(KB): "));
|
||||
println_Msg(bramSize>>10);
|
||||
if (bramSize > 0) {
|
||||
print_Msg(F("bramSize(KB): "));
|
||||
println_Msg(bramSize >> 10);
|
||||
}
|
||||
print_Msg(F("Size: "));
|
||||
print_Msg(cartSize * 8 / 1024 / 1024 );
|
||||
println_Msg(F(" MBit"));
|
||||
|
Loading…
Reference in New Issue
Block a user