all repos — mgba @ bbb5c5ff94e104b34fdf4f45c07a87d7a01c1996

mGBA Game Boy Advance Emulator

GBA Video: Fix another blending regression
Jeffrey Pfau jeffrey@endrift.com
Sat, 26 Sep 2015 01:03:38 -0700
commit

bbb5c5ff94e104b34fdf4f45c07a87d7a01c1996

parent

e9c97bed0069f52007f429182cb64b16adc18cfd

2 files changed, 5 insertions(+), 5 deletions(-)

jump to
M src/gba/renderers/software-private.hsrc/gba/renderers/software-private.h

@@ -42,7 +42,7 @@ if (color >= current) {

if (current & FLAG_TARGET_1 && color & FLAG_TARGET_2) { color = _mix(renderer->blda, current, renderer->bldb, color); } else { - color = (current & 0x00FFFFFF) | ((current >> 1) & FLAG_REBLEND); + color = (current & 0x00FFFFFF) | ((current << 1) & FLAG_REBLEND); } } else { color = (color & ~FLAG_TARGET_2) | (current & FLAG_OBJWIN);

@@ -55,7 +55,7 @@ if (color >= current) {

if (current & FLAG_TARGET_1 && color & FLAG_TARGET_2) { color = _mix(renderer->blda, current, renderer->bldb, color); } else { - color = (current & 0x00FFFFFF) | ((current >> 1) & FLAG_REBLEND); + color = (current & 0x00FFFFFF) | ((current << 1) & FLAG_REBLEND); } } else { color = color & ~FLAG_TARGET_2;

@@ -69,7 +69,7 @@ UNUSED(renderer);

if (color < current) { color |= (current & FLAG_OBJWIN); } else { - color = (current & 0x00FFFFFF) | ((current >> 1) & FLAG_REBLEND); + color = (current & 0x00FFFFFF) | ((current << 1) & FLAG_REBLEND); } *pixel = color; }

@@ -78,7 +78,7 @@ static inline void _compositeNoBlendNoObjwin(struct GBAVideoSoftwareRenderer* renderer, uint32_t* pixel, uint32_t color,

uint32_t current) { UNUSED(renderer); if (color >= current) { - color = (current & 0x00FFFFFF) | ((current >> 1) & FLAG_REBLEND); + color = (current & 0x00FFFFFF) | ((current << 1) & FLAG_REBLEND); } *pixel = color; }
M src/gba/renderers/video-software.hsrc/gba/renderers/video-software.h

@@ -71,10 +71,10 @@ #define FLAG_PRIORITY 0xC0000000

#define FLAG_INDEX 0x30000000 #define FLAG_IS_BACKGROUND 0x08000000 #define FLAG_UNWRITTEN 0xFC000000 +#define FLAG_REBLEND 0x04000000 #define FLAG_TARGET_1 0x02000000 #define FLAG_TARGET_2 0x01000000 #define FLAG_OBJWIN 0x01000000 -#define FLAG_REBLEND 0x01000000 #define FLAG_ORDER_MASK 0xF8000000 #define IS_WRITABLE(PIXEL) ((PIXEL) & 0xFE000000)