]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2400b19
authorToni Wilen <twilen@winuae.net>
Sat, 25 Feb 2012 14:21:07 +0000 (16:21 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 25 Feb 2012 14:21:07 +0000 (16:21 +0200)
14 files changed:
custom.cpp
fpp.cpp
include/events_jit.h
include/options.h
main.cpp
od-win32/direct3d.cpp
od-win32/dxwrap.cpp
od-win32/resources/resource
od-win32/resources/winuae.rc
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt

index 6e16fc12ce1837194ed4c9a9effe0c53b1b0ac6a..2a24910e1c3598bce2258191c1bd3550537a4e91 100644 (file)
@@ -5426,8 +5426,7 @@ static void vsync_handler_post (void)
        } else if (lof_togglecnt_nlace >= LOF_TOGGLES_NEEDED) {
                interlace_changed = notice_interlace_seen (false);
                if (interlace_changed) {
-                       if (currprefs.gfx_scandoubler && currprefs.gfx_vresolution)
-                               notice_screen_contents_lost ();
+                       notice_screen_contents_lost ();
                }
        }
        if (lof_changing) {
@@ -6017,7 +6016,7 @@ static void hsync_handler_post (bool onvsync)
        if (diw_change > 0)
                diw_change--;
 
-       if (is_lastline && isvsync_chipset () == -2 && !vsync_rendered && currprefs.gfx_apmode[0].gfx_vflip == false) {
+       if (is_lastline && isvsync_chipset () == -2 && !vsync_rendered && currprefs.gfx_apmode[0].gfx_vflip == 0) {
                /* fastest possible + last line and no vflip wait: render the frame as early as possible */
                vsync_rendered = true;
                vsync_handle_redraw (lof_store, lof_changed);
diff --git a/fpp.cpp b/fpp.cpp
index c9465b52e6579ce054f151352480fc8f823d4c67..c19dc1a64d9cbd4bc128ba7e03fb22cab678fe0a 100644 (file)
--- a/fpp.cpp
+++ b/fpp.cpp
@@ -116,11 +116,24 @@ float  fp_1e0 = 1, fp_1e1 = 10, fp_1e2 = 100, fp_1e4 = 10000;
 static __inline__ void native_set_fpucw (uae_u32 m68k_cw)
 {
 #ifdef _WIN32
+       static int ex = 0;
        // RN, RZ, RM, RP
        static unsigned int fp87_round[4] = { _RC_NEAR, _RC_CHOP, _RC_DOWN, _RC_UP };
        // X, S, D, U
        static unsigned int fp87_prec[4] = { _PC_64 , _PC_24 , _PC_53, 0 };
-       _control87(fp87_round[(m68k_cw >> 4) & 3] | fp87_prec[(m68k_cw >> 6) & 3], _MCW_RC | _MCW_PC);
+       
+#if 0
+       if (m68k_cw & (0x0100 | 0x0200))
+               ex |= _EM_INEXACT;
+       if (m68k_cw & (0x0400))
+               ex |= _EM_ZERODIVIDE;
+       if (m68k_cw & (0x0800))
+               ex |= _EM_UNDERFLOW;
+       if (m68k_cw & (0x1000))
+               ex |= _EM_OVERFLOW;
+#endif
+
+       _control87(ex | fp87_round[(m68k_cw >> 4) & 3] | fp87_prec[(m68k_cw >> 6) & 3], _MCW_RC | _MCW_PC);
 #else
 static uae_u16 x87_cw_tab[] = {
        0x137f, 0x1f7f, 0x177f, 0x1b7f, /* Extended */
@@ -1050,7 +1063,7 @@ static void fround (int reg)
        regs.fp[reg] = (float)regs.fp[reg];
 }
 
-void fpuop_arithmetic (uae_u32 opcode, uae_u16 extra)
+static void fpuop_arithmetic2 (uae_u32 opcode, uae_u16 extra)
 {
        int reg;
        fptype src;
@@ -1642,6 +1655,19 @@ void fpuop_arithmetic (uae_u32 opcode, uae_u16 extra)
        op_illg (opcode);
 }
 
+void fpuop_arithmetic (uae_u32 opcode, uae_u16 extra)
+{
+       regs.fpsr_highbyte = 0;
+       fpuop_arithmetic2 (opcode, extra);
+       if (regs.fpsr_highbyte) {
+               regs.fpsr &= 0xffff00ff;
+               regs.fpsr |= regs.fpsr_highbyte;
+               regs.fpsr |= regs.fpsr_highbyte << 8;
+               write_log (L"FPU exception: %04x\n", regs.fpsr);
+       }
+}
+
+
 void fpu_reset (void)
 {
        regs.fpcr = regs.fpsr = regs.fpiar = 0;
@@ -1649,6 +1675,11 @@ void fpu_reset (void)
        fpux_restore (NULL);
 }
 
+void fpp_setexcept (uae_u16 mask)
+{
+       regs.fpsr_highbyte |= mask >> 8;
+}
+
 uae_u8 *restore_fpu (uae_u8 *src)
 {
        int i;
@@ -1703,3 +1734,4 @@ uae_u8 *save_fpu (int *len, uae_u8 *dstptr)
        *len = dst - dstbak;
        return dstbak;
 }
+
index c61f370496fc64bec71501384127a869046cc57e..cbf96be8de30c8a00aceaf460df8baa23a86920a 100644 (file)
@@ -58,7 +58,8 @@ STATIC_INLINE void set_cycles (unsigned long int x)
 #endif
 }
 
-extern volatile bool vblank_found_chipset, vblank_found_rtg;
+extern volatile bool vblank_found_chipset;
+extern volatile bool vblank_found_rtg;
 
 STATIC_INLINE void do_cycles_slow (unsigned long cycles_to_add)
 {
index ac844811f4e579ae44c43d2ce1c17b549adb4fd8..c747ccadf9eccaee7b7b22a5280ed5e5fb1fcb3a 100644 (file)
@@ -171,7 +171,10 @@ struct apmode
 {
        int gfx_fullscreen;
        int gfx_vsync;
-       bool gfx_vflip;
+       // 0 = immediate flip
+       // -1 = wait for flip, before frame ends
+       // 1 = wait for flip, after new frame has started
+       int gfx_vflip;
        int gfx_vsyncmode;
        int gfx_backbuffers;
        bool gfx_interlaced;
@@ -430,7 +433,9 @@ struct uae_prefs {
        bool win32_minimize_inactive;
        int win32_statusbar;
 
-       int win32_active_priority;
+       int win32_active_capture_priority;
+       bool win32_active_nocapture_pause;
+       bool win32_active_nocapture_nosound;
        int win32_inactive_priority;
        bool win32_inactive_pause;
        bool win32_inactive_nosound;
index 632facf442395765811b0c10d532970c348e08a9..c6bd75eeaa9238c14e5fa6b29c367d586aec2052 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -138,20 +138,22 @@ void fixup_prefs_dimensions (struct uae_prefs *prefs)
 
        for (int i = 0; i < 2; i++) {
                struct apmode *ap = &prefs->gfx_apmode[i];
-               ap->gfx_vflip = false;
+               ap->gfx_vflip = 0;
                if (ap->gfx_vsync) {
                        if (ap->gfx_vsyncmode) {
                                // low latency vsync: no flip only if no-buffer
                                if (ap->gfx_backbuffers >= 1)
-                                       ap->gfx_vflip = true; // true = wait for vblank flip, false = immediate flip
+                                       ap->gfx_vflip = -1;
+                               if (!i && ap->gfx_backbuffers == 2)
+                                       ap->gfx_vflip = 1;
                        } else {
                                // legacy vsync: always wait for flip
-                               ap->gfx_vflip = true;
+                               ap->gfx_vflip = -1;
                        }
                } else {
                        // no vsync: wait if triple bufferirng
                        if (ap->gfx_backbuffers >= 2)
-                               ap->gfx_vflip = true;
+                               ap->gfx_vflip = -1;
                }
        }
 
@@ -475,7 +477,9 @@ void fixup_prefs (struct uae_prefs *p)
                p->maprom = 0x0f000000;
        if (p->tod_hack && p->cs_ciaatod == 0)
                p->cs_ciaatod = p->ntscmode ? 2 : 1;
+
        blkdev_fix_prefs (p);
+
        target_fixup_options (p);
 }
 
index d5a1d0bb70df9e946baab552b56b2a0b1a812ce7..cc60108f82532bb9e3dc2e2713a8c9d9c7388856 100644 (file)
@@ -2127,7 +2127,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth
                dpp.FullScreen_RefreshRateInHz,
                dpp.Windowed ? L"" : L" FS",
                vsync, ap->gfx_backbuffers,
-               ap->gfx_vflip ? L"W" : L"I"
+               ap->gfx_vflip < 0 ? L"WE" : (ap->gfx_vflip > 0 ? L"WS" :  L"I")
                t_depth, adapter
        );
 
@@ -2195,13 +2195,13 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth
        d3d_enabled = 1;
        wasstilldrawing_broken = true;
 
-       if (vsync < 0 && ap->gfx_vflip == false) {
+       if (vsync < 0 && ap->gfx_vflip == 0) {
                hr = d3ddev->CreateQuery(D3DQUERYTYPE_EVENT, &query);
                if (FAILED (hr))
                        write_log (L"%s: CreateQuery(D3DQUERYTYPE_EVENT) failed: %s\n", D3DHEAD, D3D_ErrorString (hr));
        }
        if (d3ddevex) {
-               hr = d3ddevex->SetMaximumFrameLatency (vsync < 0 ? 1 : 0);
+               hr = d3ddevex->SetMaximumFrameLatency (vsync < 0 && ap->gfx_vflip <= 0 ? 1 : 0);
                if (FAILED (hr))
                        write_log (L"%s: SetMaximumFrameLatency() failed: %s\n", D3DHEAD, D3D_ErrorString (hr));
        }
index 570fe68355c4d06501ecba1a28b42f15510a01f1..241886d59b9849f8d0d9b1a75f8d1a90f9415424 100644 (file)
@@ -408,7 +408,7 @@ HRESULT DirectDraw_CreateMainSurface (int width, int height)
        }
        write_log (L"DDRAW: %dx%d B=%d%s %d-bit\n",
                width, height,
-               ap->gfx_backbuffers, ap->gfx_vflip ? L"W" : L"I",
+               ap->gfx_backbuffers, ap->gfx_vflip < 0 ? L"WE" : (ap->gfx_vflip > 0 ? L"WS" : L"I"),
                dxdata.native.ddpfPixelFormat.dwRGBBitCount
                );
        return ddrval;
index 448428e334fddba2f46cee8a2b0a680c3942233b..0d439fa71630a4b978fdd66701980d552036354f 100644 (file)
 #define IDC_STATEREC_RECORD             1532
 #define IDC_KBLED_USB                   1533
 #define IDC_STATEREC_CAPTURE2           1533
+#define IDC_ACTIVE_PAUSE                1534
+#define IDC_ACTIVE_NOSOUND              1535
 #define IDC_SER_SHARED                  1553
 #define IDC_SER_CTSRTS                  1554
 #define IDC_SER_DIRECT                  1555
 #define IDC_WINDOWEDMODE                1793
 #define IDC_DF1WPTEXTQ                  1794
 #define IDC_RTG_Z2Z3                    1794
-#define IDC_RTG_BACKBUFFERS             1795
 #define IDC_RTG_BUFFERCNT               1795
 #define IDC_INPUTMAPLIST                1797
 #define IDC_PORT1_REMAP                 1798
index 6a7c980149b340a6d2a6f4b552fd520a6cf6b088..235aa4e5bd54288f331bd4e14160b1ac2e42257c 100644 (file)
@@ -812,23 +812,26 @@ IDD_MISC2 DIALOGEX 0, 0, 300, 244
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
 FONT 8, "MS Sans Serif", 0, 0, 0x1\r
 BEGIN\r
-    GROUPBOX        "When Active",IDC_STATIC,8,7,88,73\r
-    RTEXT           "Run at priority:",IDC_ACTIVE_PRI,14,17,52,10,SS_CENTERIMAGE | WS_TABSTOP\r
+    GROUPBOX        "When Active",IDC_STATIC,8,7,88,81\r
+    CTEXT           "Run at priority:",IDC_ACTIVE_PRI,14,17,77,10,SS_CENTERIMAGE | WS_TABSTOP\r
     COMBOBOX        IDC_ACTIVE_PRIORITY,14,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    GROUPBOX        "When Inactive",IDC_STATIC,102,7,92,73\r
-    RTEXT           "Run at priority:",IDC_INACTIVE_PRI,109,17,51,10,SS_CENTERIMAGE | WS_TABSTOP\r
+    GROUPBOX        "When Inactive",IDC_STATIC,102,7,92,81\r
+    CTEXT           "Run at priority:",IDC_INACTIVE_PRI,109,17,75,10,SS_CENTERIMAGE | WS_TABSTOP\r
     COMBOBOX        IDC_INACTIVE_PRIORITY,109,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Pause emulation",IDC_INACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,50,69,10\r
-    CONTROL         "Disable sound",IDC_INACTIVE_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,63,79,10\r
-    GROUPBOX        "When Minimized",IDC_STATIC,199,7,92,73\r
-    RTEXT           "Run at priority:",IDC_MINIMIZED_PRI,207,18,51,10,SS_CENTERIMAGE | WS_TABSTOP\r
+    CONTROL         "Pause emulation",IDC_INACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,61,69,10\r
+    CONTROL         "Disable sound",IDC_INACTIVE_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,74,79,10\r
+    GROUPBOX        "When Minimized",IDC_STATIC,199,7,92,81\r
+    CTEXT           "Run at priority:",IDC_MINIMIZED_PRI,207,18,75,10,SS_CENTERIMAGE | WS_TABSTOP\r
     COMBOBOX        IDC_MINIMIZED_PRIORITY,207,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Pause emulation",IDC_MINIMIZED_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,50,69,10\r
-    CONTROL         "Disable sound",IDC_MINIMIZED_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,63,79,10\r
-    CONTROL         "",IDC_ASSOCIATELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,19,94,164,100\r
-    GROUPBOX        "File Extension Associations",IDC_STATIC,8,83,186,138\r
-    PUSHBUTTON      "Deassociate all",IDC_ASSOCIATE_OFF,108,200,75,14\r
-    PUSHBUTTON      "Associate all",IDC_ASSOCIATE_ON,19,200,75,14\r
+    CONTROL         "Pause emulation",IDC_MINIMIZED_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,61,69,10\r
+    CONTROL         "Disable sound",IDC_MINIMIZED_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,74,79,10\r
+    CONTROL         "",IDC_ASSOCIATELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,19,104,164,100\r
+    GROUPBOX        "File Extension Associations",IDC_STATIC,8,93,186,138\r
+    PUSHBUTTON      "Deassociate all",IDC_ASSOCIATE_OFF,108,210,75,14\r
+    PUSHBUTTON      "Associate all",IDC_ASSOCIATE_ON,19,210,75,14\r
+    CONTROL         "Pause emulation",IDC_ACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,61,69,10\r
+    CONTROL         "Disable sound",IDC_ACTIVE_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,74,79,10\r
+    CTEXT           "Mouse uncaptured:",IDC_STATIC,18,44,72,15,SS_CENTERIMAGE\r
 END\r
 \r
 IDD_DISK DIALOGEX 0, 0, 300, 242\r
index c9dce8f511c25440a773077f38d2697d0cfa72a1..eb27886c20b8090208c323c031259f42f82b8263 100644 (file)
@@ -467,14 +467,6 @@ void setpaused (int priority)
 #endif
 }
 
-static void checkpause (void)
-{
-       if (currprefs.win32_inactive_pause) {
-               setpaused (1);
-               setpriority (&priorities[currprefs.win32_inactive_priority]);
-       }
-}
-
 static int showcursor;
 
 extern TCHAR config_filename[256];
@@ -638,13 +630,24 @@ static void setmouseactive2 (int active, bool allowpause)
                        setcursor (-30000, -30000);
                }
                inputdevice_acquire (TRUE);
-               setpriority (&priorities[currprefs.win32_active_priority]);
+               setpriority (&priorities[currprefs.win32_active_capture_priority]);
+               if (currprefs.win32_active_nocapture_pause) {
+                       resumepaused (1);
+               } else if (currprefs.win32_active_nocapture_nosound && sound_closed < 0) {
+                       resumesoundpaused ();
+               }
        } else {
                inputdevice_acquire (FALSE);
        }
-       if (!active && allowpause)
-               checkpause ();
-       setmaintitle (hMainWnd);
+       if (!active && allowpause) {
+               if (currprefs.win32_active_nocapture_pause) {
+                       setpaused (1);
+               } else if (currprefs.win32_active_nocapture_nosound) {
+                       setsoundpaused ();
+                       sound_closed = -1;
+               }
+               setmaintitle (hMainWnd);
+       }
 #ifdef RETROPLATFORM
        rp_mouse_capture (active);
        rp_mouse_magic (magicmouse_alive ());
@@ -671,7 +674,7 @@ static void winuae_active (HWND hWnd, int minimized)
        focus = 1;
        pri = &priorities[currprefs.win32_inactive_priority];
        if (!minimized)
-               pri = &priorities[currprefs.win32_active_priority];
+               pri = &priorities[currprefs.win32_active_capture_priority];
        setpriority (pri);
 
        if (!avioutput_video) {
@@ -754,6 +757,14 @@ static void winuae_inactive (HWND hWnd, int minimized)
                        if (!avioutput_video) {
                                set_inhibit_frame (IHF_WINDOWHIDDEN);
                        }
+               } else if (mouseactive) {
+                       if (currprefs.win32_active_nocapture_pause) {
+                               setpaused (2);
+                               sound_closed = 1;
+                       } else if (currprefs.win32_active_nocapture_nosound) {
+                               setsoundpaused ();
+                               sound_closed = -1;
+                       }
                } else {
                        if (currprefs.win32_inactive_pause) {
                                setpaused (2);
@@ -785,7 +796,7 @@ void enablecapture (void)
                resumesoundpaused ();
                sound_closed = 0;
        }
-       if (currprefs.win32_inactive_pause) {
+       if (currprefs.win32_inactive_pause || currprefs.win32_active_nocapture_pause) {
                resumepaused (2);
        }
 }
@@ -794,10 +805,10 @@ void disablecapture (void)
 {
        setmouseactive (0);
        focus = 0;
-       if (currprefs.win32_inactive_pause && sound_closed == 0) {
+       if (currprefs.win32_active_nocapture_pause && sound_closed == 0) {
                setpaused (2);
                sound_closed = 1;
-       } else if (currprefs.win32_inactive_nosound && sound_closed == 0) {
+       } else if (currprefs.win32_active_nocapture_nosound && sound_closed == 0) {
                setsoundpaused ();
                sound_closed = -1;
        }
@@ -992,7 +1003,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
                                SendMessage (hAmigaWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0);
                                return 0;
                        }
-                       if (!pause_emulation)
+                       if (!pause_emulation || currprefs.win32_active_nocapture_pause)
                                setmouseactive ((message == WM_LBUTTONDBLCLK || isfullscreen() > 0) ? 2 : 1);
                } else if (dinput_winmouse () >= 0 && isfocus ()) {
                        setmousebuttonstate (dinput_winmouse (), 0, 1);
@@ -2785,6 +2796,23 @@ void target_fixup_options (struct uae_prefs *p)
        if (p->win32_automount_cddrives && !p->scsi)
                p->scsi = 1;
 
+       bool paused = false;
+       bool nosound = false;
+       if (!paused) {
+               paused = p->win32_active_nocapture_pause;
+               nosound = p->win32_active_nocapture_nosound;
+       } else {
+               p->win32_active_nocapture_pause = p->win32_active_nocapture_nosound = true;
+               nosound = true;
+       }
+       if (!paused) {
+               paused = p->win32_inactive_pause;
+               nosound = p->win32_inactive_nosound;
+       } else {
+               p->win32_inactive_pause = p->win32_inactive_nosound = true;
+               nosound = true;
+       }
+
 #ifdef RETROPLATFORM
        rp_fixup_options (p);
 #endif
@@ -2796,6 +2824,8 @@ void target_default_options (struct uae_prefs *p, int type)
        if (type == 2 || type == 0) {
                p->win32_middle_mouse = 1;
                p->win32_logfile = 0;
+               p->win32_active_nocapture_pause = 0;
+               p->win32_active_nocapture_nosound = 0;
                p->win32_iconified_nosound = 1;
                p->win32_iconified_pause = 1;
                p->win32_inactive_nosound = 0;
@@ -2804,7 +2834,8 @@ void target_default_options (struct uae_prefs *p, int type)
                p->win32_soundcard = 0;
                p->win32_samplersoundcard = -1;
                p->win32_minimize_inactive = 0;
-               p->win32_active_priority = 1;
+               p->win32_active_capture_priority = 1;
+               //p->win32_active_nocapture_priority = 1;
                p->win32_inactive_priority = 2;
                p->win32_iconified_priority = 3;
                p->win32_notaskbarbutton = 0;
@@ -2876,7 +2907,12 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
        sernametodev (p->sername);
        cfgfile_target_dwrite_str (f, L"parallel_port", p->prtname[0] ? p->prtname : L"none");
 
-       cfgfile_target_dwrite (f, L"active_priority", L"%d", priorities[p->win32_active_priority].value);
+       cfgfile_target_dwrite (f, L"active_priority", L"%d", priorities[p->win32_active_capture_priority].value);
+#if 0
+       cfgfile_target_dwrite (f, L"active_not_captured_priority", L"%d", priorities[p->win32_active_nocapture_priority].value);
+#endif
+       cfgfile_target_dwrite_bool (f, L"active_not_captured_nosound", p->win32_active_nocapture_nosound);
+       cfgfile_target_dwrite_bool (f, L"active_not_captured_pause", p->win32_active_nocapture_pause);
        cfgfile_target_dwrite (f, L"inactive_priority", L"%d", priorities[p->win32_inactive_priority].value);
        cfgfile_target_dwrite_bool (f, L"inactive_nosound", p->win32_inactive_nosound);
        cfgfile_target_dwrite_bool (f, L"inactive_pause", p->win32_inactive_pause);
@@ -2987,6 +3023,8 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *
                || cfgfile_yesno (option, value, L"logfile", &p->win32_logfile)
                || cfgfile_yesno (option, value, L"networking", &p->socket_emu)
                || cfgfile_yesno (option, value, L"borderless", &p->win32_borderless)
+               || cfgfile_yesno (option, value, L"active_not_captured_pause", &p->win32_active_nocapture_pause)
+               || cfgfile_yesno (option, value, L"active_not_captured_nosound", &p->win32_active_nocapture_nosound)
                || cfgfile_yesno (option, value, L"inactive_pause", &p->win32_inactive_pause)
                || cfgfile_yesno (option, value, L"inactive_nosound", &p->win32_inactive_nosound)
                || cfgfile_yesno (option, value, L"iconified_pause", &p->win32_iconified_pause)
@@ -3117,14 +3155,18 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *
        if (cfgfile_strval (option, value, L"statusbar", &p->win32_statusbar, statusbarmode, 0))
                return 1;
 
-       if (cfgfile_intval (option, value, L"active_priority", &v, 1)) {
-               p->win32_active_priority = fetchpri (v, 1);
+       if (cfgfile_intval (option, value, L"active_priority", &v, 1) || cfgfile_intval (option, value, L"activepriority", &v, 1)) {
+               p->win32_active_capture_priority = fetchpri (v, 1);
+               p->win32_active_nocapture_pause = false;
+               p->win32_active_nocapture_nosound = false;
                return 1;
        }
-       if (cfgfile_intval (option, value, L"activepriority", &v, 1)) {
-               p->win32_active_priority = fetchpri (v, 1);
+#if 0
+       if (cfgfile_intval (option, value, L"active_not_captured_priority", &v, 1)) {
+               p->win32_active_nocapture_priority = fetchpri (v, 1);
                return 1;
        }
+#endif
        if (cfgfile_intval (option, value, L"inactive_priority", &v, 1)) {
                p->win32_inactive_priority = fetchpri (v, 1);
                return 1;
@@ -5237,6 +5279,20 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer
        PEXCEPTION_RECORD er = pExceptionPointers->ExceptionRecord;
        PCONTEXT ctx = pExceptionPointers->ContextRecord;
 
+#if 0
+       if (ec >= EXCEPTION_FLT_DENORMAL_OPERAND && ec <= EXCEPTION_FLT_UNDERFLOW) {
+               extern void fpp_setexcept (uae_u16);
+               if (ec == EXCEPTION_FLT_INEXACT_RESULT)
+                       fpp_setexcept (0x0100 | 0x0200);
+               else if (ec == EXCEPTION_FLT_OVERFLOW)
+                       fpp_setexcept (0x1000);
+               else if (ec == EXCEPTION_FLT_UNDERFLOW)
+                       fpp_setexcept (0x0800);
+               else if (ec == EXCEPTION_FLT_DIVIDE_BY_ZERO)
+                       fpp_setexcept (0x0400);
+               return EXCEPTION_CONTINUE_EXECUTION;
+       }
+#endif
        /* Check possible access violation in 68010+/compatible mode disabled if PC points to non-existing memory */
 #if 1
        if (ec == EXCEPTION_ACCESS_VIOLATION && !er->ExceptionFlags &&
index 65b4bd6179539fa05095ed0cbd8127fba7631fc0..bd8866be18b89222f364a3b2cb035d6aca57b2d6 100644 (file)
@@ -19,8 +19,8 @@
 #define LANG_DLL 1
 
 //#define WINUAEBETA L""
-#define WINUAEBETA L"Beta 18"
-#define WINUAEDATE MAKEBD(2012, 2, 22)
+#define WINUAEBETA L"Beta 19"
+#define WINUAEDATE MAKEBD(2012, 2, 25)
 #define WINUAEEXTRA L""
 //#define WINUAEEXTRA L"AmiKit Preview"
 #define WINUAEREV L""
index c9d2ab96f1852b8fa6d5ab72279a76614d4a442b..7799bf3d8fe09c3dddb8c31b21d536bbf71ab400 100644 (file)
@@ -121,7 +121,8 @@ extern int reopen (int);
 
 static volatile bool vblank_found;
 static volatile int flipthread_mode;
-volatile bool vblank_found_chipset, vblank_found_rtg;
+volatile bool vblank_found_chipset;
+volatile bool vblank_found_rtg;
 static HANDLE flipevent, flipevent2;
 static volatile int flipevent_mode;
 static CRITICAL_SECTION screen_cs;
@@ -157,7 +158,8 @@ static void changevblankthreadmode (int newmode)
 {
        int t = vblankthread_counter;
        vblank_found = false;
-       vblank_found_chipset = vblank_found_rtg = false;
+       vblank_found_chipset = false;
+       vblank_found_rtg = false;
        if (vblankthread_mode <= 0 || vblankthread_mode == newmode)
                return;
        vblankthread_mode = newmode;
@@ -886,8 +888,11 @@ bool show_screen_maybe (bool show)
                        show_screen ();
                return false;
        }
-       doflipevent ();
-       return true;
+       if (ap->gfx_vflip < 0) {
+               doflipevent ();
+               return true;
+       }
+       return false;
 }
 
 void show_screen (void)
@@ -1355,7 +1360,7 @@ static int open_windows (int full)
                return ret;
        }
 
-       setpriority (&priorities[currprefs.win32_active_priority]);
+       setpriority (&priorities[currprefs.win32_active_capture_priority]);
        if (!rp_isactive () && full)
                setmouseactive (-1);
        for (i = 0; i < NUM_LEDS; i++)
@@ -1604,9 +1609,11 @@ int check_prefs_changed_gfx (void)
                currprefs.keyboard_leds[2] != changed_prefs.keyboard_leds[2] ||
                currprefs.win32_minimize_inactive != changed_prefs.win32_minimize_inactive ||
                currprefs.win32_middle_mouse != changed_prefs.win32_middle_mouse ||
-               currprefs.win32_active_priority != changed_prefs.win32_active_priority ||
+               currprefs.win32_active_capture_priority != changed_prefs.win32_active_capture_priority ||
                currprefs.win32_inactive_priority != changed_prefs.win32_inactive_priority ||
                currprefs.win32_iconified_priority != changed_prefs.win32_iconified_priority ||
+               currprefs.win32_active_nocapture_nosound != changed_prefs.win32_active_nocapture_nosound ||
+               currprefs.win32_active_nocapture_pause != changed_prefs.win32_active_nocapture_pause ||
                currprefs.win32_inactive_nosound != changed_prefs.win32_inactive_nosound ||
                currprefs.win32_inactive_pause != changed_prefs.win32_inactive_pause ||
                currprefs.win32_iconified_nosound != changed_prefs.win32_iconified_nosound ||
@@ -1619,9 +1626,11 @@ int check_prefs_changed_gfx (void)
                currprefs.keyboard_leds[1] = changed_prefs.keyboard_leds[1];
                currprefs.keyboard_leds[2] = changed_prefs.keyboard_leds[2];
                currprefs.win32_middle_mouse = changed_prefs.win32_middle_mouse;
-               currprefs.win32_active_priority = changed_prefs.win32_active_priority;
+               currprefs.win32_active_capture_priority = changed_prefs.win32_active_capture_priority;
                currprefs.win32_inactive_priority = changed_prefs.win32_inactive_priority;
                currprefs.win32_iconified_priority = changed_prefs.win32_iconified_priority;
+               currprefs.win32_active_nocapture_nosound = changed_prefs.win32_active_nocapture_nosound;
+               currprefs.win32_active_nocapture_pause = changed_prefs.win32_active_nocapture_pause;
                currprefs.win32_inactive_nosound = changed_prefs.win32_inactive_nosound;
                currprefs.win32_inactive_pause = changed_prefs.win32_inactive_pause;
                currprefs.win32_iconified_nosound = changed_prefs.win32_iconified_nosound;
@@ -1633,7 +1642,7 @@ int check_prefs_changed_gfx (void)
                resume_sound ();
                inputdevice_acquire (TRUE);
 #ifndef        _DEBUG
-               setpriority (&priorities[currprefs.win32_active_priority]);
+               setpriority (&priorities[currprefs.win32_active_capture_priority]);
 #endif
                return 1;
        }
@@ -2296,7 +2305,7 @@ double getcurrentvblankrate (void)
                return DirectDraw_CurrentRefreshRate ();
 }
 
-static int maxscanline, prevvblankpos;
+static int maxscanline, minscanline, prevvblankpos;
 
 static bool getvblankpos (int *vp)
 {
@@ -2312,8 +2321,11 @@ static bool getvblankpos (int *vp)
        prevvblankpos = sl;
        if (sl > maxscanline)
                maxscanline = sl;
-       if (sl > 0)
+       if (sl > 0) {
                vblankthread_oddeven = (sl & 1) != 0;
+               if (sl < minscanline || minscanline < 0)
+                       minscanline = sl;
+       }
        *vp = sl;
        return true;
 }
@@ -2350,7 +2362,7 @@ static bool vblank_wait (void)
                int opos = prevvblankpos;
                if (!getvblankpos (&vp))
                        return false;
-               if (opos > maxscanline / 2 && vp < maxscanline / 4)
+               if (opos > maxscanline / 2 && vp < maxscanline / 3)
                        return true;
                if (vp <= 0)
                        return true;
@@ -2366,7 +2378,7 @@ static bool vblank_getstate (bool *state)
        opos = prevvblankpos;
        if (!getvblankpos (&vp))
                return false;
-       if (opos > maxscanline / 2 && vp < maxscanline / 4) {
+       if (opos > maxscanline / 2 && vp < maxscanline / 3) {
                *state = true;
                return true;
        }
@@ -2444,9 +2456,10 @@ static unsigned int __stdcall vblankthread (void *dummy)
                        // busy wait mode
                        frame_time_t t = read_processor_time ();
                        bool donotwait = false;
+                       int vs = isvsync_chipset ();
                        if (!vblank_found) {
                                // immediate vblank if mismatched frame type 
-                               if (isvsync_chipset () < 0 && vblanklaceskip ()) {
+                               if (vs < 0 && vblanklaceskip ()) {
                                        vblank_found = true;
                                        vblank_found_chipset = true;
                                        vblankthread_mode = VBLANKTH_ACTIVE_WAIT;
@@ -2461,7 +2474,7 @@ static unsigned int __stdcall vblankthread (void *dummy)
                                        ok = vblank_getstate (&vb);
                                        if (!ok || vb) {
                                                vblank_found = true;
-                                               if (isvsync_chipset () < 0) {
+                                               if (vs < 0) {
                                                        vblank_found_chipset = true;
                                                        if (!ap->gfx_vflip) {
                                                                show_screen ();
@@ -2478,7 +2491,7 @@ static unsigned int __stdcall vblankthread (void *dummy)
                        }
                        if (t - vblank_prev_time > vblankbasefull * 3)
                                vblankthread_mode = VBLANKTH_IDLE;
-                       if (!donotwait || ap->gfx_vflip == true || picasso_on)
+                       if (!donotwait || ap->gfx_vflip || picasso_on)
                                sleep_millis (ap->gfx_vflip ? 2 : 1);
                } else {
                        break;
@@ -2526,8 +2539,12 @@ frame_time_t vsync_busywait_end (void)
 
 void vsync_busywait_start (void)
 {
+       struct apmode *ap = picasso_on ? &currprefs.gfx_apmode[1] : &currprefs.gfx_apmode[0];
        if (!dooddevenskip) {
                vsync_notvblank ();
+               if (ap->gfx_vflip > 0) {
+                       doflipevent ();
+               }
        }
        changevblankthreadmode (VBLANKTH_ACTIVE_START);
        vblank_prev_time = thread_vblank_time;
@@ -2700,6 +2717,7 @@ double vblank_calibrate (double approx_vblank, bool waitonly)
        maxtotal = 10;
        maxcnt = maxtotal;
        maxscanline = 0;
+       minscanline = -1;
        tsum2 = 0;
        tcnt2 = 0;
        for (maxcnt = 0; maxcnt < maxtotal; maxcnt++) {
@@ -2775,8 +2793,8 @@ skip:
        vblankbasewait2 = (syncbase / tsum2) * 70 / 100;
        vblankbasewait3 = (syncbase / tsum2) * 90 / 100;
        vblankbaselace = lace;
-       write_log (L"VSync %s: %.6fHz/%.1f=%.6fHz. MaxV=%d%s Units=%d\n",
-               waitonly ? L"remembered" : L"calibrated", tsum, div, tsum2, maxvpos, lace ? L"i" : L"", vblankbasefull);
+       write_log (L"VSync %s: %.6fHz/%.1f=%.6fHz. MinV=%d MaxV=%d%s Units=%d\n",
+               waitonly ? L"remembered" : L"calibrated", tsum, div, tsum2, minscanline, maxvpos, lace ? L"i" : L"", vblankbasefull);
        remembered_vblank = tsum;
        vblank_prev_time = read_processor_time ();
        
index ad0c715d38e7361db928112727b54ab4f1bbb51a..6435ba740347c2f8dae9cdfae075e93ab5ba32fb 100644 (file)
@@ -7410,10 +7410,58 @@ static void enable_for_miscdlg (HWND hDlg)
 #endif
                ew (hDlg, IDC_DOSAVESTATE, FALSE);
        }
+
        ew (hDlg, IDC_ASSOCIATELIST, !rp_isactive ());
        ew (hDlg, IDC_ASSOCIATE_ON, !rp_isactive ());
        ew (hDlg, IDC_ASSOCIATE_OFF, !rp_isactive ());
        ew (hDlg, IDC_DD_SURFACETYPE, full_property_sheet && workprefs.gfx_api == 0);
+
+       bool paused = false;
+       bool nosound = false;
+       ew (hDlg, IDC_ACTIVE_PAUSE, paused == false);
+       ew (hDlg, IDC_ACTIVE_NOSOUND, nosound == false && paused == false);
+       if (!paused) {
+               paused = workprefs.win32_active_nocapture_pause;
+               if (!nosound)
+                       nosound = workprefs.win32_active_nocapture_nosound;
+               else
+                       workprefs.win32_active_nocapture_nosound = true;
+       } else {
+               workprefs.win32_active_nocapture_pause = workprefs.win32_active_nocapture_nosound = true;
+               nosound = true;
+       }
+       if (paused)
+               CheckDlgButton (hDlg, IDC_INACTIVE_PAUSE, TRUE);
+       if (nosound || paused)
+               CheckDlgButton (hDlg, IDC_INACTIVE_NOSOUND, TRUE);
+       ew (hDlg, IDC_INACTIVE_PAUSE, paused == false);
+       ew (hDlg, IDC_INACTIVE_NOSOUND, nosound == false && paused == false);
+       if (!paused) {
+               paused = workprefs.win32_inactive_pause;
+               if (!nosound)
+                       nosound = workprefs.win32_inactive_nosound;
+               else
+                       workprefs.win32_inactive_nosound = true;
+       } else {
+               workprefs.win32_inactive_pause = workprefs.win32_inactive_nosound = true;
+               nosound = true;
+       }
+       if (paused)
+               CheckDlgButton (hDlg, IDC_MINIMIZED_PAUSE, TRUE);
+       if (nosound || paused)
+               CheckDlgButton (hDlg, IDC_MINIMIZED_NOSOUND, TRUE);
+       ew (hDlg, IDC_MINIMIZED_PAUSE, paused == false);
+       ew (hDlg, IDC_MINIMIZED_NOSOUND, nosound == false && paused == false);
+       if (!paused) {
+               paused = workprefs.win32_iconified_pause;
+               if (!nosound)
+                       nosound = workprefs.win32_iconified_nosound;
+               else
+                       workprefs.win32_iconified_nosound = true;
+       } else {
+               workprefs.win32_iconified_pause = workprefs.win32_iconified_nosound = true;
+               nosound = true;
+       }
 }
 
 static void misc_kbled (HWND hDlg, int v, int nv)
@@ -7584,11 +7632,13 @@ static void values_to_miscdlg (HWND hDlg)
 
        } else if (currentpage == MISC2_ID) {
 
+               CheckDlgButton (hDlg, IDC_ACTIVE_PAUSE, workprefs.win32_active_nocapture_pause);
+               CheckDlgButton (hDlg, IDC_ACTIVE_NOSOUND, workprefs.win32_active_nocapture_nosound || workprefs.win32_active_nocapture_pause);
                CheckDlgButton (hDlg, IDC_INACTIVE_PAUSE, workprefs.win32_inactive_pause);
                CheckDlgButton (hDlg, IDC_INACTIVE_NOSOUND, workprefs.win32_inactive_nosound || workprefs.win32_inactive_pause);
                CheckDlgButton (hDlg, IDC_MINIMIZED_PAUSE, workprefs.win32_iconified_pause);
                CheckDlgButton (hDlg, IDC_MINIMIZED_NOSOUND, workprefs.win32_iconified_nosound || workprefs.win32_iconified_pause);
-               misc_addpri (hDlg, IDC_ACTIVE_PRIORITY, workprefs.win32_active_priority);
+               misc_addpri (hDlg, IDC_ACTIVE_PRIORITY, workprefs.win32_active_capture_priority);
                misc_addpri (hDlg, IDC_INACTIVE_PRIORITY, workprefs.win32_inactive_priority);
                misc_addpri (hDlg, IDC_MINIMIZED_PRIORITY, workprefs.win32_iconified_priority);
 
@@ -7705,7 +7755,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
                                }
                        }
                } else if (currentpage == MISC2_ID) {
-                       misc_getpri (hDlg, IDC_ACTIVE_PRIORITY, &workprefs.win32_active_priority);
+                       misc_getpri (hDlg, IDC_ACTIVE_PRIORITY, &workprefs.win32_active_capture_priority);
                        misc_getpri (hDlg, IDC_INACTIVE_PRIORITY, &workprefs.win32_inactive_priority);
                        misc_getpri (hDlg, IDC_MINIMIZED_PRIORITY, &workprefs.win32_iconified_priority);
                }
@@ -7769,6 +7819,17 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
                        if (workprefs.win32_inactive_pause)
                                CheckDlgButton (hDlg, IDC_INACTIVE_NOSOUND, BST_CHECKED);
                        workprefs.win32_inactive_nosound = ischecked (hDlg, IDC_INACTIVE_NOSOUND);
+                       enable_for_miscdlg (hDlg);
+                       break;
+               case IDC_ACTIVE_NOSOUND:
+                       if (!ischecked (hDlg, IDC_ACTIVE_NOSOUND))
+                               CheckDlgButton (hDlg, IDC_ACTIVE_PAUSE, BST_UNCHECKED);
+               case IDC_ACTIVE_PAUSE:
+                       workprefs.win32_active_nocapture_pause = ischecked (hDlg, IDC_ACTIVE_PAUSE);
+                       if (workprefs.win32_active_nocapture_pause)
+                               CheckDlgButton (hDlg, IDC_ACTIVE_NOSOUND, BST_CHECKED);
+                       workprefs.win32_active_nocapture_nosound = ischecked (hDlg, IDC_ACTIVE_NOSOUND);
+                       enable_for_miscdlg (hDlg);
                        break;
                case IDC_MINIMIZED_NOSOUND:
                        if (!ischecked (hDlg, IDC_MINIMIZED_NOSOUND))
@@ -7778,6 +7839,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
                        if (workprefs.win32_iconified_pause)
                                CheckDlgButton (hDlg, IDC_MINIMIZED_NOSOUND, BST_CHECKED);
                        workprefs.win32_iconified_nosound = ischecked (hDlg, IDC_MINIMIZED_NOSOUND);
+                       enable_for_miscdlg (hDlg);
                        break;
                case IDC_CTRLF11:
                        workprefs.win32_ctrl_F11_is_quit = ischecked (hDlg, IDC_CTRLF11);
index 584872aefed7102c375ef9cac55ebf8a1c903cc2..02deafe771934c6b61809b0322b9893870404621 100644 (file)
@@ -1,4 +1,11 @@
 
+Beta 19:
+
+- Triple buffered native chipset low latency vsync uses slightly different flipping method
+  and also does not force min D3D framelatency value.
+- Added active but mouse uncaptured pause/no sound option.
+- Interlace to non-laced switch graphics corruption fixed (b17)
+
 Beta 18:
 
 - Z2 Fast Autoconfig on/off checkbox added.