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

Anarchy Online game crashes on launch #279

Open Pillboxing opened 3 days ago

Pillboxing commented 3 days ago

Trying to get directx9 support for an old directx 7 game (Anarchy Online). Tried many combinations of options but with directx7-9 enabled I always get the following errors.

16176 07:54:44.124 Starting DxWrapper v1.1.7062.22 16176 07:54:44.124 Running from: E:\Anarchy Online\dxwrapper.dll 16176 07:54:44.124 Reading config file: E:\Anarchy Online\dxwrapper.ini 16176 07:54:44.125 Gigabyte Technology Co., Ltd. X470 AORUS GAMING 7 WIFI Default string (Desktop) 16176 07:54:44.125 Gigabyte Technology Co., Ltd. X470 AORUS GAMING 7 WIFI-CF Default string (Desktop) 16176 07:54:44.125 NVIDIA GeForce RTX 2080 SUPER 16176 07:54:44.126 Windows 10 Enterprise 64-bit (10.0.19041) 16176 07:54:44.126 anarchyonline.exe (PID:34980) 16176 07:54:44.164 Environment variable __COMPAT_LAYER = "" 16176 07:54:44.164 Disabling High DPI Scaling... 16176 07:54:44.164 Loaded library: user32.dll 16176 07:54:44.169 Loaded library: shcore.dll 16176 07:54:44.170 Loading 'ddraw.dll'... 16176 07:54:44.170 Hooking ddraw.dll APIs... 16176 07:54:44.170 Installing GDI & User32 hooks 16176 07:54:44.170 Loaded library: gdi32.dll 16176 07:54:44.170 Loaded library: kernel32.dll 16176 07:54:44.176 Loaded library: d3d9.dll 16176 07:54:44.176 Enabling ddraw wrapper 16176 07:54:44.176 Enabling d3d9 wrapper 16176 07:54:44.177 Loading 'd3d9.dll'... 16176 07:54:44.177 Loaded library: C:\WINDOWS\system32\d3d9.dll 16176 07:54:44.177 Loaded library: winmm.dll 16176 07:54:44.177 Installing memory management hooks 16176 07:54:44.210 Installing messaging hooks 16176 07:54:44.210 Installing display mode hooks 16176 07:54:44.214 Installing registry hooks 16176 07:54:44.214 Installing Win32 hooks 16176 07:54:44.215 DxWrapper loaded! 16176 07:54:44.347 dd_DirectDrawCreate 16176 07:54:44.347 dd_DirectDrawCreateEx 16176 07:54:44.347 Direct3D9SetSwapEffectUpgradeShim Calling 'Direct3D9SetSwapEffectUpgradeShim' ... 0 16176 07:54:44.347 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9' 16176 07:54:44.347 Creating interface m_IDirectDrawX::m_IDirectDrawX (00A926C8) converting interface from v1 to v9 16176 07:54:44.347 d9_Direct3DCreate9 16176 07:54:44.347 Redirecting 'Direct3DCreate9' ... 16176 07:54:44.441 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00AD3CC8) 16176 07:54:44.441 m_IDirect3D9Ex::LogAdapterNames Adapter: 0 \.\DISPLAY1 NVIDIA GeForce RTX 2080 SUPER 16176 07:54:44.441 m_IDirectDrawX::~m_IDirectDrawX (00A926C8) deleting interface! 16176 07:54:44.448 m_IDirect3D9Ex::~m_IDirect3D9Ex (00AD3CC8) deleting interface! 16176 07:54:44.448 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 16176 07:54:44.448 dd_DirectDrawEnumerateExA 16176 07:54:44.448 Redirecting 'Direct3DCreate9' ... 16176 07:54:44.538 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00AA8030) 16176 07:54:44.538 Direct3D9SetSwapEffectUpgradeShim Calling 'Direct3D9SetSwapEffectUpgradeShim' ... 0 16176 07:54:44.538 Redirecting 'DirectDrawCreate' IID_IDirectDraw7 to --> 'Direct3DCreate9' 16176 07:54:44.538 Creating interface m_IDirectDrawX::m_IDirectDrawX (00A92C08) converting interface from v7 to v9 16176 07:54:44.538 Redirecting 'Direct3DCreate9' ... 16176 07:54:44.543 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00AA7E80) 16176 07:54:44.710 Creating interface m_IDirect3DX::m_IDirect3DX (00A9BB60) converting interface from v7 to v9 16176 07:54:44.725 m_IDirect3DX::~m_IDirect3DX (00A9BB60) deleting interface! 16176 07:54:44.725 m_IDirectDrawX::~m_IDirectDrawX (00A92C08) deleting interface! 16176 07:54:44.725 m_IDirect3D9Ex::~m_IDirect3D9Ex (00AA7E80) deleting interface! 16176 07:54:44.725 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 16176 07:54:44.726 Direct3D9SetSwapEffectUpgradeShim Calling 'Direct3D9SetSwapEffectUpgradeShim' ... 0 16176 07:54:44.726 Redirecting 'DirectDrawCreate' IID_IDirectDraw7 to --> 'Direct3DCreate9' 16176 07:54:44.726 Creating interface m_IDirectDrawX::m_IDirectDrawX (00A926C8) converting interface from v7 to v9 16176 07:54:44.835 Creating interface m_IDirect3DX::m_IDirect3DX (00A9BB60) converting interface from v7 to v9 16176 07:54:44.843 m_IDirect3DX::~m_IDirect3DX (00A9BB60) deleting interface! 16176 07:54:44.843 m_IDirectDrawX::~m_IDirectDrawX (00A926C8) deleting interface! 16176 07:54:44.843 m_IDirect3D9Ex::~m_IDirect3D9Ex (02B23390) deleting interface! 16176 07:54:44.843 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 16176 07:54:44.945 Direct3D9SetSwapEffectUpgradeShim Calling 'Direct3D9SetSwapEffectUpgradeShim' ... 0 16176 07:54:45.040 Creating interface m_IDirect3DX::m_IDirect3DX (00A9BB60) converting interface from v7 to v9 16176 07:54:45.044 m_IDirect3DX::~m_IDirect3DX (00A9BB60) deleting interface! 16176 07:54:45.045 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 16176 07:54:45.045 Direct3D9SetSwapEffectUpgradeShim Calling 'Direct3D9SetSwapEffectUpgradeShim' ... 0 16176 07:54:45.155 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 16176 07:54:45.157 Direct3D9SetSwapEffectUpgradeShim Calling 'Direct3D9SetSwapEffectUpgradeShim' ... 0 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Primary surface 0x0 dwFlags: 0x1 ddsCaps: 0x200, 0x0, 513 16176 07:54:45.246 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (02B55198) converting interface from v7 to v9 16176 07:54:45.246 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (00AB28D0) converting interface from v7 to v9 16176 07:54:45.246 Creating interface m_IDirectDrawClipper::m_IDirectDrawClipper (05437FE0) 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Error: non-supported pixel format! 2 D3DFMT_D32->D3DFMT_D32 {0x400,0,32,0x0,0xffffffff,0x0,0x0} 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Found Stencil surface: D3DFMT_D24S8 16176 07:54:45.246 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (00AAC0D0) converting interface from v7 to v9 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Error: non-supported pixel format! 2 D3DFMT_D32->D3DFMT_D32 {0x400,0,32,0x0,0xffffffff,0x0,0x0} 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Found Stencil surface: D3DFMT_D24S8 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Warning: Creating a second depth stencil surface! {0x1007,8,8,0,0,0,0,0,00000000,{0x0,0x0},{0x0,0x0},{0x0,0x0},{0x0,0x0},{0x4400,0,32,0x8,0xffffff00,0xff,0x0},32,{{ DDSCAPS_VIDEOMEMORY DDSCAPS_ZBUFFER },0x0,0x0,0x1},0} 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Error: non-supported pixel format! 2 D3DFMT_D32->D3DFMT_D32 {0x400,0,32,0x0,0xffffffff,0x0,0x0} 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Found Stencil surface: D3DFMT_D24S8 16176 07:54:45.246 m_IDirectDrawX::CreateSurface2 Warning: Creating a second depth stencil surface! {0x1007,8,8,0,0,0,0,0,00000000,{0x0,0x0},{0x0,0x0},{0x0,0x0},{0x0,0x0},{0x4400,0,32,0x8,0xffffff00,0xff,0x0},32,{{ DDSCAPS_VIDEOMEMORY DDSCAPS_ZBUFFER },0x0,0x0,0x1},0} 16176 07:54:45.252 Creating interface m_IDirect3DDeviceX::m_IDirect3DDeviceX (00AAC348) converting interface from v7 to v9 16176 07:54:45.252 m_IDirectDrawX::SetD3DDevice Setting 3D Device Surface: 00AB28D0 16176 07:54:45.301 m_IDirectDrawX::CreateD3D9Device Direct3D9 device! 1920x1080 refresh: 0 format: D3DFMT_UNKNOWN wnd: null params: {1920,1080,D3DFMT_UNKNOWN,1,0,0,1,null,1,0,D3DFMT_UNKNOWN,0x0,0,0x80000000} flags: 0x44 16176 07:54:45.552 Creating interface m_IDirect3DDevice9Ex::InitDirect3DDevice (09D00780) 16176 07:54:45.553 Creating interface m_IDirect3DSurface9::m_IDirect3DSurface9 (09DEE210) 16176 07:54:45.554 Direct3D9SetSwapEffectUpgradeShim Calling 'Direct3D9SetSwapEffectUpgradeShim' ... 0 16176 07:54:45.554 m_IDirect3DDeviceX::GetDirect3D Error: missing Direct3D wrapper! 16176 07:54:45.625 Quiting DxWrapper 16176 07:54:45.626 Unloading libraries... 16176 07:54:45.626 DxWrapper terminated!

Please advise.

elishacloud commented 3 days ago

Can you try with the debug version of dxwrapper and send me the logs?

Pillboxing commented 3 days ago

Can you try with the debug version of dxwrapper and send me the logs?

I apologise for my ignorance but could you tell me where to find that?

Pillboxing commented 3 days ago

Nevermind, I figured it out.

https://pastebin.com/kYLcCxZp

elishacloud commented 3 days ago

I put in a fix for the crash. You can give it a try. It should be downloadable here.

Pillboxing commented 3 days ago

https://pastebin.com/b145uv1n

It doesn't crash with release binaries, but it only loads to a black screen. This is the output of running the debug binary, which resulted in a crash that stated the following:

"

Microsoft Visual C++ Runtime Library X Assertion failed! Program: E:\Anarchy Online\dxwrapper.dll File: D:\a\dxwrapper\dxwrapper\External....\imgui_i...n32.cpp Line: 302 Expression: bd-> hWnd != 0 For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts (Press Retry to debug the application - JIT must be enabled)"

elishacloud commented 3 days ago

Don't worry about the crash with the debug build. That is just a debug issue.

As far as the black screen issue, I will need to test it myself. The logs don't have enough data in them.