all repos — mgba @ cecf6adb2c5e60a847a75050917a0d47ec889466

mGBA Game Boy Advance Emulator

GBA Video: Fix 256-color sprites in GL renderer
Vicki Pfau vi@endrift.com
Wed, 15 May 2019 10:42:21 -0700
commit

cecf6adb2c5e60a847a75050917a0d47ec889466

parent

99d07c98c5d03510899c50a67573498900cddfef

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

jump to
M src/gba/renderers/gl.csrc/gba/renderers/gl.c

@@ -1126,7 +1126,7 @@ x >>= 23;

int align = GBAObjAttributesAIs256Color(sprite->a) && !GBARegisterDISPCNTIsObjCharacterMapping(renderer->dispcnt); unsigned charBase = (BASE_TILE >> 1) + (GBAObjAttributesCGetTile(sprite->c) & ~align) * 0x10; - int stride = GBARegisterDISPCNTIsObjCharacterMapping(renderer->dispcnt) ? (width >> 3) : (0x40 >> !GBAObjAttributesAIs256Color(sprite->a)); + int stride = GBARegisterDISPCNTIsObjCharacterMapping(renderer->dispcnt) ? (width >> 3) : (0x20 >> GBAObjAttributesAGet256Color(sprite->a)); if (spriteY + height >= 256) { spriteY -= 256;