summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Happy <Happy-yappH@users.noreply.github.com>2017-04-25 23:36:30 -0600
committer Happy <Happy-yappH@users.noreply.github.com>2017-04-25 23:36:30 -0600
commit3fc3f8254ec04dc5afcc5b7ce221c41f79db88d2 (patch)
tree8ac4f236867d9739dd87f614cd9b09ffb962c5e6
parent66ac95eb053102bbf4fbf28371a15ded2b5bd221 (diff)
N64, RSP, drc : Wrap PC to 12 bits in a few more places.
-rw-r--r--src/devices/cpu/rsp/rspdrc.cpp6
-rw-r--r--src/devices/cpu/rsp/rspfe.cpp2
2 files changed, 4 insertions, 4 deletions
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 <linkreg>,desc->pc + 8
+ UML_MOV(block, R32(linkreg), (int32_t)((desc->pc + 8) & 0x0000fff)); // mov <linkreg>,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;