From 268690946c1b0883963cdeb85a4278a034bb9b72 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 28 Jan 2011 18:37:47 +0200 Subject: [PATCH] drc: fall back to interpreter on delay slot link reg dependencies perhaps until someone implements this in recompiler used by Tomb Raider 2 at least --- libpcsxcore/new_dynarec/new_dynarec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index abfd8340..641c673d 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -8419,6 +8419,17 @@ int new_recompile_block(int addr) else ba[i]=-1; /* Is this the end of the block? */ if(i>0&&(itype[i-1]==UJUMP||itype[i-1]==RJUMP||(source[i-1]>>16)==0x1000)) { +#ifdef PCSX + // check for link register access in delay slot + int rt1_=rt1[i-1]; + if(rt1_!=0&&(rs1[i]==rt1_||rs2[i]==rt1_||rt1[i]==rt1_||rt2[i]==rt1_)) { + printf("link access in delay slot @%08x (%08x)\n", addr + i*4, addr); + ba[i-1]=-1; + itype[i-1]=INTCALL; + done=2; + } + else +#endif if(rt1[i-1]==0) { // Continue past subroutine call (JAL) done=2; } -- 2.39.2