boot_test: updates for changes to breakpoints

Because now they actually stop in the correct place.

Also, some other fixups because I'm too lazy to properly split patches
for a personal project.
This commit is contained in:
2018-07-01 22:32:59 -07:00
parent 213c08fa18
commit 447276d029
3 changed files with 12 additions and 14 deletions

View File

@@ -32,7 +32,7 @@ runto 0xc
assert $pc == 0xc
assert $hl == 0x7fff
step; step
step
assert $pc == 0xf
assert $hl == 0xff26
@@ -59,7 +59,7 @@ assert $c == 0x12
runto 0x27
assert $pc == 0x27
step; step
step
assert $pc == 0x28
step
@@ -94,7 +94,7 @@ assert $pc == 0xa1
runto 0xa3
assert $pc == 0xa3
step; step #FIXME: bugs
step
assert $pc == 0xa4
@@ -116,11 +116,11 @@ assert $pc == 0x96
runto 0x34
assert $pc == 0x34
step; step
step
assert $pc == 0x37
assert $de == 0xd8
step;
step
assert $pc == 0x39
assert $b == 0x08
@@ -128,7 +128,7 @@ runto 0x40
assert $pc == 0x40
assert $b == 0
step; step
step
assert $pc == 0x42
assert $a == 0x19
@@ -151,7 +151,7 @@ runto 0x55
assert $a == 0
assert $pc == 0x55
step; step
step
assert $h == 0
assert $pc == 0x56

View File

@@ -227,7 +227,6 @@ static void step(char *arg_list)
if (end_steps <= cpu.metrics.retired_instrs) {
gb_log("CPU stopped after %" PRId64 " instructions\n", steps);
} else if (paused_breakpoint) {
breakpoint_addr_hit(cpu.pc);
gb_log("Breakpoint hit\n");
} else if (paused_signal){
gb_log("Interrupted\n");
@@ -482,7 +481,6 @@ static void do_run(void) {
if (paused_signal) {
gb_log("Interrupted.\n");
} else if (paused_breakpoint) {
breakpoint_addr_hit(cpu.pc);
gb_log("Breakpoint hit\n");
}
@@ -610,7 +608,7 @@ static void breakpoint_addr_hit(uint16_t addr)
for (i = 0; i < num_breakpoints; i++) {
if (breakpoints[i].addr == addr) {
bkpt= &breakpoints[i];
bkpt = &breakpoints[i];
break;
}
}

View File

@@ -393,8 +393,7 @@ void lr35902_cycle(struct lr35902_state *cpu)
WRITE_BIT(cpu->a, 7, cpu->cf);
break;
case 0x10: /* STOP */
//TODO:
//cpu->stopped = true;
ASSERT(0); //TODO: Implement me
break;
case 0x11: /* LD DE, d16 */
LD_D16(cpu, cpu->de);
@@ -1409,10 +1408,11 @@ void lr35902_cycle(struct lr35902_state *cpu)
POP_16(cpu, cpu->hl);
break;
case 0xe2:
cpu->mem_write(cpu, 0xff00 + cpu->c, cpu->a);
break;
case 0xe3: /* UNDEF */
break;
case 0xe4: /* UNDEF */
break;
ASSERT(0);
case 0xe5: /* PUSH HL */
PUSH_16(cpu, cpu->hl);
break;