From d2cb9d3011aeecf7e76bb832fa413e95be05b995 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 27 Jul 2025 23:21:32 -0230 Subject: [PATCH] Revert palette to use ARGB8888, which allows the snapshot and libretro code to work without any further changes. --- src/common/FBBackendSDL.cxx | 4 ++-- src/common/tv_filters/AtariNTSC.hxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/FBBackendSDL.cxx b/src/common/FBBackendSDL.cxx index ea3bb51c2..3e3f745bf 100644 --- a/src/common/FBBackendSDL.cxx +++ b/src/common/FBBackendSDL.cxx @@ -47,7 +47,7 @@ FBBackendSDL::FBBackendSDL(OSystem& osystem) // It's done this way (vs directly accessing a FBSurfaceSDL object) // since the structure may be needed before any FBSurface's have // been created - myPixelFormat = SDL_GetPixelFormatDetails(SDL_PIXELFORMAT_RGBA32); + myPixelFormat = SDL_GetPixelFormatDetails(SDL_PIXELFORMAT_ARGB8888); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -588,7 +588,7 @@ void FBBackendSDL::setWindowIcon() ASSERT_MAIN_THREAD; SDL_Surface* surface = - SDL_CreateSurfaceFrom(32, 32, SDL_PIXELFORMAT_RGBA32, stella_icon, 32 * 4); + SDL_CreateSurfaceFrom(32, 32, pixelFormat().format, stella_icon, 32 * 4); SDL_SetWindowIcon(myWindow, surface); SDL_DestroySurface(surface); #endif diff --git a/src/common/tv_filters/AtariNTSC.hxx b/src/common/tv_filters/AtariNTSC.hxx index 6ccd1c7ff..d8d0bf3e7 100644 --- a/src/common/tv_filters/AtariNTSC.hxx +++ b/src/common/tv_filters/AtariNTSC.hxx @@ -212,13 +212,13 @@ class AtariNTSC } // Generates output in the specified 32-bit format. - // 8888: 00000000 BBBBBBBB GGGGGGGG RRRRRRRR (8-8-8-8 32-bit ABGR) + // 8888: 00000000 RRRRRRRR GGGGGGGG BBBBBBBB (8-8-8-8 32-bit ARGB) #define ATARI_NTSC_RGB_OUT_8888( index, rgb_out ) {\ uInt32 raw_ =\ kernel0 [(index) ] + kernel1 [((index)+10)%7+14] +\ kernelx0 [((index)+7)%14] + kernelx1 [((index)+ 3)%7+14+7];\ ATARI_NTSC_CLAMP( raw_, 0 );\ - (rgb_out) = (raw_>>21 & 0x000000FF)|(raw_>>3 & 0x0000FF00)|(raw_<<15 & 0x00FF0000);\ + (rgb_out) = (raw_>>5 & 0x00FF0000)|(raw_>>3 & 0x0000FF00)|(raw_>>1 & 0x000000FF);\ } // Common ntsc macros