# Ddraw tweaks

No primary SYSTEMMEMORY | NOSYSMEMPRIMARY | DirectDraw applications have much better performance if they can operate on system memory rather than video memory, particularly when reading surface memory. Since the virtual primary surface has to be read before it can be transferred to the actual primary surface, it's best to use system memory offscreen surfaces whenever possible. Unfortunately, some programs request hardware acceleration functions that are only available for video surfaces. This flag forces the virtual primary surface to be created in system memory, sacrificing performance for compatibility.
No backbuffer SYSTEMMEMORY | NOSYSMEMBACKBUF | Similar to the NOSYSMEMPRIMARY flag, but applied to the backbuffer surface. It's rare to need both of these flags, and which one to use depends on where the application performs the accelerated functions.
Lock/Unlock Pitch Fix | FIXPITCH | Some programs ignore the pitch value returned by the DirectDrawSurface::Lock method and fill the graphics buffer according to an incorrect predetermined pitch value. This discrepancy is caused when DxWnd creates virtual surfaces with varying pitch values that may not correspond to the original values when creating the surface on a different memory type (system memory and video memory). When this is happening to a hooked program, some elements may appear diagonally skewed. Note how the left border of the text widget in the figure below goes down and to the right rather than straight down, distorting the contained text as well. This flag resolves the issue by copying the graphic scan lines to the proper memory offset. For additional examples, see Examples > SnowBoard: Racer.
Width not power of 2 fix | POWER2WIDTH | Some programs produce texture surfaces of odd sizes, which are generally not supported but can be detected when the textures have an incorrect aspect ratio. This flag resolves the issue by copying the graphic scan lines to the proper memory offset. The most notable example of this issue is in Midtown Madness.
Fix ddraw refcount | FIXREFCOUNTER | Decrement the reference counter of some objects to properly track all of DxWnd's service objects.
Return 0 refcount | RETURNNULLREF | Always return a 0 reference counter when a surface or DirectDraw session is released.
Suppress overlay capability | SUPPRESSOVERLAY | Prevents the game from detecting any hardware overlay capability. Hardware overlay is very efficient, but not very flexible. If you run a program with hardware overlay in a window, you may be able to reposition and resize the window, but the blitted surface (the content of the window) doesn't move or change. This flag makes programs ignore hardware overlay capability so that you can move or stretch the window with expected results. The most notable example of this issue is in Moto Racer 2.
Set minimal caps | MINIMALCAPS | Simulates minimal hardware capabilities similar to what's available by the VirtualPC or VMWare emulators. Some older games may not support advanced features, in which case this flag can improve the rendering process and eliminate some artifacts.
Deinterlace movies | DEINTERLACE | Interlaced movies on old games would improve their frame rate by only showing the odd horizontal lines of the video, leaving even lines black. The black lines weren't very noticeable on old monitors, but the effect becomes more pronounced on modern computers. This flag detects interlaced movies and interpolates the lines above and below each black line to approximate a full video, improving the video quality at the cost of some extra CPU usage.
Set ZBufferBitDepths capability | SETZBUFFERBITDEPTHS | The dwZBufferBitDepths is an obsolete field in the DirectDraw surface descriptor. It is no longer set and should be ignored, but some old programs rely on the value of this field and may crash if the field is empty (contains the null value). This flag copies the value returned by the GetCaps method and places it into the dwZBufferBitDepths field. The most notable example of this issue is in Mech Commander 2.
Limit ddraw interface | LIMITDDRAW | Instead of using a specific version of DirectDraw, some programs simply request the most recent version available on the machine. Using a version of DirectDraw that is significantly newer than what was available when the game was developed may have poor results. This option hides newer versions of DirectDraw from the hooked program, basically allowing you to manually specify which version of DirectDraw the program should use. Choose a maximum DirectDraw version from the drop-down menu located near this option.
Forces HEL | FORCESHEL | Forces Hardware Emulation Layer.
Simulate BW monitor | BLACKWHITE | Activate a tweak in the palette handling that causes all colors to be replaced with the corresponding grayscale color. It works only on 8BPP palettized games or while emulating 16BPP on a 32BPP desktop.
Set 16BPP RGB565 encoding | USERGB565 | By default, DxWnd emulates 16BPP color with RGB555 encoding. The option forces RGB565. This option only impacts the video in emulation mode and with 16BPP color depth.
Make Backbuf attachable | BACKBUFATTACH | Alters the size specification of the created backbuffer so that it copes with the actual primary surface, so that it may be attachable to a ZBUFFER surface. It makes “Dave Mirra Freestyle BMX” playable.
Clear texture FourCC | CLEARTEXTUREFOURCC | Experimental flag for tweaking games. DxWnd lets you dump, edit, and replace all uncompressed game textures. Textures compressed with a FourCC codec can't be processed this way. This flag forces FourCC capabilities OFF in the capability query and in texture surface creation. This forces the game to use plain, uncompressed bitmap textures that can be easily tweaked. To avoid texture errors, you may need to adjust texture flags. This flag was introduced to allow uncompressed textures for the game "The Sting!".
No EXCLUSIVE coop level | NODDEXCLUSIVEMODE | When running a program in windowed mode, DxWnd suppresses the DirectDraw DDSCL_EXCLUSIVE mode in the SetCooperativeLevel wrapper, since this mode is not allowed in windowed mode. However, if windowed mode is not requested, DxWnd leaves the cooperative level flags as they are, allowing DDSCL_EXCLUSIVE cooperative mode if requested. This flag also suppresses the DDSCL_EXCLUSIVE mode in fullscreen mode (that is, when DDSCL_FULLSCREEN is set). This flag is required when running "Warhammer 40,000: Rites of War" in non-windowed fullscreen mode.