Previous 199869 Revisions Next

r26692 Sunday 22nd December, 2013 at 22:06:05 UTC by smf
use MCFG_TIMER_DRIVER_ADD_PERIODIC for tape timer (nw)
[src/mess/drivers]osi.c
[src/mess/includes]osi.h

trunk/src/mess/includes/osi.h
r26691r26692
3030public:
3131   enum
3232   {
33      TIMER_CASSETTE,
3433      TIMER_SETUP_BEEP
3534   };
3635
r26691r26692
6362   DECLARE_WRITE8_MEMBER( keyboard_w );
6463   DECLARE_WRITE8_MEMBER( ctrl_w );
6564   DECLARE_WRITE_LINE_MEMBER( cassette_tx );
65   TIMER_DEVICE_CALLBACK_MEMBER( tape_tick );
6666
6767   /* keyboard state */
6868   UINT8 m_keylatch;
r26691r26692
9696   required_ioport m_io_sound;
9797   required_ioport m_io_reset;
9898   optional_device<beep_device> m_beeper;
99   emu_timer *m_cassette_timer;
10099
101100protected:
102101   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mess/drivers/osi.c
r26691r26692
644644
645645/* Machine Start */
646646
647TIMER_DEVICE_CALLBACK_MEMBER( sb2m600_state::tape_tick )
648{
649   m_acia_0->write_rx((m_cassette->input() > 0.0) ? 1 : 0);
650}
651
647652WRITE_LINE_MEMBER( sb2m600_state::cassette_tx )
648653{
649654   m_cassette->output(state ? +1.0 : -1.0);
r26691r26692
796801
797802   /* cassette */
798803   MCFG_CASSETTE_ADD("cassette", default_cassette_interface)
804   MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", sb2m600_state, tape_tick, attotime::from_hz(44100))
799805
800806   /* internal ram */
801807   MCFG_RAM_ADD(RAM_TAG)
r26691r26692
817823
818824   /* cassette */
819825   MCFG_CASSETTE_ADD("cassette", default_cassette_interface)
826   MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", sb2m600_state, tape_tick, attotime::from_hz(44100))
820827
821828   /* internal ram */
822829   MCFG_RAM_ADD(RAM_TAG)
r26691r26692
850857
851858   /* cassette */
852859   MCFG_CASSETTE_ADD("cassette", default_cassette_interface)
860   MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", sb2m600_state, tape_tick, attotime::from_hz(44100))
853861
854862   /* internal ram */
855863   MCFG_RAM_ADD(RAM_TAG)
r26691r26692
921929{
922930   switch (id)
923931   {
924   case TIMER_CASSETTE:
925      m_acia_0->write_rx(((m_cassette)->input() > 0.0) ? 1 : 0);
926      break;
927932   case TIMER_SETUP_BEEP:
928933      m_beeper->set_state(0);
929934      m_beeper->set_frequency(300);
r26691r26692
936941DRIVER_INIT_MEMBER(c1p_state,c1p)
937942{
938943   timer_set(attotime::zero, TIMER_SETUP_BEEP);
939   m_cassette_timer = timer_alloc(TIMER_CASSETTE);
940   m_cassette_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100));
941944}
942945
943946

Previous 199869 Revisions Next


© 1997-2024 The MAME Team