Defined RESTORE_SIGNALS by default and call SIGNAL_EmulatorInit
through a function pointer instead. Added a few traces. Fixed the "Memory corruption !" message in DGA mode. Commented out an unnecessary TSXF86VidModeSetViewPort that caused my X server to act up, relying on TSXF86DGASetViewPort instead.
This commit is contained in:
parent
6b5a811175
commit
b77de0298d
3 changed files with 22 additions and 7 deletions
|
@ -67,9 +67,9 @@
|
||||||
#undef DIABLO_HACK
|
#undef DIABLO_HACK
|
||||||
|
|
||||||
/* Restore signal handlers overwritten by XF86DGA
|
/* Restore signal handlers overwritten by XF86DGA
|
||||||
* this is a define, for it will only work in emulator mode
|
|
||||||
*/
|
*/
|
||||||
#undef RESTORE_SIGNALS
|
#define RESTORE_SIGNALS
|
||||||
|
BOOL32 (*SIGNAL_Reinit)(void); /* didn't find any obvious place to put this */
|
||||||
|
|
||||||
/* Where do these GUIDs come from? mkuuid.
|
/* Where do these GUIDs come from? mkuuid.
|
||||||
* They exist solely to distinguish between the targets Wine support,
|
* They exist solely to distinguish between the targets Wine support,
|
||||||
|
@ -390,6 +390,8 @@ static HRESULT WINAPI IDirectDrawSurface3_Lock(
|
||||||
|
|
||||||
/* First, copy the Surface description */
|
/* First, copy the Surface description */
|
||||||
*lpddsd = this->s.surface_desc;
|
*lpddsd = this->s.surface_desc;
|
||||||
|
TRACE(ddraw,"locked surface: height=%ld, width=%ld, pitch=%ld\n",
|
||||||
|
lpddsd->dwHeight,lpddsd->dwWidth,lpddsd->lPitch);
|
||||||
|
|
||||||
/* If asked only for a part, change the surface pointer */
|
/* If asked only for a part, change the surface pointer */
|
||||||
if (lprect) {
|
if (lprect) {
|
||||||
|
@ -2103,6 +2105,7 @@ static HRESULT WINAPI DGA_IDirectDraw2_CreateSurface(
|
||||||
(*lpdsf)->s.surface_desc.dwFlags |= DDSD_WIDTH|DDSD_HEIGHT|DDSD_PITCH|DDSD_LPSURFACE;
|
(*lpdsf)->s.surface_desc.dwFlags |= DDSD_WIDTH|DDSD_HEIGHT|DDSD_PITCH|DDSD_LPSURFACE;
|
||||||
(*lpdsf)->s.surface_desc.dwWidth = this->d.width;
|
(*lpdsf)->s.surface_desc.dwWidth = this->d.width;
|
||||||
(*lpdsf)->s.surface_desc.dwHeight = this->d.height;
|
(*lpdsf)->s.surface_desc.dwHeight = this->d.height;
|
||||||
|
TRACE(ddraw,"primary surface: dwWidth=%ld, dwHeight=%ld, lPitch=%ld\n",this->d.width,this->d.height,lpddsd->lPitch);
|
||||||
/* We put our surface always in video memory */
|
/* We put our surface always in video memory */
|
||||||
(*lpdsf)->s.surface_desc.ddsCaps.dwCaps |= DDSCAPS_VISIBLE|DDSCAPS_VIDEOMEMORY;
|
(*lpdsf)->s.surface_desc.ddsCaps.dwCaps |= DDSCAPS_VISIBLE|DDSCAPS_VIDEOMEMORY;
|
||||||
_getpixelformat(this,&((*lpdsf)->s.surface_desc.ddpfPixelFormat));
|
_getpixelformat(this,&((*lpdsf)->s.surface_desc.ddpfPixelFormat));
|
||||||
|
@ -2443,6 +2446,9 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
|
||||||
|
|
||||||
TRACE(ddraw, "(%p)->(%ld,%ld,%ld)\n", this, width, height, depth);
|
TRACE(ddraw, "(%p)->(%ld,%ld,%ld)\n", this, width, height, depth);
|
||||||
|
|
||||||
|
/* We hope getting the asked for depth */
|
||||||
|
this->d.screen_depth = depth;
|
||||||
|
|
||||||
depths = TSXListDepths(display,DefaultScreen(display),&depcount);
|
depths = TSXListDepths(display,DefaultScreen(display),&depcount);
|
||||||
for (i=0;i<depcount;i++)
|
for (i=0;i<depcount;i++)
|
||||||
if (depths[i]==depth)
|
if (depths[i]==depth)
|
||||||
|
@ -2496,6 +2502,7 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
|
||||||
} else
|
} else
|
||||||
TSXFree(all_modes[i]->private);
|
TSXFree(all_modes[i]->private);
|
||||||
}
|
}
|
||||||
|
for (i++;i<mode_count;i++) TSXFree(all_modes[i]->private);
|
||||||
TSXFree(all_modes);
|
TSXFree(all_modes);
|
||||||
|
|
||||||
if (!vidmode)
|
if (!vidmode)
|
||||||
|
@ -2503,8 +2510,11 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
|
||||||
|
|
||||||
if (vidmode)
|
if (vidmode)
|
||||||
{
|
{
|
||||||
|
TRACE(ddraw,"SwitchToMode(%dx%d)\n",vidmode->hdisplay,vidmode->vdisplay);
|
||||||
TSXF86VidModeSwitchToMode(display, DefaultScreen(display), vidmode);
|
TSXF86VidModeSwitchToMode(display, DefaultScreen(display), vidmode);
|
||||||
|
#if 0 /* This messes up my screen (XF86_Mach64, 3.3.2.3a) for some reason, and should now be unnecessary */
|
||||||
TSXF86VidModeSetViewPort(display, DefaultScreen(display), 0, 0);
|
TSXF86VidModeSetViewPort(display, DefaultScreen(display), 0, 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2516,10 +2526,12 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
|
||||||
TSXF86DGADirectVideo(display,DefaultScreen(display),XF86DGADirectGraphics);
|
TSXF86DGADirectVideo(display,DefaultScreen(display),XF86DGADirectGraphics);
|
||||||
#ifdef DIABLO_HACK
|
#ifdef DIABLO_HACK
|
||||||
TSXF86DGASetViewPort(display,DefaultScreen(display),0,this->e.dga.fb_height);
|
TSXF86DGASetViewPort(display,DefaultScreen(display),0,this->e.dga.fb_height);
|
||||||
|
#else
|
||||||
|
TSXF86DGASetViewPort(display,DefaultScreen(display),0,0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RESTORE_SIGNALS
|
#ifdef RESTORE_SIGNALS
|
||||||
SIGNAL_InitEmulator();
|
if (SIGNAL_Reinit) SIGNAL_Reinit();
|
||||||
#endif
|
#endif
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
#else /* defined(HAVE_LIBXXF86DGA) */
|
#else /* defined(HAVE_LIBXXF86DGA) */
|
||||||
|
@ -2688,7 +2700,7 @@ static HRESULT WINAPI common_IDirectDraw2_CreatePalette(
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR(ddraw, "Memory corruption !\n");
|
ERR(ddraw, "Memory corruption ! (depth=%ld, screen_depth=%ld)\n",this->d.depth,this->d.screen_depth);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2765,7 +2777,7 @@ static HRESULT WINAPI DGA_IDirectDraw2_RestoreDisplayMode(LPDIRECTDRAW2 this) {
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
TSXF86DGADirectVideo(display,DefaultScreen(display),0);
|
TSXF86DGADirectVideo(display,DefaultScreen(display),0);
|
||||||
#ifdef RESTORE_SIGNALS
|
#ifdef RESTORE_SIGNALS
|
||||||
SIGNAL_InitEmulator();
|
if (SIGNAL_Reinit) SIGNAL_Reinit();
|
||||||
#endif
|
#endif
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
#else /* defined(HAVE_LIBXXF86DGA) */
|
#else /* defined(HAVE_LIBXXF86DGA) */
|
||||||
|
@ -2813,7 +2825,7 @@ static ULONG WINAPI DGA_IDirectDraw2_Release(LPDIRECTDRAW2 this) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RESTORE_SIGNALS
|
#ifdef RESTORE_SIGNALS
|
||||||
SIGNAL_InitEmulator();
|
if (SIGNAL_Reinit) SIGNAL_Reinit();
|
||||||
#endif
|
#endif
|
||||||
HeapFree(GetProcessHeap(),0,this);
|
HeapFree(GetProcessHeap(),0,this);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3391,9 +3403,10 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* just assume the default depth is the DGA depth too */
|
/* just assume the default depth is the DGA depth too */
|
||||||
|
(*lplpDD)->d.screen_depth = DefaultDepthOfScreen(screen);
|
||||||
(*lplpDD)->d.depth = DefaultDepthOfScreen(screen);
|
(*lplpDD)->d.depth = DefaultDepthOfScreen(screen);
|
||||||
#ifdef RESTORE_SIGNALS
|
#ifdef RESTORE_SIGNALS
|
||||||
SIGNAL_InitEmulator();
|
if (SIGNAL_Reinit) SIGNAL_Reinit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
|
|
|
@ -102,6 +102,7 @@ extern void SIGNAL_MaskAsyncEvents( BOOL32 flag );
|
||||||
|
|
||||||
/* if1632/signal.c */
|
/* if1632/signal.c */
|
||||||
extern BOOL32 SIGNAL_InitEmulator(void);
|
extern BOOL32 SIGNAL_InitEmulator(void);
|
||||||
|
extern BOOL32 (*SIGNAL_Reinit)(void);
|
||||||
|
|
||||||
/* misc/aspi.c */
|
/* misc/aspi.c */
|
||||||
extern void ASPI_DOS_HandleInt(CONTEXT *context);
|
extern void ASPI_DOS_HandleInt(CONTEXT *context);
|
||||||
|
|
|
@ -34,6 +34,7 @@ BOOL32 MAIN_EmulatorInit(void)
|
||||||
|
|
||||||
/* Initialize signal handling */
|
/* Initialize signal handling */
|
||||||
if (!SIGNAL_InitEmulator()) return FALSE;
|
if (!SIGNAL_InitEmulator()) return FALSE;
|
||||||
|
SIGNAL_Reinit=SIGNAL_InitEmulator;
|
||||||
|
|
||||||
/* Create the Win16 printer driver */
|
/* Create the Win16 printer driver */
|
||||||
if (!WIN16DRV_Init()) return FALSE;
|
if (!WIN16DRV_Init()) return FALSE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue