summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/hd44780.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/hd44780.cpp')
-rw-r--r--src/devices/video/hd44780.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/devices/video/hd44780.cpp b/src/devices/video/hd44780.cpp
index ac19c97ffcc..01035d4f5b5 100644
--- a/src/devices/video/hd44780.cpp
+++ b/src/devices/video/hd44780.cpp
@@ -471,10 +471,11 @@ void hd44780_device::control_write(u8 data)
// function set
if (!m_first_cmd && m_data_len == (BIT(m_ir, 4) ? 8 : 4) && (m_char_size != (BIT(m_ir, 2) ? 10 : 8) || m_num_line != (BIT(m_ir, 3) + 1)))
{
- logerror("HD44780 '%s': function set cannot be executed after other instructions unless the interface data length is changed\n", tag());
+ logerror("HD44780: function set cannot be executed after other instructions unless the interface data length is changed\n");
return;
}
+ m_first_cmd = false;
m_char_size = BIT(m_ir, 2) ? 10 : 8;
m_data_len = BIT(m_ir, 4) ? 8 : 4;
m_num_line = BIT(m_ir, 3) + 1;
@@ -484,6 +485,12 @@ void hd44780_device::control_write(u8 data)
LOG("HD44780: char size 5x%d, data len %d, lines %d\n", m_char_size, m_data_len, m_num_line);
return;
}
+ else if (m_first_cmd)
+ {
+ // Some machines do a "clear display" first, even though the datasheet insists "function set" must come before all else
+ LOG("HD44780: command %x ignored (function not set yet)\n", m_ir);
+ return;
+ }
else if (BIT(m_ir, 4))
{
// cursor or display shift
@@ -540,8 +547,6 @@ void hd44780_device::control_write(u8 data)
memset(m_ddram, 0x20, sizeof(m_ddram));
set_busy_flag(1520);
}
-
- m_first_cmd = false;
}
u8 hd44780_device::control_read()