From 6881b6ec64474f87dcb14e8cdfe621f1e950ef6c Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 21 Dec 2019 20:04:18 +0100 Subject: [PATCH] The CD-ROM READ SUBCHANNEL command in header only mode now correctly returns the disc status and header type, fixes DOS CD players with OAKCDROM.SYS. --- src/scsi/scsi_cdrom.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index 045c78fa9..abfd8a6ef 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -9,7 +9,7 @@ * Implementation of the CD-ROM drive with SCSI(-like) * commands, for both ATAPI and SCSI usage. * - * Version: @(#)scsi_cdrom.c 1.0.72 2019/11/19 + * Version: @(#)scsi_cdrom.c 1.0.73 2019/12/13 * * Author: Miran Grca, * @@ -2076,10 +2076,13 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->buffer[pos++] = 0; dev->buffer[pos++] = 0; /*Subchannel length*/ /* Mode 0 = Q subchannel mode, first 16 bytes are indentical to mode 1 (current position), the rest are stuff like ISRC etc., which can be all zeroes. */ - if ((cdb[3] <= 3) && (alloc_length != 4)) { + if (cdb[3] <= 3) { dev->buffer[pos++] = cdb[3]; /*Format code*/ - dev->buffer[1] = cdrom_get_current_subchannel(dev->drv, &dev->buffer[4], msf); - dev->buffer[2] = alloc_length - 4; + + if (alloc_length != 4) { + dev->buffer[1] = cdrom_get_current_subchannel(dev->drv, &dev->buffer[4], msf); + dev->buffer[2] = alloc_length - 4; + } switch(dev->drv->cd_status) { case CD_STATUS_PLAYING: