From d771334d6f43831d0c683d016b63833325da93e8 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 31 May 2017 21:10:49 -0700 Subject: Prevent emulated screen from "rolling" when the vertical resolution is changed at an inopportune time --- vdp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index 74d3a60..3b8538e 100644 --- a/vdp.c +++ b/vdp.c @@ -1738,6 +1738,11 @@ static void advance_output_line(vdp_context *context) if (output_line < context->inactive_start + context->border_bot && context->output_lines > 0) { output_line = context->output_lines++;//context->border_top + context->vcounter; } else if (output_line >= 0x200 - context->border_top) { + if (output_line == 0x200 - context->border_top) { + //We're at the top of the display, force context->output_lines to be zero to avoid + //potential screen rolling if the mode is changed at an inopportune time + context->output_lines = 0; + } output_line = context->output_lines++;//context->vcounter - (0x200 - context->border_top); } else { output_line = INVALID_LINE; -- cgit v1.2.3