all repos — mgba @ 4ecdcf25f53a0ca18fc7bc74640d8b1ee4291799

mGBA Game Boy Advance Emulator

Disable blending in backgrounds when unnecessary
Jeffrey Pfau jeffrey@endrift.com
Sat, 11 Oct 2014 14:41:28 -0700
commit

4ecdcf25f53a0ca18fc7bc74640d8b1ee4291799

parent

bbcf161fec2d6bb860fd75fd9b9012457ce8e6c4

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

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

@@ -1193,6 +1193,9 @@

int flags = (background->priority << OFFSET_PRIORITY) | (background->index << OFFSET_INDEX) | FLAG_IS_BACKGROUND; flags |= FLAG_TARGET_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA); flags |= FLAG_TARGET_2 * background->target2; + if (renderer->blda == 0x10 && renderer->bldb == 0) { + flags &= ~(FLAG_TARGET_1 | FLAG_TARGET_2); + } uint32_t screenBase; uint32_t charBase;

@@ -1255,6 +1258,9 @@ \

int flags = (background->priority << OFFSET_PRIORITY) | (background->index << OFFSET_INDEX) | FLAG_IS_BACKGROUND; \ flags |= FLAG_TARGET_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA); \ flags |= FLAG_TARGET_2 * background->target2; \ + if (renderer->blda == 0x10 && renderer->bldb == 0) { \ + flags &= ~(FLAG_TARGET_1 | FLAG_TARGET_2); \ + } \ int variant = background->target1 && GBAWindowControlIsBlendEnable(renderer->currentWindow.packed) && (renderer->blendEffect == BLEND_BRIGHTEN || renderer->blendEffect == BLEND_DARKEN); \ color_t* palette = renderer->normalPalette; \ if (variant) { \