From: notaz Date: Mon, 3 Dec 2007 21:44:19 +0000 (+0000) Subject: added handling for bad sram headers X-Git-Tag: v1.85~609 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53668ca0f8dae622f61c2b30000a27b80fd8ec6f;p=picodrive.git added handling for bad sram headers git-svn-id: file:///home/notaz/opt/svn/PicoDrive@309 be3aeb3a-fb24-0410-a615-afba39da0efa --- 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)