Mercurial > repos > blastem
changeset 1385:1eded4f19910
Prevent emulated screen from "rolling" when the vertical resolution is changed at an inopportune time
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 31 May 2017 21:10:49 -0700 |
parents | 1df16f5985f3 |
children | d0008f2620cc |
files | vdp.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/vdp.c Wed May 31 09:45:37 2017 -0700 +++ b/vdp.c Wed May 31 21:10:49 2017 -0700 @@ -1738,6 +1738,11 @@ 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;