diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-07-06 21:51:35 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-07-06 21:51:35 -0700 |
commit | ca926b3fb134dc47b0ff6815356c619344a8214c (patch) | |
tree | 16192f9c1291bb2d71a26d1c4c385e016d3ccbb0 /debug.c | |
parent | 34891053bed6e161e8cdd9712e61c6c9dd7b105b (diff) |
Fix s(tep) debug command for the case of dbra with an expired counter reg
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -796,10 +796,16 @@ int run_debugger_command(m68k_context *context, char *input_buf, m68kinst inst, branch_f = after; branch_t = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; insert_breakpoint(context, branch_t, debugger); - } else if(inst.op == M68K_DBCC && inst.extra.cond != COND_FALSE) { - branch_t = after; - branch_f = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; - insert_breakpoint(context, branch_f, debugger); + } else if(inst.op == M68K_DBCC) { + if (inst.extra.cond == COND_FALSE) { + if (context->dregs[inst.dst.params.regs.pri] & 0xFFFF) { + after = m68k_branch_target(&inst, context->dregs, context->aregs); + } + } else { + branch_t = after; + branch_f = m68k_branch_target(&inst, context->dregs, context->aregs); + insert_breakpoint(context, branch_f, debugger); + } } else { after = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; } |