From aeb3639ef0a834544d9e8ede8669f4f06e541ec6 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Fri, 24 Nov 2023 22:55:46 +0100 Subject: [PATCH] git subrepo pull --force deps/lightrec subrepo: subdir: "deps/lightrec" merged: "d4b70e0fce" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "d4b70e0fce" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "110b9eb" --- deps/lightrec/.gitrepo | 4 ++-- deps/lightrec/interpreter.c | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deps/lightrec/.gitrepo b/deps/lightrec/.gitrepo index 41db67a6f..bcaac671c 100644 --- a/deps/lightrec/.gitrepo +++ b/deps/lightrec/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/pcercuei/lightrec.git branch = master - commit = 109d0a6ba35d0279b9d0bf5bacafabc2d634af7b - parent = 99104c0456c7c923f40a474c1cbefb89a092b966 + commit = d4b70e0fce940e988a402a163ac2ebbf88c00c26 + parent = 305945333b4ec7d6910a077278c850b1cd887057 method = merge cmdver = 0.4.6 diff --git a/deps/lightrec/interpreter.c b/deps/lightrec/interpreter.c index 9078b693b..75697bdd2 100644 --- a/deps/lightrec/interpreter.c +++ b/deps/lightrec/interpreter.c @@ -156,8 +156,7 @@ static u32 int_delay_slot(struct interpreter *inter, u32 pc, bool branch) load_in_ds, branch_in_ds = false, branch_at_addr = false, branch_taken; u32 new_rt, old_rs = 0, new_rs = 0; - u32 next_pc, ds_next_pc; - u32 cause, epc; + u32 next_pc, ds_next_pc, epc; if (op->i.op == OP_CP0 && op->r.rs == OP_CP0_RFE) { /* When an IRQ happens, the PSX exception handlers (when done) @@ -168,11 +167,13 @@ static u32 int_delay_slot(struct interpreter *inter, u32 pc, bool branch) * but on branch boundaries, we need to adjust the return * address so that the GTE opcode is effectively executed. */ - cause = state->regs.cp0[13]; epc = state->regs.cp0[14]; - if (!(cause & 0x7c) && epc == pc - 4) - pc -= 4; + if (epc == pc - 4) { + op_next = lightrec_read_opcode(state, epc); + if (op_next.i.op == OP_CP2) + pc -= 4; + } } if (inter->delay_slot) {