summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2010-02-03 19:45:15 +0100
committerSegher Boessenkool <segher@kernel.crashing.org>2010-02-03 19:45:15 +0100
commitf2c15a5ec11b2d84bc1e355697b603251307c125 (patch)
tree60a456cfbf3454209d57a14381c65c62467193f8
parent22f06280b73d93e4b2287ee81e03dba17a0def07 (diff)
Add "trace_calls" tracing option
-rw-r--r--emu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/emu.c b/emu.c
index 0efd85e..17ac2bc 100644
--- a/emu.c
+++ b/emu.c
@@ -28,6 +28,7 @@ u16 mem[N_MEM];
static int trace = 0;
static int trace_new = 0;
static int store_trace = 0;
+static int trace_calls = 0;
static int pause_after_every_frame = 0;
//static u8 trace_irq[9] = { 0, 1, 1, 1, 1, 1, 1, 1, 1 };
static u8 trace_irq[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@@ -167,6 +168,12 @@ static void step(void)
u32 old_cs_pc = cs_pc();
u32 x, d = 0xff0000;
+ if (trace_calls) {
+ op = mem[cs_pc()];
+ if ((op & 0xf3c0) == 0xf040 || (op & 0xfff7) == 0x9a90)
+ print_state();
+ }
+
op = mem[cs_pc()];
inc_cs_pc(1);