From 6a111545a11c294f339742c6e66e776f58e5cc80 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 22 Mar 2020 23:12:02 +0100 Subject: [PATCH] ZIP and (SCSI) CD-ROM code now round the maximum transfer size to the nearest sector size for disk access commands, fixes CD-ROM booting on later ASUS BIOS'es. --- src/disk/zip.c | 6 ++++++ src/scsi/scsi_cdrom.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/disk/zip.c b/src/disk/zip.c index e0fc5d783..429c68dab 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -815,8 +815,14 @@ zip_update_request_length(zip_t *dev, int len, int block_len) /* For media access commands, make sure the requested DRQ length matches the block length. */ switch (dev->current_cdb[0]) { case 0x08: + case 0x0a: case 0x28: + case 0x2a: case 0xa8: + case 0xaa: + /* Round it to the nearest 2048 bytes. */ + dev->max_transfer_len = (dev->max_transfer_len >> 9) << 9; + /* Make sure total length is not bigger than sum of the lengths of all the requested blocks. */ bt = (dev->requested_blocks * block_len); diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index ccb936901..1c9c1cab4 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -562,6 +562,10 @@ scsi_cdrom_update_request_length(scsi_cdrom_t *dev, int len, int block_len) case 0x08: case 0x28: case 0xa8: + /* Round it to the nearest 2048 bytes. */ + dev->max_transfer_len = (dev->max_transfer_len >> 11) << 11; + /* FALLTHROUGH */ + case 0xb9: case 0xbe: /* Make sure total length is not bigger than sum of the lengths of