From 53668ca0f8dae622f61c2b30000a27b80fd8ec6f Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 3 Dec 2007 21:44:19 +0000 Subject: [PATCH] added handling for bad sram headers git-svn-id: file:///home/notaz/opt/svn/PicoDrive@309 be3aeb3a-fb24-0410-a615-afba39da0efa --- Pico/Cart.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Pico/Cart.c b/Pico/Cart.c index a19dcc8..749d461 100644 --- a/Pico/Cart.c +++ b/Pico/Cart.c @@ -546,10 +546,12 @@ void PicoCartDetect(void) Pico.m.sram_reg |= 4; } else { // normal SRAM - SRam.start = PicoRead32(0x1B4) & 0xFFFF00; + SRam.start = PicoRead32(0x1B4) & ~0xff; SRam.end = PicoRead32(0x1B8) | 1; sram_size = SRam.end - SRam.start + 1; } + SRam.start &= ~0xff000000; + SRam.end &= ~0xff000000; Pico.m.sram_reg |= 0x10; // SRAM was detected } if (sram_size <= 0) -- 2.39.2