diff --git a/build/dxwnd.dll b/build/dxwnd.dll index e62a750..87b679e 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f65fdf8a92233341e1a78afe42eaa72c8a3c220b535f22367285bc7d206c01b +oid sha256:9c8410eab8068ad4e1b67b255732d31c5638723a78b14f0ff2ace2da0b7cab6a size 765952 diff --git a/build/dxwnd.ini b/build/dxwnd.ini deleted file mode 100644 index 3e1e19c..0000000 --- a/build/dxwnd.ini +++ /dev/null @@ -1,254 +0,0 @@ -[window] -exepath=F:\Games\Garfield\ -posx=1260 -posy=514 -sizx=320 -sizy=200 -exportpath=D:\DxWnd.develop\v2_04_01_fx4_src\build\ -debug=1 -autohide=0 -checkadmin=0 -namefromfolder=0 -multiprocesshook=0 -warnonexit=0 -updatepaths=1 -defaultcoord=0 -defaultposx=50 -defaultposy=50 -defaultsizx=800 -defaultsizy=600 -[target] -title0=Garfield - Caught in the Act -path0=F:\Games\Garfield\GARFIELD.NOSHIM.EXE -startfolder0= -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -monitorid0=-1 -coord0=0 -flag0=673185826 -flagg0=1208221696 -flagh0=65556 -flagi0=138412036 -flagj0=4226 -flagk0=327680 -flagl0=8421376 -flagm0=0 -tflag0=-2147477245 -dflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=0 -swapeffect0=0 -maxddinterface0=7 -slowratio0=2 -scanline0=0 -initresw0=320 -initresh0=224 -title1=Titanic -path1=F:\Games\Titanic\TI.noshim.EXE -startfolder1= -launchpath1= -module1= -opengllib1= -notes1= -registry1= -ver1=0 -monitorid1=-1 -coord1=2 -flag1=-1474297814 -flagg1=1745879088 -flagh1=540692 -flagi1=138444804 -flagj1=4224 -flagk1=67584 -flagl1=269484032 -flagm1=9216 -tflag1=0 -dflag1=0 -posx1=50 -posy1=50 -sizx1=800 -sizy1=600 -maxfps1=0 -initts1=0 -winver1=0 -maxres1=-1 -swapeffect1=0 -maxddinterface1=7 -slowratio1=2 -scanline1=0 -initresw1=800 -initresh1=600 -title2=OBSCURA.EXE -module2= -opengllib2= -monitorid2=-1 -dflag2=0 -scanline2=0 -initresw2=800 -initresh2=600 -path2=D:\Games\Obscura - The Shadow Blade\OBSCURA.EXE -startfolder2= -launchpath2= -notes2= -registry2= -ver2=0 -coord2=0 -flag2=673185826 -flagg2=1207959552 -flagh2=4 -flagi2=138412036 -flagj2=4226 -flagk2=65536 -flagl2=0 -flagm2=0 -tflag2=0 -posx2=50 -posy2=50 -sizx2=800 -sizy2=600 -maxfps2=0 -initts2=0 -winver2=0 -maxres2=0 -swapeffect2=0 -maxddinterface2=7 -slowratio2=2 -title3=NASCAR 2000.exe -path3=F:\Games\Nascar 2000\NASCAR 2000.exe -startfolder3= -launchpath3= -module3= -opengllib3= -notes3= -registry3= -ver3=0 -monitorid3=-1 -coord3=0 -flag3=673185826 -flagg3=1207959552 -flagh3=20 -flagi3=138412036 -flagj3=4224 -flagk3=67584 -flagl3=268435456 -flagm3=0 -tflag3=-2147477241 -dflag3=0 -posx3=50 -posy3=50 -sizx3=800 -sizy3=600 -maxfps3=0 -initts3=0 -winver3=0 -maxres3=0 -swapeffect3=0 -maxddinterface3=7 -slowratio3=2 -scanline3=0 -initresw3=800 -initresh3=600 -title4=Spearhead -path4=D:\Games\Spearhead\Spearhead.exe -startfolder4= -launchpath4= -module4= -opengllib4= -notes4= -registry4= -ver4=0 -monitorid4=-1 -coord4=0 -flag4=744488994 -flagg4=1207959680 -flagh4=8212 -flagi4=138412036 -flagj4=268440704 -flagk4=1114112 -flagl4=32784 -flagm4=64 -tflag4=-2147477245 -dflag4=0 -posx4=50 -posy4=50 -sizx4=800 -sizy4=600 -maxfps4=0 -initts4=0 -winver4=0 -maxres4=0 -swapeffect4=0 -maxddinterface4=7 -slowratio4=2 -scanline4=0 -initresw4=640 -initresh4=480 -title5=WINDOOM.EXE -path5=F:\Games\WinDOOM build 001\WINDOOM.EXE -startfolder5= -launchpath5= -module5= -opengllib5= -notes5= -registry5= -ver5=0 -monitorid5=-1 -coord5=0 -flag5=673185826 -flagg5=1207959552 -flagh5=4 -flagi5=138412036 -flagj5=4224 -flagk5=65536 -flagl5=0 -flagm5=8192 -tflag5=0 -dflag5=0 -posx5=50 -posy5=50 -sizx5=800 -sizy5=600 -maxfps5=0 -initts5=0 -winver5=0 -maxres5=0 -swapeffect5=0 -maxddinterface5=7 -slowratio5=2 -scanline5=0 -initresw5=800 -initresh5=600 -[texture] -MinTexX=0 -MinTexY=0 -MaxTexX=0 -MaxTexY=0 -[keymapping] -timetoggle= -timefast= -timeslow= -altf4= -cliptoggle= -refresh= -logtoggle= -plogtoggle= -fpstoggle= -printscreen= -corner= -freezetime= -fullscreen= -workarea= -desktop= -minimize= -restore= -kill= diff --git a/build/dxwnd.log b/build/dxwnd.log index 1bc8dd7..e0249d6 100644 --- a/build/dxwnd.log +++ b/build/dxwnd.log @@ -1,117 +1,20 @@ -OnRun idx=1 prog="F:\Games\Titanic\TI.noshim.EXE" -self elevation -debugger mode -create process: path="F:\Games\Titanic" -create process: base=0x400000 path="F:\Games\Titanic\TI.noshim.EXE" -create thread: th=0xD0 base=0x3A4000 start=0x76828500 -load dll: base=0x774F0000 path="C:\Windows\SysWOW64\ntdll.dll" -unload dll: base=0x5F0000 -load dll: base=0x76800000 path="C:\Windows\SysWOW64\kernel32.dll" -unload dll: base=0x76800000 -unload dll: base=0x5F0000 -unload dll: base=0x5F0000 -load dll: base=0x76800000 path="C:\Windows\SysWOW64\kernel32.dll" -load dll: base=0x76A40000 path="C:\Windows\SysWOW64\KernelBase.dll" -load dll: base=0x6AE60000 path="C:\Windows\SysWOW64\apphelp.dll" -load dll: base=0x76080000 path="C:\Windows\SysWOW64\user32.dll" -load dll: base=0x76440000 path="C:\Windows\SysWOW64\win32u.dll" -create thread: th=0xD0 base=0x3A7000 start=0x775267C0 -load dll: base=0x77150000 path="C:\Windows\SysWOW64\gdi32.dll" -load dll: base=0x76CF0000 path="C:\Windows\SysWOW64\gdi32full.dll" -create thread: th=0xD0 base=0x3AA000 start=0x775267C0 -load dll: base=0x74060000 path="C:\Windows\SysWOW64\comdlg32.dll" -create thread: th=0xD0 base=0x3AD000 start=0x775267C0 -load dll: base=0x761E0000 path="C:\Windows\SysWOW64\msvcrt.dll" -load dll: base=0x76460000 path="C:\Windows\SysWOW64\combase.dll" -load dll: base=0x76C10000 path="C:\Windows\SysWOW64\ucrtbase.dll" -load dll: base=0x77330000 path="C:\Windows\SysWOW64\rpcrt4.dll" -load dll: base=0x73FB0000 path="C:\Windows\SysWOW64\sspicli.dll" -load dll: base=0x73FA0000 path="C:\Windows\SysWOW64\cryptbase.dll" -load dll: base=0x73FD0000 path="C:\Windows\SysWOW64\bcryptprimitives.dll" -load dll: base=0x769E0000 path="C:\Windows\SysWOW64\sechost.dll" -load dll: base=0x77460000 path="C:\Windows\SysWOW64\SHCore.dll" -load dll: base=0x76E50000 path="C:\Windows\SysWOW64\shlwapi.dll" -load dll: base=0x741D0000 path="C:\Windows\SysWOW64\shell32.dll" -load dll: base=0x725E0000 path="C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.14393.447_none_5507ded2cb4f7f4c\comctl32.dll" -load dll: base=0x76400000 path="C:\Windows\SysWOW64\cfgmgr32.dll" -load dll: base=0x762B0000 path="C:\Windows\SysWOW64\advapi32.dll" -load dll: base=0x755B0000 path="C:\Windows\SysWOW64\windows.storage.dll" -load dll: base=0x75FA0000 path="C:\Windows\SysWOW64\powrprof.dll" -load dll: base=0x76BF0000 path="C:\Windows\SysWOW64\kernel.appcore.dll" -load dll: base=0x762A0000 path="C:\Windows\SysWOW64\profapi.dll" -load dll: base=0x72750000 path="C:\Windows\SysWOW64\winmm.dll" -load dll: base=0x72720000 path="C:\Windows\SysWOW64\winmmbase.dll" -load dll: base=0x1D0000 path="C:\Windows\SysWOW64\winmmbase.dll" -load dll: base=0x630000 path="C:\Windows\SysWOW64\winmmbase.dll" -unload dll: base=0x1D0000 -unload dll: base=0x630000 -exception: code=0x80000003(Breakpoint) addr=0x7759748C first=1 -load dll: base=0x74030000 path="C:\Windows\SysWOW64\imm32.dll" -load dll: base=0x10000000 path="D:\DxWnd.develop\v2_04_01_fx4_src\build\dxwnd.dll" -load dll: base=0x5F290000 path="C:\Windows\SysWOW64\ddraw.dll" -load dll: base=0x61910000 path="C:\Windows\SysWOW64\dciman32.dll" -unload dll: base=0x61910000 -unload dll: base=0x5F290000 -exit thread: exitcode=0x10000000 -load dll: base=0x57B40000 path="C:\Windows\SysWOW64\dinput.dll" -load dll: base=0x5D4B0000 path="C:\Windows\SysWOW64\hid.dll" -load dll: base=0x75B20000 path="C:\Windows\SysWOW64\setupapi.dll" -load dll: base=0x686E0000 path="C:\Windows\SysWOW64\devobj.dll" -load dll: base=0x77180000 path="C:\Windows\SysWOW64\wintrust.dll" -load dll: base=0x76350000 path="C:\Windows\SysWOW64\msasn1.dll" -load dll: base=0x76680000 path="C:\Windows\SysWOW64\crypt32.dll" -create thread: th=0xB4 base=0x3B0000 start=0x7272EF70 -output debug: len=22 unicode=0 -output debug: len=56 unicode=0 -output debug: len=22 unicode=0 -output debug: len=56 unicode=0 -output debug: len=22 unicode=0 -output debug: len=56 unicode=0 -output debug: len=22 unicode=0 -output debug: len=56 unicode=0 -output debug: len=22 unicode=0 -output debug: len=56 unicode=0 -load dll: base=0x6AB70000 path="C:\Windows\SysWOW64\uxtheme.dll" -load dll: base=0x77010000 path="C:\Windows\SysWOW64\msctf.dll" -load dll: base=0x77230000 path="C:\Windows\SysWOW64\oleaut32.dll" -load dll: base=0x74150000 path="C:\Windows\SysWOW64\msvcp_win.dll" -load dll: base=0x44BD0000 path="C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\spyxxhk.dll" -load dll: base=0x704E0000 path="C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_5090cb78bcba4a35\msvcr90.dll" -load dll: base=0x718F0000 path="C:\Windows\SysWOW64\dwmapi.dll" -load dll: base=0x685A0000 path="C:\Windows\SysWOW64\MMDevAPI.dll" -load dll: base=0x689E0000 path="C:\Windows\SysWOW64\propsys.dll" -load dll: base=0x5CAD0000 path="C:\Windows\SysWOW64\wdmaud.drv" -load dll: base=0x73370000 path="C:\Windows\SysWOW64\avrt.dll" -load dll: base=0x671D0000 path="C:\Windows\SysWOW64\ksuser.dll" -load dll: base=0x65240000 path="C:\Windows\SysWOW64\AudioSes.dll" -load dll: base=0x66550000 path="C:\Windows\SysWOW64\WinTypes.dll" -load dll: base=0x5D4D0000 path="C:\Windows\SysWOW64\msacm32.drv" -load dll: base=0x727C0000 path="C:\Windows\SysWOW64\msacm32.dll" -load dll: base=0x5D4C0000 path="C:\Windows\SysWOW64\midimap.dll" -load dll: base=0x728C0000 path="C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.14393.447_none_89c64d28dafea4b9\comctl32.dll" -create thread: th=0x2D0 base=0x3B3000 start=0x5CADA060 -load dll: base=0x3B70000 path="C:\Windows\SysWOW64\clbcatq.dll" -create thread: th=0xD8 base=0x3B6000 start=0x775267C0 -create thread: th=0x2D0 base=0x3B9000 start=0x775267C0 -create thread: th=0x2D0 base=0x3BC000 start=0x775267C0 -create thread: th=0x2D0 base=0x3BF000 start=0x775267C0 -exit thread: exitcode=0x0 -exit thread: exitcode=0x0 -exit thread: exitcode=0x0 -exit thread: exitcode=0x0 -exit thread: exitcode=0x0 -exit thread: exitcode=0x0 -exit thread: exitcode=0x0 -exit thread: exitcode=0x0 -exit thread: exitcode=0x0 -exit process -OnRun idx=0 prog="F:\Games\Garfield\GARFIELD.NOSHIM.EXE" +OnRun idx=6 prog="D:\Games\Tomb Raider III\tomb3.exe" +setwindowshook mode +OnRun idx=4 prog="D:\Games\Spearhead\Spearhead.exe" injectsuspended mode -InjectSuspended: exe=F:\Games\Garfield\GARFIELD.NOSHIM.EXE dir=F:\Games\Garfield -Target handle=2d0 -NT Header offset=100 -AddressOfEntryPoint=10000 ImageBase=400000 -Thread start address=410000 -wait cycle 0 eip=77560970 -wait cycle 1 eip=77560970 -wait cycle 2 eip=410000 +InjectSuspended: exe=D:\Games\Spearhead\Spearhead.exe dir=D:\Games\Spearhead +Target handle=7ac +NT Header offset=80 +AddressOfEntryPoint=1AA380 ImageBase=400000 +Thread start address=5aa380 +wait cycle 0 eip=5aa380 +OnRun idx=4 prog="D:\Games\Spearhead\Spearhead.exe" +injectsuspended mode +InjectSuspended: exe=D:\Games\Spearhead\Spearhead.exe dir=D:\Games\Spearhead +Target handle=768 +NT Header offset=80 +AddressOfEntryPoint=1AA380 ImageBase=400000 +Thread start address=5aa380 +wait cycle 0 eip=5aa380 +OnRun idx=3 prog="F:\Games\Nascar 2000\NASCAR 2000.exe" +setwindowshook mode diff --git a/build/exports/Tomb Raider III (HW acceleration).dxw b/build/exports/Tomb Raider III (HW acceleration).dxw index 28de0c8..bd5fbc1 100644 --- a/build/exports/Tomb Raider III (HW acceleration).dxw +++ b/build/exports/Tomb Raider III (HW acceleration).dxw @@ -5,10 +5,10 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=134217760 +flag0=134217762 flagg0=1241513984 flagh0=25165844 -flagi0=0 +flagi0=4194304 tflag0=0 initx0=0 inity0=0 @@ -22,5 +22,23 @@ sizx0=800 sizy0=600 maxfps0=0 initts0=0 +startfolder0= +launchpath0= +notes0= +registry0= +monitorid0=0 +flagj0=128 +flagk0=65536 +flagl0=0 +flagm0=0 +dflag0=0 +winver0=0 +maxres0=0 +swapeffect0=0 +maxddinterface0=7 +slowratio0=1 +scanline0=1 +initresw0=0 +initresh0=0 -; remember to set HW accelerated mode and turn ZBUFFER option off in game setup panel \ No newline at end of file +; remember to set HW accelerated mode and turn ZBUFFER option off in game setup panel diff --git a/build/exports/dxwnd.log b/build/exports/dxwnd.log index af4a6d5..0bc5ed2 100644 --- a/build/exports/dxwnd.log +++ b/build/exports/dxwnd.log @@ -1,12 +1,4 @@ -OnRun idx=23 prog="D:\Games\Crimson_Skies\crimson.exe" +OnRun idx=6 prog="D:\Games\Tomb Raider III\tomb3.exe" setwindowshook mode -OnRun idx=23 prog="D:\Games\Crimson_Skies\crimson.exe" +OnRun idx=6 prog="D:\Games\Tomb Raider III\tomb3.exe" setwindowshook mode -OnRun idx=23 prog="D:\Games\Crimson_Skies\crimson.exe" -injectsuspended mode -InjectSuspended: exe=D:\Games\Crimson_Skies\crimson.exe dir=D:\Games\Crimson_Skies -Target handle=844 -NT Header offset=F8 -AddressOfEntryPoint=1F7056 ImageBase=400000 -Thread start address=5f7056 -wait cycle 0 eip=5f7056 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index 0ff3394..4739ca7 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -1393,7 +1393,7 @@ fix: bug in Hybrid and GDI ddraw surface rendering fix: missing "No HAL Device" flag default to disabled fix: improvements in texture handling, dds format support for DirectDraw textures -v2.04.01/fx4 +v2.04.01/fx6 add: preliminary WinG32 handling add: minimal WinG32 replacement, thank to Wine source code add: DirectX(2)/"Create a Desktop Win" option. Fixes "Man TT Super Bike" @@ -1407,3 +1407,6 @@ fix: SetWindowLong hooker: eliminated a unassigned variable condition fix: added hooker for GDI32/SetROP2 call to insert a InvalidateRect as in older OS. Makes "Titanic" working. fix: added hooker for Smack32/SmackSetSystemRes call to prevent resolution change and set proper virtual screen size: see "Spearhead" fix: fixed virtual screen size initialization so that it doesn't override settings defined before first window creation: see "Spearhead" +fix: fixed error condition when DirectDraw::GetCaps is invoked with wrong length - fix "Spearhead" bug +fix?: ZBUFFER original capabilities passed to new surface created by QueryInterface - so far, useless +fix: bug causing crash when using fast bilinear filtering 2X diff --git a/dll/ddraw.cpp b/dll/ddraw.cpp index 63efef2..73d5ad2 100644 --- a/dll/ddraw.cpp +++ b/dll/ddraw.cpp @@ -30,7 +30,7 @@ static void NullMethodPointer(char *s) extern BOOL IsChangeDisplaySettingsHotPatched; extern void TextureHandling(LPDIRECTDRAWSURFACE, int); -extern void SetMinimalCaps(LPDDCAPS, LPDDCAPS); +extern void SetMinimalCaps(int, LPDDCAPS, LPDDCAPS); ColorConversion_Type pColorConversion = NULL; HDC hFlippedDC = NULL; @@ -1648,7 +1648,7 @@ static HRESULT WINAPI extGetCapsD(int dxversion, GetCapsD_Type pGetCapsD, LPDIRE HandleCapsD("D-HW(NoHAL)", c1); } - if((dxw.dwFlags3 & MINIMALCAPS)) SetMinimalCaps(c1, c2); + if((dxw.dwFlags3 & MINIMALCAPS)) SetMinimalCaps(dxversion, c1, c2); if(dxw.dwFlags3 & CAPMASK) MaskCapsD(c1, c2); @@ -2178,6 +2178,11 @@ static HRESULT WINAPI extQueryInterfaceS(int dxversion, QueryInterface_Type pQue // v2.02.13: seems that hooking inconditionally gives troubles. What is the proper safe hook condition? HookDDSurface((LPDIRECTDRAWSURFACE *)obp, dxw.dwDDVersion, FALSE); } + DWORD dwCaps; + if (dwCaps = dxwcdb.GetCaps((LPDIRECTDRAWSURFACE)lpdds)) { + OutTrace("QueryInterface(S): PASS caps=%x lpdds=%x->%x\n", dwCaps, lpdds, *obp); + dxwcdb.PushCaps(*(LPDIRECTDRAWSURFACE *)obp,dwCaps); + } break; } } @@ -3117,6 +3122,7 @@ HRESULT WINAPI ColorConversionEmulated(int dxversion, LPDIRECTDRAWSURFACE lpdds, { HRESULT res; Blt_Type pBlt; + RECT srcrect, destrect; switch(dxversion){ case 1: pBlt=pBlt1; break; case 2: pBlt=pBlt2; break; @@ -3124,11 +3130,15 @@ HRESULT WINAPI ColorConversionEmulated(int dxversion, LPDIRECTDRAWSURFACE lpdds, case 4: pBlt=pBlt4; break; case 7: pBlt=pBlt7; break; } - res=(*pEmuBlt)(dxversion, pBlt, lpDDSEmu_Back, &emurect, lpdds, &emurect, DDBLT_WAIT, 0); + // v2.04.01.fx6: copy emurect since pEmuBlt will alter values! + srcrect=destrect=emurect; + res=(*pEmuBlt)(dxversion, pBlt, lpDDSEmu_Back, &destrect, lpdds, &srcrect, DDBLT_WAIT, 0); if(res==DDERR_SURFACEBUSY){ (*pUnlockMethod(dxversion))(lpdds, NULL); (*pUnlockMethod(dxversion))(lpDDSEmu_Back, NULL); - res=(*pEmuBlt)(dxversion, pBlt, lpDDSEmu_Back, &emurect, lpdds, &emurect, DDBLT_WAIT, 0); + //srcrect=destrect=emurect; + //res=(*pEmuBlt)(dxversion, pBlt, lpDDSEmu_Back, &destrect, lpdds, &srcrect, DDBLT_WAIT, 0); + res=DD_OK; } if(res) { BlitError(res, &emurect, &emurect, __LINE__); @@ -4802,7 +4812,7 @@ static HRESULT WINAPI extAddAttachedSurface(AddAttachedSurface_Type pAddAttached // is set in the game "Options" menu. if (sd.ddsCaps.dwCaps & DDSCAPS_ZBUFFER) // DDSCAPS_BACKBUFFER for double buffering ??? if ((dxw.dwFlags1 & EMULATESURFACE) && (res==DDERR_CANNOTATTACHSURFACE)){ - OutTraceDW("AddAttachedSurface: emulating ZBUFFER attach on BACKBUFFER\n"); + OutTraceDW("AddAttachedSurface: emulating ZBUFFER attach on %s surface\n", IsBack ? "BACKBUFFER" : "PLAIN"); if (pAddRefS) (*pAddRefS)(lpdds); res=DD_OK; } @@ -4888,35 +4898,38 @@ static HRESULT WINAPI extGetCapsS(int dxInterface, GetCapsS_Type pGetCapsS, LPDI if(!(dxw.IsEmulated || dxw.Windowize)) return res; - if (IsPrim) { - IsFixed=TRUE; - caps->dwCaps |= DDSD_Prim.ddsCaps.dwCaps; - caps->dwCaps |= DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_FRONTBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_VISIBLE; // primary surfaces must be this way - caps->dwCaps &= ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); // primary surfaces can't be this way - if(caps->dwCaps & DDSCAPS_3DDEVICE) caps->dwCaps |= DDSCAPS_LOCALVIDMEM; - } - - if (IsBack) { - IsFixed=TRUE; - // v2.03.11: added DDSCAPS_FLIP capability to backbuffer surface: "Ignition" checks for it before Flip-ping to primary - caps->dwCaps |= (DDSCAPS_BACKBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_FLIP|DDSCAPS_LOCALVIDMEM); // you never know.... - caps->dwCaps &= ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); // backbuffer surfaces can't be this way - if(caps->dwCaps & DDSCAPS_3DDEVICE) caps->dwCaps |= DDSCAPS_LOCALVIDMEM; - //if(caps->dwCaps & DDSCAPS_3DDEVICE) caps->dwCaps |= (DDSCAPS_LOCALVIDMEM | DDSCAPS_COMPLEX); - } - - // v2.03.82: fixed logic for ZBUFFER capabilities: "The Creed" may have two, in SYSTEMMEMORY or in VIDEOMEMORY ... - // v2.03.90: "Galapagos" fix - if there's a DDSCAPS_SYSTEMMEMORY or DDSCAPS_VIDEOMEMORY spec, let it be. - // v2.03.97: "Galapagos" fix erased. - if (IsZBuf) { - DWORD dwCaps = dxwcdb.GetCaps(lpdds); - // beware! the ZBUFFER surface could have never been registered! - // in this case better keep the original capabilities (or adapt to the primary/backbuffer ones?) - if(dwCaps) { + while(TRUE){ // fake loop + if (IsPrim) { IsFixed=TRUE; - sLabel="(REG.ZBUFFER)"; - caps->dwCaps = dwCaps; + caps->dwCaps |= DDSD_Prim.ddsCaps.dwCaps; + caps->dwCaps |= DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_FRONTBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_VISIBLE; // primary surfaces must be this way + caps->dwCaps &= ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); // primary surfaces can't be this way + if(caps->dwCaps & DDSCAPS_3DDEVICE) caps->dwCaps |= DDSCAPS_LOCALVIDMEM; } + + if (IsBack) { + IsFixed=TRUE; + // v2.03.11: added DDSCAPS_FLIP capability to backbuffer surface: "Ignition" checks for it before Flip-ping to primary + caps->dwCaps |= (DDSCAPS_BACKBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_FLIP|DDSCAPS_LOCALVIDMEM); // you never know.... + caps->dwCaps &= ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); // backbuffer surfaces can't be this way + if(caps->dwCaps & DDSCAPS_3DDEVICE) caps->dwCaps |= DDSCAPS_LOCALVIDMEM; + //if(caps->dwCaps & DDSCAPS_3DDEVICE) caps->dwCaps |= (DDSCAPS_LOCALVIDMEM | DDSCAPS_COMPLEX); + } + + // v2.03.82: fixed logic for ZBUFFER capabilities: "The Creed" may have two, in SYSTEMMEMORY or in VIDEOMEMORY ... + // v2.03.90: "Galapagos" fix - if there's a DDSCAPS_SYSTEMMEMORY or DDSCAPS_VIDEOMEMORY spec, let it be. + // v2.03.97: "Galapagos" fix erased. + if (IsZBuf) { + DWORD dwCaps = dxwcdb.GetCaps(lpdds); + // beware! the ZBUFFER surface could have never been registered! + // in this case better keep the original capabilities (or adapt to the primary/backbuffer ones?) + if(dwCaps) { + IsFixed=TRUE; + sLabel="(REG.ZBUFFER)"; + caps->dwCaps = dwCaps; + } + } + break; // inconditional break; } if(IsFixed) OutTraceDW("GetCaps(S%d): lpdds=%x FIXED %s caps=%x(%s)\n", dxInterface, lpdds, sLabel, caps->dwCaps, ExplainDDSCaps(caps->dwCaps)); @@ -4978,34 +4991,41 @@ static HRESULT WINAPI extGetSurfaceDesc(int dxversion, GetSurfaceDesc_Type pGetS if(!(dxw.IsEmulated || dxw.Windowize)) return res; - if (IsPrim) { - IsFixed=TRUE; - if (dxw.dwFlags1 & EMULATESURFACE) lpddsd->ddpfPixelFormat = dxw.VirtualPixelFormat; - lpddsd->ddsCaps.dwCaps |= DDSD_Prim.ddsCaps.dwCaps; - lpddsd->ddsCaps.dwCaps |= (DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_FRONTBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_VISIBLE); // primary surfaces must be this way - lpddsd->ddsCaps.dwCaps &= ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); // primary surfaces can't be this way - if(lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) lpddsd->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM; - lpddsd->dwBackBufferCount=DDSD_Prim.dwBackBufferCount; - lpddsd->dwHeight=dxw.GetScreenHeight(); - lpddsd->dwWidth=dxw.GetScreenWidth(); - } - - if (IsBack) { - IsFixed=TRUE; - // flags that backbuffer surfaces must have set - lpddsd->ddsCaps.dwCaps |= (DDSCAPS_BACKBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_FLIP|DDSCAPS_LOCALVIDMEM);; - lpddsd->ddsCaps.dwCaps &= ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); // backbuffer surfaces can't be this way - if(lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) lpddsd->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM; - } - - // v2.03.82: fixed logic for ZBUFFER capabilities: "The Creed" may have two, in SYSTEMMEMORY or in VIDEOMEMORY ... - if(IsZBuf) { - DWORD dwCaps = dxwcdb.GetCaps(lpdds); - if(dwCaps) { + while(TRUE){ // fake loop + if (IsPrim) { IsFixed=TRUE; - sLabel="(REG.ZBUFFER)"; - lpddsd->ddsCaps.dwCaps = dwCaps; + if (dxw.dwFlags1 & EMULATESURFACE) lpddsd->ddpfPixelFormat = dxw.VirtualPixelFormat; + lpddsd->ddsCaps.dwCaps |= DDSD_Prim.ddsCaps.dwCaps; + lpddsd->ddsCaps.dwCaps |= (DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_FRONTBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_VISIBLE); // primary surfaces must be this way + lpddsd->ddsCaps.dwCaps &= ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); // primary surfaces can't be this way + if(lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) lpddsd->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM; + lpddsd->dwBackBufferCount=DDSD_Prim.dwBackBufferCount; + lpddsd->dwHeight=dxw.GetScreenHeight(); + lpddsd->dwWidth=dxw.GetScreenWidth(); + break; } + + if (IsBack) { + IsFixed=TRUE; + // flags that backbuffer surfaces must have set + lpddsd->ddsCaps.dwCaps |= (DDSCAPS_BACKBUFFER|DDSCAPS_VIDEOMEMORY|DDSCAPS_FLIP|DDSCAPS_LOCALVIDMEM);; + lpddsd->ddsCaps.dwCaps &= ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN); // backbuffer surfaces can't be this way + if(lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) lpddsd->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM; + break; + } + + // v2.03.82: fixed logic for ZBUFFER capabilities: "The Creed" may have two, in SYSTEMMEMORY or in VIDEOMEMORY ... + if(IsZBuf) { + DWORD dwCaps = dxwcdb.GetCaps(lpdds); + if(dwCaps) { + IsFixed=TRUE; + sLabel="(REG.ZBUFFER)"; + lpddsd->ddsCaps.dwCaps = dwCaps; + } + break; + } + + break; // inconditional break } if(IsFixed){ diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index 84d696c..40c91a0 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.04.01.fx4" +#define VERSION "2.04.01.fx6" #define DDTHREADLOCK 1 diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index 388f1c6..a75a098 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/mincaps.cpp b/dll/mincaps.cpp index d3c6060..f865979 100644 --- a/dll/mincaps.cpp +++ b/dll/mincaps.cpp @@ -79,8 +79,27 @@ typedef struct _DDCAPS_DX7 typedef DDCAPS_DX7 FAR* LPDDCAPS_DX7; #endif -void SetMinimalCaps(LPDDCAPS c1, LPDDCAPS c2) +void SetMinimalCaps(int dxversion, LPDDCAPS c1, LPDDCAPS c2) { + DWORD dwMaxSize; + switch(dxversion){ + case 1: + case 2: + case 3: + dwMaxSize=sizeof(DDCAPS_DX3); + break; + case 4: + case 5: + dwMaxSize=sizeof(DDCAPS_DX5); + break; + case 6: + dwMaxSize=sizeof(DDCAPS_DX6); + break; + case 7: + dwMaxSize=sizeof(DDCAPS_DX7); + break; + } + #ifdef VIRTUAL_CAPS_VMWARE if(c1){ int dwSize = c1->dwSize; @@ -198,6 +217,7 @@ CapsDump(c2:SW)= */ if(c1){ DWORD dwSize = c1->dwSize; + if(dwSize > dwMaxSize) dwSize = dwMaxSize; DWORD dwVidMemTotal = c1->dwVidMemTotal; DWORD dwVidMemFree = c1->dwVidMemFree; memset((void *)c1, 0, dwSize); @@ -219,7 +239,8 @@ CapsDump(c2:SW)= } } if(c2){ - int dwSize = c2->dwSize; + DWORD dwSize = c2->dwSize; + if(dwSize > dwMaxSize) dwSize = dwMaxSize; DWORD dwVidMemTotal = c2->dwVidMemTotal; DWORD dwVidMemFree = c2->dwVidMemFree; memset((void *)c2, 0, dwSize);