diff options
Diffstat (limited to 'src/mame/drivers/hh_tms1k.cpp')
-rw-r--r-- | src/mame/drivers/hh_tms1k.cpp | 53 |
1 files changed, 16 insertions, 37 deletions
diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index ab05a4c0d52..ded2c6b7513 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -221,9 +221,13 @@ void hh_tms1k_state::machine_start() { + // resolve handlers + m_out_x.resolve(); + m_out_a.resolve(); + m_out_digit.resolve(); + // zerofill memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); @@ -241,7 +245,6 @@ void hh_tms1k_state::machine_start() save_item(NAME(m_display_wait)); save_item(NAME(m_display_state)); - /* save_item(NAME(m_display_cache)); */ // don't save! /* save_item(NAME(m_power_led)); */ // don't save! save_item(NAME(m_display_decay)); save_item(NAME(m_display_segmask)); @@ -272,11 +275,9 @@ void hh_tms1k_state::machine_reset() void hh_tms1k_state::display_update() { - u32 active_state[0x20]; - for (int y = 0; y < m_display_maxy; y++) { - active_state[y] = 0; + u32 active_state = 0; for (int x = 0; x <= m_display_maxx; x++) { @@ -286,41 +287,19 @@ void hh_tms1k_state::display_update() // determine active state u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; - active_state[y] |= (ds << x); - } - } + active_state |= (ds << x); - // on difference, send to output - for (int y = 0; y < m_display_maxy; y++) - if (m_display_cache[y] != active_state[y]) - { - if (m_display_segmask[y] != 0) - output().set_digit_value(y, active_state[y] & m_display_segmask[y]); - - const int mul = (m_display_maxx <= 10) ? 10 : 100; - for (int x = 0; x <= m_display_maxx; x++) - { - int state = active_state[y] >> x & 1; - char buf1[0x10]; // lampyx - char buf2[0x10]; // y.x - - if (x == m_display_maxx) - { - // always-on if selected - sprintf(buf1, "lamp%da", y); - sprintf(buf2, "%d.a", y); - } - else - { - sprintf(buf1, "lamp%d", y * mul + x); - sprintf(buf2, "%d.%d", y, x); - } - output().set_value(buf1, state); - output().set_value(buf2, state); - } + // output to y.x, or y.a when always-on + if (x != m_display_maxx) + m_out_x[y][x] = ds; + else + m_out_a[y] = ds; } - memcpy(m_display_cache, active_state, sizeof(m_display_cache)); + // output to digity + if (m_display_segmask[y] != 0) + m_out_digit[y] = active_state & m_display_segmask[y]; + } // output optional power led if (m_power_led != m_power_on) |