From 36676699f0c9ed44db66524bc7077c8a80bac32b Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Thu, 21 Jul 2022 14:10:11 -0600 Subject: [PATCH] update parallel rsp --- parallel-rsp/parallel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/parallel-rsp/parallel.cpp b/parallel-rsp/parallel.cpp index 047eaeb..2fbdcf2 100644 --- a/parallel-rsp/parallel.cpp +++ b/parallel-rsp/parallel.cpp @@ -83,7 +83,7 @@ extern "C" RSP::cpu.invalidate_imem(); // Run CPU until we either break or we need to fire an IRQ. - RSP::cpu.get_state().pc = *RSP::rsp.SP_PC_REG & 0xfff; + cycles = RSP::cpu.get_state().pc = *RSP::rsp.SP_PC_REG & 0xfff; #ifdef INTENSE_DEBUG fprintf(stderr, "RUN TASK: %u\n", RSP::cpu.get_state().pc); @@ -100,7 +100,10 @@ extern "C" break; } - cycles = RSP::cpu.get_state().pc; + 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.