Skip to content

Commit 6071062

Browse files
committed
MEGA65: full colour MCM #419
The VIC-II legacy "MCM" mode (4 colours given by 2 bits / pixel) uses data read from colour RAM for bit combination "11". In MCM char mode the low 3 bits of that data can be used as colour index, as bit 4 tells if the character is MCM at all. In bitmap mode, the full 4 bit can be used. However on MEGA65 we have 8 bit wide colour RAM, which can then use all the 8 bits. $D063.6 controls this feature. This is currently experimental, there can be problems! The issue has been reported by @TheChief Introduced in branch next.
1 parent 9b4ae0b commit 6071062

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

targets/mega65/vic4.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ static XEMU_INLINE void vic4_render_char_raster ( void )
15191519
SXA_HORIZONTAL_FLIP(color_data), // hflip?
15201520
palette_now
15211521
);
1522-
} else if ((REG_MCM && (color_data & 8)) || (REG_MCM && REG_BMM)) { // Multicolor character
1522+
} else if ((REG_MCM && ((color_data & 8) || (vic_registers[0x63] & 0x40))) || (REG_MCM && REG_BMM)) { // Multicolor character
15231523
// using static vars: faster in a rapid loop like this, no need to re-adjust stack pointer all the time to allocate space and this way using constant memory address
15241524
// also, as an optimization, later, some value can be re-used and not always initialized here, when in reality VIC
15251525
// registers in current Xemu cannot change within a scanline anyway (ie, scanline precision based emulation/rendering)
@@ -1530,13 +1530,13 @@ static XEMU_INLINE void vic4_render_char_raster ( void )
15301530
// value 00 is common /w or w/o BMM so not initialized here
15311531
color_source_mcm[1] = char_value >> 4; // 01
15321532
color_source_mcm[2] = char_value & 0xF; // 10
1533-
color_source_mcm[3] = color_data & 0xF; // 11
1533+
color_source_mcm[3] = (vic_registers[0x63] & 0x40) ? color_data : color_data & 0xF; // 11
15341534
char_byte = *(row_data_base_addr + display_row * (LINESTEP_BYTES * 8) + 8 * line_char_index + sel_char_row);
15351535
} else {
15361536
// value 00 is common /w or w/o BMM so not initialized here
15371537
color_source_mcm[1] = REG_MULTICOLOR_1; // 01
15381538
color_source_mcm[2] = REG_MULTICOLOR_2; // 10
1539-
color_source_mcm[3] = color_data & 7; // 11
1539+
color_source_mcm[3] = (vic_registers[0x63] & 0x40) ? color_data : color_data & 7; // 11
15401540
char_byte = *(row_data_base_addr + (char_id * 8) + sel_char_row);
15411541
}
15421542
// FIXME: is this really a thing to have FLIP in bitmap mode AS WELL?!

0 commit comments

Comments
 (0)