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.16k stars 83 forks source link

Wargames no CD patch doesn't work #142

Closed SpecialAgent45954 closed 1 month ago

SpecialAgent45954 commented 2 years ago

Hello, I copied the three files from Wargames-fix.zip file in my local folder where the WarGames.exe file is, but it keeps asking me the CD (which I have, but either my CD drive of the CD itself works 50% of the times...). I am attaching the log file here, I think the issue is

17688 09:50:19.784 Utils::WriteMemory::WriteMemory Failed verification for memory write!

17688 09:50:19.769 Starting DxWrapper v1.0.6334.21 17688 09:50:19.769 ASUSTeK COMPUTER INC. SABERTOOTH X79 Rev 1.xx (Desktop) 17688 09:50:19.769 NVIDIA GeForce GTX 1060 6GB 17688 09:50:19.769 Windows 10 64-bit (10.0.19041) 17688 09:50:19.769 "WarGames.exe" (PID:10972) 17688 09:50:19.784 Utils::WriteMemory::WriteMemory Failed verification for memory write! 17688 09:50:19.784 Disabling High DPI Scaling... 17688 09:50:19.784 Loaded library: user32.dll 17688 09:50:19.784 Loaded library: shcore.dll 17688 09:50:19.784 Loading 'ddraw.dll'... 17688 09:50:19.784 Hooking ddraw.dll APIs... 17688 09:50:19.784 Enabling ddraw wrapper 17688 09:50:19.784 Enabling d3d9 wrapper 17688 09:50:19.784 Loading 'd3d9.dll'... 17688 09:50:19.784 DxWrapper loaded! 17688 09:50:19.878 dd_DirectDrawEnumerateA 17688 09:50:19.878 Redirecting 'Direct3DCreate9' ... 17688 09:50:19.925 Creating device m_IDirect3D9Ex::m_IDirect3D9Ex(00A8DB28) 17688 09:50:19.925 dd_DirectDrawCreate 17688 09:50:19.925 dd_DirectDrawCreateEx 17688 09:50:19.925 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9' 17688 09:50:19.925 Creating device m_IDirectDrawX::m_IDirectDrawX(009A3410) converting device from v1 to v9 17688 09:50:19.925 Redirecting 'Direct3DCreate9' ... 17688 09:50:19.925 Creating device m_IDirect3D9Ex::m_IDirect3D9Ex(00A8D888) 17688 09:50:20.065 Creating device m_IDirect3DDevice9Ex::InitDirect3DDevice(00A7F890) 17688 09:50:20.081 m_IDirectDrawX::~m_IDirectDrawX(009A3410) deleting device! 17688 09:50:20.097 m_IDirect3DDevice9Ex::~m_IDirect3DDevice9Ex(00A7F890) deleting device! 17688 09:50:20.097 m_IDirect3D9Ex::~m_IDirect3D9Ex(00A8D888) deleting device! 17688 09:50:20.097 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 17688 09:50:20.097 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9' 17688 09:50:20.097 Creating device m_IDirectDrawX::m_IDirectDrawX(0790DA78) converting device from v1 to v9 17688 09:50:20.097 Redirecting 'Direct3DCreate9' ... 17688 09:50:20.097 Creating device m_IDirect3D9Ex::m_IDirect3D9Ex(079454E8) 17688 09:50:20.175 Creating device m_IDirect3DDevice9Ex::InitDirect3DDevice(00A7FB60) 17688 09:50:20.175 m_IDirectDrawX::~m_IDirectDrawX(0790DA78) deleting device! 17688 09:50:20.190 m_IDirect3DDevice9Ex::~m_IDirect3DDevice9Ex(00A7FB60) deleting device! 17688 09:50:20.190 m_IDirect3D9Ex::~m_IDirect3D9Ex(079454E8) deleting device! 17688 09:50:20.190 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 17688 09:50:20.190 m_IDirect3D9Ex::~m_IDirect3D9Ex(00A8DB28) deleting device! 17688 09:50:24.143 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9' 17688 09:50:24.143 Creating device m_IDirectDrawX::m_IDirectDrawX(0790DB38) converting device from v1 to v9 17688 09:50:24.247 Creating device m_IDirect3DDevice9Ex::InitDirect3DDevice(00A80070) 17688 09:50:24.435 m_IDirect3DDevice9Ex::~m_IDirect3DDevice9Ex(00A80070) deleting device! 17688 09:50:24.933 Creating device m_IDirectDrawClipper::m_IDirectDrawClipper(009AEB60) 17688 09:50:24.933 Creating device m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX(07A36848) converting device from v1 to v9 17688 09:50:24.933 Creating device m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX(07A369E8) converting device from v1 to v9 17688 09:50:24.933 Creating device m_IDirectDrawPalette::m_IDirectDrawPalette(0798B3F8) 17688 09:50:24.933 Creating device m_IDirect3DTexture9::m_IDirect3DTexture9(07944988) 17688 09:50:24.934 Creating device m_IDirect3DTexture9::m_IDirect3DTexture9(07944C10) 17688 09:50:24.934 Creating device m_IDirect3DVertexBuffer9::m_IDirect3DVertexBuffer9(07944CA0) 17688 09:50:24.941 Creating device m_IDirect3DTexture9::m_IDirect3DTexture9(07944C70) 17688 09:50:25.297 Creating device m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX(038228A8) converting device from v1 to v9 17688 09:50:25.344 m_IDirectDrawSurfaceX::~m_IDirectDrawSurfaceX(038228A8) deleting device! 17688 09:50:28.895 m_IDirectDrawSurfaceX::~m_IDirectDrawSurfaceX(03822E50) deleting device! 17688 09:50:29.745 m_IDirectDrawSurfaceX::~m_IDirectDrawSurfaceX(03822E50) deleting device! 17688 09:50:32.375 m_IDirectDrawPalette::~m_IDirectDrawPalette(0798B3F8) deleting device! 17688 09:50:32.375 m_IDirectDrawX::~m_IDirectDrawX(0790DB38) deleting device! 17688 09:50:32.718 m_IDirect3DTexture9::~m_IDirect3DTexture9(07944988) deleting device! 17688 09:50:32.718 m_IDirect3DTexture9::~m_IDirect3DTexture9(07944C70) deleting device! 17688 09:50:32.718 m_IDirect3DTexture9::~m_IDirect3DTexture9(0CBC29A0) deleting device! 17688 09:50:32.718 m_IDirect3DVertexBuffer9::~m_IDirect3DVertexBuffer9(07944CA0) deleting device! 17688 09:50:32.719 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 17688 09:50:32.730 Quiting DxWrapper 17688 09:50:32.731 Unloading libraries... 17688 09:50:32.731 Reseting screen resolution 17688 09:50:32.737 Reseting font smoothing 17688 09:50:32.745 DxWrapper terminated!

elishacloud commented 2 years ago

It seems like you have a different version of the game. Can you zip and upload your exe file?

SpecialAgent45954 commented 2 years ago

Sure, it is an italian copy of the game, I think I got it with a videogame magazine ages ago...

WarGames.zip

elishacloud commented 2 years ago

Try using this config file update. It should work with that version of the game.

dxwrapper.zip

elishacloud commented 1 year ago

Related to issue #119

SpecialAgent45954 commented 1 year ago

Hello, just to inform that I tried the zip from April 8 2022, but the game crashes for me after launching it. If this problem happens only with my version of the game, maybe it is not worth the effort to fix (I can play with the CD or virtualizing the iso).

elishacloud commented 1 year ago

Ok, try with this one. If it still crashes then please zip up the wargames.exe file and post it here so I can check it out.

Here is the latest build from today. I also changed some settings to make it more compatible: dxwrapper.zip

Note: make sure you use the "Software Rasterizer". It only works with the "Software Rasterizer" option:

image

SpecialAgent45954 commented 1 year ago

Nope, please, find below the log: 12208 10:07:08.446 Starting DxWrapper v1.0.6612.21 12208 10:07:08.446 Running from: C:\WarGames\dxwrapper.dll 12208 10:07:08.446 Reading config file: C:\WarGames\dxwrapper.ini 12208 10:07:08.446 ASUSTeK COMPUTER INC. SABERTOOTH X79 Rev 1.xx (Desktop) 12208 10:07:08.446 NVIDIA GeForce GTX 1060 6GB 12208 10:07:08.446 Windows 10 Home 64-bit (10.0.19041) 12208 10:07:08.446 WarGames.exe (PID:11480) 12208 10:07:08.446 Environment variable __COMPAT_LAYER = "DWM8And16BitMitigation" 12208 10:07:08.508 Utils::WriteMemory::WriteMemory Writing bytes to memory... 12208 10:07:08.509 Disabling High DPI Scaling... 12208 10:07:08.509 Loaded library: user32.dll 12208 10:07:08.509 Loaded library: shcore.dll 12208 10:07:08.509 Setting SingleCoreAffinity... 12208 10:07:08.509 Utils::GetProcessMask Setting CPU mask: 0x2 12208 10:07:08.509 Set exception handler 12208 10:07:08.509 Loaded library: kernel32.dll 12208 10:07:08.510 Finished setting exception handler 12208 10:07:08.510 Loading 'ddraw.dll'... 12208 10:07:08.510 Hooking ddraw.dll APIs... 12208 10:07:08.523 Loaded library: d3d9.dll 12208 10:07:08.523 Enabling ddraw wrapper 12208 10:07:08.523 Enabling d3d9 wrapper 12208 10:07:08.524 Loading 'd3d9.dll'... 12208 10:07:08.524 Loaded library: C:\Windows\system32\d3d9.dll 12208 10:07:08.524 Loaded library: gdi32.dll 12208 10:07:08.524 DxWrapper loaded! 12208 10:07:08.626 dd_DirectDrawEnumerateA 12208 10:07:08.626 d9_Direct3DCreate9 12208 10:07:08.626 Redirecting 'Direct3DCreate9' ... 12208 10:07:08.687 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00B451A8) 12208 10:07:08.688 m_IDirect3D9Ex::LogAdapterNames Adapter: 0 \.\DISPLAY1 NVIDIA GeForce GTX 1060 6GB 12208 10:07:08.688 dd_DirectDrawCreate 12208 10:07:08.688 dd_DirectDrawCreateEx 12208 10:07:08.688 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9' 12208 10:07:08.688 Creating interface m_IDirectDrawX::m_IDirectDrawX (036CC4B0) converting interface from v1 to v9 12208 10:07:08.688 Redirecting 'Direct3DCreate9' ... 12208 10:07:08.691 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00B45208) 12208 10:07:08.695 m_IDirectDrawX::~m_IDirectDrawX (036CC4B0) deleting interface! 12208 10:07:08.695 m_IDirect3D9Ex::~m_IDirect3D9Ex (00B45208) deleting interface! 12208 10:07:08.695 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 12208 10:07:08.696 m_IDirect3D9Ex::~m_IDirect3D9Ex (00B451A8) deleting interface! 12208 10:07:08.699 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9' 12208 10:07:08.699 Creating interface m_IDirectDrawX::m_IDirectDrawX (00B481A8) converting interface from v1 to v9 12208 10:07:08.699 Redirecting 'Direct3DCreate9' ... 12208 10:07:08.730 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00B45250) 12208 10:07:08.913 m_IDirectDrawX::CreateD3D9Device Direct3D9 device! 640x480 refresh: 0 format: D3DFMT_X8R8G8B8 wnd: WND(000406F8,WarGames,{0,0,639,479}) params: {640,480,D3DFMT_X8R8G8B8,1,0,0,1,null,0,0,D3DFMT_UNKNOWN,0x0,0,0x80000000} flags: 0x40 12208 10:07:09.596 Creating interface m_IDirect3DDevice9Ex::InitDirect3DDevice (08670EA8) 12208 10:07:09.600 Creating interface m_IDirectDrawClipper::m_IDirectDrawClipper (08595470) 12208 10:07:09.600 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (08671280) converting interface from v1 to v9 12208 10:07:09.600 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (08671450) converting interface from v1 to v9 12208 10:07:09.600 Creating interface m_IDirectDrawPalette::m_IDirectDrawPalette (085FCEB0) 12208 10:07:09.600 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9 (0859BC20) 12208 10:07:09.600 Creating interface m_IDirect3DSurface9::m_IDirect3DSurface9 (085F1E78) 12208 10:07:09.627 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9 (0859B800) 12208 10:07:09.628 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9 (0859B680) 12208 10:07:09.629 Creating interface m_IDirect3DVertexBuffer9::m_IDirect3DVertexBuffer9 (0859B650) 12208 10:07:09.630 Creating interface m_IDirect3DSurface9::m_IDirect3DSurface9 (085F1C38) 12208 10:07:09.644 UnhandledExceptionFilter: exception code=3221225477 flags=0 addr=0055B2FB 12208 10:07:09.664 UnhandledExceptionFilter: NOP opcode=‹ len=2 12208 10:07:09.664 UnhandledExceptionFilter: exception code=3221225477 flags=0 addr=0055B304 12208 10:07:09.664 UnhandledExceptionFilter: NOP opcode=‹ len=2

elishacloud commented 1 year ago

Weird. Are you are using the exe file you sent above? I tested that one and it worked for me.

Did you follow all the steps about copying the data from the CD ROM to the WarGames folder or are you playing with the CD ROM?

Can you try with this binary file and see if it works? Make sure to backup your file first. This is the one I am using: wargames.zip

SpecialAgent45954 commented 1 year ago

Tried with the exe from your last comment and https://github.com/elishacloud/dxwrapper/files/11238039/dxwrapper.zip, not launching, below the log:

9044 18:35:21.408 Starting DxWrapper v1.0.6612.21 9044 18:35:21.408 Running from: C:\WarGames\dxwrapper.dll 9044 18:35:21.408 Reading config file: C:\WarGames\dxwrapper.ini 9044 18:35:21.408 ASUSTeK COMPUTER INC. SABERTOOTH X79 Rev 1.xx (Desktop) 9044 18:35:21.409 NVIDIA GeForce GTX 1060 6GB 9044 18:35:21.411 Windows 10 Home 64-bit (10.0.19041) 9044 18:35:21.411 wargames.exe (PID:10860) 9044 18:35:21.419 Environment variable __COMPAT_LAYER = "DWM8And16BitMitigation DetectorsAppHealth DetectorsXP" 9044 18:35:21.484 Utils::WriteMemory::WriteMemory Failed verification for memory write! 9044 18:35:21.484 Disabling High DPI Scaling... 9044 18:35:21.484 Loaded library: user32.dll 9044 18:35:21.484 Loaded library: shcore.dll 9044 18:35:21.484 Setting SingleCoreAffinity... 9044 18:35:21.484 Utils::GetProcessMask Setting CPU mask: 0x2 9044 18:35:21.485 Set exception handler 9044 18:35:21.485 Loaded library: kernel32.dll 9044 18:35:21.485 Finished setting exception handler 9044 18:35:21.485 Loading 'ddraw.dll'... 9044 18:35:21.485 Hooking ddraw.dll APIs... 9044 18:35:21.500 Loaded library: d3d9.dll 9044 18:35:21.500 Enabling ddraw wrapper 9044 18:35:21.500 Enabling d3d9 wrapper 9044 18:35:21.500 Loading 'd3d9.dll'... 9044 18:35:21.500 Loaded library: C:\Windows\system32\d3d9.dll 9044 18:35:21.500 Loaded library: gdi32.dll 9044 18:35:21.501 DxWrapper loaded! 9044 18:36:01.423 Quiting DxWrapper 9044 18:36:01.424 Unloading libraries... 9044 18:36:01.424 Unloading exception handlers 9044 18:36:01.424 Reseting screen resolution 9044 18:36:01.450 Reseting font smoothing 9044 18:36:01.530 DxWrapper terminated!

elishacloud commented 8 months ago

Can you try with the latest patch, just released: https://github.com/elishacloud/dxwrapper/wiki/WarGames

elishacloud commented 1 month ago

Closing issue. You can reopen it if you still have an issue.