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.28k stars 91 forks source link

Hard Time broken #217

Open ghost opened 1 year ago

ghost commented 1 year ago

www.MDickie.com/games_blitz.htm (game)

When dd7to9 is enabled the game doesn't work (game is ddraw7) and it just leaves me with a black screen

Artix Linux WINE 8.13 (ge-custom)

Log:

1456 02:08:44.906 Starting DxWrapper v1.0.6771.21
1456 02:08:44.906 Running from: Z:\home\kaktus\Games\hard-time\drive_c\Program Files\MDickie\Hard Time\dxwrapper.dll
1456 02:08:44.906 Reading config file: Z:\home\kaktus\Games\hard-time\drive_c\Program Files\MDickie\Hard Time\dxwrapper.ini
1456 02:08:44.977 AMD Radeon RX Vega (RADV VEGA10)
1456 02:08:44.977 Microsoft Windows 7 64-bit (10.0.19043)
1456 02:08:44.977 Hard Time.exe (PID:1452)
1456 02:08:44.981 Environment variable __COMPAT_LAYER = ""
1456 02:08:44.982 Disabling High DPI Scaling...
1456 02:08:44.982 Loaded library: user32.dll
1456 02:08:44.982 Loaded library: shcore.dll
1456 02:08:44.982 Loading 'ddraw.dll'...
1456 02:08:44.982 Hooking ddraw.dll APIs...
1456 02:08:44.983 Hook::HotPatch Error: 'DestroyWindow' is not patch aware at addr=68917090
1456 02:08:44.983 Bytes in memory are: \x4E\x95\x68\x90\x90\xFF\x25\xF0\x4E\x95\x68\x90\x90\xFF
1456 02:08:44.986 Loaded library: d3d9.dll
1456 02:08:44.986 Enabling ddraw wrapper
1456 02:08:44.986 Enabling d3d9 wrapper
1456 02:08:44.986 Loading 'd3d9.dll'...
1456 02:08:44.986 Loaded library: C:\windows\system32\d3d9.dll
1456 02:08:44.986 DxWrapper loaded!
1456 02:08:45.068 dd_DirectDrawEnumerateExA
1456 02:08:45.068 d9_Direct3DCreate9
1456 02:08:45.068 Redirecting 'Direct3DCreate9' ...
1456 02:08:45.249 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00A88C08)
1456 02:08:45.249 m_IDirect3D9Ex::LogAdapterNames Adapter: 0 \\.\DISPLAY1 Radeon RX Vega
1456 02:08:45.249 dd_DirectDrawCreateEx
1456 02:08:45.249 Redirecting 'DirectDrawCreate' IID_IDirectDraw7 to --> 'Direct3DCreate9'
1456 02:08:45.249 Creating interface m_IDirectDrawX::m_IDirectDrawX (00A88F08) converting interface from v7 to v9
1456 02:08:45.249 Redirecting 'Direct3DCreate9' ...
1456 02:08:45.316 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00A88DE8)
1456 02:08:45.316 Creating interface m_IDirect3DX::m_IDirect3DX (00A8AB10) converting interface from v7 to v9
1456 02:08:45.316 m_IDirect3DX::~m_IDirect3DX (00A8AB10) deleting interface!
1456 02:08:45.316 m_IDirectDrawX::~m_IDirectDrawX (00A88F08) deleting interface!
1456 02:08:45.316 m_IDirect3D9Ex::~m_IDirect3D9Ex (00A88DE8) deleting interface!
1456 02:08:45.316 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces!
1456 02:08:45.317 m_IDirect3D9Ex::~m_IDirect3D9Ex (00A88C08) deleting interface!
1456 02:08:45.317 Redirecting 'DirectDrawCreate' IID_IDirectDraw7 to --> 'Direct3DCreate9'
1456 02:08:45.317 Creating interface m_IDirectDrawX::m_IDirectDrawX (00A88F08) converting interface from v7 to v9
1456 02:08:45.317 Redirecting 'Direct3DCreate9' ...
1456 02:08:45.396 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex (00A8D4A0)
1456 02:08:45.396 m_IDirectDrawX::CreateD3D9Device Direct3D9 device! 113x2 refresh: 0 format: D3DFMT_UNKNOWN wnd: WND(000E0118,Blitz Runtime Class,{0,0,119,34}) params: {113,2,D3DFMT_UNKNOWN,1,0,0,1,WND(000E0118,Blitz Runtime Class,{0,0,119,34}),1,0,D3DFMT_UNKNOWN,0x0,0,0x80000000} flags: 0x44
1456 02:08:45.428 Creating interface m_IDirect3DDevice9Ex::InitDirect3DDevice (00ACA960)
1456 02:08:45.429 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (00ACADE8) converting interface from v7 to v9
1456 02:08:45.429 Creating interface m_IDirectDrawClipper::m_IDirectDrawClipper (00A72D18)
1456 02:08:45.429 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (00ACB3C8) converting interface from v7 to v9
1456 02:08:45.429 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9 (00ACB208)
1456 02:08:45.429 Creating interface m_IDirect3DSurface9::m_IDirect3DSurface9 (00A70FF0)
1456 02:08:45.434 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX (00B4C920) converting interface from v7 to v9
1456 02:08:45.434 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9 (00B4CB80)
1456 02:08:45.434 Creating interface m_IDirect3DSurface9::m_IDirect3DSurface9 (00B4CF18)
1456 02:08:45.435 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9 (00B4CD40)
1456 02:08:45.435 Creating interface m_IDirect3DSurface9::m_IDirect3DSurface9 (00B4CFA8)
1496 02:09:04.662 Quiting DxWrapper
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 688D41DB
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 688E0F6B
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 688E0E1B
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 6DA863CB
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00572FBB
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00572FAB
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578BCB
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578BBB
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578BAB
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B9B
1496 02:09:04.662 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B8B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B7B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B6B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B5B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B4B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B3B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B2B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B1B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578B0B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578AFB
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578AEB
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578ADB
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578ACB
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578ABB
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578AAB
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 00578A9B
1496 02:09:04.663 Hook::UnHotPatchAll Error: Failed to read memory procaddr: 684CBA7B
1496 02:09:04.663 Unloading libraries...
1496 02:09:04.663 Reseting screen resolution
1496 02:09:04.712 Reseting font smoothing
1496 02:09:04.716 DxWrapper terminated!

