]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix A2024 (others later)
authorToni Wilen <twilen@winuae.net>
Sat, 28 Mar 2026 14:14:06 +0000 (16:14 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 28 Mar 2026 14:14:06 +0000 (16:14 +0200)
custom.cpp
drawing.cpp
include/drawing.h
specialmonitors.cpp

index 13ff005458562790cd51e0cac5cc38ba3d10bda3..d620cea98ce5956942083c10cf35d9776e243529 100644 (file)
@@ -393,6 +393,7 @@ static int next_lineno;
 int linear_vpos, linear_vpos_vb_start, linear_vpos_vb_end, linear_hpos, linear_vpos_prev[3], linear_hpos_prev[3];
 static int linear_vb_offset;
 static int linear_vpos_vsync;
+int vsync_start_offset;
 int linear_display_vpos;
 int current_linear_vpos, current_linear_hpos;
 static int current_linear_hblen, current_linear_hblen_temp;
@@ -1686,7 +1687,9 @@ void compute_framesync(void)
        if (currprefs.cs_hvcsync >= HVSYNC_SYNCPOS) {
                vblines = LINES_AFTER_VSYNC;
        }
-       int maxv = current_linear_vpos - (vblines - display_vblankstart_skip) + display_vblankend_skip + 1;
+       int hiddentopv = (vblines - display_vblankstart_skip);
+       int hiddenbottomv = display_vblankend_skip;
+       int maxv = current_linear_vpos - (hiddentopv + hiddenbottomv) + 1;
        linear_vpos_vb_end = current_linear_vpos_vb_end - display_vblankstart_skip - 1;
        if (currprefs.gfx_overscanmode >= OVERSCANMODE_ULTRA) {
                maxv = current_linear_vpos;
@@ -4612,7 +4615,8 @@ static void cursorsprite(struct sprite *s)
 
 static int calculate_linetype(int vp)
 {
-       int lineno = vp - (currprefs.cs_hvcsync >= HVSYNC_SYNCPOS ? LINES_AFTER_VSYNC : linear_vb_offset);
+       int off = currprefs.cs_hvcsync >= HVSYNC_SYNCPOS ? LINES_AFTER_VSYNC : linear_vb_offset;
+       int lineno = vp - off;
        nextline_how = nln_normal;
        if (doflickerfix_active()) {
                lineno *= 2;
@@ -10086,7 +10090,7 @@ static void vsync_mark(void)
                if (!vb_end_detect) {
                        vb_detect_cnt++;
                        if (vb_detect_cnt >= 4) {
-                               // if VB does not exists
+                               // if VB does not exist
                                linear_vpos_vblank_end = LINES_AFTER_VSYNC;
                                linear_vpos_vblank_start = linear_vpos;
                                linear_vpos_vblank_lines = LINES_AFTER_VSYNC;
@@ -10099,6 +10103,10 @@ static void vsync_mark(void)
                }
                vb_end_detect = false;
                linear_vpos = 0;
+
+               int off = currprefs.cs_hvcsync >= HVSYNC_SYNCPOS ? LINES_AFTER_VSYNC : linear_vb_offset;
+               vsync_start_offset = -off;
+
        }
 }
 
index 9292ad2ead5606c8126dc3d208256d60a4c97ef6..34512c7aabf6be245f9ee006b5f33cb00238fd32 100644 (file)
@@ -1529,7 +1529,7 @@ static void center_image(void)
        }
 
        vidinfo->inbuffer->xoffset = visible_left_border << (RES_MAX - currprefs.gfx_resolution);
-       vidinfo->inbuffer->yoffset = thisframe_y_adjust << VRES_MAX;
+       vidinfo->inbuffer->yoffset = (-vsync_start_offset) << VRES_MAX;
 
        int linedbl = currprefs.gfx_vresolution;
        if (doublescan > 0 && interlace_seen <= 0) {
@@ -2029,6 +2029,8 @@ static void setspecialmonitorpos(struct vidbuffer *vb)
        vb->yoffset = vidinfo->inbuffer->yoffset;
        vb->inxoffset = vidinfo->inbuffer->inxoffset;
        vb->inyoffset = vidinfo->inbuffer->inyoffset;
+       vb->outwidth = vidinfo->inbuffer->outwidth;
+       vb->outheight = vidinfo->inbuffer->outheight;
 }
 
 static void vbcopy(struct vidbuffer *vbout, struct vidbuffer *vbin)
index 2bd86d684e45858c4f539995049afdb354a465e4..4ba9dfb1843805a2be1db2164c18323e8da2d611 100644 (file)
@@ -25,6 +25,7 @@ extern int detected_screen_resolution;
 extern int hdisplay_left_border, denisehtotal;
 extern int vsync_startline;
 extern int video_recording_active;
+extern int vsync_start_offset;
 
 #define AMIGA_WIDTH_MAX (754 / 2)
 #define AMIGA_HEIGHT_MAX_PAL (576 / 2)
index b9b25f269b4a4272bdf0b6db62cc795326563c70..db0823063439af26561a9071ef73cf1ec2e9f844 100755 (executable)
@@ -1,3 +1,11 @@
+/*
+* UAE - The Un*x Amiga Emulator
+*
+* Video port display adapters using digital RGBI signals
+*
+*/
+
+
 #include "sysconfig.h"
 #include "sysdeps.h"
 
@@ -18,9 +26,6 @@
 #include "arcadia.h"
 #include "uae/attributes.h"
 
-// We have this in sysconfig.h
-//#define VIDEOGRAB 1
-
 const TCHAR *specialmonitorfriendlynames[] =
 {
        _T("A2024"),
@@ -2051,7 +2056,7 @@ static bool a2024(struct vidbuffer *src, struct vidbuffer *dst)
        doff = ((dxoff << RES_MAX) / avidinfo->xchange) * src->pixbytes;
        found = false;
 
-       int idlinestart = 21;
+       int idlinestart = 18;
        for (idline = idlinestart; idline <= idlinestart + 8; idline += 8) {
                if (src->yoffset > (idline << VRES_MAX))
                        continue;
@@ -2169,7 +2174,11 @@ static bool a2024(struct vidbuffer *src, struct vidbuffer *dst)
                return false;
        }
 
-       srcbuf = src->bufmem + (((44 << VRES_MAX) - src->yoffset) / avidinfo->ychange) * src->rowbytes + (srcxoffset / avidinfo->xchange) * src->pixbytes;
+       int ystart = 82 - src->yoffset;
+       if (ystart < 0) {
+               return false;
+       }
+       srcbuf = src->bufmem + (ystart / avidinfo->ychange) * src->rowbytes + (srcxoffset / avidinfo->xchange) * src->pixbytes;
        dstbuf = dst->bufmem + py * (panel_height / avidinfo->ychange) * dst->rowbytes + px * ((panel_width * 2) / avidinfo->xchange) * dst->pixbytes;
 
        for (y = 0; y < (panel_height / (dbl == 1 ? 1 : 2)) / avidinfo->ychange; y++) {