nmlgc / ssg

秋霜玉 / Shuusou Gyoku
MIT License
20 stars 5 forks source link

(DirectDraw) Programmatically disable the 8- and 16-bit compatibility shim #33

Open nmlgc opened 1 year ago

nmlgc commented 1 year ago

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:

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.