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. Windows_CorrectColors.png
          Windows_CorrectColors.png
          5 kB
        2. win32k.sys
          2.76 MB
        3. VirtualBox_ReactOS_14_11_2019_15_28_57.png
          VirtualBox_ReactOS_14_11_2019_15_28_57.png
          30 kB
        4. VirtualBox_ReactOS_0.4.15-372_SetDIBitsToDevice.png
          VirtualBox_ReactOS_0.4.15-372_SetDIBitsToDevice.png
          33 kB
        5. ROS8bppScreen.png
          ROS8bppScreen.png
          10 kB
        6. ReactOS_0.4.8.png
          ReactOS_0.4.8.png
          40 kB
        7. Pallet_Bad01.png
          Pallet_Bad01.png
          68 kB
        8. Palette.zip
          238 kB
        9. Palette_eba00d1.png
          Palette_eba00d1.png
          43 kB
        10. ntgdi_palette_c.patch
          1 kB
        11. ntgdi_palette_c.patch
          1 kB
        12. ntgdi_palette_c.patch
          1 kB
        13. ntgdi_palette_c.patch
          1 kB
        14. GDIProg.zip
          45 kB
        15. GDI_test_Good.png
          GDI_test_Good.png
          79 kB
        16. gdc_window_xp.png
          gdc_window_xp.png
          5 kB
        17. gdc_window_w2k3.png
          gdc_window_w2k3.png
          5 kB
        18. ColorPalette.png
          ColorPalette.png
          10 kB

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: