all repos — mgba @ 9b29344a87fea0e894babd6b5e21a1ca09e9f7cb

mGBA Game Boy Advance Emulator

DS GX: Fix unmapped slot 1 for compressed textures
Vicki Pfau vi@endrift.com
Mon, 20 Mar 2017 14:02:51 -0700
commit

9b29344a87fea0e894babd6b5e21a1ca09e9f7cb

parent

78b612595207cb07b280402667fafcf47a6dece6

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M src/ds/gx/software.csrc/ds/gx/software.c

@@ -177,7 +177,9 @@ }

uint8_t r, g, b; unsigned wr, wg, wb, wa; if (poly->texFormat == 5) { - // TODO: Slot 2 uses upper half + if (!renderer->d.tex[1]) { + return 0; + } uint16_t half = DSGXTexParamsGetVRAMBase(poly->poly->texParams) & 0x8000; uint32_t slot1Base = (DSGXTexParamsGetVRAMBase(poly->poly->texParams) << 1) + (texelCoord >> 2) + half; uint16_t texel2 = renderer->d.tex[1][slot1Base];