mirror of
https://github.com/n64dev/cen64.git
synced 2024-06-23 14:33:13 -04:00
Delay computing accurate value of count.
Instead, just bump the counter and don't track cycle count. When it comes time to use count, shift it to the right by one instead.
This commit is contained in:
parent
8912b4cc50
commit
85654a891f
18
vr4300/cp0.c
18
vr4300/cp0.c
|
@ -61,7 +61,14 @@ int VR4300_DMFC0(struct vr4300 *vr4300,
|
|||
unsigned dest = GET_RT(iw);
|
||||
unsigned src = GET_RD(iw);
|
||||
|
||||
exdc_latch->result = mask_reg(src, vr4300->regs[32 + src]);
|
||||
if (src == (VR4300_CP0_REGISTER_COUNT - 32)) {
|
||||
exdc_latch->result = (uint32_t)
|
||||
(vr4300->regs[VR4300_CP0_REGISTER_COUNT] >> 1);
|
||||
}
|
||||
|
||||
else
|
||||
exdc_latch->result = mask_reg(src, vr4300->regs[32 + src]);
|
||||
|
||||
exdc_latch->dest = dest;
|
||||
return 0;
|
||||
}
|
||||
|
@ -128,7 +135,14 @@ int VR4300_MFC0(struct vr4300 *vr4300,
|
|||
unsigned dest = GET_RT(iw);
|
||||
unsigned src = GET_RD(iw);
|
||||
|
||||
exdc_latch->result = mask_reg(src, vr4300->regs[32 + src]);
|
||||
if (src == (VR4300_CP0_REGISTER_COUNT - 32)) {
|
||||
exdc_latch->result = (uint32_t)
|
||||
(vr4300->regs[VR4300_CP0_REGISTER_COUNT] >> 1);
|
||||
}
|
||||
|
||||
else
|
||||
exdc_latch->result = mask_reg(src, vr4300->regs[32 + src]);
|
||||
|
||||
exdc_latch->dest = (int32_t) dest;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,6 @@ struct vr4300 {
|
|||
struct vr4300_cp1 cp1;
|
||||
|
||||
struct bus_controller *bus;
|
||||
unsigned long long cycles;
|
||||
unsigned signals;
|
||||
|
||||
uint64_t regs[NUM_VR4300_REGISTERS];
|
||||
|
|
|
@ -429,9 +429,9 @@ void vr4300_cycle(struct vr4300 *vr4300) {
|
|||
struct vr4300_pipeline *pipeline = &vr4300->pipeline;
|
||||
|
||||
// Increment counters.
|
||||
vr4300->regs[VR4300_CP0_REGISTER_COUNT] += ++(vr4300->cycles) & 0x1;
|
||||
vr4300->regs[VR4300_CP0_REGISTER_COUNT]++;
|
||||
|
||||
if ((uint32_t) vr4300->regs[VR4300_CP0_REGISTER_COUNT] ==
|
||||
if ((uint32_t) (vr4300->regs[VR4300_CP0_REGISTER_COUNT] >> 1) ==
|
||||
(uint32_t) vr4300->regs[VR4300_CP0_REGISTER_COMPARE])
|
||||
vr4300->regs[VR4300_CP0_REGISTER_CAUSE] |= 0x8000;
|
||||
|
||||
|
|
Loading…
Reference in a new issue