DS GX: Properly mask address for slot 2 4x4-texel textures

This commit is contained in:
Vicki Pfau 2017-04-12 23:55:39 -07:00
parent 516143b170
commit 047d812178
2 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ Bugfixes:
- DS GX: Fix bitmap textures when no palette is mapped (fixes mgba.io/i/628) - 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: 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: Allow viewport to change in the middle of a frame
- DS GX: Properly mask address for slot 2 4x4-texel textures
Misc: Misc:
- DS: Set boot complete bit in RAM on boot (fixes mgba.io/i/576, mgba.io/i/580, mgba.io/i/586) - 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 - DS Memory: Ensure DS9 I/O is 8-byte aligned

View File

@ -188,7 +188,7 @@ static color_t _lookupColor(struct DSGXSoftwareRenderer* renderer, struct DSGXSo
return 0; return 0;
} }
uint16_t half = DSGXTexParamsGetVRAMBase(poly->texParams) & 0x8000; 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 texel2 = renderer->d.tex[1][slot1Base];
uint16_t texel2Base = (texel2 & 0x3FFF) << 1; uint16_t texel2Base = (texel2 & 0x3FFF) << 1;
int a = 0x8; int a = 0x8;