GB Video: Fix GBC background masking
Jeffrey Pfau jeffrey@endrift.com
Mon, 15 Feb 2016 22:53:02 -0800
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
src/gb/renderers/software.c
→
src/gb/renderers/software.c
@@ -282,7 +282,7 @@ if (GBRegisterLCDCIsObjSize(renderer->lcdc) && y - obj->y >= -8) {
++tileOffset; } } - uint8_t mask = GBObjAttributesIsPriority(obj->attr) ? 0 : 0x20; + uint8_t mask = GBObjAttributesIsPriority(obj->attr) ? ~0x1C : ~0x3F; int p; if (renderer->model >= GB_MODEL_CGB) { p = (GBObjAttributesGetCGBPalette(obj->attr) + 8) * 4;@@ -306,7 +306,7 @@ uint8_t tileDataUpper = data[(objTile * 8 + bottomY) * 2 + 1];
tileDataUpper >>= bottomX; tileDataLower >>= bottomX; color_t current = renderer->row[x]; - if (((tileDataUpper | tileDataLower) & 1) && current <= mask) { + if (((tileDataUpper | tileDataLower) & 1) && !(current & mask)) { renderer->row[x] = p | ((tileDataUpper & 1) << 1) | (tileDataLower & 1); } }