mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Fix deferred blending when OBJWIN matches window (fixes #1905)
This commit is contained in:
parent
fc520d6e1e
commit
a7ab586639
1
CHANGES
1
CHANGES
|
@ -11,6 +11,7 @@ Emulation fixes:
|
|||
- GBA Video: Don't draw sprites using unmapped VRAM in GL renderer (fixes mgba.io/i/1865)
|
||||
- GBA Video: Fix rare regression blending semitransparent sprites (fixes mgba.io/i/1876)
|
||||
- GBA Video: Do not affect OBJ pixel priority when writing OBJWIN (fixes mgba.io/i/1890)
|
||||
- GBA Video: Fix deferred blending when OBJWIN matches window (fixes mgba.io/i/1905)
|
||||
Other fixes:
|
||||
- 3DS: Redo video sync to be more precise
|
||||
- 3DS: Fix crash with libctru 2.0 when exiting
|
||||
|
|
|
@ -643,17 +643,18 @@ static void GBAVideoSoftwareRendererDrawScanline(struct GBAVideoRenderer* render
|
|||
}
|
||||
if (softwareRenderer->forceTarget1 && (softwareRenderer->blendEffect == BLEND_DARKEN || softwareRenderer->blendEffect == BLEND_BRIGHTEN)) {
|
||||
x = 0;
|
||||
uint32_t mask = FLAG_REBLEND | FLAG_IS_BACKGROUND;
|
||||
uint32_t match = FLAG_REBLEND;
|
||||
if (GBARegisterDISPCNTIsObjwinEnable(softwareRenderer->dispcnt)) {
|
||||
mask |= FLAG_OBJWIN;
|
||||
if (GBAWindowControlIsBlendEnable(softwareRenderer->objwin.packed)) {
|
||||
match |= FLAG_OBJWIN;
|
||||
}
|
||||
}
|
||||
for (w = 0; w < softwareRenderer->nWindows; ++w) {
|
||||
int end = softwareRenderer->windows[w].endX;
|
||||
if (!GBAWindowControlIsBlendEnable(softwareRenderer->windows[w].control.packed)) {
|
||||
uint32_t mask = FLAG_REBLEND | FLAG_IS_BACKGROUND;
|
||||
uint32_t match = FLAG_REBLEND;
|
||||
bool objBlend = GBAWindowControlIsBlendEnable(softwareRenderer->objwin.packed);
|
||||
bool winBlend = GBAWindowControlIsBlendEnable(softwareRenderer->windows[w].control.packed);
|
||||
if (GBARegisterDISPCNTIsObjwinEnable(softwareRenderer->dispcnt) && objBlend != winBlend) {
|
||||
mask |= FLAG_OBJWIN;
|
||||
if (objBlend) {
|
||||
match |= FLAG_OBJWIN;
|
||||
}
|
||||
} else if (!winBlend) {
|
||||
x = end;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue