From 626e94e4931d46c21668d6238e24bc6e863ed327 Mon Sep 17 00:00:00 2001 From: mtabachenko Date: Mon, 8 Dec 2008 10:18:50 +0000 Subject: [PATCH] - exclude check address range in VRAM (may crash in some games :( ); --- desmume/src/MMU.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index b5a2a6918..02667bcd9 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -408,6 +408,7 @@ u8 *MMU_RenderMapToLCD(u32 vram_addr) u8 engine = (vram_addr >> 21); vram_addr &= 0x01FFFFF; u8 engine_offset = (vram_addr >> 14); + if (engine_offset > 31) return NULL; u8 block = MMU.VRAM_MAP[engine][engine_offset]; if (block == 7) return NULL; vram_addr -= MMU.LCD_VRAM_ADDR[block]; @@ -452,11 +453,13 @@ static FORCEINLINE u32 MMU_LCDmap(u8 proc, u32 addr) addr -= MMU.LCD_VRAM_ADDR[block]; addr += LCDdata[block][0]; +#if 0 if ((addr < 0x6800000) || (addr> 0x68A3FFF)) // FIXME: this is hack { - //LOG("Address is out range 0x%X in block %i\n", addr, block); + LOG("Address is out range 0x%X in block %i\n", addr, block); addr = save_addr; } +#endif } return (addr); }