diff options
author | smf- <smf-@users.noreply.github.com> | 2013-12-22 22:06:05 +0000 |
---|---|---|
committer | smf- <smf-@users.noreply.github.com> | 2013-12-22 22:06:05 +0000 |
commit | abbb1424592638c2a775092df927d585c4bbf933 (patch) | |
tree | 823a97314361491d293c35584ba6e1c6fec38545 | |
parent | 25b08cec6bd4f5ed88ed6eeef7e188fb0b17b9a3 (diff) |
use MCFG_TIMER_DRIVER_ADD_PERIODIC for tape timer (nw)
-rw-r--r-- | src/mess/drivers/osi.c | 13 | ||||
-rw-r--r-- | src/mess/includes/osi.h | 3 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/mess/drivers/osi.c b/src/mess/drivers/osi.c index 77e2a157baf..8c873203e2f 100644 --- a/src/mess/drivers/osi.c +++ b/src/mess/drivers/osi.c @@ -644,6 +644,11 @@ INPUT_PORTS_END /* Machine Start */ +TIMER_DEVICE_CALLBACK_MEMBER( sb2m600_state::tape_tick ) +{ + m_acia_0->write_rx((m_cassette->input() > 0.0) ? 1 : 0); +} + WRITE_LINE_MEMBER( sb2m600_state::cassette_tx ) { m_cassette->output(state ? +1.0 : -1.0); @@ -796,6 +801,7 @@ static MACHINE_CONFIG_START( osi600, sb2m600_state ) /* cassette */ MCFG_CASSETTE_ADD("cassette", default_cassette_interface) + MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", sb2m600_state, tape_tick, attotime::from_hz(44100)) /* internal ram */ MCFG_RAM_ADD(RAM_TAG) @@ -817,6 +823,7 @@ static MACHINE_CONFIG_START( uk101, uk101_state ) /* cassette */ MCFG_CASSETTE_ADD("cassette", default_cassette_interface) + MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", sb2m600_state, tape_tick, attotime::from_hz(44100)) /* internal ram */ MCFG_RAM_ADD(RAM_TAG) @@ -850,6 +857,7 @@ static MACHINE_CONFIG_START( c1p, c1p_state ) /* cassette */ MCFG_CASSETTE_ADD("cassette", default_cassette_interface) + MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", sb2m600_state, tape_tick, attotime::from_hz(44100)) /* internal ram */ MCFG_RAM_ADD(RAM_TAG) @@ -921,9 +929,6 @@ void sb2m600_state::device_timer(emu_timer &timer, device_timer_id id, int param { switch (id) { - case TIMER_CASSETTE: - m_acia_0->write_rx(((m_cassette)->input() > 0.0) ? 1 : 0); - break; case TIMER_SETUP_BEEP: m_beeper->set_state(0); m_beeper->set_frequency(300); @@ -936,8 +941,6 @@ void sb2m600_state::device_timer(emu_timer &timer, device_timer_id id, int param DRIVER_INIT_MEMBER(c1p_state,c1p) { timer_set(attotime::zero, TIMER_SETUP_BEEP); - m_cassette_timer = timer_alloc(TIMER_CASSETTE); - m_cassette_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100)); } diff --git a/src/mess/includes/osi.h b/src/mess/includes/osi.h index d56dec945cb..8e7475021f2 100644 --- a/src/mess/includes/osi.h +++ b/src/mess/includes/osi.h @@ -30,7 +30,6 @@ class sb2m600_state : public driver_device public: enum { - TIMER_CASSETTE, TIMER_SETUP_BEEP }; @@ -63,6 +62,7 @@ public: DECLARE_WRITE8_MEMBER( keyboard_w ); DECLARE_WRITE8_MEMBER( ctrl_w ); DECLARE_WRITE_LINE_MEMBER( cassette_tx ); + TIMER_DEVICE_CALLBACK_MEMBER( tape_tick ); /* keyboard state */ UINT8 m_keylatch; @@ -96,7 +96,6 @@ public: required_ioport m_io_sound; required_ioport m_io_reset; optional_device<beep_device> m_beeper; - emu_timer *m_cassette_timer; protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |