summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2026-11-14 14:57:32 -0600
committerGitHub <noreply@github.com>2026-11-14 14:57:32 -0600
commit334334d42ab1f9b8d18ef078b2efbc94cfa89081 (patch)
tree0f6bb4693e37d3af1b15298025f49d923cbf7899 /Source/Core
parentf9cb5f1c084447e2be560a8449e22d68e0fe656d (diff)
parentad3598389ebc6ef2d93915b656c0c3478104ac77 (diff)
Merge pull request #15006 from Sintendo/mfspr-movsx
Jit64: mfspr - Sign-extend slice_length
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
index 70eb2e4027..b6baf2fb51 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
@@ -333,20 +333,16 @@ void Jit64::mfspr(UGeckoInstruction inst)
CVTSI2SS(XMM0, PPCSTATE(downcount));
MULSS(XMM0, MDisp(rcx, offsetof(CoreTiming::Globals, last_OC_factor_inverted)));
CVTSS2SI(rdx, R(XMM0)); // RDX is downcount scaled by the overclocking factor
- MOV(32, rax, MDisp(rcx, offsetof(CoreTiming::Globals, slice_length)));
+ MOVSX(64, 32, rax, MDisp(rcx, offsetof(CoreTiming::Globals, slice_length)));
SUB(64, rax, rdx); // cycles since the last CoreTiming::Advance() event is (slicelength -
// Scaled_downcount)
ADD(64, rax, MDisp(rcx, offsetof(CoreTiming::Globals, global_timer)));
SUB(64, rax, MDisp(rcx, offsetof(CoreTiming::Globals, fake_TB_start_ticks)));
// 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.
+ // 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, rax, Imm32(js.downcountAmount));