I would like this because otherwise font rendering is broken (it should fix it)

elishacloud commented 1 year ago

I have not tested with this game yet or with Linux. Do other games work with dxwrapper on Linux? You could also try enabling FullscreenWindowMode.

ghost commented 1 year ago

Windowed fullscreen just says on WINE LOG: 0108:err:system:NtUserChangeDisplaySettings Changing L"\\\\.\\DISPLAY1" display settings returned -2. i dont have any other game to test, but if you find the time, you can test it in windows and debug it and fix it

lorn10 commented 1 year ago

@mr-sihc You might want to look into Gallium Nine. This is nothing other than D3D9 for Linux. :+1: Works brilliant with most original D3D9 games and Dd7to9 is also mostly compatible. It looks that you are trying to use currently WineD3D which may be less compliant. An alternative would be DXVK, but I have no idea how it works together with Dd7to9. :wink:

@elishacloud Yes, dxwrapper and especially Dd7to9 is really useful also on Linux! This should be added somewhere on the webpage. The only thing which I am missing are 32 bit builds. It looks that all current are 64 bit based, right? I am experimenting currently with the awesome Sega Sonic CD game, the variant for Windows 95. And after some hours of testing I really figured out how I can play it on Kubuntu 22.04 LTS and Wine 8.14 devel. It really works better than with Windows. :smiley: But yeah, that game seems to old for dxwrapper. :wink:

ghost commented 1 year ago

didnt help, wined3d is already accurate enough, gallium nine is usually just faster still a black screen this wasnt a linux problem and i agree its a very nice thing for this wrapper to officially support wine, wine is already accurate enough for d3d9 and dd7 so there wouldnt be anything really to change, since it already pretty much works with wine and this is 32-bit only since every application that uses dd7 HAS to be 32-bit because dd7 is 32-bit only, so it seems to be another compatibility problem, dd7to9 is still not good accurate enough for these games, because converting features are missing and need to be implemented

elishacloud commented 1 year ago

This game is using Direct3D7. dxwrapper has limited Direct3D support at this point.

lorn10 commented 1 year ago

Yeah, regarding the Sega Sonic CD game I also (always) ended up at a black window when dxwrapper was in use. But at least it continued to the program window of the game without reporting that annoying "256 color mode" error. Whatever, as mentioned, that Sonic CD game is really super old, it seems to be Direct3D4 based.

Okay, I have now learned that when I install dxwrapper "globally" into a Wine prefix then it has to be in the system32 folder (for a 32 bit prefix) and otherwise (for a 64 bit prefix) in the syswow64 folder. Thanks for the clarification. :+1: And yes, this is not recommended / possible on Windows because of the "system files protection mechanism". But on Wine this is all no problem because there simply doesn't exist any such protection mechanism. :wink:

ghost commented 1 year ago

dxwrapper has an option to convert from d3d4 to d3d7 you could use that and disable dd7to9 maybe that'll work or use xephyr to set color mode to 256 in lutris

elishacloud commented 1 year ago

It looks like the game already uses d3d7 since it is calling the DirectDrawCreateEx() function and all the interfaces are the d3d7 interfaces.

Also, keep in mind that the system32 on a 64bit computer is for the 64bit files and the syswow64 folder is for the 32bit files. I know it seems backwards. Most of what dxwrapper does only works on 32bit applications. For example, as far as I know d3d7 is not even available on 64bit applications.

lorn10 commented 1 year ago

Thanks @mr-sihc for the hint with xephyr. Yes, I tested also this. But in the end the solution for Sonic CD was trivial, I just had to make a manual dll override for ddraw.dll in Wine with winecfg. After that I was able to start the game with the help of the Sega PC Reloaded program perfectly fine. That launcher and config tool was made by an enthusiast to play the game also on Windows 7. (May not work as good on Windows 11.) Last official working Windows version for that game was by the way Windows Millennium Edition from 2000. :wink:

And yes, it's clear @elishacloud. The 32 bit system files are on 32 bit Wine prefixes in the system32 folder while on 64 bit prefixes in the syswow64 one, - like on Windows.

elishacloud commented 2 months ago

Please try with the latest release. This game is fully working with the latest release.