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