From 9379290050a648905d937498987c1611529694ef Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 10 Apr 2017 01:48:35 -0700 Subject: [PATCH] DS GX: Fix 4-color texture coordinates --- CHANGES | 1 + src/ds/gx/software.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 5eadc5f68..67c307f25 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,7 @@ Bugfixes: - DS GX: Fix T-repeat textures (fixes mgba.io/i/577) - DS Video: Capture with alpha bit set - DS Video: Bitmap sprites use alpha bit for transparent + - DS GX: Fix 4-color texture coordinates Misc: - DS: Set boot complete bit in RAM on boot (fixes mgba.io/i/576, mgba.io/i/580, mgba.io/i/586) diff --git a/src/ds/gx/software.c b/src/ds/gx/software.c index a91c964f4..2c3638d89 100644 --- a/src/ds/gx/software.c +++ b/src/ds/gx/software.c @@ -152,7 +152,7 @@ static color_t _lookupColor(struct DSGXSoftwareRenderer* renderer, struct DSGXSo case 2: texel = ((uint8_t*) poly->texBase)[texelCoord >> 2]; if (texelCoord & 0x3) { - texel >>= 2 * texel & 3; + texel >>= 2 * (texelCoord & 0x3); } texel &= 0x3; break;