elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.15k stars 82 forks source link

SimCity 4 Deluxe Edition Issue #178

Closed nullhook closed 8 months ago

nullhook commented 1 year ago

I'm attempting to load SimCity 4 Deluxe Edition with dxwrapper, but I'm encountering a white screen. My hunch is that it may be a driver issue?

I have a dual graphics card setup, but it appears to be utilizing only the NVIDIA card. I believe I need to switch to the Intel card in order to support DirectX versions older than 9.

dxwrapper.ini

10540 11:21:24.440 Starting DxWrapper v1.0.6598.21
10540 11:21:24.440 Running from: D:\Games\SimCity 4 Deluxe Edition\Apps\dxwrapper.dll
10540 11:21:24.440 Reading config file: D:\Games\SimCity 4 Deluxe Edition\Apps\dxwrapper.ini
10540 11:21:24.441 Gigabyte Technology Co., Ltd. Z690 UD AX DDR4 Default string (Desktop)
10540 11:21:24.441 Gigabyte Technology Co., Ltd. Z690 UD AX DDR4 x.x (Desktop)
10540 11:21:24.441 NVIDIA GeForce RTX 3080
10540 11:21:24.441 Microsoft Windows XP 64-bit (10.0.22621)
10540 11:21:24.441 SimCity 4.exe (PID:16072)
10540 11:21:24.445 Environment variable __COMPAT_LAYER = "DWM8And16BitMitigation WinXPSp3 HighDpiAware"
10540 11:21:24.445 Disabling High DPI Scaling...
10540 11:21:24.445 Loaded library: user32.dll
10540 11:21:24.446 Loaded library: shcore.dll
10540 11:21:24.446 Loading 'ddraw.dll'...
10540 11:21:24.446 Hooking ddraw.dll APIs...
10540 11:21:24.448 Loaded library: d3d9.dll
10540 11:21:24.448 Enabling ddraw wrapper
10540 11:21:24.448 Enabling d3d9 wrapper
10540 11:21:24.448 Loading 'd3d9.dll'...
10540 11:21:24.448 Loaded library: C:\WINDOWS\system32\d3d9.dll
10540 11:21:24.448 Loaded library: gdi32.dll
10540 11:21:24.448 DxWrapper loaded!
10540 11:21:25.394 dd_DirectDrawCreate
10540 11:21:25.394 dd_DirectDrawCreateEx
10540 11:21:25.394 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9'
10540 11:21:25.394 Creating interface m_IDirectDrawX::m_IDirectDrawX (00F322A0) converting interface from v1 to v9
10540 11:21:25.394 d9_Direct3DCreate9
10540 11:21:25.394 Redirecting 'Direct3DCreate9' ...
10540 11:21:25.437 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (04B57650)
10540 11:21:25.437 m_IDirect3D9Ex::LogAdapterNames Adapter: 0 \\.\DISPLAY1 NVIDIA GeForce RTX 3080
10540 11:21:25.729 m_IDirectDrawX::~m_IDirectDrawX (00F322A0) deleting interface!
10540 11:21:25.730 m_IDirect3D9Ex::~m_IDirect3D9Ex (04B57650) deleting interface!
10540 11:21:25.730 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces!
10540 11:21:25.730 Redirecting 'DirectDrawCreate' IID_IDirectDraw7 to --> 'Direct3DCreate9'
10540 11:21:25.730 Creating interface m_IDirectDrawX::m_IDirectDrawX (04A97630) converting interface from v7 to v9
10540 11:21:25.730 Redirecting 'Direct3DCreate9' ...
10540 11:21:25.755 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (04E72A60)
10540 11:21:25.756 m_IDirectDrawX::~m_IDirectDrawX (04A97630) deleting interface!
10540 11:21:25.757 m_IDirect3D9Ex::~m_IDirect3D9Ex (04E72A60) deleting interface!
10540 11:21:25.757 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces!
10540 11:21:26.678 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9'
10540 11:21:26.678 Creating interface m_IDirectDrawX::m_IDirectDrawX (04A98638) converting interface from v1 to v9
10540 11:21:26.678 Redirecting 'Direct3DCreate9' ...
10540 11:21:26.705 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (04BCB840)
10540 11:21:26.707 dd_DirectDrawCreateClipper
10540 11:21:26.707 Creating interface m_IDirectDrawClipper::m_IDirectDrawClipper (04BD9240)
10540 11:21:26.707 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (04FC4F18) converting interface from v2 to v9
10540 11:21:26.707 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (04FC5110) converting interface from v2 to v9
10540 11:21:26.781 Creating interface m_IDirect3DDevice9Ex::InitDirect3DDevice (04F9ACF0)
10540 11:21:26.788 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9 (0D7B1B70)
10540 11:21:27.715 m_IDirectDrawX::~m_IDirectDrawX (0DA2AE38) deleting interface!
10540 11:21:28.145 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9 (0D972F68)
10540 11:21:28.145 Creating interface m_IDirect3DVertexBuffer9::m_IDirect3DVertexBuffer9 (0D972FA0)
10540 11:21:28.145 Creating interface m_IDirect3DSurface9::m_IDirect3DSurface9 (0D9E6B50)
10540 11:21:28.145 Creating interface m_IDirect3DSurface9::m_IDirect3DSurface9 (0D9E6F10)
nullhook commented 1 year ago

The main exe seems to load nvd3dnum.dll so that's another evidence that it seems to utilize Nvidia?

elishacloud commented 1 year ago

I don't have the ability to test that game right now. However, there are some bugs with Nvidia drivers when using Direct3D9 that seem to affect some games.

You could try it with the Intel card. Also, there are some bugs with SimCity 4 Deluxe Edition with Dd7to9 that I have not worked out yet.

Also, you could try with DDrawCompat. See issue #89.

Here is the latest build with some `Dd7to9' fixes in it: dxwrapper.zip

thekovic commented 1 year ago

@elishacloud I think you should make a new release instead of linking new builds under every other issue :D Would mean that people don't report stuff related to old problems.

elishacloud commented 1 year ago

LOL. Yeah. I had a few bugs that caused existing supported games to not work and I was waiting for those fixes before I release.

Mitradis commented 10 months ago

For SC4 need d3dimm.dll and ddraw.dll together. At least this rule work for dgVoodoo2 Use: "D:\Games\SimCity 4\SimCity 4.exe" -CustomResolution:enabled -r1280x720x32 -d:DirectX -Intro:off

elishacloud commented 8 months ago

This should be fixed with the latest release.

Squall-Leonhart commented 5 days ago

Latest release doesn't have the D3DImm files, are they no longer required?

elishacloud commented 5 days ago

dxwrapper has never included the D3DImm files. It handles everything from inside dxwrapper.dll. Maybe you were thinking about dgVoodoo2, which does include the D3DImm files?

Squall-Leonhart commented 5 days ago

I meant the D3DIm.dll that was included 6 or so releases ago.

elishacloud commented 4 days ago

That was just a stub. It was just used to load dxwrapper. But you can use the ddraw.dll or any other stub to load dxwrapper instead.

I did not see any case where a stub by that name was needed, since no game will load that dll manually. Instead they will load ddraw.dll and then ddraw.dll would load D3DIm.dll. This can all be short circuited by just using the ddraw stub instead.