Skip to content

Getting frame captures of Vanilla Black & White

Sandy edited this page Jul 22, 2022 · 9 revisions

Since Black & White for windows uses DirectDraw 7, most frame debuggers don't support capturing frames As of this writing (2019-11-13) this is the state of support:

  • Nvidia Nsight Supports OpenGL, Vulkan, D3D11 and D3D12.
  • RenderDoc Supports OpenGL, Vulkan, D3D11 and D3D12.
  • Api-trace Supports ddraw7, Direct3D8, Direct3D9, Direct3D10, Direct3D11, Direct3D12, OpenGL, but support for ddraw7 is buggy. It doesn't know when a frame ends (EndScene?). And it crashes during replays.

Getting a custom ddraw.dll

There are many implementations of ddraw.dll with different backends. We found that the wine OpenGL implementation is the most stable one. A version cross-compiled for windows is available on https://fdossena.com/?p=wined3d/index.frag and best working one is the latest, pre-vulkan.

Patching runblack.exe

According to the README wine ddraw requires runblack.exe to be patched:

  • Copy wined3d.dll and ddraw.dll to the directory of runblack.exe
  • Rename ddraw.dll to something with the same amount of letters such as wdraw.dll
  • Using a hex editor, replace "DDRAW.dll" with "wdraw.dll" in runblack.exe

Capturing a frame

As of this writing, api-trace and renderdoc cannot capture frames. Nvidia's Nsight is able as long as it has the correct settings. In Additional Options for OpenGL, the Frame Delimiter must be set to Flush.

Nsight 2022.3 no longer support 32 bit applications so get 2021.1

image

More

Nsight using wine ddraw is the easiest way of getting a capture but it is imperfect. Since ddraw is not the original implementation, there is lot of information lost. While debugging a frame, a lot of OpenGL specific calls can be seen which weren't the intention of the original developers. There are also strange artifacts such as geometry appearing with vertices pre-multiplied with matrices.

A more perfect solution would be to capture using renderdoc or apitrace which are both open source. This would require some patching on the side of these applications.

Apitrace

Api trace needs frame delimiters such as EndScene to be defined. It also needs d3dreplay to be fixed for the crashes it experiences while replaying. Some of the ddraw calls should also be set to verbose

Running apitrace dump will result in a very large number of calls being output to the terminal but they will be the original ddraw commands in order.

Renderdoc

Renderdoc is currently very far behind on api trace to capture and replay. It has support for trampolining off of d3d9 and d3d8 functions but do not support replaying. Therefore, it would need hooking into ddraw7 and replaying functionality to be added.