summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/hd44780.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2024-05-05 13:46:07 +0200
committer Olivier Galibert <galibert@pobox.com>2024-05-05 13:46:52 +0200
commitb3ffbf757343e996e650ca014b36d06816ed3bb7 (patch)
tree3a835d212da831a06c346b849559a034cdb5b57e /src/devices/video/hd44780.cpp
parent62016959d34d7494a6546f72cb6a6c5ba1ae3225 (diff)
hd44780: Simplify some code
sh_adc: Remove some debug stuff psr540: Add the buttons
Diffstat (limited to 'src/devices/video/hd44780.cpp')
-rw-r--r--src/devices/video/hd44780.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/devices/video/hd44780.cpp b/src/devices/video/hd44780.cpp
index 314c1a8a85a..ca1fda0dd60 100644
--- a/src/devices/video/hd44780.cpp
+++ b/src/devices/video/hd44780.cpp
@@ -486,24 +486,23 @@ const u8 *hd44780_device::render()
{
uint16_t char_pos = line * 0x40 + ((pos + m_disp_shift) % line_size);
- int char_base;
+ const u8 *src;
if (m_ddram[char_pos] < 0x10)
{
// draw CGRAM characters
if (m_char_size == 8)
- char_base = (m_ddram[char_pos] & 0x07) * 8;
+ src = m_cgram + (m_ddram[char_pos] & 0x07) * 8;
else
- char_base = ((m_ddram[char_pos] >> 1) & 0x03) * 16;
+ src = m_cgram + ((m_ddram[char_pos] >> 1) & 0x03) * 16;
}
else
{
// draw CGROM characters
- char_base = m_ddram[char_pos] * 0x10;
+ src = m_cgrom + m_ddram[char_pos] * 0x10;
}
- const u8 *charset = (m_ddram[char_pos] < 0x10) ? m_cgram : m_cgrom;
u8 *dest = m_render_buf + 16 * (line * line_size + pos);
- memcpy (dest, charset + char_base, m_char_size);
+ memcpy (dest, src, m_char_size);
if (char_pos == m_ac)
{