all repos — mgba @ a0bae17267c5bb0b6c4406cedcd8da0249af28e5

mGBA Game Boy Advance Emulator

GBA Video: Fix sprite/backdrop blending regression
Vicki Pfau vi@endrift.com
Sun, 14 Jun 2020 19:16:33 -0700
commit

a0bae17267c5bb0b6c4406cedcd8da0249af28e5

parent

318a96bcb78da0f178fb87aacd78ef86521e4bb2

M CHANGESCHANGES

@@ -29,6 +29,7 @@ - GBA Video: Add missing parts of 256-color mode 0 mosaic (fixes mgba.io/i/1701)

- GBA Video: Fix double-size OBJ wrapping in GL renderer (fixes mgba.io/i/1712) - GBA Video: Simplify sprite cycle counting (fixes mgba.io/i/1279) - GBA Video: Add sprite cycle counting to GL (fixes mgba.io/i/1635) + - GBA Video: Fix sprite/backdrop blending regression - SM83: Emulate HALT bug Other fixes: - 3DS: Fix framelimiter on newer citro3d (fixes mgba.io/i/1771)
M src/gba/renderers/software-obj.csrc/gba/renderers/software-obj.c

@@ -165,7 +165,7 @@ int objwinSlowPath = GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt) && GBAWindowControlGetBlendEnable(renderer->objwin.packed) != GBAWindowControlIsBlendEnable(renderer->currentWindow.packed);

int variant = (renderer->target1Obj || GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT) && GBAWindowControlIsBlendEnable(renderer->currentWindow.packed) && (renderer->blendEffect == BLEND_BRIGHTEN || renderer->blendEffect == BLEND_DARKEN); - if (GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT || objwinSlowPath) { + if (GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT || (renderer->target1Obj && renderer->blendEffect == BLEND_ALPHA) || objwinSlowPath) { int target2 = renderer->target2Bd; target2 |= renderer->bg[0].target2; target2 |= renderer->bg[1].target2;