DMTC0 status writes should update the segmented memory. (#135)

This matches the MTC0 code.
This commit is contained in:
Nabile Rahmani 2019-11-03 17:46:58 +01:00 committed by Simon Eriksson
parent 30f17b2e20
commit 05eedd91b5

View file

@ -83,6 +83,8 @@ int VR4300_DMFC0(struct vr4300 *vr4300,
//
int VR4300_DMTC0(struct vr4300 *vr4300,
uint32_t iw, uint64_t rs, uint64_t rt) {
struct vr4300_icrf_latch *icrf_latch = &vr4300->pipeline.icrf_latch;
struct vr4300_exdc_latch *exdc_latch = &vr4300->pipeline.exdc_latch;
unsigned dest = GET_RD(iw);
switch (dest + VR4300_REGISTER_CP0_0)
@ -94,6 +96,10 @@ int VR4300_DMTC0(struct vr4300 *vr4300,
case VR4300_CP0_REGISTER_COMPARE:
vr4300->regs[VR4300_CP0_REGISTER_CAUSE] &= ~0x8000;
break;
case VR4300_CP0_REGISTER_STATUS:
icrf_latch->segment = get_segment(icrf_latch->common.pc, rt);
exdc_latch->segment = get_default_segment();
break;
}
if (vr4300_cp0_reg_masks[dest] == 0x0000000000000BADULL)