]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Programmed mode positiong update, use hblank for centering.
authorToni Wilen <twilen@winuae.net>
Sat, 16 Jul 2022 14:16:21 +0000 (17:16 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 16 Jul 2022 14:16:21 +0000 (17:16 +0300)
custom.cpp
drawing.cpp
include/custom.h
include/drawing.h

index 0fda92a87c581f32f70d166b304cd2794c30b6c5..665148495514f99d3187834d3218c06750aa0937 100644 (file)
@@ -1313,7 +1313,7 @@ static void decide_hdiw(int hpos)
                return;
        }
        int start_diw_hpos = ((last_diw_hpos * 2 - DDF_OFFSET + 1) << 2) + 3;
-       int end_diw_hpos = ((hpos2 * 2 + 1) << 2) + 3;
+       int end_diw_hpos = ((hpos * 2 + 1) << 2) + 3;
        // should handle wrap around..
        if (start_diw_hpos < ((1 << 2) + 3)) {
                start_diw_hpos = (1 << 2) + 3;
@@ -5816,7 +5816,7 @@ void compute_vsynctime(void)
 void getsyncregisters(uae_u16 *phsstrt, uae_u16 *phsstop, uae_u16 *pvsstrt, uae_u16 *pvsstop)
 {
        *phsstrt = hsstrt;
-       *phsstop = hsstop_detect;
+       *phsstop = hsstop_detect * 2;
        *pvsstrt = vsstrt;
        *pvsstop = vsstop;
 }
@@ -5967,9 +5967,9 @@ static void updateextblk(void)
                }
                hsyncendpos = hsstop;
 
-               hsstop_detect2 = hsstrt + 21;
-               if (hsstop_detect2 >= maxhpos) {
-                       hsstop_detect2 -= maxhpos;
+               hsstop_detect2 = (hsstrt + 21) * 2;
+               if (hsstop_detect2 >= maxhpos * 2) {
+                       hsstop_detect2 -= maxhpos * 2;
                }
                hsyncendpos2 = hsstop_detect2;
 
@@ -5997,7 +5997,7 @@ static void updateextblk(void)
                hsyncstartpos = hsyncstartpos_hw;
                hsyncendpos2 = hsyncendpos = hsyncendpos_hw;
                denisehtotal = 227 + 7;
-               hsstop_detect2 = 35 + 9;
+               hsstop_detect2 = (35 + 9) * 2;
 
        }
 
