diff --git a/Source/RSP/Interpreter CPU.c b/Source/RSP/Interpreter CPU.c index ee264b6a0..bc5d7c74b 100644 --- a/Source/RSP/Interpreter CPU.c +++ b/Source/RSP/Interpreter CPU.c @@ -457,6 +457,15 @@ DWORD RunInterpreterCPU(DWORD Cycles) { RSP_NextInstruction = NORMAL; *PrgCount = RSP_JumpTo; break; + case SINGLE_STEP: + *PrgCount = (*PrgCount + 4) & 0xFFC; + RSP_NextInstruction = SINGLE_STEP_DONE; + break; + case SINGLE_STEP_DONE: + *PrgCount = (*PrgCount + 4) & 0xFFC; + *RSPInfo.SP_STATUS_REG |= SP_STATUS_HALT; + RSP_Running = FALSE; + break; } } return Cycles; diff --git a/Source/RSP/Interpreter CPU.h b/Source/RSP/Interpreter CPU.h index 520a70ec1..7dbd5becf 100644 --- a/Source/RSP/Interpreter CPU.h +++ b/Source/RSP/Interpreter CPU.h @@ -24,9 +24,17 @@ * */ -#define NORMAL 0 -#define DELAY_SLOT 1 -#define JUMP 2 +#define NORMAL 0 +#define DO_DELAY_SLOT 1 +#define DELAY_SLOT 2 +#define DELAY_SLOT_DONE 3 +#define DELAY_SLOT_EXIT 4 +#define DELAY_SLOT_EXIT_DONE 5 +#define JUMP 6 +#define SINGLE_STEP 7 +#define SINGLE_STEP_DONE 8 +#define FINISH_BLOCK 9 +#define FINISH_SUB_BLOCK 10 extern DWORD RSP_NextInstruction, RSP_JumpTo, RSP_MfStatusCount; diff --git a/Source/RSP/Interpreter Ops.c b/Source/RSP/Interpreter Ops.c index f0b4437e2..fa3697aed 100644 --- a/Source/RSP/Interpreter Ops.c +++ b/Source/RSP/Interpreter Ops.c @@ -436,8 +436,15 @@ void RSP_Cop0_MT (void) { RSPInfo.CheckInterrupts(); RSP_Running = FALSE; } - if ( ( RSP_GPR[RSPOpC.rt].W & SP_CLR_SSTEP ) != 0) { *RSPInfo.SP_STATUS_REG &= ~SP_STATUS_SSTEP; } - if ( ( RSP_GPR[RSPOpC.rt].W & SP_SET_SSTEP ) != 0) { *RSPInfo.SP_STATUS_REG |= SP_STATUS_SSTEP; } + if ( ( RSP_GPR[RSPOpC.rt].W & SP_CLR_SSTEP ) != 0) + { + *RSPInfo.SP_STATUS_REG &= ~SP_STATUS_SSTEP; + } + if ( ( RSP_GPR[RSPOpC.rt].W & SP_SET_SSTEP ) != 0) + { + *RSPInfo.SP_STATUS_REG |= SP_STATUS_SSTEP; + RSP_NextInstruction = SINGLE_STEP; + } if ( ( RSP_GPR[RSPOpC.rt].W & SP_CLR_INTR_BREAK ) != 0) { *RSPInfo.SP_STATUS_REG &= ~SP_STATUS_INTR_BREAK; } if ( ( RSP_GPR[RSPOpC.rt].W & SP_SET_INTR_BREAK ) != 0) { *RSPInfo.SP_STATUS_REG |= SP_STATUS_INTR_BREAK; } if ( ( RSP_GPR[RSPOpC.rt].W & SP_CLR_SIG0 ) != 0) { *RSPInfo.SP_STATUS_REG &= ~SP_STATUS_SIG0; }