all repos — mgba @ 4ee338e5210dbe61f511e23ccc1f83109e691c7c

mGBA Game Boy Advance Emulator

GBA Video: Fix previous commit
Vicki Pfau vi@endrift.com
Wed, 20 Sep 2017 18:06:28 -0700
commit

4ee338e5210dbe61f511e23ccc1f83109e691c7c

parent

f1d6470fdbdf9ee90d99a319e2193ed048789ccc

3 files changed, 7 insertions(+), 6 deletions(-)

jump to
M CHANGESCHANGES

@@ -40,7 +40,7 @@ - GBA BIOS: Use core's VRAM variable instead of renderer's

- GBA Savedata: Fix 512 byte EEPROM saving as 8kB (fixes mgba.io/i/877) - SDL: Fix potential race condition when pressing keys (fixes mgba.io/i/872) - GBA: Fix keypad IRQs not firing when extra buttons are pressed - - GBA Video: Remove broken sprite blending hack (fixes mgba.io/i/532) + - GBA Video: Fix broken sprite blending hack (fixes mgba.io/i/532) Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
M src/gba/renderers/software-obj.csrc/gba/renderers/software-obj.c

@@ -166,8 +166,9 @@ target2 |= renderer->bg[1].target2 << (renderer->bg[1].priority);

target2 |= renderer->bg[2].target2 << (renderer->bg[2].priority); target2 |= renderer->bg[3].target2 << (renderer->bg[3].priority); if ((1 << GBAObjAttributesCGetPriority(sprite->c)) <= target2) { + flags |= FLAG_REBLEND; variant = 0; - } else { + } else if (!target2) { flags &= ~FLAG_TARGET_1; } }
M src/gba/renderers/software-private.hsrc/gba/renderers/software-private.h

@@ -43,7 +43,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 & FLAG_REBLEND); } } else { color = (color & ~FLAG_TARGET_2) | (current & FLAG_OBJWIN);

@@ -59,7 +59,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 & FLAG_REBLEND); } } else { color = color & ~FLAG_TARGET_2;

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

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

@@ -82,7 +82,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 & FLAG_REBLEND); } *pixel = color; }