d8vk icon indicating copy to clipboard operation
d8vk copied to clipboard

Hidden And Dangerous - crashes after the ESRB notice is shown

Open WinterSnowfall opened this issue 3 years ago • 3 comments

The game works fine with WineD3D, but crashes after the ESRB notice is shown. I've captured a trace of the game with WineD3D, but it looks broken on replay (with lots of missing textures and models) - perhaps even the latest apitrace has some issues with proper capture? The game looks perfectly fine graphically with WineD3D, so I'm not sure what the problem is.

The good news, I guess, is that the trace reproduces the crash with d8vk (although the ESRB notice was not captured, and only a black screen is shown for a few seconds).

Software information

Hidden And Dangerous (GOG)

System information

  • GPU: Intel Xe (TigerLake GT2)
  • Driver: ANV/Mesa 23.0.99
  • Wine version: 7.22 Staging
  • DXVK version: d0f5903

Apitrace file(s)

hde.trace.tar.xz

Log files

WinterSnowfall avatar Jan 16 '23 20:01 WinterSnowfall

Seems like it expects R8G8B8 and P8 even though we don't advertise support for those.

@WinterSnowfall can confirm it still crashes on 1.0?

AlpyneDreams avatar May 16 '23 22:05 AlpyneDreams

@AlpyneDreams Yes, still very much crashes when it attempts to load the menu. I believe you had looked at the trace in the past and concluded the game needs texture palette support (P8) to work properly.

WinterSnowfall avatar May 17 '23 05:05 WinterSnowfall

Did some more testing here and confirmed that by doing something rather silly like the below in D3D8Device::CreateImageSurface:

    // use the backbuffer format if FMTD3D_P8 or D3DFMT_R8G8B8 is requested
    if (Format & D3DFMT_P8 || Format & D3DFMT_R8G8B8) {
        d3d9::D3DDISPLAYMODE pMode;
        GetD3D9()->GetDisplayMode(0, &pMode);
        Format = D3DFORMAT(pMode.Format);
    }

Gets the game to startup properly, but obviously texture format conversions aren't handled so everything looks psychedelic.

The game depends on us properly supporting (or converting) both FMTD3D_P8 and D3DFMT_R8G8B8, which apparently WineD3D is handling properly.

On a funny note, WineD3D is also reporting both formats as unsupported, however the game doesn't seem to care and proceeds to use them anyway.

WinterSnowfall avatar Aug 24 '23 09:08 WinterSnowfall