more work on ripper

This commit is contained in:
chudov
2008-12-10 06:48:38 +00:00
parent e3f461e43c
commit 905414db84
11 changed files with 732 additions and 441 deletions

View File

@@ -76,6 +76,7 @@ namespace Bwg.Scsi
SetCdSpeed = 0xBB,
MechanismStatus = 0xBD,
ReadCd = 0xBE,
SendDvdStructure = 0xBF
SendDvdStructure = 0xBF,
ReadCDDA = 0xD8
} ;
}

View File

@@ -2161,7 +2161,7 @@ namespace Bwg.Scsi
/// <param name="start"></param>
/// <param name="length"></param>
/// <param name="data">the memory area </param>
/// <param name="size">the size of the memory area given by the data parameter</param>
/// <param name="timeout">timeout (in seconds)</param>
/// <returns></returns>
public CommandStatus ReadCDAndSubChannel(MainChannelSelection mainmode, SubChannelMode submode, C2ErrorMode c2mode, byte exp, bool dap, uint start, uint length, IntPtr data, int timeout)
{
@@ -2204,6 +2204,41 @@ namespace Bwg.Scsi
return CommandStatus.Success;
}
/// <summary>
///
/// </summary>
/// <param name="submode">subchannel mode</param>
/// <param name="start"></param>
/// <param name="length"></param>
/// <param name="data">the memory area </param>
/// <param name="timeout">timeout (in seconds)</param>
/// <returns></returns>
public CommandStatus ReadCDDA(SubChannelMode submode, uint start, uint length, IntPtr data, int timeout)
{
if (m_logger != null)
{
string args = start.ToString() + ", " + length.ToString() + ", data";
m_logger.LogMessage(new UserMessage(UserMessage.Category.Debug, 8, "Bwg.Scsi.Device.ReadCDDA(" + args + ")"));
}
byte mode = (byte)(submode == SubChannelMode.QOnly ? 1 : submode == SubChannelMode.RWMode ? 2 : 0);
int size = 4 * 588 + (submode == SubChannelMode.QOnly ? 16 : submode == SubChannelMode.RWMode ? 96 : 0);
using (Command cmd = new Command(ScsiCommandCode.ReadCDDA, 12, data, size, Command.CmdDirection.In, timeout))
{
cmd.SetCDB8(1, 0 << 5); // lun
cmd.SetCDB32(2, start);
cmd.SetCDB24(7, length);
cmd.SetCDB8(10, mode); // Subchannel
CommandStatus st = SendCommand(cmd);
if (st != CommandStatus.Success)
return st;
}
return CommandStatus.Success;
}
/// <summary>
/// Read CD header data from the disk
/// </summary>