# HG changeset patch # User Mike Pavone # Date 1391970569 28800 # Node ID 3fc1d145493cfe40252d0465f7aacf459fc0dfda # Parent 7f54f1773e84ec1c671be127b71a2784d6a48db9 Properly handle dbcc, rtr and rte in the debugger next command diff -r 7f54f1773e84 -r 3fc1d145493c blastem.c --- a/blastem.c Sun Feb 09 00:42:43 2014 -0800 +++ b/blastem.c Sun Feb 09 10:29:29 2014 -0800 @@ -1465,17 +1465,27 @@ printf(format, param, value); break; case 'n': - //TODO: Deal with dbcc, rtr and rte if (inst.op == M68K_RTS) { after = (read_dma_value(context->aregs[7]/2) << 16) | read_dma_value(context->aregs[7]/2 + 1); + } else if (inst.op == M68K_RTE || inst.op == M68K_RTR) { + after = (read_dma_value((context->aregs[7]+2)/2) << 16) | read_dma_value((context->aregs[7]+2)/2 + 1); } else if(inst.op == M68K_BCC && inst.extra.cond != COND_FALSE) { - if (inst.extra.cond = COND_TRUE) { + if (inst.extra.cond == COND_TRUE) { after = inst.address + 2 + inst.src.params.immed; } else { branch_f = after; branch_t = inst.address + 2 + inst.src.params.immed; insert_breakpoint(context, branch_t, (uint8_t *)debugger); } + } else if(inst.op == M68K_DBCC) { + if (inst.extra.cond == COND_FALSE) { + if (context->dregs[inst.dst.params.regs.pri] & 0xFFFF) { + after = inst.address + 2 + inst.src.params.immed; + } + } else if (inst.extra.cond != COND_TRUE) { + branch_t = after; + branch_f = inst.address + 2 + inst.src.params.immed; + } } else if(inst.op == M68K_JMP) { switch(inst.src.addr_mode) {