Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-16510

[GDI32] Wrong colors in 8-bit paletted mode bitmap graphics

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • Win32SS
    • None

    Description

      GDI32 Graphics API will consistently display the wrong colors in an 8-bit paletted graphics mode game. Program uses BitBlt to draw and SetPaletteEntries, SetDIBColorTable, SelectPalette and RealizePalette to set and update the palette

      Update based on comments and research:
      Can confirm the application uses RGB internally but switches it to BGR when updating GDI's palettes. This produces the correct colors on Windows and swapped on ReactOS. Disabling the switching code makes the correct colors appear on ReactOS and incorrect colors on Windows.
      The colors are still wrong even when setting the display to 8 bit palette mode (256 color) which means that GDI is setting the wrong colors in VGA memory too!

      I've made a simple color picker program and included it in Palette.zip for helping test this and future issues (Navigate with Arrow Keys, Z is OK and X is Cancel)

      Attachments

        1. ColorPalette.png
          10 kB
          -Tom-
        2. gdc_window_w2k3.png
          5 kB
          karlexceed
        3. gdc_window_xp.png
          5 kB
          karlexceed
        4. GDI_test_Good.png
          79 kB
          DougLyons
        5. ntgdi_palette_c.patch
          1 kB
          DougLyons
        6. ntgdi_palette_c.patch
          1 kB
          DougLyons
        7. ntgdi_palette_c.patch
          1 kB
          DougLyons
        8. ntgdi_palette_c.patch
          1 kB
          DougLyons
        9. Palette_eba00d1.png
          43 kB
          -Tom-
        10. Pallet_Bad01.png
          68 kB
          DougLyons
        11. ReactOS_0.4.8.png
          40 kB
          -Tom-
        12. ROS8bppScreen.png
          10 kB
          -Tom-
        13. VirtualBox_ReactOS_0.4.15-372_SetDIBitsToDevice.png
          33 kB
          -Tom-
        14. VirtualBox_ReactOS_14_11_2019_15_28_57.png
          30 kB
          -Tom-
        15. win32k.sys
          2.76 MB
          DougLyons
        16. Windows_CorrectColors.png
          5 kB
          -Tom-

        Issue Links

          Activity

            People

              DougLyons DougLyons
              -Tom- -Tom-
              Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: