mirror of
https://github.com/holub/mame
synced 2025-06-30 07:58:56 +03:00
prof80: Eliminate timer_set; use finder array for floppies (nw)
This commit is contained in:
parent
7bfe316fd4
commit
2c3f2a7c5d
@ -40,8 +40,8 @@
|
||||
|
||||
void prof80_state::motor(int mon)
|
||||
{
|
||||
if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(mon);
|
||||
if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(mon);
|
||||
if (m_floppy[0]->get_device()) m_floppy[0]->get_device()->mon_w(mon);
|
||||
if (m_floppy[1]->get_device()) m_floppy[1]->get_device()->mon_w(mon);
|
||||
|
||||
m_motor = mon;
|
||||
}
|
||||
@ -71,7 +71,7 @@ WRITE_LINE_MEMBER(prof80_state::motor_w)
|
||||
// trigger floppy motor off NE555 timer
|
||||
int t = 110 * RES_M(10) * CAP_U(6.8); // t = 1.1 * R8 * C6
|
||||
|
||||
timer_set(attotime::from_msec(t), TIMER_ID_MOTOR);
|
||||
m_floppy_motor_off_timer->adjust(attotime::from_msec(t));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -79,7 +79,7 @@ WRITE_LINE_MEMBER(prof80_state::motor_w)
|
||||
motor(0);
|
||||
|
||||
// reset floppy motor off NE555 timer
|
||||
timer_set(attotime::never, TIMER_ID_MOTOR);
|
||||
m_floppy_motor_off_timer->adjust(attotime::never);
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ WRITE_LINE_MEMBER(prof80_state::mstop_w)
|
||||
motor(1);
|
||||
|
||||
// reset floppy motor off NE555 timer
|
||||
timer_set(attotime::never, TIMER_ID_MOTOR);
|
||||
m_floppy_motor_off_timer->adjust(attotime::never);
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ READ8_MEMBER( prof80_state::status_r )
|
||||
data |= m_rs232b->cts_r() << 7;
|
||||
|
||||
// floppy index
|
||||
data |= (m_floppy0->get_device() ? m_floppy0->get_device()->idx_r() : m_floppy1->get_device() ? m_floppy1->get_device()->idx_r() : 1) << 5;
|
||||
data |= (m_floppy[0]->get_device() ? m_floppy[0]->get_device()->idx_r() : m_floppy[1]->get_device() ? m_floppy[1]->get_device()->idx_r() : 1) << 5;
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -431,6 +431,9 @@ void prof80_state::machine_start()
|
||||
m_rtc->cs_w(1);
|
||||
m_rtc->oe_w(1);
|
||||
|
||||
// create timer
|
||||
m_floppy_motor_off_timer = timer_alloc(TIMER_ID_MOTOR);
|
||||
|
||||
// register for state saving
|
||||
save_item(NAME(m_motor));
|
||||
save_item(NAME(m_ready));
|
||||
|
@ -38,8 +38,7 @@ public:
|
||||
, m_rtc(*this, UPD1990A_TAG)
|
||||
, m_fdc(*this, UPD765_TAG)
|
||||
, m_ram(*this, RAM_TAG)
|
||||
, m_floppy0(*this, UPD765_TAG":0")
|
||||
, m_floppy1(*this, UPD765_TAG":1")
|
||||
, m_floppy(*this, UPD765_TAG":%u", 0U)
|
||||
, m_ecb(*this, ECBBUS_TAG)
|
||||
, m_rs232a(*this, "rs232a")
|
||||
, m_rs232b(*this, "rs232b")
|
||||
@ -58,8 +57,7 @@ private:
|
||||
required_device<upd1990a_device> m_rtc;
|
||||
required_device<upd765a_device> m_fdc;
|
||||
required_device<ram_device> m_ram;
|
||||
required_device<floppy_connector> m_floppy0;
|
||||
required_device<floppy_connector> m_floppy1;
|
||||
required_device_array<floppy_connector, 2> m_floppy;
|
||||
required_device<ecbbus_device> m_ecb;
|
||||
required_device<rs232_port_device> m_rs232a;
|
||||
required_device<rs232_port_device> m_rs232b;
|
||||
|
Loading…
Reference in New Issue
Block a user