Applied relevant upstream commits.

Converted AT NVR to be a device, so it gets auto-closed.
Added new machine_close() function which calls optional machine-custom close, updated machine table.
Small fixes here and there.
Re-wored the CDROM code to have a 'speeds' table instead of ugly hard-coding.
This commit is contained in:
waltje
2018-03-20 17:13:12 -05:00
parent 110070466a
commit 1cf45a9724
55 changed files with 1887 additions and 1414 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the Iomega ZIP drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)zip.c 1.0.5 2018/03/17
* Version: @(#)zip.c 1.0.6 2018/03/18
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -973,13 +973,12 @@ static void zip_command_common(uint8_t id)
bytes_per_second = 8333333.333333333333333; /* 8.3 MB/s PIO-2 speed */
} else
bytes_per_second = 3333333.333333333333333; /* 3.3 MB/s PIO-0 speed */
period = 1000000.0 / bytes_per_second;
dusec = (double) TIMER_USEC;
dusec = dusec * period * (double) (zip[id].packet_len);
period = 1000000.0 / bytes_per_second;
dusec = (double) TIMER_USEC;
dusec = dusec * period * (double) (zip[id].packet_len);
zip[id].callback = ((int64_t) dusec);
}
zip_set_callback(id);
}
@@ -2538,14 +2537,6 @@ void zip_write(uint8_t channel, uint32_t val, int length)
}
}
void zip_hard_reset(void)
{
int i = 0;
for (i=0; i<ZIP_NUM; i++)
zip_mode_sense_load(i);
}
/* Peform a master init on the entire module. */
void
@@ -2558,7 +2549,7 @@ zip_global_init(void)
void
void
zip_hard_reset(void)
{
int c;
@@ -2566,8 +2557,10 @@ zip_global_reset(void)
if (zip_drives[c].bus_type)
SCSIReset(zip_drives[c].scsi_device_id, zip_drives[c].scsi_device_lun);
zip_log("ZIP hard_reset drive=%d host=%02x\n", c, zip_drives[c].host_drive);
if (wcslen(zip_drives[c].image_path))
zip_load(c, zip_drives[c].image_path);
zip_mode_sense_load(c);
}
}