Pinpoint IRQ requests in CPU tracing

This commit is contained in:
Aaron Culliney 2016-10-02 11:53:29 -07:00
parent 3edb24ea3b
commit 4fd6a87340
3 changed files with 18 additions and 4 deletions

View File

@ -61,12 +61,15 @@
# define TRACE_EPILOGUE \
CommonSaveCPUState; \
bl CALL(cpu65_trace_epilogue);
# define TRACE_IRQ \
bl CALL(cpu65_trace_irq);
#else
# define TRACE_PROLOGUE
# define TRACE_ARG
# define TRACE_ARG1
# define TRACE_ARG2
# define TRACE_EPILOGUE
# define TRACE_IRQ
#endif
@ -2467,8 +2470,9 @@ ex_reset: eor r0, r0, r0
ex_irq: tst F_Reg, #I_Flag // Already interrupted?
beq 1f
JumpNextInstruction
1: mov r0, PC_Reg
JumpNextInstruction // Yes (ignored) ...
1: TRACE_IRQ // No (handle IRQ) ...
mov r0, PC_Reg
mov r0, r0, ROR #8
Push(r0)
mov r0, r0, LSR #24

View File

@ -916,7 +916,13 @@ GLUE_C_WRITE(cpu65_trace_epilogue)
}
fprintf(cpu_trace_fp, "%s", "\n");
fflush(cpu_trace_fp);
}
GLUE_C_WRITE(cpu65_trace_irq)
{
if (cpu_trace_fp) {
fprintf(cpu_trace_fp, "IRQ:%02X\n", cpu65__signal);
}
}
void cpu65_trace_checkpoint(void) {

View File

@ -58,12 +58,15 @@
CommonSaveCPUState; \
popLQ _XAX; \
CALL_FN(callLQ, cpu65_trace_epilogue, 0x4);
# define TRACE_IRQ \
CALL_FN(callLQ, cpu65_trace_irq, 0x4);
#else
# define TRACE_PROLOGUE
# define TRACE_ARG
# define TRACE_ARG1
# define TRACE_ARG2
# define TRACE_EPILOGUE
# define TRACE_IRQ
#endif
/* -------------------------------------------------------------------------
@ -2186,7 +2189,8 @@ ex_reset: REG2MEM(movb, $0, cpu65__signal)
ex_irq: testb $I_Flag, F_Reg // Already interrupted?
jz 1f
JumpNextInstruction // Yes (ignored) ...
1: movw PC_Reg, %ax // No (handle IRQ) ...
1: TRACE_IRQ // No (handle IRQ) ...
movw PC_Reg, %ax
#if __PIC__
xchgb %al, %ah
Push(%al)