]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
fullscreen directdraw alt-tab blank screen
authorToni Wilen <twilen@winuae.net>
Fri, 26 Feb 2010 17:23:47 +0000 (19:23 +0200)
committerToni Wilen <twilen@winuae.net>
Fri, 26 Feb 2010 17:23:47 +0000 (19:23 +0200)
od-win32/dxwrap.cpp
od-win32/picasso96_win.cpp
od-win32/win32gfx.cpp

index 3b8efc22386f5e1f6d885eea2e2652ee89a5f19d..9b8f707f4fc568dfab55eb0426c14f7190007d80 100644 (file)
@@ -598,8 +598,10 @@ int DirectDraw_SurfaceLock (void)
        surf = getlocksurface ();
        if (surf == NULL)
                return 0;
-       if (FAILED (IDirectDrawSurface7_IsLost (surf)))
+       if (FAILED (IDirectDrawSurface7_IsLost (surf))) {
+               restoresurface (surf);
                return 0;
+       }
        if (dxdata.lockcnt > 0)
                return 1;
        ok = locksurface (getlocksurface (), &dxdata.locksurface);
index 70864d8a67036e99b599919d87c1ca98ac8c4135..ac210cfed4a447b5923e5ffe24f1b59d76095d65 100644 (file)
@@ -34,8 +34,6 @@
 #define P96DX 0
 #define WINCURSOR 1
 
-static int multithreaded = 0;
-
 #include "sysconfig.h"
 #include "sysdeps.h"
 
@@ -581,10 +579,10 @@ static void do_fillrect_frame_buffer (struct RenderInfo *ri, int X, int Y,
 
 static void disablemouse (void)
 {
-       if (!currprefs.gfx_api)
-               return;
        cursorok = FALSE;
        cursordeactivate = 0;
+       if (!currprefs.gfx_api)
+               return;
        D3D_setcursor (0, 0, 0);
 }
 
@@ -596,9 +594,6 @@ static void mouseupdate (void)
        int y = newcursor_y;
        int forced = 0;
 
-       if (!currprefs.gfx_api)
-               return;
-
        if (cursordeactivate > 0) {
                cursordeactivate--;
                if (cursordeactivate == 0) {
@@ -607,6 +602,8 @@ static void mouseupdate (void)
                }
        }
 
+       if (!currprefs.gfx_api)
+               return;
        D3D_setcursor (x, y, cursorvisible);
 }
 
@@ -664,8 +661,7 @@ void picasso_handle_vsync (void)
                return;
 
        framecnt++;
-       if (!multithreaded)
-               mouseupdate ();
+       mouseupdate ();
 
        if (thisisvsync) {
                int flushed = 0;
@@ -2462,6 +2458,29 @@ static uae_u32 REGPARAM2 picasso_SetPanning (TrapContext *ctx)
        return 1;
 }
 
+#ifdef CPU_64_BIT
+static void do_xor8 (uae_u8 *p, int w, uae_u32 v)
+{
+       while (ALIGN_POINTER_TO32 (p) != 7 && w) {
+               *p ^= v;
+               p++;
+               w--;
+       }
+       v |= v << 32;
+       while (w >= 2 * 8) {
+               *((uae_u64*)p) ^= v;
+               p += 8;
+               *((uae_u64*)p) ^= v;
+               p += 8;
+               w -= 2 * 8;
+       }
+       while (w) {
+               *p ^= v;
+               p++;
+               w--;
+       }
+}
+#else
 static void do_xor8 (uae_u8 *p, int w, uae_u32 v)
 {
        while (ALIGN_POINTER_TO32 (p) != 3 && w) {
@@ -2482,7 +2501,7 @@ static void do_xor8 (uae_u8 *p, int w, uae_u32 v)
                w--;
        }
 }
-
+#endif
 /*
 * InvertRect:
 *
@@ -4353,11 +4372,6 @@ static uaecptr uaegfx_card_install (TrapContext *ctx, uae_u32 extrasize)
        if (currprefs.win32_rtgvblankrate >= -1)
                initvblankirq (ctx, uaegfx_base);
 
-       if (multithreaded && thread_alive == 0) {
-               uae_sem_init (&sem, FALSE, FALSE);
-               uae_start_thread (L"rtg_copy", picasso_copy, NULL, NULL);
-       }
-
        write_log (L"uaegfx.card %d.%d init @%08X\n", UAEGFX_VERSION, UAEGFX_REVISION, uaegfx_base);
        return uaegfx_base;
 }
index 05c78c885fb8d0b33b4cb6af6e1eaa0c7e32dfa5..f0e00b70a4479a8ee0e3c10d877be3021f1400d0 100644 (file)
@@ -817,10 +817,10 @@ void flush_screen (int a, int b)
 
 static uae_u8 *ddraw_dolock (void)
 {
-       if (dx_islost ())
-               return 0;
-       if (!DirectDraw_SurfaceLock ())
+       if (!DirectDraw_SurfaceLock ()) {
+               dx_check ();
                return 0;
+       }
        gfxvidinfo.bufmem = DirectDraw_GetSurfacePointer ();
        gfxvidinfo.rowbytes = DirectDraw_GetSurfacePitch ();
        init_row_map ();
@@ -992,8 +992,10 @@ uae_u8 *gfx_lock_picasso (void)
                picasso_vidinfo.rowbytes = pitch;
                return p;
        } else {
-               if (!DirectDraw_SurfaceLock ())
+               if (!DirectDraw_SurfaceLock ()) {
+                       dx_check ();
                        return 0;
+               }
                picasso_vidinfo.rowbytes = DirectDraw_GetSurfacePitch ();
                return DirectDraw_GetSurfacePointer ();
        }
@@ -2518,10 +2520,10 @@ void updatedisplayarea (void)
 {
        if (!screen_is_initialized)
                return;
-       if (picasso_on)
-               return;
        if (dx_islost ())
                return;
+       if (picasso_on)
+               return;
 #if defined (GFXFILTER)
        if (currentmode->flags & DM_OPENGL) {
 #if defined (OPENGL)