Home

Home of Aqrit's ddwrapper
ddwrapper.zip ( src included )
updated: December 24, 2012
ddwrapper works by providing a proxy DLL, which the application connects to and treats like the real DDRAW.DLL. It intercepts ddraw calls and performs various actions before forwarding to the real DirectDraw interface.

*** Usage ***
Extract the included ddraw.dll and aqrit.cfg files to the same directory as your target executable.
Edit the config file as wanted. ( see below for possible options )

Warning: Do NOT overwrite your system ddraw.dll!
Warning: Windows likes to "virtualize" the config file if it resides within the "Program Files" directory.

You may also like DxWnd, dgVoodoo 2, WineD3D (builds), or Microsoft Application Compatibility Toolkit (ACT)

Note for developers: improved "wrapper" code here but it doesn't contain any compatibility "fixes".
BltMirror
0 = off
1 = on
2 = auto select
DDBLTFX_MIRRORLEFTRIGHT and DDBLTFX_MIRRORUPDOWN flags are unsupported on Windows 2000 and later and are never passed to the driver. [Microsoft] [uncensored?!]

Use GDI32.StretchBlt() to mirror onto an intermediate surface which is then passed to Blt(). Not needed if using DirectDraw's Hardware Emulation Layer.

BltNoTearing
0 = off
1 = on
DDBLTFX_NOTEARING flag is unsupported on Windows 2000 and later and is never passed to the driver. [Microsoft]

If DDBLTFX_NOTEARING then WaitForVerticalBlank() before the Blt(). (also see FakeVsync)

ColorFix
0 = off
1 = on
8-bit color palette entires are not shared properly on Windows Vista and later, which results in psychedelic colors.

Sets an undocumented hack by modifing an internal DirectDraw structure. ((DDRAWI_DIRECTDRAW_INT*)->lpLcl->dwAppHackFlags|=0x800)
It does NOT work for all games. Enabling this option may cause an error if ddraw's internal structures have changed. (like Wine)
An alternative if this setting isn't helping:
Open TaskMgr.exe and end the explorer.exe process
Launch your executable from the task manager's run menu
After exiting the game you may restart explorer.exe from the task manager's run menu
DisableHighDpiScaling
0 = off
1 = on
Applications that do not handle the [new] high DPI case are likely to exhibit visual artifacts. [Microsoft]

SetProcessDPIAware() to prevent scaling.

FakeVsync
0 = off
1 = on
2 = auto select
DirectDraw's Hardware Emulation Layer does not emulate vsync.

Sleep() awhile everytime the application asks for vsync to prevent the game from running too fast.

FakeVsyncInterval
0 = default
[n] = ms
Milliseconds between vertical blanking intervals for FakeVsync.

FakeVsyncInterval = 18 would equate roughly to 55 fps. ( 1000 / 18 = 55 )

MillisecondsFrames-Per-Second
1471
1566
16 ( default )62
1758
1855
ForceBltNoTearing
0 = off
1 = on
Attempt to impose vsync on an application. (to slow it down)

Add a DDBLTFX_NOTEARING flag to all of the primary surface's Blt operations. (also see FakeVsync, BltNoTearing)

ForceDirectDrawEmulation
0 = off
1 = on
2 = on + error lie
Use DirectDraw's Hardware Emulation Layer for all features.

DDCREATE_EMULATIONONLY
  • Pitch vs Width Issues [Microsoft]
  • Circumvent driver specific issues
  • Doesn't allow surfaces in video memory
Setting "2" - CreateSurface() calls that fail with DDERR_NODIRECTDRAWHW will report DDERR_OUTOFVIDEOMEMORY instead.
NoVideoMemory
0 = off
1 = on, threaded
2 = on, WM_TIMER
Try to create all the application's drawing surfaces in system memory ( Not video memory ). Fake the game's primary surface in system memory, Blt() to the real primary periodically.

Solves the following issues:
Directly accessing a video memory surface after it has been Unlocked() may causes problems.
Lock() and Unlock() on a video memory surface may be slow.
The HEL doesn't Flip() the primary surface correctly. [Microsoft]
The HEL fails to Lock() the primary surface.
( Also see ForceDirectDrawEmulation )

ShowFPS
0 = off
1 = Flip
2 = Blt
4 = BltFast
8 = Unlock
Display the roughly estimated rate of frames-per-second ( FPS ) in the top-left corner of the game window. Games can use several methods to display frames. Flip() is the only method that could not be called several times per frame. To track multiple methods add their identifiers together.

To track all methods set ShowFPS = 15 ( 1 + 2 + 4 + 8 = 15 )
SingleProcAffinity
0 = off
1 = on
Force all threads in a process to run on a single processor/core.

SetProcessAffinityMask()/SetThreadAffinityMask() may fix timing issues, but may impede performance. Useful to have applied to games of the DirectDraw era, though there may be no threading issues with DiretDraw itself. It is best to not use NoVideoMemory=1 with this option.


Windows and DirectDraw are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Bitpatch.com is not affiliated with anyone.