diff --git a/Include/dxwnd.h b/Include/dxwnd.h index 9e44332..52b2ac6 100644 --- a/Include/dxwnd.h +++ b/Include/dxwnd.h @@ -198,6 +198,8 @@ #define CONFIRMONCLOSE 0x00004000 // on close button, ask the user before closing the window / terminating the program #define TERMINATEONCLOSE 0x00008000 // on WM_CLOSE message, also terminates the program #define FLIPEMULATION 0x00010000 // create virtual primary and backbuffer as un-attached surfaces and replace Flip with Blt +#define SETZBUFFERBITDEPTHS 0x00020000 // when not set, set the legacy dwZBufferBitDepths field in the directdraw capability from GetCaps() +#define SHAREDDC 0x00040000 // enable sharing window DC and primary surface DC // logging Tflags DWORD: #define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 0984c50..5ba6e8d 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c01c7fd1f64f802d8807161a3d3e61c674473cb75ea1ce1b888b42c325af145d -size 581632 +oid sha256:7974a9d6ece70e47422cce4c82daa4d31131c217d89aa967ad23993ba7a3268c +size 583680 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index 46ba3e7..134653c 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:36da51e4bf39269c8ad561b1573553024b8de8be9072da196c89e32955a2ffb8 -size 541696 +oid sha256:cd704d7423b954daf34806d31bb047aa8d606752a5fa6cd1f9f602b668c5e5f3 +size 542208 diff --git a/build/exports/Age of Empires II.dxw b/build/exports/Age of Empires II.dxw index 13d078c..875af95 100644 --- a/build/exports/Age of Empires II.dxw +++ b/build/exports/Age of Empires II.dxw @@ -6,10 +6,10 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=134218272 +flag0=134217762 flagg0=1207959552 flagh0=20 -flagi0=4 +flagi0=4194308 tflag0=0 initx0=0 inity0=0 @@ -25,3 +25,7 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +notes0= +flagj0=128 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/Avernum demo.dxw b/build/exports/Avernum demo.dxw new file mode 100644 index 0000000..7006bfc --- /dev/null +++ b/build/exports/Avernum demo.dxw @@ -0,0 +1,31 @@ +[target] +title0=Avernum demo +path0=D:\Games\Avernum Demo\Avernum.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=136314914 +flagg0=1745879040 +flagh0=16 +flagi0=138412036 +flagj0=4224 +flagk0=0 +tflag0=0 +initx0=0 +inity0=0 +minx0=0 +miny0=0 +maxx0=0 +maxy0=0 +posx0=50 +posy0=50 +sizx0=1200 +sizy0=900 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 diff --git a/build/exports/Banzai Bug.dxw b/build/exports/Banzai Bug.dxw new file mode 100644 index 0000000..c840edc --- /dev/null +++ b/build/exports/Banzai Bug.dxw @@ -0,0 +1,31 @@ +[target] +title0=Banzai Bug +path0=D:\Games\Banzai Bug\EXE\RELEASE.EXE +launchpath0= +module0= +opengllib0= +notes0= +ver0=1 +coord0=0 +flag0=685899810 +flagg0=1207959680 +flagh0=20 +flagi0=138412036 +flagj0=4224 +flagk0=131072 +tflag0=0 +initx0=0 +inity0=0 +minx0=0 +miny0=0 +maxx0=0 +maxy0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 diff --git a/build/exports/Cydonia.dxw b/build/exports/Cydonia.dxw new file mode 100644 index 0000000..fee7f4b --- /dev/null +++ b/build/exports/Cydonia.dxw @@ -0,0 +1,31 @@ +[target] +title0=Cydonia +path0=D:\Games\Cydonia\cydonia.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=136314914 +flagg0=1207959552 +flagh0=20 +flagi0=138543108 +flagj0=4224 +flagk0=0 +tflag0=0 +initx0=0 +inity0=0 +minx0=0 +miny0=0 +maxx0=0 +maxy0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 diff --git a/build/exports/Diablo MP demo.dxw b/build/exports/Diablo MP demo.dxw new file mode 100644 index 0000000..1668e12 --- /dev/null +++ b/build/exports/Diablo MP demo.dxw @@ -0,0 +1,31 @@ +[target] +title0=Diablo MP demo +path0=D:\Games\Diablo MP demo\diablo_s.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=136331298 +flagg0=1207959552 +flagh0=20 +flagi0=138412036 +flagj0=4225 +flagk0=0 +tflag0=0 +initx0=0 +inity0=0 +minx0=0 +miny0=0 +maxx0=0 +maxy0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 diff --git a/build/exports/Grand Prix World.dxw b/build/exports/Grand Prix World.dxw index f96743d..9174eb4 100644 --- a/build/exports/Grand Prix World.dxw +++ b/build/exports/Grand Prix World.dxw @@ -27,5 +27,5 @@ winver0=0 maxres0=0 notes0= flagj0=128 -flagk0=0 +flagk0=65536 swapeffect0=0 diff --git a/build/exports/Gruntz.dxw b/build/exports/Gruntz.dxw index 1c4872b..1d98e7a 100644 --- a/build/exports/Gruntz.dxw +++ b/build/exports/Gruntz.dxw @@ -27,3 +27,5 @@ maxres0=-1 launchpath0= notes0= flagj0=128 +flagk0=65536 +swapeffect0=0 diff --git a/build/exports/H.E.D.Z..dxw b/build/exports/H.E.D.Z..dxw index f0c91a8..097c877 100644 --- a/build/exports/H.E.D.Z..dxw +++ b/build/exports/H.E.D.Z..dxw @@ -27,3 +27,5 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +flagk0=65536 +swapeffect0=0 diff --git a/build/exports/Homeworld.dxw b/build/exports/Homeworld.dxw index c889303..e1e9261 100644 --- a/build/exports/Homeworld.dxw +++ b/build/exports/Homeworld.dxw @@ -5,11 +5,11 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=704667680 +flag0=704667682 flagg0=1208090896 flagh0=20 -flagi0=4 -tflag0=64 +flagi0=4194308 +tflag0=0 initx0=0 inity0=0 minx0=0 @@ -24,3 +24,8 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +launchpath0= +notes0= +flagj0=128 +flagk0=65536 +swapeffect0=0 diff --git a/build/exports/House of the Dead 2.dxw b/build/exports/House of the Dead 2.dxw index 7fdf9f6..c022a51 100644 --- a/build/exports/House of the Dead 2.dxw +++ b/build/exports/House of the Dead 2.dxw @@ -27,5 +27,5 @@ maxres0=-1 launchpath0= notes0= flagj0=128 -flagk0=0 +flagk0=65536 swapeffect0=0 diff --git a/build/exports/Hoyle Casino Empire.dxw b/build/exports/Hoyle Casino Empire.dxw index d8254c1..292b4a8 100644 --- a/build/exports/Hoyle Casino Empire.dxw +++ b/build/exports/Hoyle Casino Empire.dxw @@ -6,12 +6,12 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=134217762 +flag0=142606370 flagg0=1242562560 flagh0=20 -flagi0=138413060 +flagi0=205520900 flagj0=4224 -tflag0=6151 +tflag0=0 initx0=0 inity0=0 minx0=0 @@ -26,3 +26,6 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +notes0= +flagk0=0 +swapeffect0=0 diff --git a/build/exports/Hydro Thunder.dxw b/build/exports/Hydro Thunder.dxw index 3210cd5..d952464 100644 --- a/build/exports/Hydro Thunder.dxw +++ b/build/exports/Hydro Thunder.dxw @@ -5,10 +5,10 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=704643104 +flag0=704643106 flagg0=1207959552 flagh0=20 -flagi0=4 +flagi0=4194308 tflag0=0 initx0=0 inity0=0 @@ -24,3 +24,8 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +launchpath0= +notes0= +flagj0=128 +flagk0=65536 +swapeffect0=0 diff --git a/build/exports/Incoming (GOG).dxw b/build/exports/Incoming (GOG).dxw index 04531e5..95bf614 100644 --- a/build/exports/Incoming (GOG).dxw +++ b/build/exports/Incoming (GOG).dxw @@ -9,7 +9,7 @@ flag0=134217762 flagg0=1207959552 flagh0=20 flagi0=4194308 -tflag0=1024 +tflag0=0 initx0=0 inity0=0 minx0=0 @@ -26,3 +26,6 @@ winver0=0 maxres0=-1 launchpath0= flagj0=128 +notes0= +flagk0=65536 +swapeffect0=0 diff --git a/build/exports/Legacy of Kain Soul Reaver (GOG).dxw b/build/exports/Legacy of Kain Soul Reaver (GOG).dxw index ad09e92..6696bc1 100644 --- a/build/exports/Legacy of Kain Soul Reaver (GOG).dxw +++ b/build/exports/Legacy of Kain Soul Reaver (GOG).dxw @@ -5,10 +5,10 @@ module0= opengllib0= ver0=7 coord0=0 -flag0=671088672 -flagg0=134217728 +flag0=671088674 +flagg0=1207959552 flagh0=20 -flagi0=1028 +flagi0=4194308 tflag0=0 initx0=0 inity0=0 @@ -24,3 +24,8 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +launchpath0= +notes0= +flagj0=128 +flagk0=65536 +swapeffect0=0 diff --git a/build/exports/Lords of Magic Special Edition.dxw b/build/exports/Lords of Magic Special Edition.dxw index 7ebbfc7..e7fdd9c 100644 --- a/build/exports/Lords of Magic Special Edition.dxw +++ b/build/exports/Lords of Magic Special Edition.dxw @@ -26,3 +26,6 @@ launchpath0= flagj0=128 winver0=0 maxres0=0 +notes0= +flagk0=65536 +swapeffect0=0 diff --git a/build/exports/The Sting!.dxw b/build/exports/The Sting!.dxw new file mode 100644 index 0000000..f9f251d --- /dev/null +++ b/build/exports/The Sting!.dxw @@ -0,0 +1,31 @@ +[target] +title0=The Sting! +path0=D:\Games\sting\Sting.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=136314914 +flagg0=1207959552 +flagh0=16 +flagi0=138412036 +flagj0=4224 +flagk0=0 +tflag0=0 +initx0=0 +inity0=0 +minx0=0 +miny0=0 +maxx0=0 +maxy0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index 4aa99c8..2fc8c67 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -876,4 +876,15 @@ fix: protections for GDI ReleaseDC operations against null window or DC v2.03.34: fix: handling of real primary/backbuffer surfaces in non-emulated modes and WinXP: now uses system memory if possible, video memory otherwise. fix: simulation of backbuffer attach in non emulated modes. -fix: mciSendString hooker, was losing a final command line argument \ No newline at end of file +fix: mciSendString hooker, was losing a final command line argument + +v2.03.35: +add: added "Set ZBufferBitDepths capability" flag to set a no longer supported fields in the capability structure. This makes ""Banzai Bug" bypass the capability checks. +fix: better handling of surface capabilities in flippable mode +fix: fixed bug in primary surface handling when already created ... +add: added ""Share ddraw and GDI DC" flag: sharing was introduced in release v2.03.19, but proved to be incompatible in many situations. Now it is off by default and enabled when necessary. +fix: the flags for disabling DDSCAPS_SYSTEMMEMORY capability are now used also in non-emulated flipping emulation mode. Depending on the video card, it may help getting compatibility. +fix: handling of NULL DC in non emulated modes: the NULL DC (corresponding to the whole desktop) is replaced by the window DC. This reduces problems like clearing the whole desktop. +fix: EnumDisplayModes was returning wrong modes list in SVGA mode. +fix: applied the error suppression to the DeleteAttachedSurface hooker. +fix: hooked User32 CreateRectRegion/Indirect calls. \ No newline at end of file diff --git a/dll/ddraw.cpp b/dll/ddraw.cpp index 1d7f5c9..65265e1 100644 --- a/dll/ddraw.cpp +++ b/dll/ddraw.cpp @@ -1472,8 +1472,8 @@ static void HandleCapsD(char *sLabel, LPDDCAPS c) c->dwFXCaps, ExplainDDFXCaps(c->dwFXCaps), c->dwFXAlphaCaps, ExplainDDFXALPHACaps(c->dwFXAlphaCaps), c->dwCKeyCaps, ExplainDDCKeyCaps(c->dwCKeyCaps)); - OutTraceDDRAW("GetCaps(%s): VidMemTotal=%x VidMemFree=%x\n", - sLabel, c->dwVidMemTotal, c->dwVidMemFree); + OutTraceDDRAW("GetCaps(%s): VidMemTotal=%x VidMemFree=%x ZBufferBitDepths=%x(%s)\n", + sLabel, c->dwVidMemTotal, c->dwVidMemFree, c->dwZBufferBitDepths, ExplainZBufferBitDepths(c->dwZBufferBitDepths)); if(dxw.dwFlags2 & LIMITRESOURCES){ // check for memory value overflow const DWORD dwMaxMem = 0x70000000; if(c->dwVidMemTotal > dwMaxMem) c->dwVidMemTotal = dwMaxMem; @@ -1485,7 +1485,20 @@ static void HandleCapsD(char *sLabel, LPDDCAPS c) c->dwVidMemTotal = dwHugeMem; c->dwVidMemFree = dwHugeMem; } - if((dxw.dwFlags5 & STRESSRESOURCES) || (dxw.dwFlags5 & STRESSRESOURCES)) + if(dxw.dwFlags6 & SETZBUFFERBITDEPTHS){ + // From MSDN https://msdn.microsoft.com/en-us/library/windows/desktop/gg426101%28v=vs.85%29.aspx : + // dwZBufferBitDepths + // DDBD_8, DDBD_16, DDBD_24, or DDBD_32. (Indicate 8, 16, 24, or 32 bits per pixel.) + // This member is obsolete for DirectX 6.0 and later. + // Use the IDirect3D7::EnumZBufferFormats to retrieve information about supported depth buffer formats. + // v2.03.35: needed to bypass the "Banzai Bug" initial controls + if (c->dwZBufferBitDepths == 0) { + c->dwZBufferBitDepths = (DDBD_8|DDBD_16|DDBD_24|DDBD_32); + OutTraceDDRAW("GetCaps(%s): FIXED ZBufferBitDepths=%x(%s)\n", + sLabel, c->dwZBufferBitDepths, ExplainZBufferBitDepths(c->dwZBufferBitDepths)); + } + } + if((dxw.dwFlags5 & STRESSRESOURCES) || (dxw.dwFlags2 & LIMITRESOURCES)) OutTraceDDRAW("GetCaps(%s): FIXED VidMemTotal=%x VidMemFree=%x\n", sLabel, c->dwVidMemTotal, c->dwVidMemFree); } @@ -2182,30 +2195,25 @@ static void ClearSurfaceDesc(void *ddsd, int dxversion) ((LPDDSURFACEDESC)ddsd)->dwSize = size; } -static void BuildRealSurfaces(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurface, LPDDSURFACEDESC2 lpddsd, int dxversion) +static void BuildRealSurfaces(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurface, int dxversion) { HRESULT res; DDSURFACEDESC2 ddsd; - OutTraceDW("DEBUG: BuildRealSurfaces: lpdd=%x pCreateSurface=%x lpddsd=%x version=%d\n", lpdd, pCreateSurface, lpddsd, dxversion); + OutTraceDW("DEBUG: BuildRealSurfaces: lpdd=%x pCreateSurface=%x version=%d\n", lpdd, pCreateSurface, dxversion); if(lpDDSEmu_Prim==NULL){ ClearSurfaceDesc((void *)&ddsd, dxversion); ddsd.dwFlags = DDSD_CAPS; // try DDSCAPS_SYSTEMMEMORY first, then suppress it if not supported - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE|DDSCAPS_SYSTEMMEMORY; + // no, DDSCAPS_SYSTEMMEMORY cause screen flickering while moving the window (and other troubles?) + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; OutTraceDW("CreateSurface: %s\n", LogSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[EmuPrim]", __LINE__)); res=(*pCreateSurface)(lpdd, &ddsd, &lpDDSEmu_Prim, 0); - if(res==DDERR_INCOMPATIBLEPRIMARY) { - ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY; - OutTraceDW("CreateSurface: %s\n", LogSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[EmuPrim]", __LINE__)); - res=(*pCreateSurface)(lpdd, &ddsd, &lpDDSEmu_Prim, 0); - } if(res==DDERR_PRIMARYSURFACEALREADYEXISTS){ OutTraceDW("CreateSurface: ASSERT DDSEmu_Prim already exists\n"); if(dxw.Windowize){ - // in Winowize mode, the desktop properties are untouched, then the current primary surface can be recycled + // in Windowize mode, the desktop properties are untouched, then the current primary surface can be recycled res=(*pGetGDISurface)(lpdd, &lpDDSEmu_Prim); - (*pReleaseS)(lpDDSEmu_Prim); } else { // in non-Windowized mode, the primary surface must be released and rebuilt with the proper properties @@ -2231,8 +2239,7 @@ static void BuildRealSurfaces(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurfa if(lpDDSEmu_Back==NULL){ ClearSurfaceDesc((void *)&ddsd, dxversion); ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - //ddsd.ddsCaps.dwCaps = dwBackBufferCaps; - ddsd.ddsCaps.dwCaps = dwBackBufferCaps|DDSCAPS_SYSTEMMEMORY; + ddsd.ddsCaps.dwCaps = dwBackBufferCaps; ddsd.dwWidth = dxw.GetScreenWidth(); ddsd.dwHeight = dxw.GetScreenHeight(); if(dxw.dwFlags4 & BILINEAR2XFILTER){ @@ -2310,11 +2317,11 @@ static HRESULT BuildPrimaryEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf // this is important to avoid that certain D3D operations will abort - see "Forsaken" problem if(dxw.dwFlags6 & NOSYSMEMBACKBUF) dwBackBufferCaps = DDSCAPS_OFFSCREENPLAIN; - bFlippedDC = TRUE; + if(dxw.dwFlags6 & SHAREDDC) bFlippedDC = TRUE; if(dxw.dwFlags5 & GDIMODE) return DD_OK; - BuildRealSurfaces(lpdd, pCreateSurface, lpddsd, dxversion); + BuildRealSurfaces(lpdd, pCreateSurface, dxversion); return DD_OK; } @@ -2343,8 +2350,10 @@ static HRESULT BuildPrimaryFlippable(LPDIRECTDRAW lpdd, CreateSurface_Type pCrea if(!(lpddsd->dwFlags & DDSD_BACKBUFFERCOUNT) || (lpddsd->dwBackBufferCount == 0)) ddsd.dwBackBufferCount = 1; // dwCaps - ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM); - ddsd.ddsCaps.dwCaps |= (DDSCAPS_COMPLEX|DDSCAPS_FLIP|DDSCAPS_OFFSCREENPLAIN); + ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM|DDSCAPS_FRONTBUFFER); + ddsd.ddsCaps.dwCaps |= (DDSCAPS_COMPLEX|DDSCAPS_FLIP|DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY); + // on WinXP Fifa 99 doesn't like DDSCAPS_SYSTEMMEMORY cap, so better to leave a way to unset it.... + if(dxw.dwFlags6 & NOSYSMEMPRIMARY) ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY; // dwWidth & dwHeight ddsd.dwWidth = dxw.GetScreenWidth(); @@ -2367,12 +2376,15 @@ static HRESULT BuildPrimaryFlippable(LPDIRECTDRAW lpdd, CreateSurface_Type pCrea // set a global capability value for surfaces that have to blit to primary dwBackBufferCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY); + // on WinXP Fifa 99 doesn't like DDSCAPS_SYSTEMMEMORY cap, so better to leave a way to unset it.... + // this is important to avoid that certain D3D operations will abort - see "Forsaken" problem + if(dxw.dwFlags6 & NOSYSMEMBACKBUF) dwBackBufferCaps = DDSCAPS_OFFSCREENPLAIN; - bFlippedDC = TRUE; + if(dxw.dwFlags6 & SHAREDDC) bFlippedDC = TRUE; if(dxw.dwFlags5 & GDIMODE) return DD_OK; - BuildRealSurfaces(lpdd, pCreateSurface, lpddsd, dxversion); + BuildRealSurfaces(lpdd, pCreateSurface, dxversion); return DD_OK; } @@ -2488,6 +2500,7 @@ static HRESULT BuildBackBufferFlippable(LPDIRECTDRAW lpdd, CreateSurface_Type pC HRESULT res; OutTraceDW("DEBUG: BuildBackBufferFlippable: lpdd=%x pCreateSurface=%x lpddsd=%x version=%d\n", lpdd, pCreateSurface, lpddsd, dxversion); + //MessageBox(NULL, "BuildBackBufferFlippable", "DxWnd", MB_OK); // create BackBuffer surface memcpy(&ddsd, lpddsd, lpddsd->dwSize); @@ -2495,8 +2508,8 @@ static HRESULT BuildBackBufferFlippable(LPDIRECTDRAW lpdd, CreateSurface_Type pC ddsd.dwFlags &= ~(DDSD_BACKBUFFERCOUNT|DDSD_REFRESHRATE); ddsd.dwFlags |= (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT); - ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_BACKBUFFER|DDSCAPS_PRIMARYSURFACE); - ddsd.ddsCaps.dwCaps |= (DDSCAPS_FLIP|DDSCAPS_COMPLEX|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM); + ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_FRONTBUFFER|DDSCAPS_BACKBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM); + ddsd.ddsCaps.dwCaps |= (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); ddsd.dwWidth = dxw.GetScreenWidth(); ddsd.dwHeight = dxw.GetScreenHeight(); @@ -2675,6 +2688,57 @@ static HRESULT BuildGenericEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf return DD_OK; } +static HRESULT BuildGenericFlippable(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurface, LPDDSURFACEDESC2 lpddsd, int dxversion, LPDIRECTDRAWSURFACE *lplpdds, void *pu) +{ + DDSURFACEDESC2 ddsd; + HRESULT res; + + OutTraceDW("DEBUG: BuildGenericFlippable: lpdd=%x pCreateSurface=%x lpddsd=%x version=%d\n", lpdd, pCreateSurface, lpddsd, dxversion); + memcpy(&ddsd, lpddsd, lpddsd->dwSize); // Copy over .... + FixSurfaceCaps(&ddsd, dxversion); + + if(dxw.dwFlags6 & POWER2WIDTH){ // v2.03.28: POWER2WIDTH to fix "Midtown Madness" in surface emulation mode + if(((ddsd.dwFlags & (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH)) == (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH)) && + (ddsd.ddsCaps.dwCaps & DDSCAPS_OFFSCREENPLAIN) + ){ + DWORD dwWidth; + dwWidth = ((ddsd.dwWidth + 3) >> 2) << 2; + if(dwWidth != ddsd.dwWidth) OutTraceDW("CreateSurface: fixed surface width %d->%d\n", ddsd.dwWidth, dwWidth); + ddsd.dwWidth = dwWidth; + } + } + + res=(*pCreateSurface)(lpdd, &ddsd, lplpdds, pu); + if ((dxw.dwFlags1 & SWITCHVIDEOMEMORY) && (res!=DD_OK)){ + OutTraceDW("CreateSurface ERROR: res=%x(%s) at %d, retry\n", res, ExplainDDError(res), __LINE__); + ddsd.ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY; + ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY; + res=(*pCreateSurface)(lpdd, &ddsd, lplpdds, pu); + } + if (res) { + OutTraceE("CreateSurface: ERROR on Emu_Generic res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); + return res; + } + + OutTraceDW("CreateSurface: CREATED lpddsd=%x version=%d %s\n", + *lplpdds, dxversion, LogSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[Emu Generic]", __LINE__)); + + // v2.02.66: if 8BPP paletized surface and a primary palette exixts, apply. + // fixes "Virtua Fighter PC" palette bug + if(lpDDP && (ddsd.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8)){ + res=(*pSetPalette)(*lplpdds, lpDDP); + if(res) + OutTraceE("SetPalette: ERROR on lpdds=%x(Emu_Generic) res=%x(%s) at %d\n", *lplpdds, res, ExplainDDError(res), __LINE__); + else + OutTraceDW("CreateSurface: applied lpddp=%x to lpdds=%x\n", lpDDP, *lplpdds); + } + + // diagnostic hooks .... + HookDDSurfaceGeneric(lplpdds, dxversion); + + return DD_OK; +} + static HRESULT BuildGenericDir(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurface, LPDDSURFACEDESC2 lpddsd, int dxversion, LPDIRECTDRAWSURFACE *lplpdds, void *pu) { HRESULT res; @@ -2743,7 +2807,8 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate BuildPrimary = BuildPrimaryFlippable; BuildBackBuffer = BuildBackBufferFlippable; AttachBackBuffer = AttachBackBufferFlippable; - BuildGeneric = BuildGenericEmu; + BuildGeneric = BuildGenericFlippable; + //BuildGeneric = BuildGenericEmu; break; case PRIMARY_EMULATED: BuildPrimary = BuildPrimaryEmu; @@ -2974,10 +3039,16 @@ HRESULT WINAPI extGetAttachedSurface(int dxversion, GetAttachedSurface_Type pGet lpBackBuffer = dxwss.GetBackBufferSurface(); if(lpBackBuffer){ *lplpddas = lpBackBuffer; - OutTraceDW("GetAttachedSurface(%d): SIMULATE attached to PRIM=%x\n", dxversion, lpdds); + OutTraceDW("GetAttachedSurface(%d): SIMULATE BACKBUF attach to PRIM=%x\n", dxversion, lpdds); return DD_OK; } } + // arguable utility .... + if ((IsPrim || IsBack) && lpDDZBuffer && (lpddsc->dwCaps & DDSCAPS_ZBUFFER)){ + *lplpddas = lpDDZBuffer; + OutTraceDW("GetAttachedSurface(%d): SIMULATE ZBUFFER attach to %s=%x\n", dxversion, IsPrim?"PRIM":"BACK", lpdds); + return DD_OK; + } OutTraceE("GetAttachedSurface(%d): ERROR res=%x(%s) at %d\n", dxversion, res, ExplainDDError(res), __LINE__); } else { @@ -3350,18 +3421,6 @@ HRESULT WINAPI extFlip(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWSURFACE lpddssrc, OutTraceDDRAW("Flip: lpdds=%x%s, src=%x, flags=%x(%s)\n", lpdds, IsPrim?"(PRIM)":"", lpddssrc, dwflags, ExplainFlipFlags(dwflags)); - if (!(dxw.dwFlags6 & FLIPEMULATION) && 0) { - OutTrace("DEBUG: attempting actual Flip\n"); - //res=(*pFlip)(lpdds, lpddssrc, dwflags); - res=(*pFlip)(lpdds, lpddssrc, 0); - if(res){ - OutTraceE("Flip: ERROR res=%x(%s)\n", res, ExplainDDError(res)); - return res; - } - if(dxw.dwFlags1 & EMULATESURFACE) dxw.ScreenRefresh(); - return DD_OK; - } - if (!IsPrim){ if(lpddssrc){ res=(*pFlip)(lpdds, lpddssrc, dwflags); @@ -3822,8 +3881,10 @@ HRESULT WINAPI extLockDir(LPDIRECTDRAWSURFACE lpdds, LPRECT lprect, LPDDSURFACED } else{ // since it can't scale, at least the updated rect is centered into the window. - (*pGetClientRect)(dxw.GethWnd(), &client); - (*pClientToScreen)(dxw.GethWnd(), &upleft); + HWND hwnd; + hwnd = dxw.GethWnd(); + (*pGetClientRect)(hwnd, &client); + (*pClientToScreen)(hwnd, &upleft); if (!lprect) lprect=&client; OffsetRect(lprect, upleft.x+(client.right-dxw.GetScreenWidth())/2, @@ -4009,6 +4070,8 @@ ReleaseDC with Unlock, returning the surface memory ptr (???) as HDC and avoiding the consistency check performed by surface::GetDC (why should it bother if the screen is 32BPP and the surface is not??? */ +// to do: double extGetDC/ReleaseDC in Emu/Dir mode ? + HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR *pHDC) { HRESULT res; @@ -4016,6 +4079,14 @@ HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR *pHDC) IsPrim=dxwss.IsAPrimarySurface(lpdds); OutTraceDDRAW("GetDC: lpdss=%x%s\n",lpdds, IsPrim?"(PRIM)":""); + + // In non-emulated mode, better return the window DC rather than the actual primary surfce DC, + // because that would refer to the whole desktop + if (!(dxw.dwFlags1 & EMULATESURFACE) && IsPrim) { + *pHDC = (*pGDIGetDC)(dxw.GethWnd()); + return DD_OK; + } + res=(*pGetDC)(lpdds, pHDC); if (res==DDERR_CANTCREATEDC && @@ -4069,7 +4140,8 @@ HRESULT WINAPI extFlipToGDISurface(LPDIRECTDRAW lpdd) // res=(*pFlipToGDISurface)(lpdd); // if (res) OutTraceE("FlipToGDISurface: ERROR res=%x(%s), skipping\n", res, ExplainDDError(res)); // pretend you flipped anyway.... - bFlippedDC = TRUE; + + if(dxw.dwFlags6 & SHAREDDC) bFlippedDC = TRUE; return DD_OK; } @@ -4189,15 +4261,6 @@ HRESULT WINAPI myEnumModesFilterDirect(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID l if (IsDebug) EnumModesCallbackDumper(lpDDSurfaceDesc, NULL); - if (dxw.dwFlags1 & PREVENTMAXIMIZE){ - // if PREVENTMAXIMIZE is set, don't let the caller know about forbidden screen settings. - if((lpDDSurfaceDesc->dwHeight > dxw.GetScreenHeight()) || - (lpDDSurfaceDesc->dwWidth > dxw.GetScreenWidth())){ - OutTraceDW("EnumDisplayModes: skipping screen size=(%d,%d)\n", lpDDSurfaceDesc->dwHeight, lpDDSurfaceDesc->dwWidth); - return DDENUMRET_OK; - } - } - // tricky part: for each color depth related to current video resolution, fake each of the // supported resolutions, unless is greater than maximum allowed @@ -4207,6 +4270,14 @@ HRESULT WINAPI myEnumModesFilterDirect(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID l lpDDSurfaceDesc->dwHeight=SupportedRes[ResIdx].h; lpDDSurfaceDesc->dwWidth=SupportedRes[ResIdx].w; if((dxw.dwFlags4 & LIMITSCREENRES) && CheckResolutionLimit(lpDDSurfaceDesc)) return DDENUMRET_OK; + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + // if PREVENTMAXIMIZE is set, don't let the caller know about forbidden screen settings. + if((lpDDSurfaceDesc->dwHeight > dxw.GetScreenHeight()) || + (lpDDSurfaceDesc->dwWidth > dxw.GetScreenWidth())){ + OutTraceDW("EnumDisplayModes: skipping screen size=(%d,%d)\n", lpDDSurfaceDesc->dwHeight, lpDDSurfaceDesc->dwWidth); + return DDENUMRET_OK; + } + } res=(*((NewContext_Type *)lpContext)->lpCallback)(lpDDSurfaceDesc, ((NewContext_Type *)lpContext)->lpContext); OutTraceDW("EnumDisplayModes(D): proposed size[%d]=(%d,%d) res=%x\n", ResIdx, SupportedRes[ResIdx].w, SupportedRes[ResIdx].h, res); if(res==DDENUMRET_CANCEL) break; @@ -4564,6 +4635,7 @@ HRESULT WINAPI extDeleteAttachedSurface(LPDIRECTDRAWSURFACE lpdds, DWORD dwflag OutTraceDW("DeleteAttachedSurface: emulating surface detach lpdds=%x\n", lpddsdel); res = DD_OK; } + if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=DD_OK; return res; } @@ -4982,7 +5054,7 @@ HRESULT WINAPI extDirectDrawEnumerateEx(LPDDENUMCALLBACKEX lpCallback, LPVOID lp ret=(*pDirectDrawEnumerateEx)(lpCallback, lpContext, dwFlags); } if(ret) OutTraceE("DirectDrawEnumerateEx: ERROR res=%x(%s)\n", ret, ExplainDDError(ret)); - if(dxw.dwFlags1 & SUPPRESSDXERRORS) ret=0; + if(dxw.dwFlags1 & SUPPRESSDXERRORS) ret=DD_OK; return ret; } diff --git a/dll/dxhelper.cpp b/dll/dxhelper.cpp index 96942d3..2ee318d 100644 --- a/dll/dxhelper.cpp +++ b/dll/dxhelper.cpp @@ -1622,6 +1622,22 @@ char *ExplainRegionType(DWORD c) return "unknown"; } +char *ExplainZBufferBitDepths(DWORD c) +{ + static char eb[128]; + unsigned int l; + strcpy(eb,"DDBD_"); + if(c & DDBD_8) strcat(eb, "8+"); + if(c & DDBD_16) strcat(eb, "16+"); + if(c & DDBD_24) strcat(eb, "24+"); + if(c & DDBD_32) strcat(eb, "32+"); + l=strlen(eb); + if (l>strlen("DDBD_")) eb[l-1]=0; // delete last '+' if any + else strcpy(eb,"NULL"); + return(eb); +} + + #define _FACD3D 0x876 #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) #define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) diff --git a/dll/dxhelper.h b/dll/dxhelper.h index c1912fb..7eadb97 100644 --- a/dll/dxhelper.h +++ b/dll/dxhelper.h @@ -53,3 +53,4 @@ extern char *ExplainChangeDisplaySettingsFlags(DWORD); extern char *ExplainDICooperativeFlags(DWORD); extern char *ExplainRegionType(DWORD); extern char *ExplainPixelFormat(LPDDPIXELFORMAT); +extern char *ExplainZBufferBitDepths(DWORD); diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index dae3f23..fc41b93 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -108,8 +108,8 @@ static char *Flag6Names[32]={ "FORCESWAPEFFECT", "LEGACYALLOC", "NODESTROYWINDOW", "NOMOVIES", "SUPPRESSRELEASE", "FIXMOVIESCOLOR", "WOW64REGISTRY", "DISABLEMAXWINMODE", "FIXPITCH", "POWER2WIDTH", "HIDETASKBAR", "ACTIVATEAPP", - "NOSYSMEMPRIMARY", "NOSYSMEMBACKBUF", "", "", - "", "", "", "", + "NOSYSMEMPRIMARY", "NOSYSMEMBACKBUF", "CONFIRMONCLOSE", "TERMINATEONCLOSE", + "FLIPEMULATION", "SETZBUFFERBITDEPTHS", "SHAREDDC", "", "", "", "", "", "", "", "", "", "", "", "", "", diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index 3a96404..13a79bd 100644 --- a/dll/dxwnd.cpp +++ b/dll/dxwnd.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . #include "TlHelp32.h" -#define VERSION "2.03.34" +#define VERSION "2.03.35" #define DDTHREADLOCK 1 //#define LOCKTHREADS diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index 5293e82..8423cf1 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/gdi32.cpp b/dll/gdi32.cpp index a3698b7..605be5d 100644 --- a/dll/gdi32.cpp +++ b/dll/gdi32.cpp @@ -118,8 +118,9 @@ static HookEntry_Type ScaledHooks[]={ // commented out since they alter text on screen...... (see Imperialism II difficulty level menu) //{HOOK_IAT_CANDIDATE, "CreateEllipticRgn", (FARPROC)NULL, (FARPROC *)&pCreateEllipticRgn, (FARPROC)extCreateEllipticRgn}, //{HOOK_IAT_CANDIDATE, "CreateEllipticRgnIndirect", (FARPROC)NULL, (FARPROC *)&pCreateEllipticRgnIndirect, (FARPROC)extCreateEllipticRgnIndirect}, - //{HOOK_IAT_CANDIDATE, "CreateRectRgn", (FARPROC)NULL, (FARPROC *)&pCreateRectRgn, (FARPROC)extCreateRectRgn}, - //{HOOK_IAT_CANDIDATE, "CreateRectRgnIndirect", (FARPROC)NULL, (FARPROC *)&pCreateRectRgnIndirect, (FARPROC)extCreateRectRgnIndirect}, + // CreateRectRgn must be hooked in scaled mode to let Avernum work correctly! + {HOOK_IAT_CANDIDATE, "CreateRectRgn", (FARPROC)NULL, (FARPROC *)&pCreateRectRgn, (FARPROC)extCreateRectRgn}, + {HOOK_IAT_CANDIDATE, "CreateRectRgnIndirect", (FARPROC)NULL, (FARPROC *)&pCreateRectRgnIndirect, (FARPROC)extCreateRectRgnIndirect}, //{HOOK_IAT_CANDIDATE, "CreatePolygonRgn", (FARPROC)NULL, (FARPROC *)&pCreatePolygonRgn, (FARPROC)extCreatePolygonRgn}, // same as emulated GDI ... {HOOK_IAT_CANDIDATE, "CreateCompatibleDC", (FARPROC)CreateCompatibleDC, (FARPROC *)&pGDICreateCompatibleDC, (FARPROC)extGDICreateCompatibleDC}, diff --git a/dll/gdiblt.cpp b/dll/gdiblt.cpp index 4775915..465bb3c 100644 --- a/dll/gdiblt.cpp +++ b/dll/gdiblt.cpp @@ -27,9 +27,15 @@ void BlitToWindow(HWND w, LPDIRECTDRAWSURFACE s) if(!s) return; // for surface color fill res=(*pGetDC)(s, &shdc); - if(res) OutTrace("ddraw GetDC error lpdds=%x res=%x(%s)\n", s, res, ExplainDDError(res)); + if(res) { + OutTrace("ddraw GetDC error lpdds=%x res=%x(%s)\n", s, res, ExplainDDError(res)); + return; + } thdc=(*pGDIGetDC)(w); - if(!thdc) OutTrace("GDI GetDC error=%d\n", GetLastError()); + if(!thdc) { + OutTrace("GDI GetDC error=%d\n", GetLastError()); + return; + } client = dxw.MapClientRect(NULL); if(dxw.dwFlags5 & CENTERTOWIN){ int x, y; diff --git a/host/TabDirect3D.cpp b/host/TabDirect3D.cpp index 2d5876e..cec156a 100644 --- a/host/TabDirect3D.cpp +++ b/host/TabDirect3D.cpp @@ -36,6 +36,7 @@ void CTabDirect3D::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_FORCESHEL, cTarget->m_ForcesHEL); DDX_Check(pDX, IDC_FIXREFCOUNTER, cTarget->m_FixRefCounter); DDX_Check(pDX, IDC_RETURNNULLREF, cTarget->m_ReturnNullRef); + DDX_Check(pDX, IDC_SETZBUFFERBITDEPTHS, cTarget->m_SetZBufferBitDepths); // Ddraw tweaks DDX_Check(pDX, IDC_NOSYSMEMPRIMARY, cTarget->m_NoSysMemPrimary); diff --git a/host/TabSysLibs.cpp b/host/TabSysLibs.cpp index 0b658ba..6e561a6 100644 --- a/host/TabSysLibs.cpp +++ b/host/TabSysLibs.cpp @@ -31,6 +31,7 @@ void CTabSysLibs::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_CLIENTREMAPPING, cTarget->m_ClientRemapping); DDX_Radio(pDX, IDC_GDINONE, cTarget->m_DCEmulationMode); DDX_Check(pDX, IDC_FIXTEXTOUT, cTarget->m_FixTextOut); + DDX_Check(pDX, IDC_SHAREDDC, cTarget->m_SharedDC); // OpenGL DDX_Check(pDX, IDC_HOOKOPENGL, cTarget->m_HookOpenGL); // duplicated diff --git a/host/TargetDlg.cpp b/host/TargetDlg.cpp index c2dca3f..9c71c72 100644 --- a/host/TargetDlg.cpp +++ b/host/TargetDlg.cpp @@ -56,6 +56,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_NoImagehlp = FALSE; m_ReplacePrivOps = FALSE; m_ForcesHEL = FALSE; + m_SetZBufferBitDepths = FALSE; m_ForcesSwapEffect = FALSE; m_ColorFix = FALSE; m_NoPixelFormat = FALSE; @@ -120,6 +121,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_CursorClipping = FALSE; m_VideoToSystemMem = FALSE; m_FixTextOut = FALSE; + m_SharedDC = TRUE; // seems better ..... m_HookGlide = FALSE; m_RemapMCI = TRUE; m_NoMovies = FALSE; diff --git a/host/TargetDlg.h b/host/TargetDlg.h index c0e3bd6..cb61681 100644 --- a/host/TargetDlg.h +++ b/host/TargetDlg.h @@ -88,6 +88,7 @@ public: BOOL m_CursorClipping; BOOL m_VideoToSystemMem; BOOL m_FixTextOut; + BOOL m_SharedDC; BOOL m_HookGlide; BOOL m_RemapMCI; BOOL m_NoMovies; @@ -181,6 +182,7 @@ public: BOOL m_DisableMaxWinMode; BOOL m_NoImagehlp; BOOL m_ForcesHEL; + BOOL m_SetZBufferBitDepths; BOOL m_ForcesSwapEffect; BOOL m_ColorFix; BOOL m_NoPixelFormat; diff --git a/host/dxwndhost.aps b/host/dxwndhost.aps index 9d095d4..851b00f 100644 Binary files a/host/dxwndhost.aps and b/host/dxwndhost.aps differ diff --git a/host/dxwndhost.rc b/host/dxwndhost.rc index 6df0913..766e752 100644 Binary files a/host/dxwndhost.rc and b/host/dxwndhost.rc differ diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index 16f5ebc..52635b6 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ diff --git a/host/dxwndhostView.cpp b/host/dxwndhostView.cpp index 8b70dd8..a3dce89 100644 --- a/host/dxwndhostView.cpp +++ b/host/dxwndhostView.cpp @@ -286,6 +286,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg) if(dlg->m_DisableMaxWinMode) t->flags6 |= DISABLEMAXWINMODE; if(dlg->m_NoImagehlp) t->flags5 |= NOIMAGEHLP; if(dlg->m_ForcesHEL) t->flags3 |= FORCESHEL; + if(dlg->m_SetZBufferBitDepths) t->flags6 |= SETZBUFFERBITDEPTHS; if(dlg->m_ForcesSwapEffect) t->flags6 |= FORCESWAPEFFECT; if(dlg->m_ColorFix) t->flags3 |= COLORFIX; if(dlg->m_NoPixelFormat) t->flags3 |= NOPIXELFORMAT; @@ -317,6 +318,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg) if(dlg->m_CursorClipping) t->flags |= CLIPCURSOR; if(dlg->m_VideoToSystemMem) t->flags |= SWITCHVIDEOMEMORY; if(dlg->m_FixTextOut) t->flags |= FIXTEXTOUT; + if(dlg->m_SharedDC) t->flags6 |= SHAREDDC; if(dlg->m_HookGlide) t->flags4 |= HOOKGLIDE; if(dlg->m_RemapMCI) t->flags5 |= REMAPMCI; if(dlg->m_NoMovies) t->flags6 |= NOMOVIES; @@ -498,6 +500,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg) dlg->m_DisableMaxWinMode = t->flags6 & DISABLEMAXWINMODE ? 1 : 0; dlg->m_NoImagehlp = t->flags5 & NOIMAGEHLP ? 1 : 0; dlg->m_ForcesHEL = t->flags3 & FORCESHEL ? 1 : 0; + dlg->m_SetZBufferBitDepths = t->flags6 & SETZBUFFERBITDEPTHS ? 1 : 0; dlg->m_ForcesSwapEffect = t->flags6 & FORCESWAPEFFECT ? 1 : 0; dlg->m_ColorFix = t->flags3 & COLORFIX ? 1 : 0; dlg->m_NoPixelFormat = t->flags3 & NOPIXELFORMAT ? 1 : 0; @@ -546,6 +549,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg) dlg->m_CursorClipping = t->flags & CLIPCURSOR ? 1 : 0; dlg->m_VideoToSystemMem = t->flags & SWITCHVIDEOMEMORY ? 1 : 0; dlg->m_FixTextOut = t->flags & FIXTEXTOUT ? 1 : 0; + dlg->m_SharedDC = t->flags6 & SHAREDDC ? 1 : 0; dlg->m_HookGlide = t->flags4 & HOOKGLIDE ? 1 : 0; dlg->m_RemapMCI = t->flags5 & REMAPMCI ? 1 : 0; dlg->m_NoMovies = t->flags6 & NOMOVIES ? 1 : 0; diff --git a/host/host.aps b/host/host.aps index b6d7830..b5dc05d 100644 Binary files a/host/host.aps and b/host/host.aps differ diff --git a/host/resource b/host/resource index 2a40ede..b362f05 100644 Binary files a/host/resource and b/host/resource differ