all repos — mgba @ b3e1aa785326fafab1806bc76fa0f08fa9da78f7

mGBA Game Boy Advance Emulator

Don't blend if not target 1
Jeffrey Pfau jeffrey@endrift.com
Sat, 27 Apr 2013 00:11:04 -0700
commit

b3e1aa785326fafab1806bc76fa0f08fa9da78f7

parent

f7922c1627f8096966e1cceb77718b6009cf6110

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

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

@@ -335,7 +335,7 @@ uint16_t color; \

charBase = ((background->charBase + (mapData.tile << 5)) >> 1) + (localY << 1) + ((localX >> 2) & 1); \ uint16_t tileData = renderer->d.vram[charBase]; \ tileData >>= (localX & 0x3) << 2; \ - if (renderer->blendEffect == BLEND_NONE || renderer->blendEffect == BLEND_ALPHA) { \ + if (!background->target1 || renderer->blendEffect == BLEND_NONE || renderer->blendEffect == BLEND_ALPHA) { \ color = renderer->d.palette[(tileData & 0xF) | (mapData.palette << 4)]; \ } else { \ color = renderer->variantPalette[(tileData & 0xF) | (mapData.palette << 4)]; \

@@ -351,7 +351,7 @@ uint16_t color; \

charBase = ((background->charBase + (mapData.tile << 6)) >> 1) + (localY << 2) + ((localX >> 1) & 3); \ uint16_t tileData = renderer->d.vram[charBase]; \ tileData >>= (localX & 0x1) << 3; \ - if (renderer->blendEffect == BLEND_NONE || renderer->blendEffect == BLEND_ALPHA) { \ + if (!background->target1 || renderer->blendEffect == BLEND_NONE || renderer->blendEffect == BLEND_ALPHA) { \ color = renderer->d.palette[tileData & 0xFF]; \ } else if (renderer->blendEffect == BLEND_DARKEN) { \ color = _darken(renderer->d.palette[tileData & 0xFF], renderer->bldy); \