cpu_thread::test_state added

lv2_obj::sleep adjustment
synchronization fixes
This commit is contained in:
Nekotekina 2017-02-22 13:10:55 +03:00
parent 4b6f8d2f62
commit 9000407a77
36 changed files with 421 additions and 302 deletions

View file

@ -50,7 +50,7 @@ void spu_interpreter::set_interrupt_status(SPUThread& spu, spu_opcode_t op)
spu.set_interrupt_status(false);
}
if ((spu.ch_event_stat & SPU_EVENT_INTR_TEST) > SPU_EVENT_INTR_ENABLED)
if ((spu.ch_event_stat & SPU_EVENT_INTR_TEST & spu.ch_event_mask) > SPU_EVENT_INTR_ENABLED)
{
spu.ch_event_stat &= ~SPU_EVENT_INTR_ENABLED;
spu.srr0 = std::exchange(spu.pc, -4) + 4;
@ -89,10 +89,16 @@ void spu_interpreter::MFSPR(SPUThread& spu, spu_opcode_t op)
void spu_interpreter::RDCH(SPUThread& spu, spu_opcode_t op)
{
if (!spu.get_ch_value(op.ra, spu.gpr[op.rt]._u32[3]))
u32 result;
if (!spu.get_ch_value(op.ra, result))
{
spu.pc -= 4;
}
else
{
spu.gpr[op.rt] = v128::from32r(result);
}
}
void spu_interpreter::RCHCNT(SPUThread& spu, spu_opcode_t op)