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) {