diff --git a/BizHawk.Client.Common/RomLoader.cs b/BizHawk.Client.Common/RomLoader.cs index 037cc39055..7bce2f288b 100644 --- a/BizHawk.Client.Common/RomLoader.cs +++ b/BizHawk.Client.Common/RomLoader.cs @@ -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"); diff --git a/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs index 993a37d226..39217582e3 100644 --- a/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs +++ b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs @@ -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() diff --git a/BizHawk.Emulation.DiscSystem/DiscMountJob.cs b/BizHawk.Emulation.DiscSystem/DiscMountJob.cs index c5c199eed5..33ca006c13 100644 --- a/BizHawk.Emulation.DiscSystem/DiscMountJob.cs +++ b/BizHawk.Emulation.DiscSystem/DiscMountJob.cs @@ -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 diff --git a/BizHawk.Emulation.DiscSystem/DiscTOC.cs b/BizHawk.Emulation.DiscSystem/DiscTOC.cs index 87275ad966..999f3c826f 100644 --- a/BizHawk.Emulation.DiscSystem/DiscTOC.cs +++ b/BizHawk.Emulation.DiscSystem/DiscTOC.cs @@ -55,8 +55,8 @@ namespace BizHawk.Emulation.DiscSystem /// /// 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 /// public TOCItem[] TOCItems = new TOCItem[101];