RSP: Add Single step to Interpreter

This commit is contained in:
zilmar 2013-01-29 21:43:10 +11:00
parent e814eb967b
commit 6d39bb2246
3 changed files with 29 additions and 5 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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; }