comparison vdp.c @ 1628:3c1661305219

Avoid changing VDP status flags when executing debugger commands
author Michael Pavone <pavone@retrodev.com>
date Wed, 31 Oct 2018 21:58:59 -0700
parents a664bade4b29
children 079e5b9d59ce
comparison
equal deleted inserted replaced
1627:dc1eab3ec092 1628:3c1661305219
526 context->regs[REG_DMASRC_L], 526 context->regs[REG_DMASRC_L],
527 context->regs[REG_DMASRC_M], 527 context->regs[REG_DMASRC_M],
528 context->regs[REG_DMASRC_H], 528 context->regs[REG_DMASRC_H],
529 context->regs[REG_DMASRC_H] << 17 | context->regs[REG_DMASRC_M] << 9 | context->regs[REG_DMASRC_L] << 1, 529 context->regs[REG_DMASRC_H] << 17 | context->regs[REG_DMASRC_M] << 9 | context->regs[REG_DMASRC_L] << 1,
530 src_types[context->regs[REG_DMASRC_H] >> 6 & 3]); 530 src_types[context->regs[REG_DMASRC_H] >> 6 & 3]);
531 uint8_t old_flags = context->flags;
532 uint8_t old_flags2 = context->flags2;
531 printf("\n**Internal Group**\n" 533 printf("\n**Internal Group**\n"
532 "Address: %X\n" 534 "Address: %X\n"
533 "CD: %X - %s\n" 535 "CD: %X - %s\n"
534 "Pending: %s\n" 536 "Pending: %s\n"
535 "VCounter: %d\n" 537 "VCounter: %d\n"
539 "Status: %X\n", 541 "Status: %X\n",
540 context->address, context->cd, cd_name(context->cd), 542 context->address, context->cd, cd_name(context->cd),
541 (context->flags & FLAG_PENDING) ? "word" : (context->flags2 & FLAG2_BYTE_PENDING) ? "byte" : "none", 543 (context->flags & FLAG_PENDING) ? "word" : (context->flags2 & FLAG2_BYTE_PENDING) ? "byte" : "none",
542 context->vcounter, context->hslot*2, (context->flags2 & FLAG2_VINT_PENDING) ? "true" : "false", 544 context->vcounter, context->hslot*2, (context->flags2 & FLAG2_VINT_PENDING) ? "true" : "false",
543 (context->flags2 & FLAG2_HINT_PENDING) ? "true" : "false", vdp_control_port_read(context)); 545 (context->flags2 & FLAG2_HINT_PENDING) ? "true" : "false", vdp_control_port_read(context));
544 546 //restore flags as calling vdp_control_port_read can change them
545 //TODO: Window Group, DMA Group 547 context->flags = old_flags;
548 context->flags2 = old_flags2;
546 } 549 }
547 550
548 static uint8_t is_active(vdp_context *context) 551 static uint8_t is_active(vdp_context *context)
549 { 552 {
550 return context->state != INACTIVE && (context->regs[REG_MODE_2] & BIT_DISP_EN) != 0; 553 return context->state != INACTIVE && (context->regs[REG_MODE_2] & BIT_DISP_EN) != 0;