wd_fdc: clear head load after 3 disk revolutions, fixes z80netf format

command
This commit is contained in:
Dirk Best 2015-05-30 11:09:26 +02:00
parent bafa89c8a8
commit 51709eef04

View File

@ -1232,6 +1232,10 @@ void wd_fdc_t::spinup()
void wd_fdc_t::ready_callback(floppy_image_device *floppy, int state)
{
// why is this even possible?
if (!floppy)
return;
live_sync();
if(!ready_hooked)
return;
@ -1260,13 +1264,24 @@ void wd_fdc_t::index_callback(floppy_image_device *floppy, int state)
switch(sub_state) {
case IDLE:
if(motor_control) {
if(motor_control || head_control) {
motor_timeout ++;
if(motor_timeout >= 5) {
if(motor_control && motor_timeout >= 5) {
status &= ~S_MON;
if(floppy)
floppy->mon_w(1);
}
if (head_control && motor_timeout >= 3)
{
hld = false;
// signal drive to unload head
if (!hld_cb.isnull())
hld_cb(hld);
status &= ~S_HLD; // todo: should get this value from the drive
}
}
break;