From 08949454299e1078dbcc733a8533dbb4c4ba7412 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Tue, 25 Apr 2023 19:09:51 +0200 Subject: machine/t10mmc.cpp: track command 48h just plays track when TNO start == TNO end (#11141) * fix redbook silent regression with konami/konamigv.cpp --- src/devices/machine/t10mmc.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/devices/machine/t10mmc.cpp b/src/devices/machine/t10mmc.cpp index f6cbd78b6a1..0d2cee2d0ad 100644 --- a/src/devices/machine/t10mmc.cpp +++ b/src/devices/machine/t10mmc.cpp @@ -345,11 +345,17 @@ void t10mmc::ExecCommand() break; } + // [4] track start + // [5] index start + // [7] track end + // [8] index end if (command[4] > command[7]) { // TODO: check error set_sense(SCSI_SENSE_KEY_ILLEGAL_REQUEST, SCSI_SENSE_ASC_ASCQ_AUDIO_PLAY_OPERATION_STOPPED_DUE_TO_ERROR); m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + + m_device->logerror("Error: start TNO (%d,%d) > end TNO (%d,%d)\n", command[4], command[5], command[7], command[8]); } else { @@ -360,12 +366,16 @@ void t10mmc::ExecCommand() if (end_track > command[7]) end_track = command[7]; - // HACK: assume index 0 & 1 means beginning of track and anything else means end of track - if (command[8] <= 1) - end_track--; + // konamigv lacrazyc just sends same track start/end + if (command[4] != command[7] && command[5] != command[8]) + { + // HACK: assume index 0 & 1 means beginning of track and anything else means end of track + if (command[8] <= 1) + end_track--; - if (m_sotc) - end_track = command[4]; + if (m_sotc) + end_track = command[4]; + } m_lba = m_cdrom->get_track_start(command[4] - 1); m_blocks = m_cdrom->get_track_start(end_track) - m_lba; @@ -376,6 +386,7 @@ void t10mmc::ExecCommand() m_cdda->start_audio(m_lba, m_blocks); m_audio_sense = SCSI_SENSE_ASC_ASCQ_AUDIO_PLAY_OPERATION_IN_PROGRESS; m_status_code = SCSI_STATUS_CODE_GOOD; + m_device->logerror("Starting audio TNO %d LBA %d blocks %d\n", trk, m_lba, m_blocks); } else { -- cgit v1.2.3