🐛Fix detecting CD-i and CD-ROM XA on dumping and media-info.

This commit is contained in:
2018-02-04 20:24:48 +00:00
parent dfba0f6b71
commit a0ebde3b38
2 changed files with 31 additions and 0 deletions

View File

@@ -391,6 +391,18 @@ namespace DiscImageChef.Core.Devices.Dumping
lastSector = phour * 3600 * 75 + pmin * 60 * 75 + psec * 75 + pframe - 150;
}
else if(trk.POINT == 0xA0 && trk.ADR == 1)
{
switch(trk.PSEC)
{
case 0x10:
dskType = MediaType.CDI;
break;
case 0x20:
dskType = MediaType.CDROMXA;
break;
}
}
if(trackList.Count == 0)
{

View File

@@ -1158,6 +1158,25 @@ namespace DiscImageChef.Commands
DataFile.WriteTo("Media-Info command", outputPrefix, "_rawtoc.bin",
"SCSI READ TOC/PMA/ATIP", cmdBuf);
DicConsole.WriteLine("Raw TOC:\n{0}", FullTOC.Prettify(cmdBuf));
FullTOC.CDFullTOC? fullToc = FullTOC.Decode(cmdBuf);
if(fullToc.HasValue)
{
FullTOC.TrackDataDescriptor a0Track =
fullToc.Value.TrackDescriptors.FirstOrDefault(t => t.POINT == 0xA0 && t.ADR == 1);
if(a0Track.POINT == 0xA0)
{
switch(a0Track.PSEC)
{
case 0x10:
dskType = MediaType.CDI;
break;
case 0x20:
dskType = MediaType.CDROMXA;
break;
}
}
}
}
sense = dev.ReadPma(out cmdBuf, out senseBuf, dev.Timeout, out _);
if(sense)