Previous 15994 Revisions Next

r9904 Monday 3rd January, 2011 at 13:14:56 UTC by MooglyGuy
[MIPS3] Fix case where branch delay slot straddles a page boundary and the page check confirms that the block is paged in. Fixes N64 LucasArts game booting. [Aaron Giles]
[src/emu/cpu/mips]mips3drc.c mips3fe.c

src/emu/cpu/mips/mips3fe.c
r9903r9904
4444   UINT32 op, opswitch;
4545
4646   /* compute the physical PC */
47   assert((desc->physpc & 3) == 0);
4748   if (!mips3com_translate_address(mips, ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &desc->physpc))
4849   {
4950      /* uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and */
r9903r9904
5354   }
5455
5556   /* fetch the opcode */
57   assert((desc->physpc & 3) == 0);
5658   op = desc->opptr.l[0] = mips->direct->read_decrypted_dword(desc->physpc);
5759
5860   /* all instructions are 4 bytes and default to a single cycle each */
src/emu/cpu/mips/mips3drc.c
r9903r9904
11041104   UML_EXH(block, mips3->impstate->exception[EXCEPTION_TLBLOAD_FILL], IREG(0));   // exh     exception[TLBLOAD_FILL],i0
11051105   UML_LABEL(block, 1);                                          // 1:
11061106   save_fast_iregs(mips3, block);
1107
1108   // the saved PC may be set 1 instruction back with the low bit set to indicate
1109   // a delay slot; in this path we want the original instruction address, so recover it
1110   UML_ADD(block, IREG(0), MEM(&mips3->pc), IMM(3));                        // add     i0,<pc>,3
1111   UML_AND(block, MEM(&mips3->pc), IREG(0), IMM(~3));                        // and     <pc>,i0,~3
11071112   UML_EXIT(block, IMM(EXECUTE_MISSING_CODE));                              // exit    EXECUTE_MISSING_CODE
11081113
11091114   drcuml_block_end(block);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team