From d8eb5c7ff45a70478793104b06fc65d279adb265 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 26 Oct 2022 06:07:02 +0200 Subject: [PATCH] Change ATAPI CD-ROM phase earlier (the ATAPI specification's flow chart says it should happen when data is ready, but that behavior is not listed as mandatory, and at least one DOS CD-ROM driver from Acer expects it to be set right after the current command phase has finished). --- src/scsi/scsi_cdrom.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index 83451e71c..f57cfd9c5 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -689,6 +689,7 @@ scsi_cdrom_command_complete(scsi_cdrom_t *dev) ui_sb_update_icon(SB_CDROM | dev->id, 0); dev->packet_status = PHASE_COMPLETE; scsi_cdrom_command_common(dev); + dev->phase = 3; } static void @@ -696,6 +697,7 @@ scsi_cdrom_command_read(scsi_cdrom_t *dev) { dev->packet_status = PHASE_DATA_IN; scsi_cdrom_command_common(dev); + dev->phase = !(dev->packet_status & 0x01) << 1; } static void @@ -710,6 +712,7 @@ scsi_cdrom_command_write(scsi_cdrom_t *dev) { dev->packet_status = PHASE_DATA_OUT; scsi_cdrom_command_common(dev); + dev->phase = !(dev->packet_status & 0x01) << 1; } static void