mirror of
https://github.com/holub/mame
synced 2025-04-25 01:40:16 +03:00
t10mmc: added Play Audio MSF (0x47) command, used by Another CD Player and Astrocounter of Crescents.
This commit is contained in:
parent
e0938f4218
commit
d1485e2d04
@ -251,6 +251,41 @@ void t10mmc::ExecCommand()
|
||||
m_transfer_length = 0;
|
||||
break;
|
||||
|
||||
case T10MMC_CMD_PLAY_AUDIO_MSF:
|
||||
m_lba = (command[5] % 75) + ((command[4] * 75) % (60*75)) + (command[3] * (75*60));
|
||||
m_blocks = (command[8] % 75) + ((command[7] * 75) % (60*75)) + (command[6] * (75*60)) - m_lba;
|
||||
|
||||
// special cases: lba of 0 means MSF of 00:02:00
|
||||
if (m_lba == 0)
|
||||
{
|
||||
m_lba = 150;
|
||||
}
|
||||
else if (m_lba == 0xffffffff)
|
||||
{
|
||||
m_device->logerror("T10MMC: play audio from current not implemented!\n");
|
||||
}
|
||||
|
||||
m_device->logerror("T10MMC: PLAY AUDIO MSF at LBA %x for %x blocks (MSF %i:%i:%i - %i:%i:%i)\n",
|
||||
m_lba, m_blocks, command[3], command[4], command[5], command[6], command[7], command[8]);
|
||||
|
||||
trk = cdrom_get_track(m_cdrom, m_lba);
|
||||
|
||||
if (cdrom_get_track_type(m_cdrom, trk) == CD_TRACK_AUDIO)
|
||||
{
|
||||
m_cdda->start_audio(m_lba, m_blocks);
|
||||
m_audio_sense = SCSI_SENSE_ASC_ASCQ_AUDIO_PLAY_OPERATION_IN_PROGRESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_device->logerror("T10MMC: track is NOT audio!\n");
|
||||
set_sense(SCSI_SENSE_KEY_ILLEGAL_REQUEST, SCSI_SENSE_ASC_ASCQ_ILLEGAL_MODE_FOR_THIS_TRACK);
|
||||
}
|
||||
|
||||
m_phase = SCSI_PHASE_STATUS;
|
||||
m_status_code = SCSI_STATUS_CODE_GOOD;
|
||||
m_transfer_length = 0;
|
||||
break;
|
||||
|
||||
case T10MMC_CMD_PLAY_AUDIO_TRACK_INDEX:
|
||||
// be careful: tracks here are zero-based, but the SCSI command
|
||||
// uses the real CD track number which is 1-based!
|
||||
|
@ -36,6 +36,7 @@ protected:
|
||||
T10MMC_CMD_READ_SUB_CHANNEL = 0x42,
|
||||
T10MMC_CMD_READ_TOC_PMA_ATIP = 0x43,
|
||||
T10MMC_CMD_PLAY_AUDIO_10 = 0x45,
|
||||
T10MMC_CMD_PLAY_AUDIO_MSF = 0x47,
|
||||
T10MMC_CMD_PLAY_AUDIO_TRACK_INDEX = 0x48,
|
||||
T10MMC_CMD_PAUSE_RESUME = 0x4b,
|
||||
T10MMC_CMD_STOP_PLAY_SCAN = 0x4e,
|
||||
|
Loading…
Reference in New Issue
Block a user