mirror of
https://github.com/holub/mame
synced 2025-06-01 18:41:47 +03:00
[N64] Force mtc0 opcodes that initiate to-RSP DMAs to end recompile sequences to force a code check. Fixes certain microcodes from executing garbage code after DMA. [Ryan Holtz]
This commit is contained in:
parent
97c3d0cb39
commit
3915e5c0e2
@ -3622,8 +3622,7 @@ static void static_generate_entry_point(rsp_state *rsp)
|
||||
load_fast_iregs(rsp, block);
|
||||
|
||||
/* generate a hash jump via the current mode and PC */
|
||||
UML_HASHJMP(block, 0, mem(&rsp->pc), *rsp->impstate->nocode);
|
||||
// hashjmp <mode>,<pc>,nocode
|
||||
UML_HASHJMP(block, 0, mem(&rsp->pc), *rsp->impstate->nocode); // hashjmp <mode>,<pc>,nocode
|
||||
block->end();
|
||||
}
|
||||
|
||||
@ -4622,6 +4621,11 @@ static int generate_cop0(rsp_state *rsp, drcuml_block *block, compiler_state *co
|
||||
UML_MOV(block, mem(&rsp->impstate->arg0), RDREG); // mov [arg0],<rdreg>
|
||||
UML_MOV(block, mem(&rsp->impstate->arg1), RTREG); // mov [arg1],<rtreg>
|
||||
UML_CALLC(block, cfunc_get_cop0_reg, rsp); // callc cfunc_get_cop0_reg
|
||||
if(RDREG == 2)
|
||||
{
|
||||
generate_update_cycles(rsp, block, compiler, mem(&rsp->pc), TRUE);
|
||||
UML_HASHJMP(block, 0, mem(&rsp->pc), *rsp->impstate->nocode);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
|
@ -274,6 +274,10 @@ bool rsp_frontend::describe_cop0(UINT32 op, opcode_desc &desc)
|
||||
|
||||
case 0x04: // MTCz
|
||||
desc.regin[0] |= REGFLAG_R(RTREG);
|
||||
if(RDREG == 2) // SP_RD_LEN, initiating DMA
|
||||
{
|
||||
desc.flags |= OPFLAG_END_SEQUENCE;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user