@@ -6427,31 +6427,39 @@ static void init_hz(bool checkvposw)
                // assume VGA-like monitor if VARBEAMEN
                if (currprefs.gfx_overscanmode >= OVERSCANMODE_ULTRA) {
                        maxhpos_display = maxhpos;
-                       hsstop_detect = 8;
+                       hsstop_detect = 8 * 2;
                        maxvpos_display_vsync += 2;
-               } else if (currprefs.gfx_overscanmode >= OVERSCANMODE_EXTREME) {
-                       maxhpos_display = maxhpos - 2;
-                       hsstop_detect = 18;
-                       maxvpos_display_vsync += 2;
-               } else if (currprefs.gfx_overscanmode == OVERSCANMODE_BROADCAST) {
-                       maxhpos_display = maxhpos - 10;
-                       hsstop_detect = 22;
-                       maxvpos_display_vsync++;
                } else {
+                       int hp2 = maxhpos * 2;
                        if (exthblank) {
+
                                int hb = 0;
-                               int hbstrtx = hbstrt & 0xff;
-                               int hbstopx = hbstop & 0xff;
-                               if (hbstrtx > maxhpos / 2 && hbstopx < maxhpos / 2) {
-                                       hb = (maxhpos - hbstrtx) + hbstopx;
-                               } else if (hbstopx < maxhpos / 2 && hbstrtx < hbstopx) {
+                               int hbstrtx = (hbstrt & 0xff) * 2;
+                               int hbstopx = (hbstop & 0xff) * 2;
+                               if (aga_mode) {
+                                       hbstrtx |= (hbstrt & 0x400) ? 1 : 0;
+                                       hbstopx |= (hbstop & 0x400) ? 1 : 0;
+                               }
+                               if (hbstrtx > hp2) {
+                                       hbstrtx = hp2;
+                               }
+                               if (hbstopx > hp2) {
+                                       hbstopx = hp2;
+                               }
+                               if (hbstrtx > hp2 / 2 && hbstopx < hp2 / 2) {
+                                       hb = (hp2 - hbstrtx) + hbstopx;
+                               } else if (hbstopx < hp2 / 2 && hbstrtx < hbstopx) {
                                        hb = hbstopx - hbstrtx;
                                }
-                               if (hb < 4) {
-                                       hb = 4;
+                               if (hbstopx > hp2 / 2) {
+                                       hbstopx = 0;
+                               }
+                               if (hb < 0) {
+                                       hb = 0;
                                }
-                               maxhpos_display = maxhpos - (hb - 2);
-                               int hsadj = 10;
+
+#if 0
+                               // HSYNC adjustment
                                int hsz = 0;
                                if (hsstrt > maxhpos / 2 && hsstop > hsstrt) {
                                        hsz = hsstop - hsstrt;
@@ -6460,19 +6468,35 @@ static void init_hz(bool checkvposw)
                                } else if (hsstop < maxhpos / 2 && hsstrt < hsstop) {
                                        hsz = hsstop - hsstrt;
                                }
-                               if (hsz >= 12) {
-                                       hsadj = 15;
-                               }
-                               hsstop_detect = (hbstopx - (hsstrt - hsadj));
+#endif
+                               maxhpos_display = maxhpos - (hb / 2);
+                               hsstop_detect = hbstopx;
+
                        } else {
-                               maxhpos_display = maxhpos - 15;
-                               hsstop_detect = 15;
+
+                               // hardwired
+                               int hbstrtx = 7 * 2;
+                               int hbstopx = 46 * 2;
+                               int hb = hbstopx - hbstrtx;
+                               maxhpos_display = maxhpos - (hb / 2);
+                               hsstop_detect = 46 * 2 - 2;
+                       }
+
+                       if (currprefs.gfx_overscanmode >= OVERSCANMODE_EXTREME) {
+                               int diff = (maxhpos - 2) - maxhpos_display;
+                               if (diff > 0) {
+                                       hsstop_detect -= (diff / 2) * 2;
+                               }
+                               maxhpos_display = maxhpos - 2;
+                               maxvpos_display_vsync += 2;
+                       } else if (currprefs.gfx_overscanmode == OVERSCANMODE_BROADCAST) {
+                               maxhpos_display += EXTRAWIDTH_BROADCAST;
+                               hsstop_detect--;
+                               maxvpos_display_vsync++;
                        }
+
                }
                maxhpos_display *= 2;
-               if (currprefs.gfx_overscanmode < OVERSCANMODE_ULTRA && hsstop_detect2 > hsstop_detect + 5) {
-                       hsstop_detect = hsstop_detect2;
-               }
 
        } else {
 
index c455f8cfd0dcc1f43ca05558917f948dc3d46ea6..851c235b0f1940861d2ab6b54c26dc2bc9946434 100644 (file)
@@ -3918,7 +3918,7 @@ static void center_image (void)
 
        } else if (ew == -1) {
                // wide mode
-               int hs = hsync_end_left_border * 2;
+               int hs = hsync_end_left_border;
                visible_left_border = hs << currprefs.gfx_resolution;
                if (visible_left_border + w > maxdiw) {
                        visible_left_border += (maxdiw - (visible_left_border + w) - 1) / 2;
@@ -4094,7 +4094,7 @@ static void init_drawing_frame (void)
                                                struct wh *dst = currprefs.gfx_apmode[0].gfx_fullscreen ? &changed_prefs.gfx_monitor[0].gfx_size_fs : &changed_prefs.gfx_monitor[0].gfx_size_win;
                                                while (m < 3 * 2) {
                                                        struct wh *src = currprefs.gfx_apmode[0].gfx_fullscreen ? &currprefs.gfx_monitor[0].gfx_size_fs_xtra[m] : &currprefs.gfx_monitor[0].gfx_size_win_xtra[m];
-                                                       if ((src->width > 0 && src->height > 0) || (currprefs.gfx_api || currprefs.gf[0].gfx_filter > 0)) {
+                                                       if (src->width > 0 && src->height > 0) {
                                                                int nr = m >> 1;
                                                                int nl = (m & 1) == 0 ? 0 : 1;
                                                                int nr_o = nr;
index 2ef6a75fa2e877bff14dae04e60af9f866ede9d4..6f1f1e79b7d69156ccc05f19f5ff51d2f8bbb8a2 100644 (file)
@@ -117,7 +117,7 @@ extern uae_u16 INTREQR(void);
 #define MAXVPOS 312
 #else
 #define MAXHPOS 256
-#define MAXVPOS 592
+#define MAXVPOS 800
 #endif
 
 /* PAL/NTSC values */
index d27bf79a71a2667ced83e2f54f5d0d682eaff316..20ab9a5ad9c78b1b0c334b3a9d021ed238f439da 100644 (file)
@@ -286,7 +286,7 @@ extern uae_u16 spixels[MAX_SPR_PIXELS * 2];
 #endif
 
 /* Way too much... */
-#define MAX_REG_CHANGE ((MAXVPOS + MAXVPOS_WRAPLINES) * 2 * MAXHPOS)
+#define MAX_REG_CHANGE ((MAXVPOS + MAXVPOS_WRAPLINES) * 2 * MAXHPOS / 2)
 
 extern struct color_entry *curr_color_tables, *prev_color_tables;