diff --git a/src/devices/cpu/rsp/rspdrc.cpp b/src/devices/cpu/rsp/rspdrc.cpp index 34204110139..c384c94eb54 100644 --- a/src/devices/cpu/rsp/rspdrc.cpp +++ b/src/devices/cpu/rsp/rspdrc.cpp @@ -671,7 +671,7 @@ void rsp_device::generate_checksum_block(drcuml_block *block, compiler_state *co if (seqhead->delay.first() != nullptr && seqhead->physpc != seqhead->delay.first()->physpc) { - base = m_direct->read_ptr(seqhead->delay.first()->physpc | 0x1000); + base = m_direct->read_ptr((seqhead->delay.first()->physpc & 0x00000fff) | 0x1000); assert(base != nullptr); UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword UML_ADD(block, I0, I0, I1); // add i0,i0,i1 @@ -702,7 +702,7 @@ void rsp_device::generate_checksum_block(drcuml_block *block, compiler_state *co if (curdesc->delay.first() != nullptr && (curdesc == seqlast || (curdesc->next() != nullptr && curdesc->next()->physpc != curdesc->delay.first()->physpc))) { - base = m_direct->read_ptr(curdesc->delay.first()->physpc | 0x1000); + base = m_direct->read_ptr((curdesc->delay.first()->physpc & 0x00000fff) | 0x1000); assert(base != nullptr); UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword UML_ADD(block, I0, I0, I1); // add i0,i0,i1 @@ -813,7 +813,7 @@ void rsp_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_st /* set the link if needed -- before the delay slot */ if (linkreg != 0) { - UML_MOV(block, R32(linkreg), (int32_t)(desc->pc + 8)); // mov ,desc->pc + 8 + UML_MOV(block, R32(linkreg), (int32_t)((desc->pc + 8) & 0x0000fff)); // mov ,desc->pc + 8 } /* compile the delay slot using temporary compiler state */ diff --git a/src/devices/cpu/rsp/rspfe.cpp b/src/devices/cpu/rsp/rspfe.cpp index c86ed6f5298..5bbf6c94c2e 100644 --- a/src/devices/cpu/rsp/rspfe.cpp +++ b/src/devices/cpu/rsp/rspfe.cpp @@ -37,7 +37,7 @@ bool rsp_frontend::describe(opcode_desc &desc, const opcode_desc *prev) uint32_t op, opswitch; // fetch the opcode - op = desc.opptr.l[0] = m_rsp.m_direct->read_dword(desc.physpc | 0x1000); + op = desc.opptr.l[0] = m_rsp.m_direct->read_dword((desc.physpc & 0x00000fff) | 0x1000); // all instructions are 4 bytes and default to a single cycle each desc.length = 4;