VOGONS

Common searches


Fullscreen mode in Direct3D8 games on Windows 10

Topic actions

First post, by UCyborg

User metadata
Rank Member
Rank
Member

So there is this strange bug (might be a feature to allow some Xbox stuff to work, eg. Game bar) with Direct3D8 games on Windows 10 not fullscreening properly. The problem is hardcoded setting in d3d8.dll that forces so called maximized windowed mode. In previous Windows versions, this mode was activated only for certain applications via Windows Application Compatibility Engine's DXMaximizedWindowedMode shim. You can look up which applications are effected with Compatibility Administrator (32-bit), which is part of Windows 10 ADK.

Even if the game looks fullscreen, it's not real fullscreen, the window may just be setup this way that it doesn't have any borders, but the Desktop Window Manager is sill compositing in the background and giving you VSync, whether you want it or not.

You'll find patched d3d8.dll in the attached ZIP file for various Windows 10 builds. You can throw it in the same folder where your game exe resides. Only one byte is modified from 01 to 00. Or you could try replacing the system version, located in \Windows\SysWOW64 directory (or System32 on 32-bit Windows). This results in system file integrity check failure, sfc / DISM utilities will detect the corruption when ran and replace the file with original. The file will also be overwritten with every feature update.

If you know how to use OllyDbg, the procedure for fixing the system DLL yourself is as simple as locating exported function Direct3D8EnableMaximizedWindowedModeShim, then modifying the one and only referenced global variable from 1 to 0. This will make it behave like on older Windowses, so that mode is activated only if instructed so via settings in Compatibility Administrator. I used this trick to get Mafia working right, the only suggested solution until now was using some Direct3D8 -> Direct3D9 wrappers that don't even work right.

Same problem exists with some games using older Direct3D versions since Windows 8, to fix those, you can use Compatibility Administrator and enable DXPrimaryEmulation shim for the game with -DisableMaxWindowedMode parameter. See this for details, post #66. Note that Compatibility Administrator linked there is the old version, use the one bundled with Windows 10 ADK.

Important: Starting with Win10 version 1809 Build 17763 aka. October 2018 update, the exclusive fullscreen functionality has been removed from system d3d8.dll. As of this writing, it's still possible to use d3d8.dll from Build 17134 to get the real fullscreen back, but that could change any time with future builds.

Attachments

  • Filename
    d3d8.zip
    File size
    1.57 MiB
    Downloads
    6015 downloads
    File license
    Fair use/fair dealing exception
Last edited by UCyborg on 2019-02-04, 22:53. Edited 7 times in total.
Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 1 of 64, by mockingbird

User metadata
Rank Oldbie
Rank
Oldbie

Thank you. Posted here as an attachment for posterity.

Filename
d3d8.zip
File size
407.37 KiB
Downloads
1943 downloads
File license
Fair use/fair dealing exception

mslrlv.png
(Decommissioned:)
7ivtic.png

Reply 3 of 64, by UCyborg

User metadata
Rank Member
Rank
Member

Sure, I don't mind. I just posted this because nobody is aware of what the actual problem is behind the current behavior. The fix could also be implemented as the part of the unofficial patch for any game without the need for the entire copy of Microsoft's DLL since the only difference between this and the original is a value of a single variable which changing it programmatically shouldn't present much of a challenge.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 5 of 64, by UCyborg

User metadata
Rank Member
Rank
Member

Mafia, Max Payne, Max Payne 2, Silent Hill 2, ...

Drakan: Order of the Flame is an example of DirectX 6.1 game that has this issue without patches. With DirectX versions below 8, it could be turned off with Compatibility Administrator, with 8, there is no such option.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 6 of 64, by Parras

User metadata
Rank Newbie
Rank
Newbie
UCyborg wrote:

Mafia, Max Payne, Max Payne 2, Silent Hill 2, ...

Drakan: Order of the Flame is an example of DirectX 6.1 game that has this issue without patches. With DirectX versions below 8, it could be turned off with Compatibility Administrator, with 8, there is no such option.

It seems you're right. I'm having this issue trying to play Max Payne 2.

Last edited by Parras on 2021-10-29, 22:02. Edited 3 times in total.

Reply 7 of 64, by UCyborg

User metadata
Rank Member
Rank
Member

This maximized windowed mode exists in Direct3D 9 as well, except it's not turned on by default and if it does get turned on for some reason (tends to happen when running monitor at DPI settings above 100%), it can be disabled in registry by navigating to HKEY_CURRENT_USER\Software\Microsoft\Direct3D\Shims\MaximizedWindowedMode, finding the entry for the game in the right pane and setting its value to 0. Maybe even taking away write permissions for that key if the problems persist, not sure when that's needed. This method doesn't work for Direct3D 8 as it doesn't read those settings from registry, so the only way is patching the d3d8.dll itself.

The most convenient method i'm aware of which doesn't affect the ability to pass system file integrity check is probably using ThirteenAG's Ultimate ASI Loader. It's bundled with his widescreen patches, but can also be used on its own. His stuff relies on memory patching at runtime.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 8 of 64, by Kb20

User metadata
Rank Newbie
Rank
Newbie

😊 are

UCyborg wrote:
So there is this strange bug with Direct3D8 games on Windows 10 not fullscreening properly. The problem is hardcoded setting in […]
Show full quote

So there is this strange bug with Direct3D8 games on Windows 10 not fullscreening properly. The problem is hardcoded setting in d3d8.dll that forces so called maximized windowed mode. In previous Windows versions, this mode was activated only for certain applications via Windows Application Compatibility Engine's DXMaximizedWindowedMode shim. You can look up which applications are effected with Compatibility Administrator (32-bit), which is part of Windows 10 ADK.

