From 818ce96d0dd8be7f0e5c476f8667d5890230f7af Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 5 Nov 2013 04:13:49 -0800 Subject: [PATCH] Fix mixing colors on 16-bit --- src/gba/renderers/video-software.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 15248c520..3d2ad889d 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -1484,14 +1484,14 @@ static unsigned _mix(int weightA, unsigned colorA, int weightB, unsigned colorB) b = colorB & 0x3E0; c |= ((a * weightA + b * weightB) / 16) & 0x7E0; if (c & 0x0400) { - c |= 0x03E0; + c = (c & 0x001F) | 0x03E0; } a = colorA & 0x7C00; b = colorB & 0x7C00; c |= ((a * weightA + b * weightB) / 16) & 0xFC00; if (c & 0x8000) { - c |= 0x7C00; + c = (c &0x03FF) | 0x7C00; } #else a = colorA & 0xF8;