From: Toni Wilen Date: Sat, 7 Jun 2025 14:24:23 +0000 (+0300) Subject: OpalVision emulation update. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=ae6cf1a41edc112b0bc7866b3722eaa8e3472d41;p=francis%2Fwinuae.git OpalVision emulation update. --- diff --git a/specialmonitors.cpp b/specialmonitors.cpp index 7b01c63a..56e22fae 100755 --- a/specialmonitors.cpp +++ b/specialmonitors.cpp @@ -3016,11 +3016,11 @@ static bool opalvision(struct vidbuffer *src, struct vidbuffer *dst, bool double uae_u8 *dstline = NULL; int ydisp = -1; - int yoff = (((y * 2 + oddlines) - src->yoffset) / vdbl); + int yoff = (((y * 2 - oddlines) - src->yoffset) / vdbl); if (yoff >= 0 && yoff < src->inheight) { line = src->bufmem + yoff * src->rowbytes; line_genlock = row_map_genlock ? row_map_genlock[yoff] : NULL; - dstline = dst->bufmem + (((y * 2 + oddlines) - dst->yoffset) / vdbl) * dst->rowbytes; + dstline = dst->bufmem + (((y * 2 - oddlines) - dst->yoffset) / vdbl) * dst->rowbytes; if (y >= yimgstart) { ydisp = y - yimgstart; } @@ -3091,13 +3091,15 @@ static bool opalvision(struct vidbuffer *src, struct vidbuffer *dst, bool double bool command_update = false; bool hstart = false; - int ax = 8; - for (x = 0; x < src->inwidth; x++, ax++) { + int xoffset = 8; + int ax = xoffset; + + for (x = 0; x < src->inwidth - xoffset; x++, ax++) { uae_u8 *sa = line + ((x << 1) >> hdbl_shift) * src->pixbytes; uae_u8 newval = FIRGB(src, sa); uae_u8 val = prev | newval; - uae_u8 *d = dstline + ((x << 1) >> hdbl_shift) * dst->pixbytes + dst->pixbytes; + uae_u8 *d = dstline + ((ax << 1) >> hdbl_shift) * dst->pixbytes; uae_u8 *d2 = d + dst->rowbytes; uae_u8 *s = line + ((ax << 1) >> hdbl_shift) * src->pixbytes; @@ -3370,7 +3372,6 @@ static bool opalvision(struct vidbuffer *src, struct vidbuffer *dst, bool double xxx = false; } #endif - if (opal->control_y && y >= opal->control_y) { if (opal_debug & 2) @@ -3456,6 +3457,24 @@ static bool opalvision(struct vidbuffer *src, struct vidbuffer *dst, bool double } } + // blank left and right edge + for (x = 0; x < (xoffset + 2); x++) { + uae_u8 *d = dstline + ((x << 1) >> hdbl_shift) * dst->pixbytes; + uae_u8 *d2 = d + dst->rowbytes; + PUT_PRGB(d, d2, dst, 0, 0, 0, 0, doublelines, true); + } + for (x = src->inwidth - (xoffset + 2); x < src->inwidth; x++) { + uae_u8 *d = dstline + ((x << 1) >> hdbl_shift) * dst->pixbytes; + uae_u8 *d2 = d + dst->rowbytes; + PUT_PRGB(d, d2, dst, 0, 0, 0, 0, doublelines, true); + } + if (ydisp < 0) { + uae_u8 *d = dstline; + uae_u8 *d2 = d + dst->rowbytes; + memset(d, 0, dst->inwidth * dst->pixbytes); + memset(d2, 0, dst->inwidth * dst->pixbytes); + } + if (command_update) { int off = (opal->video_command >> 6) & 3; if (off == 3)