throw slightly more descriptive warning when loading a cue with a missing bin

This commit is contained in:
zeromus 2015-08-08 16:40:37 -05:00
parent 2a8ed31cbf
commit 66c2d48e8d
4 changed files with 23 additions and 3 deletions

View File

@ -269,6 +269,9 @@ namespace BizHawk.Client.Common
return false;
}
if (discMountJob.OUT_ErrorLevel)
throw new InvalidOperationException(discMountJob.OUT_Log);
if(disc == null)
throw new InvalidOperationException("Can't load one of the files specified in the M3U");
@ -324,6 +327,10 @@ namespace BizHawk.Client.Common
System.Windows.Forms.MessageBox.Show("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk");
return false;
}
if (discMountJob.OUT_ErrorLevel)
throw new InvalidOperationException(discMountJob.OUT_Log);
var disc = discMountJob.OUT_Disc;
//-----------
@ -457,6 +464,9 @@ namespace BizHawk.Client.Common
return false;
}
if (discMountJob.OUT_ErrorLevel)
throw new InvalidOperationException(discMountJob.OUT_Log);
if (disc == null)
throw new InvalidOperationException("Can't load one of the files specified in the M3U");

View File

@ -223,7 +223,9 @@ namespace BizHawk.Emulation.DiscSystem.CUE
string choice = null;
if (options.Count == 0)
{
Error("Couldn't resolve referenced cue file: " + f.Path);
Error(string.Format("Couldn't resolve referenced cue file: {0} ; you can commonly repair the cue file yourself, or a file might be missing", f.Path));
//add a null entry to keep the count from being wrong later (quiets a warning)
OUT_CompiledCueFiles.Add(null);
return;
}
else
@ -303,6 +305,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
Error("Cue file doesn't specify any input files!");
//we can't reliably analyze the length of files here, because we might have to be decoding to get lengths (VBR mp3s)
//REMINDER: we could actually scan the mp3 frames in software
//So, it's not really worth the trouble. We'll cope with lengths later
//we could check the format of the wav file here, though
@ -311,6 +314,8 @@ namespace BizHawk.Emulation.DiscSystem.CUE
OUT_LoadTime = 0;
foreach (var cfi in OUT_CompiledCueFiles)
{
if (cfi == null)
continue;
if (cfi.Type == CompiledCueFileType.DecodeAudio)
{
needsCodec = true;
@ -477,6 +482,8 @@ namespace BizHawk.Emulation.DiscSystem.CUE
CreateTrack1Pregap();
FinalAnalysis();
FinishLog();
} //Run()

View File

@ -154,6 +154,8 @@ namespace BizHawk.Emulation.DiscSystem
//TODO - need better handling of log output
if (!string.IsNullOrEmpty(compileJob.OUT_Log)) Console.WriteLine(compileJob.OUT_Log);
ConcatenateJobLog(compileJob);
if (compileJob.OUT_ErrorLevel)
goto DONE;
//check slow loading threshold
if (compileJob.OUT_LoadTime >= IN_SlowLoadAbortThreshold)
@ -180,6 +182,7 @@ namespace BizHawk.Emulation.DiscSystem
OUT_Disc = ccdLoader.LoadCCDToDisc(IN_FromPath, IN_DiscMountPolicy);
}
DONE:
//setup the lowest level synth provider

View File

@ -55,8 +55,8 @@ namespace BizHawk.Emulation.DiscSystem
/// <summary>
/// This is a convenient format for storing the TOC (taken from mednafen)
/// Index 0 is empty, so that track 1 is in index 1.
/// Index 100 is the Lead-out track
/// Element 0 is the Lead-in track
/// Element 100 is the Lead-out track
/// </summary>
public TOCItem[] TOCItems = new TOCItem[101];