From 6629aeebecb19d7a24782c1ab94735e3ee4fdd06 Mon Sep 17 00:00:00 2001
From: Vicki Pfau <vi@endrift.com>
Date: Fri, 24 Jun 2022 21:46:02 -0700
Subject: [PATCH] GBA Video: Fix high tiles rendering wrong on macOS

---
 src/gba/renderers/gl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gba/renderers/gl.c b/src/gba/renderers/gl.c
index a06b2e4d6..acd5dad7f 100644
--- a/src/gba/renderers/gl.c
+++ b/src/gba/renderers/gl.c
@@ -177,7 +177,7 @@ static const char* const _renderMode0 =
 	"		coord.y ^= 7;\n"
 	"	}\n"
 	"	int tile = map & 1023;\n"
-	"	int paletteEntry = renderTile(tile, map >> 12, coord & 7);\n"
+	"	int paletteEntry = renderTile(tile, (map >> 12) & 15, coord & 7);\n"
 	"	color = texelFetch(palette, ivec2(paletteEntry, int(texCoord.y)), 0);\n"
 	"}\n";