GBA Video: Fix transparent OBJWIN pixel/sprite priority interaction (fixes #2809)

This commit is contained in:
Vicki Pfau 2025-06-09 00:25:47 -07:00
parent be021ea5de
commit ae6b0ed1be
2 changed files with 11 additions and 0 deletions

View File

@ -27,6 +27,7 @@ Emulation fixes:
- GBA Serialize: Fix some minor save state edge cases
- GBA Video: Disable BG target 1 blending when OBJ blending (fixes mgba.io/i/2722)
- GBA Video: Improve emulation of window start/end conditions (fixes mgba.io/i/1945)
- GBA Video: Fix transparent OBJWIN pixel/sprite priority interaction (fixes mgba.io/i/2809)
Other fixes:
- Core: Fix inconsistencies with setting game-specific overrides (fixes mgba.io/i/2963)
- Debugger: Fix writing to specific segment in command-line debugger

View File

@ -103,6 +103,11 @@
tileData = (tileData >> ((localX & 3) << 2)) & 0xF; \
if (tileData) { \
renderer->row[outX] |= FLAG_OBJWIN; \
} else { \
current = renderer->spriteLayer[outX]; \
if (current != FLAG_UNWRITTEN && (current & FLAG_ORDER_MASK) > flags) { \
renderer->spriteLayer[outX] = (current & ~(FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)) | (flags & (FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)); \
} \
}
#define SPRITE_XBASE_256(localX) unsigned xBase = (localX & ~0x7) * 8 + (localX & 6);
@ -138,6 +143,11 @@
tileData = (tileData >> ((localX & 1) << 3)) & 0xFF; \
if (tileData) { \
renderer->row[outX] |= FLAG_OBJWIN; \
} else { \
current = renderer->spriteLayer[outX]; \
if (current != FLAG_UNWRITTEN && (current & FLAG_ORDER_MASK) > flags) { \
renderer->spriteLayer[outX] = (current & ~(FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)) | (flags & (FLAG_ORDER_MASK | FLAG_REBLEND | FLAG_TARGET_1)); \
} \
}
int GBAVideoSoftwareRendererPreprocessSprite(struct GBAVideoSoftwareRenderer* renderer, struct GBAObj* sprite, int index, int y) {