all repos — mgba @ 32e0591fd0db4fc2b868865dd5db96e9bce73157

mGBA Game Boy Advance Emulator

Early finalization if possible
Jeffrey Pfau jeffrey@endrift.com
Sat, 02 Nov 2013 22:11:36 -0700
commit

32e0591fd0db4fc2b868865dd5db96e9bce73157

parent

53a52d8cf8954a1689cc0b8da79dab0ca09ee1f7

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

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

@@ -517,6 +517,8 @@ renderer->target1Bd = bldcnt.target1Bd;

renderer->target2Obj = bldcnt.target2Obj; renderer->target2Bd = bldcnt.target2Bd; + renderer->anyTarget2 = bldcnt.packed & 0x3F00; + if (oldEffect != renderer->blendEffect) { _updatePalettes(renderer); }

@@ -725,6 +727,9 @@

int flags = (background->priority << OFFSET_PRIORITY) | FLAG_IS_BACKGROUND; flags |= FLAG_TARGET_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA); flags |= FLAG_TARGET_2 * background->target2; + if (!renderer->anyTarget2) { + flags |= FLAG_FINALIZED; + } uint32_t screenBase; uint32_t charBase;

@@ -1001,6 +1006,9 @@ \

int flags = (background->priority << OFFSET_PRIORITY) | FLAG_IS_BACKGROUND; \ flags |= FLAG_TARGET_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA); \ flags |= FLAG_TARGET_2 * background->target2; \ + if (!renderer->anyTarget2) { \ + flags |= FLAG_FINALIZED; \ + } \ int variant = background->target1 && renderer->currentWindow.blendEnable && (renderer->blendEffect == BLEND_BRIGHTEN || renderer->blendEffect == BLEND_DARKEN); \ color_t* palette = renderer->normalPalette; \ if (variant) { \
M src/gba/renderers/video-software.hsrc/gba/renderers/video-software.h

@@ -115,6 +115,7 @@ unsigned target2Bd;

enum BlendEffect blendEffect; color_t normalPalette[512]; color_t variantPalette[512]; + int anyTarget2; uint16_t blda; uint16_t bldb;