shithub: riscv

Download patch

ref: 9fbce3b1b4fba5b302aff49b6b769ecdcae59faa
parent: 5d202d345616907d511b46e395226958fe66a2c3
author: aiju <devnull@localhost>
date: Wed Jun 13 05:52:41 EDT 2018

games/gb: attempt at fixing sprite priority

--- a/sys/src/games/gb/ppu.c
+++ b/sys/src/games/gb/ppu.c
@@ -210,7 +210,8 @@
 			chr = q->chr;
 			if((chr & ((q->t & SPRXFL) != 0 ? 0x0101 : 0x8080)) != 0 && (attr & TILSPR) == 0 &&
 					((mode & COL) != 0 && (reg[LCDC] & BGPRI) == 0 ||
-					(attr & TILPRI) == 0 && ((q->t & SPRPRI) == 0 || (attr & TILCOL0) != 0)))
+					(attr & TILCOL0) != 0 ||
+					(attr & TILPRI) == 0 && (q->t & SPRPRI) == 0))
 				if((q->t & SPRXFL) == 0)
 					picp[x] = pal[q->pal | chr >> 15 | chr >> 6 & 2] | TILSPR << prish;
 				else