Skip to content

Commit c342bbf

Browse files
committed
test/cd_hle_boot: dump 68K registers on stuck-PC failures
When the boot smoke test parks on a tiny PC set, we already dump 32 bytes around each visited PC. Add a one-line dump of D0-D3 / A0-A2 / A6 / SP at the same time so the wait loop's source pointer and target value are visible without re-running with extra logging. Example: BrainDead 13 stops at \$12438A executing CMPA.L (A0)+, D0 ; BEQ ; BRA -4 with A0=\$00851644 and D0=\$41545249 ("ATRI") — i.e. it scans cart space for the universal boot header instead of using CD_poll, which means HLE needs to populate the CD cart memory window (or implement direct BUTCH FIFO data reads) before that path can complete. Made-with: Cursor
1 parent 5df78ac commit c342bbf

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/test_cd_hle_boot.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,21 @@ static void cd_run_one_disc(const char *path, unsigned frames,
237237
fprintf(stderr, "\n");
238238
}
239239
}
240+
241+
/* Dump current 68K data and address registers — the wait loop's
242+
* read target is usually in A0/A1 and the magic value in D0/D1. */
243+
if (C.m68k_get_reg) {
244+
fprintf(stderr, " [REGS]");
245+
static const struct { int id; const char *name; } regs[] = {
246+
{0, "D0"}, {1, "D1"}, {2, "D2"}, {3, "D3"},
247+
{8, "A0"}, {9, "A1"}, {10, "A2"}, {14, "A6"},
248+
{18, "SP"},
249+
};
250+
for (size_t i = 0; i < sizeof(regs)/sizeof(regs[0]); i++)
251+
fprintf(stderr, " %s=$%08X", regs[i].name,
252+
C.m68k_get_reg(NULL, regs[i].id));
253+
fprintf(stderr, "\n");
254+
}
240255
}
241256

242257
cd_unload_game();

0 commit comments

Comments
 (0)