Rainbow color problems in older games
- Windows XP, Vista and 7 have compatibility issues with DirectDraw games using 256 color depth resulting in incorrect colors.
- On Windows 7, these applications could also fully lock up the display requiring a hard reset.
- This color issue does not occur on Windows 8 and later; the steps below only apply to earlier versions.
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.
DirectDraw Compatibility Tool
DirectDraw Compatibility Tool is designed to fix color palette corruption in the old games.
DDrawCompat is a DLL wrapper aimed at fixing compatibility and performance issues with games based on DirectDraw and Direct3D 1-7. Partially supports GDI as well.
- w7ddpatcher is another simple method.
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.
Display Changer II
Display Changer II changes your Windows desktop width, height, color depth, refresh rate, and rotation temporarily or permanently (via a configuration file). Display Changer II can run another application in a specific display setting and return to the previous resolution when the application finishes. This feature can be used to change the color depth of the display temporarily to fix color problems
Use a graphics wrapper
Another method is using tools like DgVoodoo 2 to convert DirectDraw calls to equivalent, modern Direct3D ones.
- Windows 7 actually has a builtin, hidden fix for this issue but requires editing the registry.
32 bit only
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectDraw\Compatibility\<NameOfGame>] "Flags"=hex:00,08,00,00 "ID"=hex:00,00,00,00 "Name"="game.exe"
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DirectDraw\Compatibility\<NameOfGame>] "Flags"=hex:00,08,00,00 "ID"=hex:00,00,00,00 "Name"="game.exe"
7. Save it as fix.reg and run it to import it to the registry.
Kill Explorer with batch script
Paste the following into a text editor and save as a batch script. Run it from the game's folder:
TASKKILL /F /IM "explorer.exe" start /w [insert executable name here].exe start explorer.exe
- If script fails/crashes before it restores the Explorer, you will be left with a blank desktop screen and will have to manually restart the process by the windows key+R to bring up the run dialog and typing "explorer.exe"
- DirectDraw applications Freeze on Windows 7 anywhere between 1 minute and 3 hours into running them - Microsoft Answers
- gdi - "Exclusive" DirectDraw palette isn't actually exclusive - Stack Overflow
- 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