From e6de35f5ac0cdd6b3b4c78f6262a5d0cd2393193 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 7 Dec 2014 17:50:38 +0100 Subject: [PATCH] pcsx2:tlb: enable GoemonUnloadTlb on recompiler --- pcsx2/x86/ix86-32/iR5900-32.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 378adeaf18..edc3fc7ef6 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -1739,9 +1739,15 @@ static void __fastcall recRecompile( const u32 startpc ) xCALL(PreBlockCheck); } - // 0x33ad48 is the return address of the function that populate the TLB cache - if (pc == 0x33ad48 && EmuConfig.Gamefixes.GoemonTlbHack) { - xCALL(GoemonPreloadTlb); + if (EmuConfig.Gamefixes.GoemonTlbHack) { + if (pc == 0x33ad48) { + // 0x33ad48 is the return address of the function that populate the TLB cache + xCALL(GoemonPreloadTlb); + } else if (pc == 0x3563b8) { + // 0x3563b8 is the start address of the function that invalidate entry in TLB cache + MOV32MtoR(ECX, (int)&cpuRegs.GPR.n.a0.UL[ 0 ] ); + xCALL(GoemonUnloadTlb); + } } // go until the next branch