(DirectDraw) Programmatically disable the 8- and 16-bit compatibility shim #33
Labels
Vintage
Only necessary to keep the game working on the old Windows 9x systems that it originally targeted.
~≤0.33 pushes
Projected number of pushes needed. Might turn out to get more expensive!
While #3 implemented a proper 32-bit mode, DirectDraw's
DWM8And16BitMitigation
might still be active from running a previous version of a Shuusou Gyoku binary from the same path. This mitigation provides the emulated 8- and 16-bit modes even on modern Windows systems that don't support them, and are what causes the infamous slowdown in the first place. Ideally, we would remove this mitigation programmatically and not even offer players the option to select an actually unsupported, emulated video mode.Doing that is not trivial hough:
HKEY_LOCAL_MACHINE
, in addition toHKEY_CURRENT_USER
.DWM8And16Bit_IsShimApplied_CallOut()
fromapphelp.dll
. This DLL is loaded into the game process at startup, and the flag read by the above function call is set on its DLL entry point, before any of our code gets to run.That only leaves IAT patching as the most reliable method to override this flag, which is also what DDrawCompat arrived at:
https://github.com/narzoul/DDrawCompat/blob/7a59458d585fbf7eb1b243fc133c091bbdf561ce/DDrawCompat/Win32/DisplayMode.cpp#L276
Too complicated to handle within the same push as #3.
The text was updated successfully, but these errors were encountered: