From edc121c27b83300e0339c5f24fa6bfcd2743534a Mon Sep 17 00:00:00 2001 From: rakslice Date: Tue, 14 Jan 2025 23:46:19 -0800 Subject: [PATCH] use appropriate blitters when SDL is running in 8-bit colour and we have a lower host colour depth --- src/CrossPlatform/video_blit.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/CrossPlatform/video_blit.cpp b/src/CrossPlatform/video_blit.cpp index 19e400f..2429e7e 100644 --- a/src/CrossPlatform/video_blit.cpp +++ b/src/CrossPlatform/video_blit.cpp @@ -577,9 +577,26 @@ bool Screen_blitter_init(VisualFormat const & visual_format, bool native_byte_or } } #else - // The UAE memory handlers will blit correctly - // --> no need for specialised blitters here - Screen_blit = Blit_Copy_Raw; + if (use_sdl_video && 8 > mac_depth && 8 == visual_format.depth) { + switch (mac_depth) { + case 1: + Screen_blit = Blit_Expand_1_To_8; + break; + case 2: + Screen_blit = Blit_Expand_2_To_8; + break; + case 4: + Screen_blit = Blit_Expand_4_To_8; + break; + default: + Screen_blit = Blit_Copy_Raw; + break; + } + } else { + // The UAE memory handlers will blit correctly + // --> no need for specialised blitters here + Screen_blit = Blit_Copy_Raw; + } #endif // If the blitter simply reduces to a copy, we don't need VOSF in DGA mode