Fullscreen mode in Direct3D8 games on Windows 10

Getting old Windows games working.

Fullscreen mode in Direct3D8 games on Windows 10

Postby UCyborg » 2016-4-21 @ 16:52

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.
Attachments
d3d8.zip
(1.85 MiB) Downloaded 50 times
Last edited by UCyborg on 2018-10-06 @ 15:11, edited 4 times in total.
UCyborg
Member
 
Posts: 240
Joined: 2015-9-04 @ 11:10

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby mockingbird » 2016-4-22 @ 04:54

Thank you. Posted here as an attachment for posterity.

d3d8.zip
(407.37 KiB) Downloaded 839 times
Image
mockingbird
Member
 
Posts: 424
Joined: 2013-6-17 @ 02:57

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby Davros » 2016-4-23 @ 17:48

UCyborg is it ok if i repost your post on another forum
along with d3d8.zip
Guardian of the Sacred Five Terabyte's of Gaming Goodness
User avatar
Davros
l33t
 
Posts: 2504
Joined: 2004-3-01 @ 03:08

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby UCyborg » 2016-4-23 @ 19:17

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.
UCyborg
Member
 
Posts: 240
Joined: 2015-9-04 @ 11:10

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby stranno » 2016-4-24 @ 19:22

Any example? I have played a bunch of them in W10 and i havent found this so far.
User avatar
stranno
Newbie
 
Posts: 99
Joined: 2016-2-28 @ 19:55

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby UCyborg » 2016-4-25 @ 03:22

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.
UCyborg
Member
 
Posts: 240
Joined: 2015-9-04 @ 11:10

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby Parras » 2017-11-01 @ 07:34

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.
Parras
Newbie
 
Posts: 1
Joined: 2017-10-28 @ 09:48

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby UCyborg » 2017-11-01 @ 17:59

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.
UCyborg
Member
 
Posts: 240
Joined: 2015-9-04 @ 11:10

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby Kb20 » 2017-11-19 @ 08:36

:blush: are
UCyborg wrote: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
Kb20
Newbie
 
Posts: 1
Joined: 2017-11-19 @ 08:30

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby UCyborg » 2017-11-25 @ 15:32

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.
UCyborg
Member
 
Posts: 240
Joined: 2015-9-04 @ 11:10

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby phly95 » 2017-11-27 @ 21:03

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.
phly95
Newbie
 
Posts: 5
Joined: 2017-11-12 @ 06:07

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby Davros » 2017-11-27 @ 22:46

whats the touhou ?
Guardian of the Sacred Five Terabyte's of Gaming Goodness
User avatar
Davros
l33t
 
Posts: 2504
Joined: 2004-3-01 @ 03:08

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby lowenz » 2017-12-30 @ 00:05

RTSS can't hook the game process if you use this patched DLL :/ (tested in DXIW)
lowenz
Oldbie
 
Posts: 992
Joined: 2014-12-20 @ 01:30

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby lowenz » 2017-12-30 @ 02:13

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.
lowenz
Oldbie
 
Posts: 992
Joined: 2014-12-20 @ 01:30

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby UCyborg » 2017-12-31 @ 16:15

It works as intended if you replace system d3d8.dll.
UCyborg
Member
 
Posts: 240
Joined: 2015-9-04 @ 11:10

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby lowenz » 2017-12-31 @ 17:05

UCyborg wrote:It works as intended if you replace system d3d8.dll.

I prefer to use the RTSS option :D
lowenz
Oldbie
 
Posts: 992
Joined: 2014-12-20 @ 01:30

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby KainXVIII » 2018-3-09 @ 13:25

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 .. :dead:
User avatar
KainXVIII
Member
 
Posts: 278
Joined: 2015-5-20 @ 15:04
Location: Yaroslavl

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby lowenz » 2018-3-09 @ 16:28

UCyborg, maybe a Win10 1709 update is needed? (for the sake of updating)
lowenz
Oldbie
 
Posts: 992
Joined: 2014-12-20 @ 01:30

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby UCyborg » 2018-3-12 @ 12:11

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.
UCyborg
Member
 
Posts: 240
Joined: 2015-9-04 @ 11:10

Re: Fullscreen mode in Direct3D8 games on Windows 10

Postby KainXVIII » 2018-3-12 @ 13:08

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 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?
User avatar
KainXVIII
Member
 
Posts: 278
Joined: 2015-5-20 @ 15:04
Location: Yaroslavl

Next

Return to Windows

Who is online

Users browsing this forum: No registered users and 2 guests