summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2007-03-25 01:40:30 +0000
committerIan C <ianc@noddybox.co.uk>2007-03-25 01:40:30 +0000
commitdbc50517b6ec5ee9d166d560657a7a346bc65642 (patch)
tree4b709dac1feb1e9c5e94aff455b68ff6d1ae3661
parentea070a77079d8df5e84993568f5f72614018a13e (diff)
Tweaks to try and stop monitor showing PC history for non-stepping key-presses
-rw-r--r--source/monitor.c10
1 files changed, 7 insertions, 3 deletions
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;
}
}