summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/drivers/starwbc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/drivers/starwbc.c')
-rw-r--r--src/mess/drivers/starwbc.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/mess/drivers/starwbc.c b/src/mess/drivers/starwbc.c
index 6c465c9ac86..2235a73f9b4 100644
--- a/src/mess/drivers/starwbc.c
+++ b/src/mess/drivers/starwbc.c
@@ -39,16 +39,16 @@ public:
UINT16 m_r;
UINT16 m_o;
- 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_WRITE16_MEMBER(write_o);
DECLARE_WRITE16_MEMBER(write_r);
- TIMER_DEVICE_CALLBACK_MEMBER(leds_decay_tick);
- void leds_update();
+ TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
+ void display_update();
void prepare_and_update();
virtual void machine_start();
@@ -58,17 +58,17 @@ 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
-void starwbc_state::leds_update()
+void starwbc_state::display_update()
{
UINT16 active_state[0x10];
@@ -80,19 +80,19 @@ void starwbc_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])
{
output_set_digit_value(i, active_state[i]);
@@ -100,17 +100,17 @@ void starwbc_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(starwbc_state::leds_decay_tick)
+TIMER_DEVICE_CALLBACK_MEMBER(starwbc_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();
}
void starwbc_state::prepare_and_update()
@@ -120,9 +120,9 @@ void starwbc_state::prepare_and_update()
// R0,R2,R4,R6,R8
for (int i = 0; i < 5; i++)
- m_leds_state[i*2] = (m_r >> (i*2) & 1) ? (o & mask[i]) : 0;
+ m_display_state[i*2] = (m_r >> (i*2) & 1) ? (o & mask[i]) : 0;
- leds_update();
+ display_update();
}
@@ -227,17 +227,17 @@ INPUT_PORTS_END
void starwbc_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_r = 0;
m_o = 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_r));
save_item(NAME(m_o));
@@ -252,7 +252,7 @@ static MACHINE_CONFIG_START( starwbc, starwbc_state )
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(starwbc_state, write_o))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(starwbc_state, write_r))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("leds_decay", starwbc_state, leds_decay_tick, attotime::from_msec(10))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", starwbc_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_starwbc)