Use variant palette on sprites when target 1
Jeffrey Pfau jeffrey@endrift.com
Thu, 25 Apr 2013 00:28:39 -0700
1 files changed,
9 insertions(+),
1 deletions(-)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -422,7 +422,11 @@ unsigned xBase = (inX & ~0x7) * 4 + ((inX >> 1) & 2);
uint16_t tileData = renderer->d.vram[(yBase + charBase + xBase) >> 1]; tileData = (tileData >> ((inX & 3) << 2)) & 0xF; if (tileData) { - renderer->row[outX] = renderer->d.palette[0x100 | tileData | (sprite->palette << 4)]; + if (!renderer->target1Obj) { + renderer->row[outX] = renderer->d.palette[0x100 | tileData | (sprite->palette << 4)]; + } else { + renderer->row[outX] = renderer->variantPalette[0x100 | tileData | (sprite->palette << 4)]; + } renderer->flags[outX] = flags; } }@@ -436,6 +440,10 @@ }
} else if (renderer->blendEffect == BLEND_DARKEN) { for (int i = 0; i < 512; ++i) { renderer->variantPalette[i] = _darken(renderer->d.palette[i], renderer->bldy); + } + } else { + for (int i = 0; i < 512; ++i) { + renderer->variantPalette[i] = renderer->d.palette[i]; } } }