update parallel rsp

This commit is contained in:
Logan McNaughton
2022-08-02 13:52:56 -06:00
parent 77bb0b6441
commit cd169c0d65
3 changed files with 32 additions and 7 deletions
+5 -7
View File
@@ -83,7 +83,9 @@ extern "C"
RSP::cpu.invalidate_imem();
// Run CPU until we either break or we need to fire an IRQ.
cycles = RSP::cpu.get_state().pc = *RSP::rsp.SP_PC_REG & 0xfff;
RSP::cpu.get_state().pc = *RSP::rsp.SP_PC_REG & 0xfff;
RSP::cpu.get_state().instruction_count = 0;
RSP::cpu.get_state().last_instruction_type = RSP::VU_INSTRUCTION;
#ifdef INTENSE_DEBUG
fprintf(stderr, "RUN TASK: %u\n", RSP::cpu.get_state().pc);
@@ -100,15 +102,11 @@ extern "C"
break;
}
if (RSP::cpu.get_state().pc > cycles)
cycles = RSP::cpu.get_state().pc - cycles;
else
cycles = 0;
*RSP::rsp.SP_PC_REG = 0x04001000 | (RSP::cpu.get_state().pc & 0xffc);
// From CXD4.
if (*RSP::rsp.SP_STATUS_REG & SP_STATUS_BROKE)
return cycles;
return RSP::cpu.get_state().instruction_count * 1.5; // Converting RCP clock rate to CPU clock rate
else if (*RSP::cpu.get_state().cp0.irq & 1)
RSP::rsp.CheckInterrupts();
else if (*RSP::rsp.SP_SEMAPHORE_REG != 0) // Semaphore lock fixes.
@@ -120,7 +118,7 @@ extern "C"
// CPU restarts with the correct SIGs.
*RSP::rsp.SP_STATUS_REG &= ~SP_STATUS_HALT;
return cycles;
return RSP::cpu.get_state().instruction_count * 1.5; // Converting RCP clock rate to CPU clock rate
}
EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion,