dxwrapper icon indicating copy to clipboard operation
dxwrapper copied to clipboard

[dd7to9] [d3d9ex] Shogo and Blood 2 doesn't work with Direct3D 9Ex

Open vini1264 opened this issue 2 months ago • 9 comments

Shogo and Blood 2 doesn't work with D3d9to9Ex = 1, both games crashes before reaching the main menu, having only dd7to9 = 1 works fine. Here's the attatched log files:

dxwrapper-client_shogo.log

dxwrapper-client_blood2.log

vini1264 avatar Oct 26 '25 16:10 vini1264

Can you try with the latest build?

Here is the build: dxwrapper.zip

elishacloud avatar Oct 30 '25 22:10 elishacloud

Still nothing, the log files still reports errors:

dxwrapper-client_blood2.log

dxwrapper-client_shogo.log

vini1264 avatar Oct 30 '25 23:10 vini1264

Try enabling DdrawEmulateSurface. That can help in some cases with locking surfaces when using Driect3DEx.

elishacloud avatar Oct 31 '25 02:10 elishacloud

DdrawEmulateSurface = 1 did nothing unfortunatelly, same result as before

vini1264 avatar Oct 31 '25 03:10 vini1264

The issue is that it is crashing inside ntdll after dxwrapper calls the d3d9 function CreateOffscreenPlainSurface(). This seems to be a bug in either Direct3D9 or in the OS. I found two fixes for this:

  1. Create the surface in video memory, even though the game asked for system memory surface.
  2. Create the surface with at least 64 pixels wide, even though the game is asking for a 35 pixel wide surface.

~Option 1 may have other side effects and is not a solution I want to use. So instead, I updated the DdrawEnableByteAlignment option to set width to a minimum of 64 pixels.~

~Enabling DdrawEnableByteAlignment with this new build should fix the issue: dxwrapper.zip~

elishacloud avatar Oct 31 '25 21:10 elishacloud

The last fix caused some issues. I decided to detect this specific case and then use video memory for this case: dxwrapper.zip

elishacloud avatar Oct 31 '25 21:10 elishacloud

I was about to report that the previous build was causing distortion issues with some 2D elements haha. This newer build seems to be working so far, I'll do a playthrough on both games and see how it goes.

vini1264 avatar Oct 31 '25 22:10 vini1264

One minor thing I noticed while playing both, there's an issue where the damage indicator isn't displayed correctly, the screen should be red when taking damage, in blood 2 only half of the screen is red, while in Shogo it's not displayed at all. But this is an issue in dd7to9 and not Direct3D 9Ex itself.

Image

vini1264 avatar Oct 31 '25 22:10 vini1264

It looks like this is a bug in the game. The game is sending an invalid rhw (transformed vertices) value. It is a float value and the game sends in a NAN (not a number) value. DX7 and older is more forgiving for this. However, DX9 drops the vertix if it is invalid.

I update the DdrawClampVertexZDepth option 2 to handle this case.

Here is an updated build that should fix this issue: dxwrapper.zip

elishacloud avatar Nov 20 '25 03:11 elishacloud

Whats the advantage of running the game in d3d9ex vs plain d3d9 anyways?

Axer128 avatar Dec 19 '25 04:12 Axer128

Direct3D9Ex has better alt+tab support and can, in some cases, offer better performance.

elishacloud avatar Dec 19 '25 04:12 elishacloud