diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-05-31 21:10:49 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-05-31 21:10:49 -0700 |
commit | d771334d6f43831d0c683d016b63833325da93e8 (patch) | |
tree | 8fc463f70be0727cedbbd82c1f997c0997a0dcc6 /vdp.c | |
parent | 6bbed68c04f0c6d7204e8374fc3c15d7fdb1f552 (diff) |
Prevent emulated screen from "rolling" when the vertical resolution is changed at an inopportune time
Diffstat (limited to 'vdp.c')
-rw-r--r-- | vdp.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |