]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
4000b7
authorToni Wilen <twilen@winuae.net>
Tue, 1 May 2018 14:46:37 +0000 (17:46 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 1 May 2018 14:46:37 +0000 (17:46 +0300)
custom.cpp
od-win32/direct3d11.cpp
od-win32/win32.h
od-win32/win32_scaler.cpp

index a2e80ab69d6fde65a0ec777e1c25e3b450ed79ef..d84aba1cbea8f34b05b1a0407a423ff4bef2b39c 100644 (file)
@@ -4054,7 +4054,7 @@ void compute_vsynctime (void)
        if (fabs (currprefs.chipset_refreshrate) > 0.1) {
                syncadjust = currprefs.chipset_refreshrate / vblank_hz_nom;
                vblank_hz = currprefs.chipset_refreshrate;
-               if (isvsync_chipset ()) {
+               if (isvsync_chipset() && !currprefs.gfx_variable_sync) {
                        int mult = 0;
                        if (getvsyncrate(0, vblank_hz, &mult) != vblank_hz) {
                                vblank_hz = getvsyncrate(0, vblank_hz, &vblank_hz_mult);
@@ -4217,20 +4217,22 @@ void compute_framesync(void)
                double v = -1;
                if (!ad->picasso_on && !ad->picasso_requested_on) {
                        if (isvsync_chipset ()) {
-                               if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) {
-                                       if ((fabs (vblank_hz - 50) < 1 || fabs (vblank_hz - 60) < 1 || fabs (vblank_hz - 100) < 1 || fabs (vblank_hz - 120) < 1) && currprefs.gfx_apmode[0].gfx_vsync == 2 && currprefs.gfx_apmode[0].gfx_fullscreen > 0) {
-                                               vsync_switchmode(0, (int)vblank_hz);
+                               if (!currprefs.gfx_variable_sync) {
+                                       if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) {
+                                               if ((fabs(vblank_hz - 50) < 1 || fabs(vblank_hz - 60) < 1 || fabs(vblank_hz - 100) < 1 || fabs(vblank_hz - 120) < 1) && currprefs.gfx_apmode[0].gfx_vsync == 2 && currprefs.gfx_apmode[0].gfx_fullscreen > 0) {
+                                                       vsync_switchmode(0, (int)vblank_hz);
+                                               }
+                                       }
+                                       if (isvsync_chipset() < 0) {
+
+                                               double v2;
+                                               v2 = target_getcurrentvblankrate(0);
+                                               if (!cr->locked)
+                                                       v = v2;
+                                       } else if (isvsync_chipset() > 0) {
+                                               if (currprefs.gfx_apmode[0].gfx_refreshrate)
+                                                       v = abs(currprefs.gfx_apmode[0].gfx_refreshrate);
                                        }
-                               }
-                               if (isvsync_chipset () < 0) {
-
-                                       double v2;
-                                       v2 = target_getcurrentvblankrate(0);
-                                       if (!cr->locked)
-                                               v = v2;
-                               } else if (isvsync_chipset () > 0) {
-                                       if (currprefs.gfx_apmode[0].gfx_refreshrate)
-                                               v = abs (currprefs.gfx_apmode[0].gfx_refreshrate);
                                }
                        } else {
                                if (cr->locked == false) {
@@ -8463,7 +8465,7 @@ static bool linesync_beam_multi_single(void)
                        display_rendered = true;
                }
                // if 2 slices: make sure we are out of vblank.
-               if (display_slices <= 2) {
+               if (display_slices <= 2 && !currprefs.gfx_variable_sync) {
                        while (!currprefs.turbo_emulation && sync_timeout_check(maxtime)) {
                                int vp = target_get_display_scanline(-1);
                                if (vp != -1)
@@ -8501,15 +8503,29 @@ static bool linesync_beam_multi_single(void)
                // topmost/first slice?
                if (display_slice_cnt == 0) {
 
+                       // variable sync: use read_processor_time() for vblank timing
                        if (currprefs.gfx_variable_sync) {
 
                                if (!currprefs.turbo_emulation) {
+
+                                       frame_time_t rpt;
+                                       for (;;) {
+                                               rpt = read_processor_time();
+                                               if ((int)rpt - (int)(vsyncmintime - vsynctimebase / 2) >= 0 || (int)rpt - (int)vsyncmintime < -2 * vsynctimebase)
+                                                       break;
+                                               maybe_process_pull_audio();
+                                               if (currprefs.m68k_speed < 0 && !was_syncline) {
+                                                       is_syncline = -1;
+                                                       return 0;
+                                               }
+                                               target_spin(0);
+                                       }
+
                                        if (!was_syncline) {
                                                do_render_slice(2, display_slice_cnt, vpos - 1);
                                                display_rendered = true;
                                        }
 
-                                       frame_time_t rpt;
                                        for(;;) {
                                                rpt = read_processor_time();
                                                if ((int)rpt - (int)vsyncmintime >= 0 || (int)rpt - (int)vsyncmintime < -2 * vsynctimebase)
@@ -8521,18 +8537,19 @@ static bool linesync_beam_multi_single(void)
                                                }
                                                target_spin(0);
                                        }
-                                       do_display_slice();
                                        if ((int)rpt - (int)vsyncmintime < vsynctimebase && (int)rpt - (int)vsyncmintime > -vsynctimebase) {
                                                vsyncmintime += vsynctimebase;
                                        } else {
                                                vsyncmintime = rpt + vsynctimebase;
                                        }
+                                       do_display_slice();
                                        display_rendered = false;
                                        input_read_done = true;
                                }
 
                        } else {
 
+                               // non-variable: poll vblank
                                if (!currprefs.turbo_emulation) {
                                        if (!was_syncline) {
                                                do_render_slice(2, display_slice_cnt, vpos - 1);
index 705a771f14b4da0aa2822504a630b9fbb714c3ca..da148f31fcaf7803701a8b53ed6398c9ba38616e 100644 (file)
@@ -4678,7 +4678,7 @@ static void xD3D11_guimode(int monid, int guion)
        write_log(_T("fs guimode end\n"));
 }
 
-static int xD3D_isenabled(int monid)
+static int xD3D11_isenabled(int monid)
 {
        struct d3d11struct *d3d = &d3d11data[monid];
        return d3d->m_device != NULL ? 2 : 0;
@@ -4862,7 +4862,7 @@ void d3d11_select(void)
        D3D_showframe_special = NULL;
        D3D_guimode = xD3D11_guimode;
        D3D_getDC = xD3D_getDC;
-       D3D_isenabled = xD3D_isenabled;
+       D3D_isenabled = xD3D11_isenabled;
        D3D_clear = xD3D11_clear;
        D3D_canshaders = xD3D11_canshaders;
        D3D_goodenough = xD3D11_goodenough;
index 18e5170b39d7c116a1e1724b2b0ed01bd44ba5ec..8dafd1ec67d5cfd26e9b9827056b9ef37a625c08 100644 (file)
 #define LANG_DLL_FULL_VERSION_MATCH 1
 
 #if WINUAEPUBLICBETA
-#define WINUAEBETA _T("6")
+#define WINUAEBETA _T("7")
 #else
 #define WINUAEBETA _T("")
 #endif
 
-#define WINUAEDATE MAKEBD(2018, 4, 28)
+#define WINUAEDATE MAKEBD(2018, 5, 1)
 
 //#define WINUAEEXTRA _T("AmiKit Preview")
 //#define WINUAEEXTRA _T("Amiga Forever Edition")
index d57d806c94407096af763484189b304de2a1fc1b..ab75a72cf6c02b64a7e4ba65046496bfc51b11b3 100644 (file)
@@ -805,6 +805,8 @@ static void statusline(int monid)
 
 void S2X_configure(int monid, int rb, int gb, int bb, int rs, int gs, int bs)
 {
+       if (monid)
+               return;
        Init_2xSaI(rb, gb, bb, rs, gs, bs);
        hq_init(rb, gb, bb, rs, gs, bs);
        PAL_init(monid);
@@ -813,6 +815,8 @@ void S2X_configure(int monid, int rb, int gb, int bb, int rs, int gs, int bs)
 
 void S2X_reset(int monid)
 {
+       if (monid)
+               return;
        if (!inited)
                return;
        S2X_init(monid, dst_width2, dst_height2, amiga_depth2);
@@ -820,6 +824,9 @@ void S2X_reset(int monid)
 
 void S2X_free(int monid)
 {
+       if (monid)
+               return;
+
        changed_prefs.leds_on_screen &= ~STATUSLINE_TARGET;
        currprefs.leds_on_screen &= ~STATUSLINE_TARGET;
 
@@ -839,6 +846,9 @@ void S2X_free(int monid)
 
 bool S2X_init(int monid, int dw, int dh, int dd)
 {
+       if (monid)
+               return false;
+
        struct vidbuf_description *avidinfo = &adisplays[monid].gfxvidinfo;
        struct amigadisplay *ad = &adisplays[monid];
        struct vidbuffer *vb = avidinfo->outbuffer;
@@ -955,6 +965,8 @@ bool S2X_init(int monid, int dw, int dh, int dd)
 
 void S2X_render(int monid, int y_start, int y_end)
 {
+       if (monid)
+               return;
        struct AmigaMonitor *mon = &AMonitors[monid];
        struct amigadisplay *ad = &adisplays[monid];
        struct uae_filter *usedfilter = mon->usedfilter;
@@ -1177,12 +1189,16 @@ end:
 
 void S2X_refresh(int monid)
 {
+       if (monid)
+               return;
        DirectDraw_ClearSurface(NULL);
        S2X_render(monid, -1, -1);
 }
 
 int S2X_getmult(int monid)
 {
+       if (monid)
+               return 1;
        struct AmigaMonitor *mon = &AMonitors[monid];
        struct uae_filter *usedfilter = mon->usedfilter;
        if (!usedfilter)