CD-ROM, ATAPI HDD, MO, and ZIP: correct bus speed arithmetic, makes especially MO and ZIP much faster.

This commit is contained in:
OBattler
2025-03-21 03:29:46 +01:00
parent 7575bdc562
commit 0ebadfb942
4 changed files with 36 additions and 52 deletions

View File

@@ -400,7 +400,8 @@ scsi_disk_bus_speed(scsi_disk_t *dev)
dev->callback = -1.0;
return 0.0;
} else
return ret * 1000000.0;
/* We get bytes per µs, so divide 1000000.0 by it. */
return 1000000.0 / ret;
}
}
@@ -484,6 +485,10 @@ scsi_disk_command_common(scsi_disk_t *dev)
break;
}
/*
For ATAPI, this will be 1000000.0 / µs_per_byte, and this will
convert it back to µs_per_byte.
*/
period = 1000000.0 / bytes_per_second;
scsi_disk_log(dev->log, "Byte transfer period: %" PRIu64 " us\n",
(uint64_t) period);