comparison vdp.c @ 1998:0740d90812ee

Enter debugger when a VDP data port read would cause a CPU lockup
author Mike Pavone <pavone@retrodev.com>
date Sun, 28 Jun 2020 22:53:52 -0700
parents e08c489d5602
children 4ace0fef6f8f
comparison
equal deleted inserted replaced
1997:e08c489d5602 1998:0740d90812ee
3951 context->flags &= ~FLAG_READ_FETCHED; 3951 context->flags &= ~FLAG_READ_FETCHED;
3952 context->flags2 &= ~FLAG2_READ_PENDING; 3952 context->flags2 &= ~FLAG2_READ_PENDING;
3953 } 3953 }
3954 if (context->cd & 1) { 3954 if (context->cd & 1) {
3955 warning("Read from VDP data port while writes are configured, CPU is now frozen. VDP Address: %X, CD: %X\n", context->address, context->cd); 3955 warning("Read from VDP data port while writes are configured, CPU is now frozen. VDP Address: %X, CD: %X\n", context->address, context->cd);
3956 context->system->enter_debugger = 1;
3957 return context->prefetch;
3958 }
3959 switch (context->cd)
3960 {
3961 case VRAM_READ:
3962 case VSRAM_READ:
3963 case CRAM_READ:
3964 case VRAM_READ8:
3965 break;
3966 default:
3967 warning("Read from VDP data port with invalid source, CPU is now frozen. VDP Address: %X, CD: %X\n", context->address, context->cd);
3968 context->system->enter_debugger = 1;
3969 return context->prefetch;
3956 } 3970 }
3957 while (!(context->flags & FLAG_READ_FETCHED)) { 3971 while (!(context->flags & FLAG_READ_FETCHED)) {
3958 vdp_run_context_full(context, context->cycles + ((context->regs[REG_MODE_4] & BIT_H40) ? 16 : 20)); 3972 vdp_run_context_full(context, context->cycles + ((context->regs[REG_MODE_4] & BIT_H40) ? 16 : 20));
3959 } 3973 }
3960 context->flags &= ~FLAG_READ_FETCHED; 3974 context->flags &= ~FLAG_READ_FETCHED;