diff options
Diffstat (limited to 'src/mess/drivers/wildfire.c')
-rw-r--r-- | src/mess/drivers/wildfire.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/mess/drivers/wildfire.c b/src/mess/drivers/wildfire.c index 93e66e5d31d..853f464bded 100644 --- a/src/mess/drivers/wildfire.c +++ b/src/mess/drivers/wildfire.c @@ -46,16 +46,16 @@ public: UINT8 m_d; UINT16 m_a; - UINT16 m_leds_state[0x10]; - UINT16 m_leds_cache[0x10]; - UINT8 m_leds_decay[0x100]; + UINT16 m_display_state[0x10]; + UINT16 m_display_cache[0x10]; + UINT8 m_display_decay[0x100]; DECLARE_READ8_MEMBER(read_k); DECLARE_WRITE8_MEMBER(write_d); DECLARE_WRITE16_MEMBER(write_a); - TIMER_DEVICE_CALLBACK_MEMBER(leds_decay_tick); - void leds_update(); + TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); + void display_update(); bool index_is_7segled(int index); virtual void machine_start(); @@ -65,15 +65,15 @@ public: /*************************************************************************** - LEDs + LED Display ***************************************************************************/ // The device strobes the outputs very fast, it is unnoticeable to the user. // To prevent flickering here, we need to simulate a decay. -// decay time, in steps of 10ms -#define LEDS_DECAY_TIME 4 +// decay time, in steps of 1ms +#define DISPLAY_DECAY_TIME 40 inline bool wildfire_state::index_is_7segled(int index) { @@ -81,14 +81,14 @@ inline bool wildfire_state::index_is_7segled(int index) return (index < 3); } -void wildfire_state::leds_update() +void wildfire_state::display_update() { UINT16 active_state[0x10]; for (int i = 0; i < 0x10; i++) { // update current state - m_leds_state[i] = (~m_a >> i & 1) ? m_d : 0; + m_display_state[i] = (~m_a >> i & 1) ? m_d : 0; active_state[i] = 0; @@ -96,19 +96,19 @@ void wildfire_state::leds_update() { int di = j << 4 | i; - // turn on powered leds - if (m_leds_state[i] >> j & 1) - m_leds_decay[di] = LEDS_DECAY_TIME; + // turn on powered segments + if (m_display_state[i] >> j & 1) + m_display_decay[di] = DISPLAY_DECAY_TIME; // determine active state - int ds = (m_leds_decay[di] != 0) ? 1 : 0; + int ds = (m_display_decay[di] != 0) ? 1 : 0; active_state[i] |= (ds << j); } } // on difference, send to output for (int i = 0; i < 0x10; i++) - if (m_leds_cache[i] != active_state[i]) + if (m_display_cache[i] != active_state[i]) { if (index_is_7segled(i)) output_set_digit_value(i, BITSWAP8(active_state[i],7,0,1,2,3,4,5,6) & 0x7f); @@ -117,17 +117,17 @@ void wildfire_state::leds_update() output_set_lamp_value(i*10 + j, active_state[i] >> j & 1); } - memcpy(m_leds_cache, active_state, sizeof(m_leds_cache)); + memcpy(m_display_cache, active_state, sizeof(m_display_cache)); } -TIMER_DEVICE_CALLBACK_MEMBER(wildfire_state::leds_decay_tick) +TIMER_DEVICE_CALLBACK_MEMBER(wildfire_state::display_decay_tick) { - // slowly turn off unpowered leds + // slowly turn off unpowered segments for (int i = 0; i < 0x100; i++) - if (!(m_leds_state[i & 0xf] >> (i>>4) & 1) && m_leds_decay[i]) - m_leds_decay[i]--; + if (!(m_display_state[i & 0xf] >> (i>>4) & 1) && m_display_decay[i]) + m_display_decay[i]--; - leds_update(); + display_update(); } @@ -147,13 +147,13 @@ READ8_MEMBER(wildfire_state::read_k) WRITE8_MEMBER(wildfire_state::write_d) { m_d = data; - leds_update(); + display_update(); } WRITE16_MEMBER(wildfire_state::write_a) { m_a = data; - leds_update(); + display_update(); } @@ -183,17 +183,17 @@ INPUT_PORTS_END void wildfire_state::machine_start() { // zerofill - memset(m_leds_state, 0, sizeof(m_leds_state)); - memset(m_leds_cache, 0, sizeof(m_leds_cache)); - memset(m_leds_decay, 0, sizeof(m_leds_decay)); + 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)); m_d = 0; m_a = 0; // register for savestates - save_item(NAME(m_leds_state)); - save_item(NAME(m_leds_cache)); - save_item(NAME(m_leds_decay)); + save_item(NAME(m_display_state)); + save_item(NAME(m_display_cache)); + save_item(NAME(m_display_decay)); save_item(NAME(m_d)); save_item(NAME(m_a)); @@ -209,7 +209,7 @@ static MACHINE_CONFIG_START( wildfire, wildfire_state ) MCFG_AMI_S2000_WRITE_D_CB(WRITE8(wildfire_state, write_d)) MCFG_AMI_S2000_WRITE_A_CB(WRITE16(wildfire_state, write_a)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("leds_decay", wildfire_state, leds_decay_tick, attotime::from_msec(10)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", wildfire_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_wildfire) |