# HG changeset patch # User Michael Pavone # Date 1541048339 25200 # Node ID 3c16613052197c10e9d8e3eadef5b6dc52d297b3 # Parent dc1eab3ec0923f213d9b2cde4e6189e05467a1f8 Avoid changing VDP status flags when executing debugger commands diff -r dc1eab3ec092 -r 3c1661305219 vdp.c --- a/vdp.c Wed Oct 31 21:58:09 2018 -0700 +++ b/vdp.c Wed Oct 31 21:58:59 2018 -0700 @@ -528,6 +528,8 @@ context->regs[REG_DMASRC_H], context->regs[REG_DMASRC_H] << 17 | context->regs[REG_DMASRC_M] << 9 | context->regs[REG_DMASRC_L] << 1, src_types[context->regs[REG_DMASRC_H] >> 6 & 3]); + uint8_t old_flags = context->flags; + uint8_t old_flags2 = context->flags2; printf("\n**Internal Group**\n" "Address: %X\n" "CD: %X - %s\n" @@ -541,8 +543,9 @@ (context->flags & FLAG_PENDING) ? "word" : (context->flags2 & FLAG2_BYTE_PENDING) ? "byte" : "none", context->vcounter, context->hslot*2, (context->flags2 & FLAG2_VINT_PENDING) ? "true" : "false", (context->flags2 & FLAG2_HINT_PENDING) ? "true" : "false", vdp_control_port_read(context)); - - //TODO: Window Group, DMA Group + //restore flags as calling vdp_control_port_read can change them + context->flags = old_flags; + context->flags2 = old_flags2; } static uint8_t is_active(vdp_context *context)