all repos — mgba @ a7cb0ec85c908589b5c8b690e75eb08484962ec3

mGBA Game Boy Advance Emulator

GBA Video: Restore a fixed version of a removed optimization
Jeffrey Pfau jeffrey@endrift.com
Thu, 17 Sep 2015 19:47:29 -0700
commit

a7cb0ec85c908589b5c8b690e75eb08484962ec3

parent

bafcee7b1879b61e66302110aecf54f62b672325

2 files changed, 8 insertions(+), 0 deletions(-)

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

@@ -473,6 +473,10 @@ flags |= FLAG_TARGET_2 * background->target2;

int objwinFlags = FLAG_TARGET_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA && GBAWindowControlIsBlendEnable(renderer->objwin.packed)); objwinFlags |= flags; flags |= FLAG_TARGET_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA && GBAWindowControlIsBlendEnable(renderer->currentWindow.packed)); + if (renderer->blendEffect == BLEND_ALPHA && renderer->blda == 0x10 && renderer->bldb == 0) { + flags &= ~(FLAG_TARGET_1 | FLAG_TARGET_2); + objwinFlags &= ~(FLAG_TARGET_1 | FLAG_TARGET_2); + } uint32_t screenBase; uint32_t charBase;
M src/gba/renderers/software-private.hsrc/gba/renderers/software-private.h

@@ -184,6 +184,10 @@ GBAWindowControlIsBlendEnable(renderer->objwin.packed)); \

objwinFlags |= flags; \ flags |= FLAG_TARGET_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA && \ GBAWindowControlIsBlendEnable(renderer->currentWindow.packed)); \ + if (renderer->blendEffect == BLEND_ALPHA && renderer->blda == 0x10 && renderer->bldb == 0) { \ + flags &= ~(FLAG_TARGET_1 | FLAG_TARGET_2); \ + objwinFlags &= ~(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; \