all repos — mgba @ ec4c91dbda0eb871948335b4b005f2b4ac280140

mGBA Game Boy Advance Emulator

GBA Video: Copy higher priority target 1 flag
Vicki Pfau vi@endrift.com
Fri, 10 Jan 2020 21:20:20 -0800
commit

ec4c91dbda0eb871948335b4b005f2b4ac280140

parent

28383d4d319dd5c0db0682c5a8b544bb645dbf61

M CHANGESCHANGES

@@ -95,6 +95,7 @@ - GBA Memory: Fix open bus from IWRAM (fixes mgba.io/i/1575)

- GBA Video: Fix OpenGL renderer 512x512 backgrounds (fixes mgba.io/i/1572) - GBA Video: Fix BLDY for semitransparent sprite on non-target-2 backgrounds - GBA Video: Fix effects blending improperly in some non-last windows + - GBA Video: Copy higher priority target 1 flag Other fixes: - 3DS: Fix screen darkening (fixes mgba.io/i/1562) - Core: Fix uninitialized memory issues with graphics caches
M src/gba/renderers/software-obj.csrc/gba/renderers/software-obj.c

@@ -84,7 +84,7 @@ if ((current & FLAG_ORDER_MASK) > flags) { \

if (tileData) { \ renderer->spriteLayer[outX] = palette[tileData] | flags; \ } else if (current != FLAG_UNWRITTEN) { \ - renderer->spriteLayer[outX] = (current & ~FLAG_ORDER_MASK) | GBAObjAttributesCGetPriority(sprite->c) << OFFSET_PRIORITY; \ + renderer->spriteLayer[outX] = (current & ~(FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)) | (flags & (FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)); \ } \ }

@@ -97,7 +97,7 @@ if (tileData) { \

unsigned color = (renderer->row[outX] & FLAG_OBJWIN) ? objwinPalette[tileData] : palette[tileData]; \ renderer->spriteLayer[outX] = color | flags; \ } else if (current != FLAG_UNWRITTEN) { \ - renderer->spriteLayer[outX] = (current & ~FLAG_ORDER_MASK) | GBAObjAttributesCGetPriority(sprite->c) << OFFSET_PRIORITY; \ + renderer->spriteLayer[outX] = (current & ~(FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)) | (flags & (FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)); \ } \ }

@@ -119,7 +119,7 @@ if ((current & FLAG_ORDER_MASK) > flags) { \

if (tileData) { \ renderer->spriteLayer[outX] = palette[tileData] | flags; \ } else if (current != FLAG_UNWRITTEN) { \ - renderer->spriteLayer[outX] = (current & ~FLAG_ORDER_MASK) | GBAObjAttributesCGetPriority(sprite->c) << OFFSET_PRIORITY; \ + renderer->spriteLayer[outX] = (current & ~(FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)) | (flags & (FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)); \ } \ }

@@ -132,7 +132,7 @@ if (tileData) { \

unsigned color = (renderer->row[outX] & FLAG_OBJWIN) ? objwinPalette[tileData] : palette[tileData]; \ renderer->spriteLayer[outX] = color | flags; \ } else if (current != FLAG_UNWRITTEN) { \ - renderer->spriteLayer[outX] = (current & ~FLAG_ORDER_MASK) | GBAObjAttributesCGetPriority(sprite->c) << OFFSET_PRIORITY; \ + renderer->spriteLayer[outX] = (current & ~(FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)) | (flags & (FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)); \ } \ }