Skip to content

Commit

Permalink
[CUERipper] Add setting to force ReadCDCommand
Browse files Browse the repository at this point in the history
The ReadCDCommand is not detected correctly in some cases. This has
been reported for Plextor drives PX-5224TA and PX-708A.

- Add CUERipper setting `ReadCDCommands`
  The setting can be modified by editing `CUERipper\settings.txt`
  Remark: CUERipper needs to be closed while editing the file.
- Values for the drive specific setting `ReadCDCommands` are:
  0 (ReadCdBEh), 1 (ReadCdD8h), 2 (Unknown/AutoDetect)
  Default: 2
- Resolves:
  https://hydrogenaud.io/index.php/topic,125668.0.html
  • Loading branch information
c72578 committed Apr 28, 2024
1 parent ce2bae6 commit f52b795
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CUERipper/CUERipperConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public CUERipperConfig()

this.DriveOffsets = new SerializableDictionary<string, int>();
this.DriveC2ErrorModes = new SerializableDictionary<string, int>();
this.ReadCDCommands = new SerializableDictionary<string, int>();
}

internal static XmlSerializer serializer = new XmlSerializer(typeof(CUERipperConfig));
Expand All @@ -103,5 +104,9 @@ public CUERipperConfig()

// 0 (None), 1 (Mode294), 2 (Mode296), 3 (Auto)
public SerializableDictionary<string, int> DriveC2ErrorModes { get; set; }

// 0 (ReadCdBEh), 1 (ReadCdD8h), 2 (Unknown/AutoDetect)
public SerializableDictionary<string, int> ReadCDCommands { get; set; }

}
}
20 changes: 20 additions & 0 deletions CUERipper/frmCUERipper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,26 @@ private void DrivesLookup(object o)
reader.DriveC2ErrorMode = 3; // 0 (None), 1 (Mode294), 2 (Mode296), 3 (Auto)
}
cueRipperConfig.DriveC2ErrorModes[reader.ARName] = reader.DriveC2ErrorMode;

int readCDCommand;
if (cueRipperConfig.ReadCDCommands.ContainsKey(reader.ARName))
{
readCDCommand = cueRipperConfig.ReadCDCommands[reader.ARName];
if (readCDCommand == 0)
reader.ForceBE = true;
else if (readCDCommand == 1)
reader.ForceD8 = true;
else if (readCDCommand < 0 || readCDCommand > 2)
{
// Invalid setting, use 2 (Unknown)
readCDCommand = 2;
}
}
else
{
readCDCommand = 2; // 0 (ReadCdBEh), 1 (ReadCdD8h), 2 (Unknown/AutoDetect)
}
cueRipperConfig.ReadCDCommands[reader.ARName] = readCDCommand;
}
data.Drives.Add(new DriveInfo(m_icon_mgr, drive + ":\\", reader));
}
Expand Down
2 changes: 2 additions & 0 deletions CUETools.Ripper/Ripper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public interface ICDRipper : IAudioSource, IDisposable
string EACName { get; }
int DriveOffset { get; set; }
int DriveC2ErrorMode { get; set; }
bool ForceBE { get; set; }
bool ForceD8 { get; set; }
string RipperVersion { get; }
string CurrentReadCommand { get; }
int CorrectionQuality { get; set; }
Expand Down

0 comments on commit f52b795

Please sign in to comment.