summaryrefslogtreecommitdiff
path: root/vdp.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2020-06-28 22:53:52 -0700
committerMike Pavone <pavone@retrodev.com>2020-06-28 22:53:52 -0700
commitaef4cb676cb5588b279ac22c095a6b91b06bc520 (patch)
treeb62488448b973d1b0f089644216e590939092aa0 /vdp.c
parentdd998469827d866ee88505d5527abd6db4ae8832 (diff)
Enter debugger when a VDP data port read would cause a CPU lockup
Diffstat (limited to 'vdp.c')
-rw-r--r--vdp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/vdp.c b/vdp.c
index 0ffc1a2..b0e412f 100644
--- a/vdp.c
+++ b/vdp.c
@@ -3953,6 +3953,20 @@ uint16_t vdp_data_port_read(vdp_context * context)
}
if (context->cd & 1) {
warning("Read from VDP data port while writes are configured, CPU is now frozen. VDP Address: %X, CD: %X\n", context->address, context->cd);
+ context->system->enter_debugger = 1;
+ return context->prefetch;
+ }
+ switch (context->cd)
+ {
+ case VRAM_READ:
+ case VSRAM_READ:
+ case CRAM_READ:
+ case VRAM_READ8:
+ break;
+ default:
+ warning("Read from VDP data port with invalid source, CPU is now frozen. VDP Address: %X, CD: %X\n", context->address, context->cd);
+ context->system->enter_debugger = 1;
+ return context->prefetch;
}
while (!(context->flags & FLAG_READ_FETCHED)) {
vdp_run_context_full(context, context->cycles + ((context->regs[REG_MODE_4] & BIT_H40) ? 16 : 20));