From 16f9140960de24baf50552a6853c5a9518d6ea6c Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 16 Sep 2014 04:42:38 +0000 Subject: [PATCH] fix regression within past 2 commits of launching any game from firmware --- desmume/src/addons/slot1comp_rom.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/desmume/src/addons/slot1comp_rom.cpp b/desmume/src/addons/slot1comp_rom.cpp index bc72ca804..38ba93c74 100644 --- a/desmume/src/addons/slot1comp_rom.cpp +++ b/desmume/src/addons/slot1comp_rom.cpp @@ -44,8 +44,9 @@ u32 Slot1Comp_Rom::read() //zero 15-sep-2014 - this is meaningless. newer mask is actually reasonable //address &= gameInfo.mask; //sanity check - address &= 0x3FFF; //memory safe sanity test - u32 ret = LE_TO_LOCAL_32(*(u32*)(gameInfo.secureArea + (address - 0x4000))); + u32 secureAreaAddress = (address - 0x4000); + secureAreaAddress &= 0x3FFF; //memory safe sanity test + u32 ret = LE_TO_LOCAL_32(*(u32*)(gameInfo.secureArea + secureAreaAddress)); address = (address&~0xFFF) + ((address+4)&0xFFF); return ret; }