From ab699b662a2c983fef96eb3167d93e8dbe36bb99 Mon Sep 17 00:00:00 2001 From: Mark Garlanger Date: Sat, 16 Dec 2023 08:39:45 -0600 Subject: [PATCH] heathkit/tlb.cpp: Reverse bits in font ROMs on start to avoid doing it on scan out. (#11842) --- src/mame/heathkit/tlb.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mame/heathkit/tlb.cpp b/src/mame/heathkit/tlb.cpp index 4370d978380..dfefae1310f 100644 --- a/src/mame/heathkit/tlb.cpp +++ b/src/mame/heathkit/tlb.cpp @@ -212,6 +212,14 @@ void heath_tlb_device::device_start() m_key_click_timer = timer_alloc(FUNC(heath_tlb_device::key_click_off), this); m_bell_timer = timer_alloc(FUNC(heath_tlb_device::bell_off), this); + + // Flip bits in font ROM to avoid having to flip them during scan out since some + // boards with graphics has the pixel graphic reversed from the font layout. Doing + // it for all devices for consistency. + for (size_t i = 0; i < m_p_chargen.length(); i++) + { + m_p_chargen[i] = bitswap<8>(m_p_chargen[i], 0, 1, 2, 3, 4, 5, 6, 7); + } } void heath_tlb_device::device_reset() @@ -448,7 +456,7 @@ MC6845_UPDATE_ROW(heath_tlb_device::crtc_update_row) // Display a scanline of a character (8 pixels) for (int b = 0; 8 > b; ++b) { - *p++ = palette[BIT(gfx, 7 - b)]; + *p++ = palette[BIT(gfx, b)]; } } } @@ -1220,7 +1228,7 @@ MC6845_UPDATE_ROW(heath_superset_tlb_device::crtc_update_row) // Display a scanline of a character (8 pixels) for (int b = 0; 8 > b; ++b) { - *p++ = palette[BIT(gfx, 7 - b)]; + *p++ = palette[BIT(gfx, b)]; } } } @@ -1449,7 +1457,7 @@ MC6845_UPDATE_ROW(heath_gp19_tlb_device::crtc_update_row) // Display a scanline of a character (8 pixels) for (int b = 0; 8 > b; ++b) { - *p++ = palette[BIT(gfx, 7 - b)]; + *p++ = palette[BIT(gfx, b)]; } } } @@ -1683,7 +1691,7 @@ MC6845_UPDATE_ROW(heath_imaginator_tlb_device::crtc_update_row) chr &= 0x7f; } - output |= bitswap<8>(m_p_chargen[(chr << 4) | ra] ^ inv, 0, 1, 2, 3, 4, 5, 6, 7); + output |= m_p_chargen[(chr << 4) | ra] ^ inv; } if (m_graphics_mode_active && (x > 7 ) && (x < 73))