summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-05-31 21:10:49 -0700
committerMichael Pavone <pavone@retrodev.com>2017-05-31 21:10:49 -0700
commitd771334d6f43831d0c683d016b63833325da93e8 (patch)
tree8fc463f70be0727cedbbd82c1f997c0997a0dcc6
parent6bbed68c04f0c6d7204e8374fc3c15d7fdb1f552 (diff)
Prevent emulated screen from "rolling" when the vertical resolution is changed at an inopportune time
-rw-r--r--vdp.c5
1 files changed, 5 insertions, 0 deletions
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;