Skip to content

Commit ee39f5e

Browse files
committed
Fix for mega65-core bug #797, alt palette selection only possible when rowmask=0
1 parent 4700603 commit ee39f5e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

targets/mega65/vic4.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,14 +1479,17 @@ static XEMU_INLINE void vic4_render_char_raster ( void )
14791479
enable_bg_paint = 0;
14801480
else
14811481
enable_bg_paint = 1;
1482-
if (SXA_ATTR_BOLD(color_data) && SXA_ATTR_REVERSE(color_data) && !REG_VICIII_ATTRIBS)
1483-
used_palette = altpalette; // use the alternate palette from now in the scanline
1484-
else
1485-
used_palette = palette; // we do this as well, since there can be "double GOTOX" so we want back to "original" palette ...
1486-
if (SXA_4BIT_PER_PIXEL(color_data)) // this signals for rowmask [the rowmask itself is color_data & 0xFF]
1482+
if (SXA_4BIT_PER_PIXEL(color_data)) { // this signals for rowmask [the rowmask itself is color_data & 0xFF]
14871483
draw_mask = (color_data & (1 << char_row)) ? 0xFF : 0x00; // draw_mask is $FF (not masked) _or_ $00 (masked) ~ for the current char_row!
1488-
else
1484+
} else {
14891485
draw_mask = 0xFF;
1486+
1487+
// palette switches only allowed when rowmask=0
1488+
if (SXA_ATTR_BOLD(color_data) && SXA_ATTR_REVERSE(color_data) && !REG_VICIII_ATTRIBS)
1489+
used_palette = altpalette; // use the alternate palette from now in the scanline
1490+
else
1491+
used_palette = palette; // we do this as well, since there can be "double GOTOX" so we want back to "original" palette ...
1492+
}
14901493
continue;
14911494
}
14921495
}

0 commit comments

Comments
 (0)