osi: removed anonymous timer

This commit is contained in:
Robbbert 2020-10-09 19:14:17 +11:00
parent ac04c377a9
commit 5312d992b4
2 changed files with 8 additions and 18 deletions

View File

@ -827,6 +827,7 @@ void c1p_state::c1p(machine_config &config)
m_discrete->set_intf(osi600c_discrete_interface); m_discrete->set_intf(osi600c_discrete_interface);
m_discrete->add_route(ALL_OUTPUTS, "mono", 0.50); m_discrete->add_route(ALL_OUTPUTS, "mono", 0.50);
BEEP(config, "beeper", 300).add_route(ALL_OUTPUTS, "mono", 0.50); BEEP(config, "beeper", 300).add_route(ALL_OUTPUTS, "mono", 0.50);
TIMER(config, m_beep_timer).configure_generic(FUNC(c1p_state::beep_timer));
PIA6821(config, "pia_1", 0); PIA6821(config, "pia_1", 0);
PIA6821(config, "pia_2", 0); PIA6821(config, "pia_2", 0);
@ -922,22 +923,15 @@ ROM_END
/* Driver Initialization */ /* Driver Initialization */
void c1p_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) TIMER_DEVICE_CALLBACK_MEMBER(c1p_state::beep_timer)
{ {
switch (id) m_beeper->set_state(0);
{ m_beeper->set_clock(300);
case TIMER_SETUP_BEEP:
m_beeper->set_state(0);
m_beeper->set_clock(300);
break;
default:
throw emu_fatalerror("Unknown id in c1p_state::device_timer");
}
} }
void c1p_state::init_c1p() void c1p_state::init_c1p()
{ {
timer_set(attotime::zero, TIMER_SETUP_BEEP); m_beep_timer->adjust(attotime::zero);
} }

View File

@ -101,25 +101,21 @@ public:
c1p_state(const machine_config &mconfig, device_type type, const char *tag) c1p_state(const machine_config &mconfig, device_type type, const char *tag)
: sb2m600_state(mconfig, type, tag) : sb2m600_state(mconfig, type, tag)
, m_beeper(*this, "beeper") , m_beeper(*this, "beeper")
, m_beep_timer(*this, "beep_timer")
{ } { }
void init_c1p(); void init_c1p();
void c1p(machine_config &config); void c1p(machine_config &config);
protected: protected:
enum
{
TIMER_SETUP_BEEP
};
virtual void machine_start() override; virtual void machine_start() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
void osi630_ctrl_w(uint8_t data); void osi630_ctrl_w(uint8_t data);
void osi630_sound_w(uint8_t data); void osi630_sound_w(uint8_t data);
void c1p_mem(address_map &map); void c1p_mem(address_map &map);
TIMER_DEVICE_CALLBACK_MEMBER(beep_timer);
required_device<beep_device> m_beeper; required_device<beep_device> m_beeper;
required_device<timer_device> m_beep_timer;
}; };
class c1pmf_state : public c1p_state class c1pmf_state : public c1p_state