# HG changeset patch # User Michael Pavone # Date 1541128496 25200 # Node ID 079e5b9d59cef841982a54ddcbb9a2aae8df499c # Parent 3c16613052197c10e9d8e3eadef5b6dc52d297b3 Forcefully update the display when entering the 68K debugger so you can see it update in realtime as you step through the code diff -r 3c1661305219 -r 079e5b9d59ce debug.c --- a/debug.c Wed Oct 31 21:58:59 2018 -0700 +++ b/debug.c Thu Nov 01 20:14:56 2018 -0700 @@ -900,6 +900,8 @@ init_terminal(); sync_components(context, 0); + genesis_context *gen = context->system; + vdp_force_update_framebuffer(gen->vdp); //probably not necessary, but let's play it safe address &= 0xFFFFFF; if (address == branch_t) { diff -r 3c1661305219 -r 079e5b9d59ce vdp.c --- a/vdp.c Wed Oct 31 21:58:59 2018 -0700 +++ b/vdp.c Thu Nov 01 20:14:56 2018 -0700 @@ -1720,6 +1720,22 @@ } } +void vdp_force_update_framebuffer(vdp_context *context) +{ + uint16_t lines_max = (context->flags2 & FLAG2_REGION_PAL) + ? 240 + BORDER_TOP_V30_PAL + BORDER_BOT_V30_PAL + : 224 + BORDER_TOP_V28 + BORDER_BOT_V28; + + uint16_t to_fill = lines_max - context->output_lines; + memset( + ((char *)context->fb) + context->output_pitch * context->output_lines, + 0, + to_fill * context->output_pitch + ); + render_framebuffer_updated(context->cur_buffer, context->h40_lines > context->output_lines / 2 ? LINEBUF_SIZE : (256+HORIZ_BORDER)); + context->fb = render_get_framebuffer(context->cur_buffer, &context->output_pitch); +} + static void advance_output_line(vdp_context *context) { if (headless) { diff -r 3c1661305219 -r 079e5b9d59ce vdp.h --- a/vdp.h Wed Oct 31 21:58:59 2018 -0700 +++ b/vdp.h Thu Nov 01 20:14:56 2018 -0700 @@ -252,5 +252,6 @@ void vdp_reacquire_framebuffer(vdp_context *context); void vdp_serialize(vdp_context *context, serialize_buffer *buf); void vdp_deserialize(deserialize_buffer *buf, void *vcontext); +void vdp_force_update_framebuffer(vdp_context *context); #endif //VDP_H_