From b6d189d88b48d7058b4cd004f64edb6114d32378 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 24 Dec 2014 20:25:25 -0800 Subject: [PATCH] GBA Video: Fix windows not disabling target 1 appropriately (fixes #161) --- CHANGES | 1 + src/gba/renderers/video-software.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index b32a25c02..fa1ba97e0 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,7 @@ Bugfixes: - GBA Video: Fix blend issues with obscured middle layers - Video: Ensure FFmpeg encoder has audio frames - Video: Fix uncompressed PCM audio recording + - GBA Video: Fix windows not disabling target 1 appropriately (fixes #161) Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 76be4d1b5..91bd20e41 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -1276,7 +1276,7 @@ static void _drawBackgroundMode0(struct GBAVideoSoftwareRenderer* renderer, stru unsigned xBase; 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_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA && GBAWindowControlIsBlendEnable(renderer->currentWindow.packed)); flags |= FLAG_TARGET_2 * background->target2; if (renderer->blda == 0x10 && renderer->bldb == 0) { flags &= ~(FLAG_TARGET_1 | FLAG_TARGET_2); @@ -1349,7 +1349,7 @@ static void _drawBackgroundMode0(struct GBAVideoSoftwareRenderer* renderer, stru int32_t localY; \ \ 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_1 * (background->target1 && renderer->blendEffect == BLEND_ALPHA && GBAWindowControlIsBlendEnable(renderer->currentWindow.packed)); \ flags |= FLAG_TARGET_2 * background->target2; \ if (renderer->blda == 0x10 && renderer->bldb == 0) { \ flags &= ~(FLAG_TARGET_1 | FLAG_TARGET_2); \