From 5713346580243ef083ede085ae59d4e245759467 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 1 Jul 2015 06:26:04 -0500 Subject: [PATCH] cue clarifications --- BizHawk.Client.DiscoHawk/DiscoHawk.cs | 2 +- BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs | 21 +++++++++---------- .../Jobs/DiscMountJob.cs | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/BizHawk.Client.DiscoHawk/DiscoHawk.cs b/BizHawk.Client.DiscoHawk/DiscoHawk.cs index 4d75aa387c..884bc461a4 100644 --- a/BizHawk.Client.DiscoHawk/DiscoHawk.cs +++ b/BizHawk.Client.DiscoHawk/DiscoHawk.cs @@ -233,7 +233,7 @@ namespace BizHawk.Client.DiscoHawk var dmj = new DiscMountJob { IN_DiscInterface = loadDiscInterface, IN_FromPath = infile }; if (cmpif == DiscInterface.MednaDisc) { - dmj.IN_DiscMountPolicy.CUE_PauseContradictionModeA = false; + dmj.IN_DiscMountPolicy.CUE_PregapContradictionModeA = false; } dmj.Run(); var disc = dmj.OUT_Disc; diff --git a/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs b/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs index 3986d299d7..f345047d15 100644 --- a/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs +++ b/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs @@ -207,8 +207,8 @@ namespace BizHawk.Emulation.DiscSystem int relMSF = -totalPregapLength; //read more at policies declaration - if (!context.DiscMountPolicy.CUE_PauseContradictionModeA) - relMSF += 1; + //if (!context.DiscMountPolicy.CUE_PauseContradictionModeA) + // relMSF += 1; //--------------------------------- @@ -250,12 +250,6 @@ namespace BizHawk.Emulation.DiscSystem //WE ARE NOW AT INDEX 1: generate the RawTOCEntry for this track EmitRawTOCEntry(cct); } - - //in the weird mednafen mode, we need to adjust relMSF to be 0 since we pre-adjusted it once - if (!context.DiscMountPolicy.CUE_PauseContradictionModeA && relMSF == 1) - relMSF = 0; - else - if (relMSF != 0) throw new InvalidOperationException(); } else break; } @@ -264,9 +258,15 @@ namespace BizHawk.Emulation.DiscSystem //generate a sector: SS_Base ss = null; EControlQ qFlags = (EControlQ)(int)cct.Flags; + int qRelMSF = relMSF; if (curr_index == 0) { //generating pregap: + + //tweak relMSF due to ambiguity/contradiction in yellowbook docs + if (!context.DiscMountPolicy.CUE_PregapContradictionModeA) + qRelMSF++; + bool audioGap = true; //normally the gap takes this track's type @@ -279,8 +279,7 @@ namespace BizHawk.Emulation.DiscSystem //I agree, so let's do it that way if (t != 1 && cct.TrackType != CueFile.TrackType.Audio && TrackInfos[t - 1].CompiledCueTrack.TrackType == CueFile.TrackType.Audio) { - //there may be an off by one error here depending on the CUE_PauseContradictionModeA setting.. not really sure. - if (relMSF <= -150) + if (relMSF < -150) { qFlags = (EControlQ)(int)TrackInfos[t - 1].CompiledCueTrack.Flags; audioGap = true; @@ -321,7 +320,7 @@ namespace BizHawk.Emulation.DiscSystem ss.sq.q_tno = BCD2.FromDecimal(cct.Number); ss.sq.q_index = BCD2.FromDecimal(curr_index); ss.sq.AP_Timestamp = new Timestamp(OUT_Disc.Sectors.Count); - ss.sq.Timestamp = new Timestamp(relMSF); + ss.sq.Timestamp = new Timestamp(qRelMSF); //setup subP if (curr_index == 0) diff --git a/BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.cs b/BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.cs index b3effbe596..ea31232f1a 100644 --- a/BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.cs +++ b/BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.cs @@ -25,7 +25,7 @@ namespace BizHawk.Emulation.DiscSystem /// (Mednafen does it this way) /// Discs (including PSX) exist using A, or B, or possibly (reference please) neither. /// - public bool CUE_PauseContradictionModeA = true; + public bool CUE_PregapContradictionModeA = true; public void SetForPlaystation() {