Use unsigned instead of uint16_t in sprite drawing
Jeffrey Pfau jeffrey@endrift.com
Tue, 05 Nov 2013 23:13:37 -0800
1 files changed,
4 insertions(+),
4 deletions(-)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -1242,14 +1242,14 @@ #define SPRITE_XBASE_16(localX) unsigned xBase = (localX & ~0x7) * 4 + ((localX >> 1) & 2);
#define SPRITE_YBASE_16(localY) unsigned yBase = (localY & ~0x7) * (renderer->dispcnt.objCharacterMapping ? width >> 1 : 0x80) + (localY & 0x7) * 4; #define SPRITE_DRAW_PIXEL_16_NORMAL(localX) \ - uint16_t tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \ + unsigned tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \ tileData = (tileData >> ((localX & 3) << 2)) & 0xF; \ if (tileData && (!(renderer->spriteLayer[outX]) || ((renderer->spriteLayer[outX] & FLAG_ORDER_MASK) > flags))) { \ renderer->spriteLayer[outX] = palette[0x100 | tileData | (sprite->palette << 4)] | flags; \ } #define SPRITE_DRAW_PIXEL_16_OBJWIN(localX) \ - uint16_t tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \ + unsigned tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \ tileData = (tileData >> ((localX & 3) << 2)) & 0xF; \ if (tileData) { \ renderer->row[outX] |= FLAG_OBJWIN; \@@ -1259,14 +1259,14 @@ #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 : 0x80) + (localY & 0x7) * 8; #define SPRITE_DRAW_PIXEL_256_NORMAL(localX) \ - uint16_t tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \ + unsigned tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \ tileData = (tileData >> ((localX & 1) << 3)) & 0xFF; \ if (tileData && (!(renderer->spriteLayer[outX]) || ((renderer->spriteLayer[outX] & FLAG_ORDER_MASK) > flags))) { \ renderer->spriteLayer[outX] = palette[0x100 | tileData] | flags; \ } #define SPRITE_DRAW_PIXEL_256_OBJWIN(localX) \ - uint16_t tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \ + unsigned tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; \ tileData = (tileData >> ((localX & 1) << 3)) & 0xFF; \ if (tileData) { \ renderer->row[outX] |= FLAG_OBJWIN; \