From: Toni Wilen Date: Fri, 26 Feb 2010 17:23:47 +0000 (+0200) Subject: fullscreen directdraw alt-tab blank screen X-Git-Tag: 2100~16 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=1d63482abe4ef2789eda601ecdbe52c1e45eced5;p=francis%2Fwinuae.git fullscreen directdraw alt-tab blank screen --- diff --git a/od-win32/dxwrap.cpp b/od-win32/dxwrap.cpp index 3b8efc22..9b8f707f 100644 --- a/od-win32/dxwrap.cpp +++ b/od-win32/dxwrap.cpp @@ -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); diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index 70864d8a..ac210cfe 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -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; } diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 05c78c88..f0e00b70 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -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)