Even if the game looks fullscreen, it's not real fullscreen, the window may just be setup this way that it doesn't have any borders, but the Desktop Window Manager is sill compositing in the background and giving you VSync, whether you want it or not.

Here is fixed d3d8.dll from the current actual Windows 10 Build 10586, I don't know if Insider builds have different base d3d8.dll. You can throw it in the same folder where your game exe resides. Only one byte is modified from 01 to 00. Or you could try replacing the system version, located in \Windows\SysWOW64 directory (or System32 on 32-bit Windows), but I'm not sure if copy paste handles that correctly since d3d8.dll is actually hardlink with another instance of the file stored somewhere under WinSxS. Plus some future update might get confused if it encounters modified system DLL, so I'd rather leave it alone.

If you know how to use OllyDbg, the procedure for fixing it this way is as simple as locating exported function Direct3D8EnableMaximizedWindowedModeShim, then modifying the one and only referenced global variable from 1 to 0. This will make it behave like on older Windowses, so that mode is activated only if instructed so via settings in Compatibility Administrator. I used this trick to get Mafia working right, the only suggested solution until now was using some Direct3D8 -> Direct3D9 wrappers that don't even work right.

Same problem exists with some games using older Direct3D versions since Windows 8, to fix those, you can use Compatibility Administrator and enable DXPrimaryEmulation shim for the game with -DisableMaxWindowedMode parameter. See this for details, post #66. Note that Compatibility Administrator linked there is the old version, use the one bundled with Windows 10 ADK.

Can you provide me the steps to Locate the exported function in OllyDbg as I am noob here but placing this file fixed the Ea Cricket 07 but Capitalism was not fixed please it would be helpful if you provide any steps or vedio to fix this permanently,as I am big fan of Old DirectX8 games

Reply 9 of 64, by UCyborg

User metadata
Rank Member
Rank
Member

Are you talking about Capitalism II? From quick search, this one uses ddraw.dll rather than d3d8.dll. Then there's Capitalism, a DOS game, for which none of this applies. Anyway, for games using ddraw.dll, there's DDrawCompat among other solutions. This one does some other things under the hood, which, depending on the game, may be redundant.

To address only the fullscreen problem, you can search for Windows 10 ADK, launch its installer, select only the component containing Compatibility Administrator, then follow the steps in the post #66 here.

BTW, I've updated the first post, added patched d3d8.dll for most Windows 10 builds, edited the text a little and replaced the link to now gone BlitzBasic forum with archived version.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 10 of 64, by phly95

User metadata
Rank Newbie
Rank
Newbie

This also appears to fix the touhou dx8 games (especially eosd/06) Thanks for the DLLs 😀 Also, download the zip from the first post, as the second post is outdated for later windows 10 versions.

Reply 13 of 64, by lowenz

User metadata
Rank Oldbie
Rank
Oldbie
lowenz wrote:

RTSS can't hook the game process if you use this patched DLL 😒 (tested in DXIW)

OK, solved.

Check "Custom Direct3D support" in RTSS and you'll get back the OSD/monitoring capabilities.

Reply 14 of 64, by UCyborg

User metadata
Rank Member
Rank
Member

It works as intended if you replace system d3d8.dll.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 16 of 64, by KainXVIII

User metadata
Rank Member
Rank
Member
lowenz wrote:

RTSS can't hook the game process if you use this patched DLL 😒 (tested in DXIW)

Also Steam overlay stops working with this dll, not a big deal, but still .. 😵

Reply 18 of 64, by UCyborg

User metadata
Rank Member
Rank
Member

Build 16299 is also known as version 1709. 😀 I'm guessing the problem with Steam is related to using a copy of the DLL in the game folder instead of replacing system copy. If you're not comfortable with replacing it, you can try to use Ultimate ASI Loader, which patches it in memory at runtime.

For that to work, besides figuring out the name of the DLL that can be used to hook the game (if d3d8.dll doesn't work), you have to create folder scripts in the game folder where you put the text file called global.ini with the following content:

[GlobalSets]
LoadPlugins=1
LoadFromScriptsOnly=1
ForceEntryPointHook=1
UseD3D8to9=0
Direct3D8DisableMaximizedWindowedModeShim=1

Probably just the last setting under GlobalSets would be enough for this, but I'm including all settings for completeness.

I almost forgot, been a while since I've been on Steam, but I remember there was a special log file in its folder related to overlay. Maybe there are some clues there of what goes wrong.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 19 of 64, by KainXVIII

User metadata
Rank Member
Rank
Member
UCyborg wrote:
Build 16299 is also known as version 1709. :) I'm guessing the problem with Steam is related to using a copy of the DLL in the g […]
Show full quote

Build 16299 is also known as version 1709. 😀 I'm guessing the problem with Steam is related to using a copy of the DLL in the game folder instead of replacing system copy. If you're not comfortable with replacing it, you can try to use Ultimate ASI Loader, which patches it in memory at runtime.

For that to work, besides figuring out the name of the DLL that can be used to hook the game (if d3d8.dll doesn't work), you have to create folder scripts in the game folder where you put the text file called global.ini with the following content:

[GlobalSets]
LoadPlugins=1
LoadFromScriptsOnly=1
ForceEntryPointHook=1
UseD3D8to9=0
Direct3D8DisableMaximizedWindowedModeShim=1

Probably just the last setting under GlobalSets would be enough for this, but I'm including all settings for completeness.

I almost forgot, been a while since I've been on Steam, but I remember there was a special log file in its folder related to overlay. Maybe there are some clues there of what goes wrong.

Wow, thanks!
PS - also what is optimal way to replace system dll? I think its protected and cannot be replaced easily, maybe in safe mode?