all repos — mgba @ 6c1f03f4a20cbd13778d1953727e1ba9ca30fc94

mGBA Game Boy Advance Emulator

GBA Video: Fix force-alignment on 256 color linear objs
Vicki Pfau vi@endrift.com
Sun, 24 Dec 2017 17:05:12 -0800
commit

6c1f03f4a20cbd13778d1953727e1ba9ca30fc94

parent

1de5238e8f2992af1a4b8961477cf6e9ce78943c

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

jump to
M src/gba/renderers/software-obj.csrc/gba/renderers/software-obj.c

@@ -148,7 +148,8 @@ }

int32_t x = (uint32_t) GBAObjAttributesBGetX(sprite->b) << 23; x >>= 23; uint16_t* vramBase = &renderer->d.vram[BASE_TILE >> 1]; - unsigned charBase = (GBAObjAttributesCGetTile(sprite->c) & ~GBAObjAttributesAGet256Color(sprite->a)) * 0x20; + bool align = GBAObjAttributesAIs256Color(sprite->a) && !GBARegisterDISPCNTIsObjCharacterMapping(renderer->dispcnt); + unsigned charBase = (GBAObjAttributesCGetTile(sprite->c) & ~align) * 0x20; if (GBARegisterDISPCNTGetMode(renderer->dispcnt) >= 3 && GBAObjAttributesCGetTile(sprite->c) < 512) { return 0; }