summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/super80.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2013-04-18 08:44:08 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2013-04-18 08:44:08 +0000
commitf30a3117806c7190217a6a1bccf344ff730a6bb7 (patch)
tree240d47327de16ed57117be50c49d42c70265dc7c /src/mess/machine/super80.c
parenteb0b5a552e90e20fd042ee694078a8f76e1513ef (diff)
moving some static functions in driver state for MESS drivers plus some other modernization (nw)
Diffstat (limited to 'src/mess/machine/super80.c')
-rw-r--r--src/mess/machine/super80.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/mess/machine/super80.c b/src/mess/machine/super80.c
index 73c5649985b..dae9af12f21 100644
--- a/src/mess/machine/super80.c
+++ b/src/mess/machine/super80.c
@@ -49,19 +49,18 @@ Z80PIO_INTERFACE( super80_pio_intf )
/**************************** CASSETTE ROUTINES *****************************************************************/
-static void super80_cassette_motor( running_machine &machine, UINT8 data )
+void super80_state::super80_cassette_motor( UINT8 data )
{
- super80_state *state = machine.driver_data<super80_state>();
if (data)
- state->m_cassette->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
+ m_cassette->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
else
- state->m_cassette->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
+ m_cassette->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
/* does user want to hear the sound? */
- if BIT(state->m_io_config->read(), 3)
- state->m_cassette->change_state(CASSETTE_SPEAKER_ENABLED,CASSETTE_MASK_SPEAKER);
+ if BIT(m_io_config->read(), 3)
+ m_cassette->change_state(CASSETTE_SPEAKER_ENABLED,CASSETTE_MASK_SPEAKER);
else
- state->m_cassette->change_state(CASSETTE_SPEAKER_MUTED,CASSETTE_MASK_SPEAKER);
+ m_cassette->change_state(CASSETTE_SPEAKER_MUTED,CASSETTE_MASK_SPEAKER);
}
/********************************************* TIMER ************************************************/
@@ -184,7 +183,7 @@ WRITE8_MEMBER( super80_state::super80_f0_w )
UINT8 bits = data ^ m_last_data;
m_shared = data;
speaker_level_w(m_speaker, BIT(data, 3)); /* bit 3 - speaker */
- if (BIT(bits, 1)) super80_cassette_motor(machine(), BIT(data, 1)); /* bit 1 - cassette motor */
+ if (BIT(bits, 1)) super80_cassette_motor(BIT(data, 1)); /* bit 1 - cassette motor */
m_cassette->output( BIT(data, 0) ? -1.0 : +1.0); /* bit 0 - cass out */
m_last_data = data;
@@ -195,7 +194,7 @@ WRITE8_MEMBER( super80_state::super80r_f0_w )
UINT8 bits = data ^ m_last_data;
m_shared = data | 0x14;
speaker_level_w(m_speaker, BIT(data, 3)); /* bit 3 - speaker */
- if (BIT(bits, 1)) super80_cassette_motor(machine(), BIT(data, 1)); /* bit 1 - cassette motor */
+ if (BIT(bits, 1)) super80_cassette_motor(BIT(data, 1)); /* bit 1 - cassette motor */
m_cassette->output( BIT(data, 0) ? -1.0 : +1.0); /* bit 0 - cass out */
m_last_data = data;
@@ -210,23 +209,22 @@ void super80_state::machine_reset()
membank("boot")->set_entry(1);
}
-static void driver_init_common( running_machine &machine )
+void super80_state::driver_init_common( )
{
- super80_state *state = machine.driver_data<super80_state>();
- UINT8 *RAM = state->memregion("maincpu")->base();
- state->membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xc000);
- machine.scheduler().timer_pulse(attotime::from_hz(200000), timer_expired_delegate(FUNC(super80_state::super80_timer),state)); /* timer for keyboard and cassette */
+ UINT8 *RAM = memregion("maincpu")->base();
+ membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xc000);
+ machine().scheduler().timer_pulse(attotime::from_hz(200000), timer_expired_delegate(FUNC(super80_state::super80_timer),this)); /* timer for keyboard and cassette */
}
DRIVER_INIT_MEMBER(super80_state,super80)
{
machine().scheduler().timer_pulse(attotime::from_hz(100), timer_expired_delegate(FUNC(super80_state::super80_halfspeed),this)); /* timer for 1MHz slowdown */
- driver_init_common(machine());
+ driver_init_common();
}
DRIVER_INIT_MEMBER(super80_state,super80v)
{
- driver_init_common(machine());
+ driver_init_common();
}
/*-------------------------------------------------