From 5c8f9fb5700be9517f171918d8e5bfbc4d0ee9e4 Mon Sep 17 00:00:00 2001 From: "R. Belmont" Date: Thu, 19 Mar 2009 02:34:15 +0000 Subject: [PATCH] MIPS III: Update RA before executing the delay slot. --- src/emu/cpu/mips/mips3drc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c index b81c742d18a..c0fd28bb979 100644 --- a/src/emu/cpu/mips/mips3drc.c +++ b/src/emu/cpu/mips/mips3drc.c @@ -1697,14 +1697,14 @@ static void generate_delay_slot_and_branch(mips3_state *mips3, drcuml_block *blo if (desc->targetpc == BRANCH_TARGET_DYNAMIC) UML_MOV(block, MEM(&mips3->impstate->jmpdest), R32(RSREG)); // mov [jmpdest], + /* set the link if needed -- before the delay slot */ + if (linkreg != 0) + UML_DMOV(block, R64(linkreg), IMM((INT32)(desc->pc + 8))); // dmov ,desc->pc + 8 + /* compile the delay slot using temporary compiler state */ assert(desc->delay != NULL); generate_sequence_instruction(mips3, block, &compiler_temp, desc->delay); // - /* set the link if needed -- after the delay slot */ - if (linkreg != 0) - UML_DMOV(block, R64(linkreg), IMM((INT32)(desc->pc + 8))); // dmov ,desc->pc + 8 - /* update the cycles and jump through the hash table to the target */ if (desc->targetpc != BRANCH_TARGET_DYNAMIC) {