summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2018-11-01 20:14:56 -0700
committerMichael Pavone <pavone@retrodev.com>2018-11-01 20:14:56 -0700
commit16e0cd5352a9950fff2972f5c08636ff62987265 (patch)
tree82c459a8d86546831592a26eda3e05527e03d274
parentd8ecd824b2747daf719d58415d321cb5a1a478a9 (diff)
Forcefully update the display when entering the 68K debugger so you can see it update in realtime as you step through the code
-rw-r--r--debug.c2
-rw-r--r--vdp.c16
-rw-r--r--vdp.h1
3 files changed, 19 insertions, 0 deletions
diff --git a/debug.c b/debug.c
index ff4c8d5..1f09591 100644
--- a/debug.c
+++ b/debug.c
@@ -900,6 +900,8 @@ void debugger(m68k_context * context, uint32_t address)
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 --git a/vdp.c b/vdp.c
index 23eadb3..b09861d 100644
--- a/vdp.c
+++ b/vdp.c
@@ -1720,6 +1720,22 @@ static void vdp_advance_line(vdp_context *context)
}
}
+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 --git a/vdp.h b/vdp.h
index de420d1..fa3cdc3 100644
--- a/vdp.h
+++ b/vdp.h
@@ -252,5 +252,6 @@ void vdp_release_framebuffer(vdp_context *context);
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_