mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-07-08 17:56:18 +00:00
Implement HyperSpeed option for OmniDrive
This commit is contained in:
@@ -108,9 +108,47 @@ partial class Dump
|
||||
double elapsed = 0;
|
||||
var speedSectorCounter = 0;
|
||||
|
||||
UpdateStatus?.Invoke("[slateblue1]Setting speed to [teal]8x[/] for scrambled reading.[/]");
|
||||
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
if(_hyperSpeed)
|
||||
{
|
||||
Track t = tracks.FirstOrDefault(t => t.StartSector <= _resume.NextBlock &&
|
||||
t.EndSector >= _resume.NextBlock);
|
||||
|
||||
if(t is null)
|
||||
{
|
||||
UpdateStatus?.Invoke("[slateblue1]Setting speed to [teal]8x[/] for scrambled reading.[/]");
|
||||
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
}
|
||||
else if(t.Type == TrackType.Audio)
|
||||
{
|
||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_8x_for_audio_reading);
|
||||
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateStatus?.Invoke(_speed == 0xFFFF
|
||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading,
|
||||
_speed));
|
||||
|
||||
_speed *= _speedMultiplier;
|
||||
|
||||
if(_speed is 0 or > 0xFFFF) _speed = 0xFFFF;
|
||||
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, (ushort)_speed, 0, _dev.Timeout, out _);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateStatus?.Invoke("[slateblue1]Setting speed to [teal]8x[/] for scrambled reading.[/]");
|
||||
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
}
|
||||
|
||||
// Spin up
|
||||
_dev.OmniDriveReadCd(out _, out _, (uint)_resume.NextBlock, _maximumReadable, _dev.Timeout, out _);
|
||||
|
||||
for(ulong i = _resume.NextBlock; (long)i <= lastSector; i += blocksToRead)
|
||||
{
|
||||
@@ -161,7 +199,32 @@ partial class Dump
|
||||
|
||||
if(speedSectorCounter > 1000)
|
||||
{
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
if(_hyperSpeed)
|
||||
{
|
||||
Track t = tracks.FirstOrDefault(t => t.StartSector <= _resume.NextBlock &&
|
||||
t.EndSector >= _resume.NextBlock);
|
||||
|
||||
if(t is null || t.Type == TrackType.Audio)
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
else
|
||||
{
|
||||
if(_speed is 0 or > 0xFFFF) _speed = 0xFFFF;
|
||||
|
||||
_dev.SetCdSpeed(out _,
|
||||
RotationalControl.ClvAndImpureCav,
|
||||
(ushort)_speed,
|
||||
0,
|
||||
_dev.Timeout,
|
||||
out _);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateStatus?.Invoke("[slateblue1]Setting speed to [teal]8x[/] for scrambled reading.[/]");
|
||||
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
}
|
||||
|
||||
speedSectorCounter = 0;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -119,6 +119,7 @@ public partial class Dump
|
||||
bool _dumpFirstTrackPregap;
|
||||
bool _fixOffset;
|
||||
int _fixedSectors;
|
||||
readonly bool _hyperSpeed;
|
||||
uint _maximumReadable; // Maximum number of sectors drive can read at once
|
||||
IMediaGraph _mediaGraph;
|
||||
bool _missingTitleKeysDirty;
|
||||
@@ -187,7 +188,7 @@ public partial class Dump
|
||||
bool fixSubchannel, bool fixSubchannelCrc, bool skipCdireadyHole, ErrorLog errorLog,
|
||||
bool generateSubchannels, uint maximumReadable, bool useBufferedReads, bool storeEncrypted,
|
||||
bool titleKeys, uint ignoreCdrRunOuts, bool createGraph, uint dimensions, bool paranoia,
|
||||
bool cureParanoia, bool bypassWiiDecryption, bool startReverse, int errorRecovery)
|
||||
bool cureParanoia, bool bypassWiiDecryption, bool startReverse, int errorRecovery, bool hyperSpeed)
|
||||
{
|
||||
_doResume = doResume;
|
||||
_dev = dev;
|
||||
@@ -234,6 +235,7 @@ public partial class Dump
|
||||
_bypassWiiDecryption = bypassWiiDecryption;
|
||||
_startReverse = startReverse;
|
||||
_errorRecovery = errorRecovery;
|
||||
_hyperSpeed = hyperSpeed;
|
||||
_dumpStopwatch = new Stopwatch();
|
||||
_sidecarStopwatch = new Stopwatch();
|
||||
_speedStopwatch = new Stopwatch();
|
||||
|
||||
@@ -763,7 +763,8 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
||||
CureParanoia,
|
||||
BypassWiiDecryption,
|
||||
false,
|
||||
0);
|
||||
0,
|
||||
false);
|
||||
|
||||
new Thread(DoWork).Start();
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
|
||||
AaruLogging.Debug(MODULE_NAME, "--raw={0}", settings.Raw);
|
||||
AaruLogging.Debug(MODULE_NAME, "--start-reverse={0}", settings.StartReverse);
|
||||
AaruLogging.Debug(MODULE_NAME, "--error-recovery={0}", settings.ErrorRecovery);
|
||||
AaruLogging.Debug(MODULE_NAME, "--hyper-speed={0}", settings.HyperSpeed);
|
||||
|
||||
Dictionary<string, string> parsedOptions = Options.Parse(settings.Options);
|
||||
AaruLogging.Debug(MODULE_NAME, UI.Parsed_options);
|
||||
@@ -550,7 +551,8 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
|
||||
settings.CureParanoia,
|
||||
settings.BypassWiiDecryption,
|
||||
settings.StartReverse,
|
||||
settings.ErrorRecovery);
|
||||
settings.ErrorRecovery,
|
||||
settings.HyperSpeed);
|
||||
|
||||
AnsiConsole.Progress()
|
||||
.AutoClear(true)
|
||||
@@ -830,6 +832,10 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
|
||||
[DefaultValue(0)]
|
||||
[CommandOption("--error-recovery")]
|
||||
public int ErrorRecovery { get; set; }
|
||||
[Description("(OmniDrive only) Allows higher speed when we know the underlying track is data")]
|
||||
[DefaultValue(false)]
|
||||
[CommandOption("--hyper-speed")]
|
||||
public bool HyperSpeed { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user