From 33178b635cc732762c8b74c568bf398119e803bf Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Tue, 11 Jun 2024 08:13:18 -0700 Subject: [PATCH] Slightly more correct loads behavior. Dynarec needs love here tho. --- src/core/psxinterpreter.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/psxinterpreter.cc b/src/core/psxinterpreter.cc index 9b0f85b6c..ec693ba83 100644 --- a/src/core/psxinterpreter.cc +++ b/src/core/psxinterpreter.cc @@ -857,6 +857,7 @@ void InterpretedCPU::psxJALR(uint32_t code) { void InterpretedCPU::psxLB(uint32_t code) { // load delay = 1 latency if (_Rt_) { + maybeCancelDelayedLoad(_Rt_); _i32(delayedLoadRef(_Rt_)) = (int8_t)PCSX::g_emulator->m_mem->read8(_oB_); } else { PCSX::g_emulator->m_mem->read8(_oB_); @@ -866,6 +867,7 @@ void InterpretedCPU::psxLB(uint32_t code) { void InterpretedCPU::psxLBU(uint32_t code) { // load delay = 1 latency if (_Rt_) { + maybeCancelDelayedLoad(_Rt_); _u32(delayedLoadRef(_Rt_)) = PCSX::g_emulator->m_mem->read8(_oB_); } else { PCSX::g_emulator->m_mem->read8(_oB_); @@ -883,6 +885,7 @@ void InterpretedCPU::psxLH(uint32_t code) { } if (_Rt_) { + maybeCancelDelayedLoad(_Rt_); _i32(delayedLoadRef(_Rt_)) = (short)PCSX::g_emulator->m_mem->read16(_oB_); } else { PCSX::g_emulator->m_mem->read16(_oB_); @@ -900,6 +903,7 @@ void InterpretedCPU::psxLHU(uint32_t code) { } if (_Rt_) { + maybeCancelDelayedLoad(_Rt_); _u32(delayedLoadRef(_Rt_)) = PCSX::g_emulator->m_mem->read16(_oB_); } else { PCSX::g_emulator->m_mem->read16(_oB_); @@ -918,6 +922,7 @@ void InterpretedCPU::psxLW(uint32_t code) { uint32_t val = PCSX::g_emulator->m_mem->read32(_oB_); if (_Rt_) { + maybeCancelDelayedLoad(_Rt_); switch (_Rt_) { case 29: PCSX::g_emulator->m_callStacks->setSP(m_regs.GPR.n.sp, val);