all repos — mgba @ f8b0acd86aa052a14f41d36527dcaa67bc2062b6

mGBA Game Boy Advance Emulator

Fix tile mapping for 256-color sprites
Jeffrey Pfau jeffrey@endrift.com
Mon, 13 May 2013 02:47:11 -0700
commit

f8b0acd86aa052a14f41d36527dcaa67bc2062b6

parent

c20efb42ffdda29e8ba1540b493805cee5158ef4

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

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

@@ -917,7 +917,7 @@ renderer->spriteLayer[outX] = renderer->variantPalette[0x100 | tileData | (sprite->palette << 4)] | flags; \

} #define SPRITE_XBASE_256(localX) unsigned xBase = (localX & ~0x7) * 8 + (localX & 6); -#define SPRITE_YBASE_256(localY) unsigned yBase = (localY & ~0x7) * (renderer->dispcnt.objCharacterMapping ? width : 0x100) + (localY & 0x7) * 8; +#define SPRITE_YBASE_256(localY) unsigned yBase = (localY & ~0x7) * (renderer->dispcnt.objCharacterMapping ? width : 0x80) + (localY & 0x7) * 8; #define SPRITE_DRAW_PIXEL_256_NORMAL(localX) \ uint16_t tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \