From dbc50517b6ec5ee9d166d560657a7a346bc65642 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 25 Mar 2007 01:40:30 +0000 Subject: Tweaks to try and stop monitor showing PC history for non-stepping key-presses --- source/monitor.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/monitor.c b/source/monitor.c index 14df3bb..6f0fa05 100644 --- a/source/monitor.c +++ b/source/monitor.c @@ -107,7 +107,7 @@ static void DisplayRunningState(int running) } -static void DisplayCPU(Z80 *cpu) +static void DisplayCPU(Z80 *cpu, int stepped) { static const char *flag_char = "SZ5H3PNC"; static Z80Word prev_pc[8]; @@ -127,7 +127,7 @@ static void DisplayCPU(Z80 *cpu) TM_printf(1,f,"%4.4x:",tmp); TM_Put(7,f,Z80Disassemble(cpu,&tmp)); - if (f) + if (stepped && f) { prev_pc[f-1] = prev_pc[f]; } @@ -238,6 +238,7 @@ void MachineCodeMonitor(Z80 *cpu) int done = FALSE; int running = FALSE; int cpu_display = TRUE; + int stepped = FALSE; int key; SoftKey soft_key; @@ -256,13 +257,15 @@ void MachineCodeMonitor(Z80 *cpu) if (cpu_display) { - DisplayCPU(cpu); + DisplayCPU(cpu,stepped); } else { DisplayMem(cpu,mem_display,display_address); } + stepped = FALSE; + do { SoftKeyEvent ev; @@ -330,6 +333,7 @@ void MachineCodeMonitor(Z80 *cpu) if (running || (key & KEY_A)) { Z80SingleStep(cpu); + stepped = TRUE; } } -- cgit v1.2.3