diff --git a/CHANGES b/CHANGES index bf32459d7..813477ed1 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,7 @@ Bugfixes: - DS GX: Fix bitmap textures when no palette is mapped (fixes mgba.io/i/628) - DS GX: Don't reset state between buffer swaps (fixes mgba.io/i/642) - DS GX: Allow viewport to change in the middle of a frame + - DS GX: Properly mask address for slot 2 4x4-texel textures Misc: - DS: Set boot complete bit in RAM on boot (fixes mgba.io/i/576, mgba.io/i/580, mgba.io/i/586) - DS Memory: Ensure DS9 I/O is 8-byte aligned diff --git a/src/ds/gx/software.c b/src/ds/gx/software.c index d8cedf97b..e50d8f9e8 100644 --- a/src/ds/gx/software.c +++ b/src/ds/gx/software.c @@ -188,7 +188,7 @@ static color_t _lookupColor(struct DSGXSoftwareRenderer* renderer, struct DSGXSo return 0; } uint16_t half = DSGXTexParamsGetVRAMBase(poly->texParams) & 0x8000; - uint32_t slot1Base = (DSGXTexParamsGetVRAMBase(poly->texParams) << 1) + (texelCoord >> 2) + half; + uint32_t slot1Base = ((DSGXTexParamsGetVRAMBase(poly->texParams) << 1) & 0x7FFF) + (texelCoord >> 2) + half; uint16_t texel2 = renderer->d.tex[1][slot1Base]; uint16_t texel2Base = (texel2 & 0x3FFF) << 1; int a = 0x8;