From 4b105ed0e412fa992bd1b99c6608e7ac63e2c830 Mon Sep 17 00:00:00 2001 From: Fiora Date: Mon, 10 Nov 2014 20:10:41 -0800 Subject: [PATCH] JIT: revert accuracy improvement to mftb Fixes a few games (e.g. Karaoke Revolution Party) for reasons explained in the comments. --- Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp index 0db3a3cca1..3381d8c57e 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp @@ -232,9 +232,13 @@ void Jit64::mfspr(UGeckoInstruction inst) // cost of calling out to C for this is actually significant. MOV(64, R(RAX), M(&CoreTiming::globalTimer)); SUB(64, R(RAX), M(&CoreTiming::fakeTBStartTicks)); - // The timer can change within a long block, so add in any difference - if (js.downcountAmount) - ADD(64, R(RAX), Imm32(js.downcountAmount)); + // It might seem convenient to correct the timer for the block position here for even more accurate + // timing, but as of currently, this can break games. If we end up reading a time *after* the time + // at which an interrupt was supposed to occur, e.g. because we're 100 cycles into a block with only + // 50 downcount remaining, some games don't function correctly, such as Karaoke Party Revolution, + // which won't get past the loading screen. + //if (js.downcountAmount) + // ADD(64, R(RAX), Imm32(js.downcountAmount)); // a / 12 = (a * 0xAAAAAAAAAAAAAAAB) >> 67 MOV(64, R(RDX), Imm64(0xAAAAAAAAAAAAAAABULL)); MUL(64, R(RDX));