From d8ecd824b2747daf719d58415d321cb5a1a478a9 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 31 Oct 2018 21:58:59 -0700 Subject: Avoid changing VDP status flags when executing debugger commands --- vdp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index 56bb62b..23eadb3 100644 --- a/vdp.c +++ b/vdp.c @@ -528,6 +528,8 @@ void vdp_print_reg_explain(vdp_context * context) 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 @@ void vdp_print_reg_explain(vdp_context * context) (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) -- cgit v1.2.3