narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
880 stars 67 forks source link

Yuri Revenge Single Player = instant crash with ddrawcompat #235

Closed Steff833 closed 7 months ago

Steff833 commented 12 months ago

When I try to launch RA2MD.exe (gamemd.exe) to play SinglePlayer Campaign of Yuri Revenge

The exe instant crashes.

Using the Wrapper with the CnCNetYRLauncher.exe (For multiplayer or skirmish only). gamemd-spawn.exe instead is used and everything works great.

The Log of the Single Player game "gamemd.exe"

18:01:23.147 Process path: C:\games\Westwood\RA2Eng\gamemd.exe 18:01:23.147 Loading DDrawCompat statically from C:\games\Westwood\RA2Eng\DDRAW.dll 18:01:23.147 Environment variable __COMPAT_LAYER = "RunAsAdmin ElevateCreateProcess DWM8And16BitMitigation 16BitColor 8And16BitTimedPriSync HighDpiAware" 18:01:23.147 Loading global config file: C:\ProgramData\DDrawCompat\DDrawCompat.ini 18:01:23.147 File not found, skipping 18:01:23.147 Loading user config file: C:\Users\Desktop_PC\AppData\Local\DDrawCompat\DDrawCompat.ini 18:01:23.147 File not found, skipping 18:01:23.147 Loading directory config file: C:\games\Westwood\RA2Eng\DDrawCompat.ini 18:01:23.147 File not found, skipping 18:01:23.147 Loading process config file: C:\games\Westwood\RA2Eng\DDrawCompat-gamemd.ini 18:01:23.147 File not found, skipping 18:01:23.147 Loading overlay config file: C:\games\Westwood\RA2Eng\DDrawCompatOverlay-gamemd.ini 18:01:23.147 File not found, skipping 18:01:23.147 Final configuration: 18:01:23.147 [default] AlignSysMemSurfaces = on 18:01:23.147 [default] AltTabFix = off 18:01:23.147 [default] AlternatePixelCenter = off 18:01:23.147 [default] Antialiasing = off 18:01:23.147 [default] BltFilter = point 18:01:23.147 [default] ConfigHotKey = shift+f11 18:01:23.147 [default] CpuAffinity = 1 18:01:23.147 [default] DesktopColorDepth = initial 18:01:23.147 [default] DisplayFilter = bilinear(0) 18:01:23.147 [default] DisplayRefreshRate = app 18:01:23.147 [default] DisplayResolution = desktop 18:01:23.147 [default] DpiAwareness = permonitor 18:01:23.147 [default] FontAntialiasing = app 18:01:23.147 [default] ForceD3D9On12 = off 18:01:23.147 [default] FpsLimiter = off 18:01:23.147 [default] FullscreenMode = borderless 18:01:23.147 [default] LogLevel = info 18:01:23.147 [default] PalettizedTextures = on 18:01:23.147 [default] RemoveBorders = off 18:01:23.147 [default] RenderColorDepth = app 18:01:23.147 [default] ResolutionScale = app(1) 18:01:23.147 [default] ResolutionScaleFilter = point 18:01:23.147 [default] SoftwareDevice = rgb 18:01:23.147 [default] SpriteDetection = off 18:01:23.147 [default] SpriteFilter = app 18:01:23.147 [default] SpriteTexCoord = app 18:01:23.147 [default] SupportedResolutions = native, 640x480, 800x600, 1024x768 18:01:23.147 [default] TextureFilter = app 18:01:23.147 [default] ThreadPriorityBoost = off 18:01:23.147 [default] VSync = app 18:01:23.147 [default] WinVersionLie = off 18:01:23.157 Failed to change process DPI awareness to "permonitor" via SetProcessDpiAwarenessContext 18:01:23.157 DDrawCompat loaded successfully 18:01:23.274 Installing display mode hooks 18:01:23.313 Installing registry hooks 18:01:23.313 Installing Direct3D driver hooks 18:01:23.320 Hooking user mode display driver: C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_d24a95fa21389db6\nvldumd.dll+0x22bd0 18:01:23.430 Dynamic vertex buffers are available 18:01:23.430 Dynamic index buffers are available 18:01:23.431 Supported z-buffer bit depths: 16, 24 18:01:23.431 Supported MSAA modes: msaa(3), msaa2x(0), msaa4x(0), msaa8x(0) 18:01:23.431 Supported resource formats: 18:01:23.431 {D3DDDIFMT_A8R8G8B8,0x4d8e10f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_X8R8G8B8,0x458ed0f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_R5G6B5,0x48ed0f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_X1R5G5B5,0x48e10f,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_A1R5G5B5,0xe007,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_A4R4G4B4,0xe007,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_A8,0xf,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_A2B10G10R10,0x48610f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_G16R16,0x40400f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_A2R10G10B10,0x486d0f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_A16B16G16R16,0x40600f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_A8P8,0x5000,0x0,0x0,16} 18:01:23.431 {D3DDDIFMT_P8,0x4400,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_L8,0x40800f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_A8L8,0x8007,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_V8U8,0x10001,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_X8L8V8U8,0x10001,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_Q8W8V8U8,0x5,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_V16U16,0x7,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_S8D24,0xc1,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_D24S8,0xc1,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_X8D24,0xc1,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_D24X8,0xc1,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_D16,0xc1,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_L16,0x40000f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_D32F_LOCKABLE,0xc1,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_G8R8,0xd,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_R8,0x40400f,0x0,0x0,0} 18:01:23.431 {D3DDDIFMT_R16F,0xc0400f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_G16R16F,0xc0400f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_A16B16G16R16F,0xc8610f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_R32F,0xc0400f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_G32R32F,0xc0400f,0x8b,0x8b,0} 18:01:23.431 {D3DDDIFMT_A32B32G32R32F,0xc8600f,0x8b,0x8b,0} 18:01:23.432 {D3DDDIFMT_BINARYBUFFER,0x4000,0x0,0x0,0} 18:01:23.432 {FOURCC(P010),0x4007000,0x0,0x0,16} 18:01:23.432 {FOURCC(3x11),0x40700f,0x8b,0x8b,32} 18:01:23.432 {FOURCC(ATI1),0x1005,0x0,0x0,8} 18:01:23.432 {FOURCC(DXT1),0x8007,0x0,0x0,0} 18:01:23.432 {FOURCC(AV12),0x5000,0x0,0x0,12} 18:01:23.432 {FOURCC(NV12),0x4007000,0x0,0x0,12} 18:01:23.432 {FOURCC(YV12),0x4007000,0x0,0x0,12} 18:01:23.432 {FOURCC(ATI2),0x1005,0x0,0x0,8} 18:01:23.432 {FOURCC(DXT2),0x8007,0x0,0x0,0} 18:01:23.432 {FOURCC(YUY2),0x4007000,0x0,0x0,16} 18:01:23.432 {FOURCC(DXT3),0x8007,0x0,0x0,0} 18:01:23.432 {FOURCC(NV24),0x4007000,0x0,0x0,12} 18:01:23.432 {FOURCC(AI44),0x5000,0x0,0x0,8} 18:01:23.432 {FOURCC(DXT4),0x8007,0x0,0x0,0} 18:01:23.432 {FOURCC(DXT5),0x8007,0x0,0x0,0} 18:01:23.432 {FOURCC(3x16),0x407d0f,0x8b,0x8b,64} 18:01:23.432 {FOURCC(AIP8),0x5000,0x0,0x0,8} 18:01:23.432 {FOURCC(SSAA),0x4000,0x0,0x0,0} 18:01:23.432 {FOURCC(NVDB),0x4000,0x0,0x0,0} 18:01:23.432 {FOURCC(ATOC),0x4000,0x0,0x0,0} 18:01:23.432 {FOURCC(NVMD),0x4000,0x0,0x0,0} 18:01:23.432 {FOURCC(PLFF),0x4000,0x0,0x0,0} 18:01:23.432 {FOURCC(NULL),0x100009,0x8b,0x8b,0} 18:01:23.432 {FOURCC(NVDP),0x4000,0x0,0x0,0} 18:01:23.432 {FOURCC(NVCS),0xd,0x0,0x0,0} 18:01:23.432 {FOURCC(NVHS),0x5,0x0,0x0,0} 18:01:23.432 {FOURCC(NVHU),0x5,0x0,0x0,0} 18:01:23.432 {FOURCC(AYUV),0x5000,0x0,0x0,32} 18:01:23.432 {FOURCC(UYVY),0x4007000,0x0,0x0,16} 18:01:23.432 {FOURCC(INTZ),0x10c1,0x0,0x0,32} 18:01:23.433 Installing DirectDraw hooks 18:01:23.434 Installing Direct3D hooks 18:01:23.436 Installing GDI hooks 18:01:23.442 Finished installing hooks 18:01:28.359 DDrawCompat detached successfully

= Crashes instantly

The Log of the Multiplayer Game "gamemd-spawn.exe"

17:18:07.713 Process path: C:\games\Westwood\RA2Eng\gamemd-spawn.exe 17:18:07.713 Loading DDrawCompat statically from C:\games\Westwood\RA2Eng\DDRAW.dll 17:18:07.713 Environment variable __COMPAT_LAYER = "RunAsAdmin Win8RTM Win7RTM 16BitColor DWM8And16BitMitigation 8And16BitTimedPriSync HighDpiAware" 17:18:07.713 Loading global config file: C:\ProgramData\DDrawCompat\DDrawCompat.ini 17:18:07.713 File not found, skipping 17:18:07.713 Loading user config file: C:\Users\Desktop_PC\AppData\Local\DDrawCompat\DDrawCompat.ini 17:18:07.713 File not found, skipping 17:18:07.713 Loading directory config file: C:\games\Westwood\RA2Eng\DDrawCompat.ini 17:18:07.713 File not found, skipping 17:18:07.713 Loading process config file: C:\games\Westwood\RA2Eng\DDrawCompat-gamemd-spawn.ini 17:18:07.713 File not found, skipping 17:18:07.713 Loading overlay config file: C:\games\Westwood\RA2Eng\DDrawCompatOverlay-gamemd-spawn.ini 17:18:07.713 Final configuration: 17:18:07.713 [overlay] AlignSysMemSurfaces = off 17:18:07.713 [default] AltTabFix = off 17:18:07.713 [default] AlternatePixelCenter = off 17:18:07.713 [overlay] Antialiasing = msaa(7) 17:18:07.713 [overlay] BltFilter = bilinear 17:18:07.713 [default] ConfigHotKey = shift+f11 17:18:07.713 [overlay] CpuAffinity = 1 17:18:07.713 [default] DesktopColorDepth = initial 17:18:07.713 [overlay] DisplayFilter = bilinear(100) 17:18:07.713 [default] DisplayRefreshRate = app 17:18:07.713 [default] DisplayResolution = desktop 17:18:07.713 [default] DpiAwareness = permonitor 17:18:07.713 [default] FontAntialiasing = app 17:18:07.713 [default] ForceD3D9On12 = off 17:18:07.713 [default] FpsLimiter = off 17:18:07.713 [default] FullscreenMode = borderless 17:18:07.713 [default] LogLevel = info 17:18:07.713 [default] PalettizedTextures = on 17:18:07.713 [default] RemoveBorders = off 17:18:07.713 [default] RenderColorDepth = app 17:18:07.713 [default] ResolutionScale = app(1) 17:18:07.713 [overlay] ResolutionScaleFilter = bilinear 17:18:07.713 [overlay] SoftwareDevice = hal 17:18:07.713 [default] SpriteDetection = off 17:18:07.713 [overlay] SpriteFilter = linear 17:18:07.713 [default] SpriteTexCoord = app 17:18:07.713 [default] SupportedResolutions = native, 640x480, 800x600, 1024x768 17:18:07.713 [overlay] TextureFilter = trilinear 17:18:07.713 [overlay] ThreadPriorityBoost = main 17:18:07.713 [default] VSync = app 17:18:07.713 [overlay] WinVersionLie = xp(5) 17:18:07.730 Failed to change process DPI awareness to "permonitor" via SetProcessDpiAwarenessContext 17:18:07.731 DDrawCompat loaded successfully 17:18:07.867 Installing display mode hooks 17:18:07.923 Installing registry hooks 17:18:07.923 Installing Direct3D driver hooks 17:18:07.927 Hooking user mode display driver: C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_d24a95fa21389db6\nvldumd.dll+0x22bd0 17:18:08.055 Dynamic vertex buffers are available 17:18:08.055 Dynamic index buffers are available 17:18:08.057 Supported z-buffer bit depths: 16, 24 17:18:08.057 Supported MSAA modes: msaa(3), msaa2x(0), msaa4x(0), msaa8x(0) 17:18:08.057 Supported resource formats: 17:18:08.057 {D3DDDIFMT_A8R8G8B8,0x4d8e10f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_X8R8G8B8,0x458ed0f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_R5G6B5,0x48ed0f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_X1R5G5B5,0x48e10f,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_A1R5G5B5,0xe007,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_A4R4G4B4,0xe007,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_A8,0xf,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_A2B10G10R10,0x48610f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_G16R16,0x40400f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_A2R10G10B10,0x486d0f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_A16B16G16R16,0x40600f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_A8P8,0x5000,0x0,0x0,16} 17:18:08.057 {D3DDDIFMT_P8,0x4400,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_L8,0x40800f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_A8L8,0x8007,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_V8U8,0x10001,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_X8L8V8U8,0x10001,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_Q8W8V8U8,0x5,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_V16U16,0x7,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_S8D24,0xc1,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_D24S8,0xc1,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_X8D24,0xc1,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_D24X8,0xc1,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_D16,0xc1,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_L16,0x40000f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_D32F_LOCKABLE,0xc1,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_G8R8,0xd,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_R8,0x40400f,0x0,0x0,0} 17:18:08.057 {D3DDDIFMT_R16F,0xc0400f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_G16R16F,0xc0400f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_A16B16G16R16F,0xc8610f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_R32F,0xc0400f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_G32R32F,0xc0400f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_A32B32G32R32F,0xc8600f,0x8b,0x8b,0} 17:18:08.057 {D3DDDIFMT_BINARYBUFFER,0x4000,0x0,0x0,0} 17:18:08.057 {FOURCC(P010),0x4007000,0x0,0x0,16} 17:18:08.057 {FOURCC(3x11),0x40700f,0x8b,0x8b,32} 17:18:08.057 {FOURCC(ATI1),0x1005,0x0,0x0,8} 17:18:08.057 {FOURCC(DXT1),0x8007,0x0,0x0,0} 17:18:08.057 {FOURCC(AV12),0x5000,0x0,0x0,12} 17:18:08.057 {FOURCC(NV12),0x4007000,0x0,0x0,12} 17:18:08.057 {FOURCC(YV12),0x4007000,0x0,0x0,12} 17:18:08.057 {FOURCC(ATI2),0x1005,0x0,0x0,8} 17:18:08.057 {FOURCC(DXT2),0x8007,0x0,0x0,0} 17:18:08.057 {FOURCC(YUY2),0x4007000,0x0,0x0,16} 17:18:08.057 {FOURCC(DXT3),0x8007,0x0,0x0,0} 17:18:08.057 {FOURCC(NV24),0x4007000,0x0,0x0,12} 17:18:08.057 {FOURCC(AI44),0x5000,0x0,0x0,8} 17:18:08.057 {FOURCC(DXT4),0x8007,0x0,0x0,0} 17:18:08.057 {FOURCC(DXT5),0x8007,0x0,0x0,0} 17:18:08.057 {FOURCC(3x16),0x407d0f,0x8b,0x8b,64} 17:18:08.057 {FOURCC(AIP8),0x5000,0x0,0x0,8} 17:18:08.057 {FOURCC(SSAA),0x4000,0x0,0x0,0} 17:18:08.057 {FOURCC(NVDB),0x4000,0x0,0x0,0} 17:18:08.057 {FOURCC(ATOC),0x4000,0x0,0x0,0} 17:18:08.057 {FOURCC(NVMD),0x4000,0x0,0x0,0} 17:18:08.057 {FOURCC(PLFF),0x4000,0x0,0x0,0} 17:18:08.057 {FOURCC(NULL),0x100009,0x8b,0x8b,0} 17:18:08.057 {FOURCC(NVDP),0x4000,0x0,0x0,0} 17:18:08.057 {FOURCC(NVCS),0xd,0x0,0x0,0} 17:18:08.057 {FOURCC(NVHS),0x5,0x0,0x0,0} 17:18:08.057 {FOURCC(NVHU),0x5,0x0,0x0,0} 17:18:08.057 {FOURCC(AYUV),0x5000,0x0,0x0,32} 17:18:08.057 {FOURCC(UYVY),0x4007000,0x0,0x0,16} 17:18:08.057 {FOURCC(INTZ),0x10c1,0x0,0x0,32} 17:18:08.059 Installing DirectDraw hooks 17:18:08.060 Installing Direct3D hooks 17:18:08.063 Installing GDI hooks 17:18:08.071 Finished installing hooks 17:48:56.022 DDrawCompat detached successfully

=Everything works

So in other words Single Player dosnt works, Multiplayer works.

I hope there is a solution cuz your Wrapper is the only one who can handle up to 7 players chaos skirmish match on the 8 player map "walled world" without slowdowns or crashes.

narzoul commented 11 months ago

I think it's the usual NVIDIA G-Sync crash in exclusive fullscreen mode. Even though you're using the default FullscreenMode=borderless setting, Windows has some built in compatibility shims set up for gamemd.exe, which forces it to use exclusive fullscreen mode. This takes precedence over the setting in DDrawCompat.

I'd recommend to add an application profile for gamemd.exe in NVIDIA Control Panel, and set Monitor Technology to Fixed Refresh there.

Alternatively, you could try renaming the executable to something else. That's not an option I could try, because I have the game installed through EA app and I can only launch it through EA app, so I can't rename anything. I'm not sure if this is possible with other releases of the game.

narzoul commented 11 months ago

Contrary to my expectations, the DXPrimaryEmulation shim calls SetAppCompatData pretty late, so it's easy to suppress it. Here's a fix that doesn't require turning G-Sync off: ddraw.zip (diff.txt compared to v0.4.0)

narzoul commented 7 months ago

Fixed in v0.5.0.