SDL: Disabled incorrect 16-bit Altivec blitters

From 8b8c51573bc568d70404a7d898ed07a8d2877bd8 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 29 Oct 2025 16:11:25 +0000
Subject: [PATCH] Disabled incorrect 16-bit Altivec blitters

---
 src/video/SDL_blit_N.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c
index bdf1681616c23..63468cd3a07b4 100644
--- a/src/video/SDL_blit_N.c
+++ b/src/video/SDL_blit_N.c
@@ -292,6 +292,7 @@ static void Blit_XRGB8888_RGB565Altivec(SDL_BlitInfo *info)
     }
 }
 
+#ifdef BROKEN_ALTIVEC_BLITTERS	// This doesn't properly expand to the lower destination bits
 static void Blit_RGB565_32Altivec(SDL_BlitInfo *info)
 {
     int height = info->dst_h;
@@ -370,9 +371,7 @@ static void Blit_RGB565_32Altivec(SDL_BlitInfo *info)
     while (condition) {                                   \
         unsigned sR, sG, sB;                              \
         unsigned short Pixel = *((unsigned short *)src);  \
-        sR = (Pixel >> 8) & 0xf8;                         \
-        sG = (Pixel >> 3) & 0xfc;                         \
-        sB = (Pixel << 3) & 0xf8;                         \
+        RGB_FROM_RGB565(Pixel, sR, sG, sB);               \
         ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
         src += 2;                                         \
         dst += 4;                                         \
@@ -508,9 +507,7 @@ static void Blit_RGB555_32Altivec(SDL_BlitInfo *info)
     while (condition) {                                   \
         unsigned sR, sG, sB;                              \
         unsigned short Pixel = *((unsigned short *)src);  \
-        sR = (Pixel >> 7) & 0xf8;                         \
-        sG = (Pixel >> 2) & 0xf8;                         \
-        sB = (Pixel << 3) & 0xf8;                         \
+        RGB_FROM_RGB555(Pixel, sR, sG, sB);               \
         ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
         src += 2;                                         \
         dst += 4;                                         \
@@ -567,6 +564,7 @@ static void Blit_RGB555_32Altivec(SDL_BlitInfo *info)
         dst += dstskip;
     }
 }
+#endif // BROKEN_ALTIVEC_BLITTERS
 
 static void BlitNtoNKey(SDL_BlitInfo *info);
 static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info);
@@ -2969,11 +2967,13 @@ static const struct blit_table normal_blit_1[] = {
 
 static const struct blit_table normal_blit_2[] = {
 #ifdef SDL_ALTIVEC_BLITTERS
+#ifdef BROKEN_ALTIVEC_BLITTERS
     // has-altivec
     { 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000,
       BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
     { 0x00007C00, 0x000003E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000,
       BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
+#endif // BROKEN_ALTIVEC_BLITTERS
 #endif
 #ifdef SDL_SSE4_1_INTRINSICS
     { 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF,