bw12: add motor off delay (nw)

This commit is contained in:
cracyc 2019-11-26 14:20:48 -06:00
parent 248eb9a412
commit 6a42b2e152
2 changed files with 12 additions and 33 deletions

View File

@ -73,41 +73,16 @@ void bw12_state::bankswitch()
membank("bank1")->set_entry(m_bank);
}
void bw12_state::floppy_motor_off()
TIMER_DEVICE_CALLBACK_MEMBER(bw12_state::floppy_motor_off_tick)
{
if (m_motor0 || m_motor1)
return;
m_floppy0->mon_w(1);
m_floppy1->mon_w(1);
m_motor_on = 0;
}
TIMER_DEVICE_CALLBACK_MEMBER(bw12_state::floppy_motor_off_tick)
{
floppy_motor_off();
}
void bw12_state::set_floppy_motor_off_timer()
{
if (m_motor0 || m_motor1)
{
m_motor_on = 1;
m_floppy_timer->enable(false);
}
else
{
/* trigger floppy motor off NE556 timer */
/*
R18 = RES_K(100)
C11 = CAP_U(4.7)
*/
//m_floppy_timer->adjust(attotime::zero);
floppy_motor_off();
}
}
void bw12_state::write_ls259(int address, int data)
{
switch (address)
@ -145,10 +120,16 @@ void bw12_state::write_ls259(int address, int data)
break;
}
m_motor_on = m_motor0 || m_motor1;
m_floppy0->mon_w(!m_motor_on);
m_floppy1->mon_w(!m_motor_on);
if (m_motor0 || m_motor1)
{
m_motor_on = 1;
m_floppy0->mon_w(0);
m_floppy1->mon_w(0);
m_floppy_timer->adjust(attotime::never);
}
else
m_floppy_timer->adjust(attotime::from_msec(170));
}
WRITE8_MEMBER( bw12_state::ls259_w )

View File

@ -62,8 +62,6 @@ public:
{ }
void bankswitch();
void floppy_motor_off();
void set_floppy_motor_off_timer();
void write_ls259(int address, int data);
DECLARE_READ8_MEMBER( ls259_r );