all repos — mgba @ 17ca8f524a165cb15856b76925a17d68b2cdb09d

mGBA Game Boy Advance Emulator

GBA Video: Fix rare regression blending semitransparent sprites (fixes #1876)
Vicki Pfau vi@endrift.com
Mon, 07 Sep 2020 01:20:22 -0700
commit

17ca8f524a165cb15856b76925a17d68b2cdb09d

parent

d1178689cbd690b3f1d19a8f1bd93f6b2ffc246e

M CHANGESCHANGES

@@ -43,6 +43,7 @@ - GBA Video: Fix Hblank timing

- GBA Video: Invalidate map cache when modifying BGCNT (fixes mgba.io/i/1846) - GBA Video: Don't draw sprites using unmapped VRAM in GL renderer (fixes mgba.io/i/1865) - GBA Video: Implement green swap (fixes mgba.io/i/1609) + - GBA Video: Fix rare regression blending semitransparent sprites (fixes mgba.io/i/1876) - SM83: Emulate HALT bug Other fixes: - 3DS: Redo video sync to be more precise
M src/gba/renderers/software-obj.csrc/gba/renderers/software-obj.c

@@ -162,7 +162,7 @@ return 0;

} int objwinSlowPath = GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt) && GBAWindowControlGetBlendEnable(renderer->objwin.packed) != GBAWindowControlIsBlendEnable(renderer->currentWindow.packed); - int variant = (renderer->target1Obj || GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT) && + int variant = renderer->target1Obj && GBAWindowControlIsBlendEnable(renderer->currentWindow.packed) && (renderer->blendEffect == BLEND_BRIGHTEN || renderer->blendEffect == BLEND_DARKEN); if (GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT || (renderer->target1Obj && renderer->blendEffect == BLEND_ALPHA) || objwinSlowPath) {