Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Difference between revisions of "Glossary:DirectX/DirectDraw troubleshooting"

From PCGamingWiki, the wiki about fixing PC games
(fixed DirectX DLL link)
(rewrote intro; rearranged fixes in order of best to worst; replaced resolution dialogue method with PalettestealerSuspender)
Line 1: Line 1:
In [[Windows (Operating System)|Windows]] 7, Windows Vista and Windows XP some DirectDraw based older games have an odd color issue. Harsh basic colors will appear in different areas, particularly in black portions of the screen in many games designed for Windows 95 such as [[Command & Conquer]] and [[Age of Empires II]]. While the games remain playable, the bad coloration can be found to be distracting. For some games Windows 8 seems to have fixed this problem.
+
'''Key points'''
 
+
{{ii}} Windows XP, Vista and 7 have compatibility issues with DirectDraw games using 256 color depth resulting in incorrect colors.
The [[Windows Compatibility Mode]] article may also be relevant when running older games.
+
{{ii}} This color issue does not occur on Windows 8 and later; the steps below only apply to earlier versions.
 
 
If an older games cannot run due to a missing .DLL file, the [[Microsoft Windows#Older Games Missing .dll File in Windows Vista/7|Old Games on Windows Vista/Windows 7 Fix]] may help with that.
 
  
 
== Cause ==
 
== Cause ==
 
This issue appears to be caused by <code>Explorer.exe</code> resetting the system palette, essentially overwriting the palette defined by the game (hence the rainbow colors). This is evidenced by how taking a screenshot of an affected game will show just the discoloration with black where the other game assets would be rendered and by the fix itself.
 
This issue appears to be caused by <code>Explorer.exe</code> resetting the system palette, essentially overwriting the palette defined by the game (hence the rainbow colors). This is evidenced by how taking a screenshot of an affected game will show just the discoloration with black where the other game assets would be rendered and by the fix itself.
  
A more technical explanation: These games rely on DirectDraw, an API in [[DirectX]] which was used to render graphics which is now deprecated. More specifically, they used an exclusive palette, where they set the system palette (the colors the system can use, back when there were only 256 colors) to the palette the game wants to use. However, some applications try to set their own exclusive palette, causing conflicting colors since the game's exclusive palette is no longer actually exclusive and is set to the wrong colors. In newer versions of Windows, CSRSS and the desktop window (explorer.exe) set their own palette, which causes the odd colors.
+
A more technical explanation: These games rely on DirectDraw, an API in [[DirectX]] which was used to render graphics which is now deprecated. More specifically, they used an exclusive palette, where they set the system palette (the colors the system can use, back when there were only 256 colors) to the palette the game wants to use. However, some applications try to set their own exclusive palette, causing conflicting colors since the game's exclusive palette is no longer actually exclusive and is set to the wrong colors. In newer versions of Windows, CSRSS and the desktop window (explorer.exe) set their own palette, which causes the odd colors.<ref>[http://stackoverflow.com/questions/1054365/exclusive-directdraw-palette-isnt-actually-exclusive gdi - "Exclusive" DirectDraw palette isn't actually exclusive - Stack Overflow]</ref>
  
 
== Fixes ==
 
== Fixes ==
The most basic fix is to kill the Explorer.exe process either before running the application via the command line or use Alt-Tab to get out of the program and then killing the Explorer.exe process. Alternatively, there is a patcher for old games written by mudlord [http://www.sevenforums.com/gaming/2981-starcraft-fix-holy-cow-22.html#post866878 here] (the original link no longer works, but there is a mirror [http://www.mediafire.com/?6b1a618wdlejy6p here], or if you Google for the filename w7ddpatcher.zip). However this fix seems to be unreliable on Windows 7, 64 bit.
+
===w7ddpatcher===
 +
{{ii}} [http://www.mudlord.info/crap/ w7ddpatcher] is the simplest and best method.
 +
 
 +
===PalettestealerSuspender===
 +
[http://bedagainstthewall.blogspot.com/p/palettestealersuspender.html PalettestealerSuspender] prevents palette issues using a different method.<ref>[http://bedagainstthewall.blogspot.com/2009/07/solving-color-problem-red-grass-purple.html Bed Against The Wall: Solving Color Problem (Red Grass, Purple Water) In Age Of Empires 2: Age Of Kings (The Conquerors And Others Too) On Vista And Windows 7]</ref>
  
=== Scripted Fix ===
+
=== Kill Explorer ===
The fix can be scripted with a BAT file which will kill Explorer.exe, run the game in question, and then restart Explorer.exe once you have exited the game. Below is an example. Where the text between the square brackets describes the text.
+
The fix can be scripted with a BAT file which will kill Explorer.exe, run the game in question, and then restart Explorer.exe once you have exited the game.<ref>[http://superuser.com/questions/178731/killing-explorer-exe-when-a-process-starts-and-restarting-it-when-a-process-ends windows 7 - Killing explorer.exe when a process starts and restarting it when a process ends - Super User]</ref>
  
 
   REM -[ScriptName].bat
 
   REM -[ScriptName].bat
Line 22: Line 24:
  
 
You can place the BAT file on the desktop for some games, but others require that it be in the same folder as the EXE. In those cases, only use the executable name in place of the entire path and create a shortcut on your desktop to the executable.
 
You can place the BAT file on the desktop for some games, but others require that it be in the same folder as the EXE. In those cases, only use the executable name in place of the entire path and create a shortcut on your desktop to the executable.
 
=== Screen Resolution Dialogue ===
 
http://blog.macuyiko.com/2009/07/solving-color-problem-red-grass-purple.html
 
  
 
=== DxWnd DirectDraw emulation ===
 
=== DxWnd DirectDraw emulation ===
 
[http://sourceforge.net/projects/dxwnd/ DxWnd] was originally created to enable old DirectX games to run in a window. Nowadays it provides far more features: It can fix the odd rainbow color issue, enable time stretching, and you can decide between running the game in a window or in full screen.
 
[http://sourceforge.net/projects/dxwnd/ DxWnd] was originally created to enable old DirectX games to run in a window. Nowadays it provides far more features: It can fix the odd rainbow color issue, enable time stretching, and you can decide between running the game in a window or in full screen.
 
== Sources ==
 
* [http://gaming.stackexchange.com/questions/5909/how-do-i-get-an-older-windows-95-98-game-to-run-in-windows-7-64-bit-without-some]
 
* [http://superuser.com/questions/178731/killing-explorer-exe-when-a-process-starts-and-restarting-it-when-a-process-ends]
 
* [http://stackoverflow.com/questions/1054365/exclusive-directdraw-palette-isnt-actually-exclusive]
 
* [http://www.lacl.fr/~matran/wiki/index.php?title=Gaming_Windows_Compatibility]
 
  
 
== See also ==
 
== See also ==
 
* [[Windows Compatibility Mode]]
 
* [[Windows Compatibility Mode]]
 +
 +
{{References}}
  
 
[[Category:Fix]]
 
[[Category:Fix]]

Revision as of 10:01, 28 November 2014

Key points

Windows XP, Vista and 7 have compatibility issues with DirectDraw games using 256 color depth resulting in incorrect colors.
This color issue does not occur on Windows 8 and later; the steps below only apply to earlier versions.

Cause

This issue appears to be caused by Explorer.exe resetting the system palette, essentially overwriting the palette defined by the game (hence the rainbow colors). This is evidenced by how taking a screenshot of an affected game will show just the discoloration with black where the other game assets would be rendered and by the fix itself.

A more technical explanation: These games rely on DirectDraw, an API in DirectX which was used to render graphics which is now deprecated. More specifically, they used an exclusive palette, where they set the system palette (the colors the system can use, back when there were only 256 colors) to the palette the game wants to use. However, some applications try to set their own exclusive palette, causing conflicting colors since the game's exclusive palette is no longer actually exclusive and is set to the wrong colors. In newer versions of Windows, CSRSS and the desktop window (explorer.exe) set their own palette, which causes the odd colors.[1]

Fixes

w7ddpatcher

w7ddpatcher is the simplest and best method.

PalettestealerSuspender

PalettestealerSuspender prevents palette issues using a different method.[2]

Kill Explorer

The fix can be scripted with a BAT file which will kill Explorer.exe, run the game in question, and then restart Explorer.exe once you have exited the game.[3]

 REM -[ScriptName].bat
 taskkill /F /IM Explorer.exe
 [Path to game executable]
 start explorer.exe

You can place the BAT file on the desktop for some games, but others require that it be in the same folder as the EXE. In those cases, only use the executable name in place of the entire path and create a shortcut on your desktop to the executable.

DxWnd DirectDraw emulation

DxWnd was originally created to enable old DirectX games to run in a window. Nowadays it provides far more features: It can fix the odd rainbow color issue, enable time stretching, and you can decide between running the game in a window or in full screen.

See also


References