all repos — mgba @ d221f8fd8b3a49982211c05a01bd0f006b56d167

mGBA Game Boy Advance Emulator

DS GX: Fix stencil buffer
Vicki Pfau vi@endrift.com
Wed, 22 Mar 2017 15:40:14 -0700
commit

d221f8fd8b3a49982211c05a01bd0f006b56d167

parent

d03528d4daf55a2b64f47562c36663ba2318d0fe

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/ds/gx/software.csrc/ds/gx/software.c

@@ -616,7 +616,7 @@ if (b > ab) {

ab = b; } if (a == 0x1F) { - if (!(s == 0x40 || (stencil[x] & 0x40))) { + if (!(s & 0x40) || (s & 0x3F && !(stencil[x] & 0x40))) { depth[x] = span->ep[0].coord[softwareRenderer->sort]; scanline[x] = color; s &= ~0x40;

@@ -629,7 +629,7 @@ color = _mix32(a, color, 0x1F - a, current);

color |= ab << 27; } if (stencil[x] != s) { - if (!(s == 0x40 || (stencil[x] & 0x40))) { + if (!(s & 0x40) || (s & 0x3F && !(stencil[x] & 0x40))) { if (DSGXPolygonAttrsIsUpdateDepth(span->poly->poly->polyParams)) { depth[x] = span->ep[0].coord[softwareRenderer->sort]; }