diff --git a/Debug/.gitattributes b/Debug/.gitattributes deleted file mode 100644 index b110a24..0000000 --- a/Debug/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.{dll,exe} filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/Debug/ddraw.dll b/Debug/ddraw.dll deleted file mode 100644 index a4a427a..0000000 --- a/Debug/ddraw.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:57380350f6215b3dadaf6f920ebbf18fd2ec95162c1722bafac6f8b949eb851b -size 458240 diff --git a/Debug/ddraw.ilk b/Debug/ddraw.ilk deleted file mode 100644 index 8641d7b..0000000 Binary files a/Debug/ddraw.ilk and /dev/null differ diff --git a/build/README.FIRST.txt b/build/README.FIRST.txt index 20adf03..0d90cb0 100644 --- a/build/README.FIRST.txt +++ b/build/README.FIRST.txt @@ -14,6 +14,11 @@ You can try these two simple steps: 1) Assign to DxWnd.exe administrator privileges (right-click on DxWnd.exe, Properties->Compatibility->check "run this program as administrator" or whatever is your locale translated interface). I always try to set this flag in the DxWnd distribution, but a simple file copy can clear the privilege. 2) Clear compatibility settings on the target program (again, "Properties"->"Compatibility"->uncheck all compatibility flags). Maybe you'd better use the dedicated DxWnd command ("Tools"->"Clear compatibility flags", apparently this one goes a little deeper and clears some possibly hidden flags). If you clear compatibility flags it is likely that the game will no longer run in fullscreen without DxWnd, so maybe you can perform the operation on a copy of the executable file. +============================================================================================== +Window size & position: + +Old DxWnd releases had a different setting for locking the window size and position. +If the game jumps in some unexpected position of the screen or changes its window size, head to the Video / Window size & position panel and try some option different from "Free". ============================================================================================== Flip emulation: diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 0c4260e..a6d21ec 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d7f4c6f63e720e5a4a2275522d0d414d00fba3b80e28751a6db8e1f0613483f0 +oid sha256:c17fbc2f441f7355d88a7b189dfbba0ab31f0295b6900c1343849006fcce9f68 size 706560 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index 3f9d7cc..0a79872 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -1356,7 +1356,7 @@ fix: cleaned up and unified capability handling in DirectDrawSurface GetCaps and add: warning message and update when running a program with non updated virtual registry settings.fix: LoadLibrary wrappers failed to clear the recursion flag, stopping the hook of new modules after a recursion case. add: warning messages when closing DxWnd and possibility to cancel the operation -v2.03.98 +v2.03.98/fx1 add: fine tuning for vsync options: three modes (default: game native, force on, force off) three algorythms (ddraw WaitForVerticalBlank, loop controlled by GetScanLine, loop controlled by time delay) add: fine tuning for WAIT options in ddraw Flip() and Blt() methods: three modes (default: game native, force on, force off) fix: better support for non windowed + no emulation mode, surfaces and blit operations are left (almost) in original state, surface capabilities are left inaltered @@ -1369,4 +1369,5 @@ fix: fixed logic to hook WindowProc routines for main window, childs and dialogs fix: more frequent updates of window coordinates to avoid scaling errors fix: fixed CreateDialogIndirectParam and CreateDialogParam wrappers to make inner windows properly scaled (fixes red Alert 2) fix: recovered DEFAULTMESSAGES option -fix: normalized output for ddraw GetScanLine() method \ No newline at end of file +fix: normalized output for ddraw GetScanLine() method +fix: fixed the policy for redrecting the WindowProc routine. Fixes "Ultimate Spiderman" clipping problems, and possibly much more diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index d9a679b..fcdbbe7 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -661,13 +661,20 @@ void HookWindowProc(HWND hwnd) // v2.03.22: don't remap WindowProc in case of special address 0xFFFFnnnn. // This makes "The Hulk demo" work avoiding WindowProc recursion and stack overflow - if (((DWORD)pWindowProc & 0xFFFF0000) == 0xFFFF0000){ - OutTraceDW("GetWindowLong: hwnd=%x WindowProc HOOK %x not updated\n", hwnd, pWindowProc); - return; - } + // v2.03.99.rc1: commented out, issue fixed by addition below! + //if (((DWORD)pWindowProc & 0xFFFF0000) == 0xFFFF0000){ + // OutTraceDW("GetWindowLong: hwnd=%x WindowProc HOOK %x not updated\n", hwnd, pWindowProc); + // return; + //} + // v2.03.99.rc1: always remap WindowProc, but push to call stack the previous value + // depending on whether the window was hooked already or not! long lres; - dxwws.PutProc(hwnd, pWindowProc); + if(lres=(long)dxwws.GetProc(hwnd)) + dxwws.PutProc(hwnd, (WNDPROC)lres); + else + dxwws.PutProc(hwnd, pWindowProc); + lres=(*pSetWindowLongA)(hwnd, GWL_WNDPROC, (LONG)extWindowProc); OutTraceDW("SetWindowLong: HOOK hwnd=%x WindowProc=%x->%x\n", hwnd, lres, (LONG)extWindowProc); } diff --git a/dll/dxhook.h b/dll/dxhook.h index 1b98896..807f0dc 100644 --- a/dll/dxhook.h +++ b/dll/dxhook.h @@ -48,6 +48,7 @@ extern FARPROC Remap_DInput_ProcAddress(LPCSTR, HMODULE); extern FARPROC Remap_DInput8_ProcAddress(LPCSTR, HMODULE); extern FARPROC Remap_ComCtl32_ProcAddress(LPCSTR, HMODULE); extern FARPROC Remap_ComDlg32_ProcAddress(LPCSTR, HMODULE); +extern FARPROC Remap_DSound_ProcAddress(LPCSTR, HMODULE); typedef enum { HOOK_IAT_CANDIDATE = 0, diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index c921ccc..0a14a98 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.98" +#define VERSION "2.03.98.fx1" #define DDTHREADLOCK 1 //#define LOCKTHREADS diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index bafda67..885bb2a 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 6d0007c..58b9456 100644 --- a/dll/gdi32.cpp +++ b/dll/gdi32.cpp @@ -969,7 +969,7 @@ HDC WINAPI extGDICreateCompatibleDC(HDC hdc) BOOL bSwitchedToMainWin = FALSE; OutTraceDW("GDI.CreateCompatibleDC: hdc=%x\n", hdc); - if(hdc==0){ + if(hdc==0 || (WindowFromDC(hdc)==0)) { // v2.03.99: Star Trek Armada hdc=(*pGDIGetDC)(dxw.GethWnd()); // potential DC leakage bSwitchedToMainWin = TRUE; OutTraceDW("GDI.CreateCompatibleDC: duplicating win HDC hWnd=%x\n", dxw.GethWnd()); @@ -1810,7 +1810,7 @@ int WINAPI extSetDIBits(HDC hdc, HBITMAP hbmp, UINT uStartScan, UINT cScanLines, OrigXDest=XDest; OrigYDest=YDest; dxw.MapClient(&XDest, &YDest, (int *)&dwWidth, (int *)&dwHeight); - OutTraceDW("SetDIBitsToDevice: fixed dest=(%d,%d)-(%dx%d)\n", XDest, YDest, dwWidth, dwHeight); + OutTraceDW("SetDIBits: fixed dest=(%d,%d)-(%dx%d)\n", XDest, YDest, dwWidth, dwHeight); if(!(hTempDc=CreateCompatibleDC(hdc))) OutTraceE("CreateCompatibleDC: ERROR err=%d at=%d\n", GetLastError(), __LINE__); // tricky part: CreateCompatibleBitmap is needed to set the dc size, but it has to be performed @@ -1821,7 +1821,7 @@ int WINAPI extSetDIBits(HDC hdc, HBITMAP hbmp, UINT uStartScan, UINT cScanLines, if(!SelectObject(hTempDc, hbmPic)) OutTraceE("SelectObject: ERROR err=%d at=%d\n", GetLastError(), __LINE__); if(!(*pSetDIBits)(hTempDc, hbmp, uStartScan, cScanLines, lpvBits, lpbmi, fuColorUse)) - OutTraceE("SetDIBitsToDevice: ERROR err=%d at=%d\n", GetLastError(), __LINE__); + OutTraceE("SetDIBits: ERROR err=%d at=%d\n", GetLastError(), __LINE__); // v2.02.94: set HALFTONE stretching. Fixes "Celtic Kings Rage of War" SetStretchBltMode(hdc,HALFTONE); if(!(ret=(*pGDIStretchBlt)(hdc, XDest, YDest, dwWidth, dwHeight, hTempDc, 0, 0, OrigWidth, OrigHeight, SRCCOPY))) @@ -1839,10 +1839,10 @@ int WINAPI extSetDIBits(HDC hdc, HBITMAP hbmp, UINT uStartScan, UINT cScanLines, int X, Y; X=XDest+dxw.VirtualOffsetX; Y=YDest+dxw.VirtualOffsetY; - OutTraceDW("SetDIBitsToDevice: virtual pos=(%d,%d)+(%d+%d)=(%d,%d)\n", + OutTraceDW("SetDIBits: virtual pos=(%d,%d)+(%d+%d)=(%d,%d)\n", XDest, YDest, dxw.VirtualOffsetX, dxw.VirtualOffsetY, X, Y); ret=(*pSetDIBits)(sdc.GetHdc(), hbmp, uStartScan, cScanLines, lpvBits, lpbmi, fuColorUse); - if(!ret || (ret==GDI_ERROR)) OutTraceE("SetDIBitsToDevice: ERROR ret=%x err=%d\n", ret, GetLastError()); + if(!ret || (ret==GDI_ERROR)) OutTraceE("SetDIBits: ERROR ret=%x err=%d\n", ret, GetLastError()); return ret; } #endif diff --git a/dll/kernel32.cpp b/dll/kernel32.cpp index a38ab62..a766c99 100644 --- a/dll/kernel32.cpp +++ b/dll/kernel32.cpp @@ -715,6 +715,9 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc) case SYSLIBIDX_COMDLG32: if (remap=Remap_ComDlg32_ProcAddress(proc, hModule)) return remap; break; + case SYSLIBIDX_DSOUND: + if (remap=Remap_DSound_ProcAddress(proc, hModule)) return remap; + break; default: break; } diff --git a/dll/shareddc.cpp b/dll/shareddc.cpp index aedede8..b9fd9e6 100644 --- a/dll/shareddc.cpp +++ b/dll/shareddc.cpp @@ -40,7 +40,7 @@ dxwSDC::dxwSDC() dxwSDC::~dxwSDC() { - OutTraceB("dxwSDC::~dxwSDC: Destroy\n"); + //OutTraceB("dxwSDC::~dxwSDC: Destroy\n"); } /*---------------------------------------------------------------------------------+ @@ -351,9 +351,9 @@ void dxwSDC::copyDcAttributes(HDC destDC, HDC origDc, POINT origin) SetTextCharacterExtra(destDC, GetTextCharacterExtra(origDc)); SetTextColor(destDC, GetTextColor(origDc)); - OutTraceB("copyDcAttributes: orig=(%d,%d)\n", origin.x, origin.y); + OutTraceB("dxwSDC::copyDcAttributes: orig=(%d,%d)\n", origin.x, origin.y); if(!(*pSetWindowOrgEx)(destDC, -origin.x, -origin.y, NULL)) - OutTraceE("copyDcAttributes: SetWindowOrgEx ERROR orig=(%d,%d) err=%d\n", origin.x, origin.y, GetLastError()); + OutTraceE("dxwSDC::copyDcAttributes: SetWindowOrgEx ERROR orig=(%d,%d) err=%d\n", origin.x, origin.y, GetLastError()); POINT brushOrg = {}; GetBrushOrgEx(origDc, &brushOrg);