From: Toni Wilen Date: Sun, 14 Sep 2025 09:31:53 +0000 (+0300) Subject: Fix mode switch height change not updating row_map (for example PAL/NTSC) X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=5a2c236e1632c39d18bdf4dc89f51246066d32a8;p=francis%2Fwinuae.git Fix mode switch height change not updating row_map (for example PAL/NTSC) --- diff --git a/drawing.cpp b/drawing.cpp index 4c89c51e..2fc9c46b 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -1285,7 +1285,7 @@ void init_row_map(void) struct vidbuffer *vb = vidinfo->inbuffer; static uae_u8 *oldbufmem; static struct vidbuffer *oldvb; - static int oldheight, oldpitch; + static int oldheight_alloc, oldheight, oldpitch; static bool oldgenlock, oldburst; int i, j; @@ -1300,7 +1300,8 @@ void init_row_map(void) if (oldbufmem && oldbufmem == vb->bufmem && oldvb == vb && - oldheight == vb->height_allocated && + oldheight_alloc == vb->height_allocated && + oldheight == vb->outheight && oldpitch == vb->rowbytes && oldgenlock == init_genlock_data && oldburst == (row_map_color_burst_buffer ? 1 : 0)) { @@ -1335,7 +1336,8 @@ void init_row_map(void) } oldvb = vb; oldbufmem = vb->bufmem; - oldheight = vb->height_allocated; + oldheight_alloc = vb->height_allocated; + oldheight = vb->outheight; oldpitch = vb->rowbytes; oldgenlock = init_genlock_data; oldburst = row_map_color_burst_buffer ? 1 : 0; @@ -1513,6 +1515,12 @@ static void center_image (void) vidinfo->inbuffer->xoffset = visible_left_border << (RES_MAX - currprefs.gfx_resolution); vidinfo->inbuffer->yoffset = thisframe_y_adjust << VRES_MAX; + int linedbl = currprefs.gfx_vresolution; + if (doublescan > 0 && interlace_seen <= 0) { + linedbl = 0; + } + min_ypos_for_screen = minfirstline << linedbl; + if (center_reset > 0) { center_reset--; } @@ -1972,7 +1980,10 @@ static void vbcopy(struct vidbuffer *vbout, struct vidbuffer *vbin) { if (vbout->locked) { for (int h = 0; h < vbout->height_allocated && h < vbin->height_allocated; h++) { - memcpy(vbout->bufmem + h * vbout->rowbytes, vbin->bufmem + h * vbin->rowbytes, (vbin->width_allocated > vbout->width_allocated ? vbout->width_allocated : vbin->width_allocated) * vbout->pixbytes); + uae_u8 *dst = vbout->bufmem + h * vbout->rowbytes; + uae_u8 *src = vbin->bufmem + h * vbin->rowbytes; + int len = vbin->width_allocated > vbout->width_allocated ? vbout->width_allocated : vbin->width_allocated; + memcpy(dst, src, len * vbout->pixbytes); } } }