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);
#define P96DX 0
#define WINCURSOR 1
-static int multithreaded = 0;
-
#include "sysconfig.h"
#include "sysdeps.h"
static void disablemouse (void)
{
- if (!currprefs.gfx_api)
- return;
cursorok = FALSE;
cursordeactivate = 0;
+ if (!currprefs.gfx_api)
+ return;
D3D_setcursor (0, 0, 0);
}
int y = newcursor_y;
int forced = 0;
- if (!currprefs.gfx_api)
- return;
-
if (cursordeactivate > 0) {
cursordeactivate--;
if (cursordeactivate == 0) {
}
}
+ if (!currprefs.gfx_api)
+ return;
D3D_setcursor (x, y, cursorvisible);
}
return;
framecnt++;
- if (!multithreaded)
- mouseupdate ();
+ mouseupdate ();
if (thisisvsync) {
int flushed = 0;
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) {
w--;
}
}
-
+#endif
/*
* InvertRect:
*
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;
}
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 ();
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 ();
}
{
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)