diff --git a/BizHawk.Emulation.DiscSystem/CUE_format.cs b/BizHawk.Emulation.DiscSystem/CUE_format.cs index d0d75cd63d..e1a6017c04 100644 --- a/BizHawk.Emulation.DiscSystem/CUE_format.cs +++ b/BizHawk.Emulation.DiscSystem/CUE_format.cs @@ -281,6 +281,7 @@ namespace BizHawk.Emulation.DiscSystem session.Tracks.Add(toc_track); toc_track.Number = curr_track; toc_track.TrackType = cue_track.TrackType; + toc_track.ADR = 1; //safe assumption. CUE can't store this. //choose a Control value based on track type and other flags from cue //TODO - this might need to be controlled by cue loading prefs diff --git a/BizHawk.Emulation.DiscSystem/Disc.cs b/BizHawk.Emulation.DiscSystem/Disc.cs index ddc5557304..00b3469129 100644 --- a/BizHawk.Emulation.DiscSystem/Disc.cs +++ b/BizHawk.Emulation.DiscSystem/Disc.cs @@ -328,16 +328,14 @@ FILE ""xarp.barp.marp.farp"" BINARY var se = Sectors[aba]; - EControlQ control = dp.Track.Control; + EControlQ control = dp.Control; bool pause = true; if (dp.Num != 0) //TODO - shouldnt this be IndexNum? pause = false; - if ((dp.Track.Control & EControlQ.DataUninterrupted)!=0) + if ((dp.Control & EControlQ.DataUninterrupted)!=0) pause = false; - - //we always use ADR=1 (mode-1 q block) - //this could be more sophisticated but it is almost useless for emulation (only useful for catalog/ISRC numbers) - int adr = 1; + + int adr = dp.ADR; SubchannelQ sq = new SubchannelQ(); sq.q_status = SubchannelQ.ComputeStatus(adr, control); diff --git a/BizHawk.Emulation.DiscSystem/TOC/DiscStructure.cs b/BizHawk.Emulation.DiscSystem/TOC/DiscStructure.cs index 8ddef05ffa..1d92df6a3f 100644 --- a/BizHawk.Emulation.DiscSystem/TOC/DiscStructure.cs +++ b/BizHawk.Emulation.DiscSystem/TOC/DiscStructure.cs @@ -21,6 +21,7 @@ namespace BizHawk.Emulation.DiscSystem /// TODO - this is kind of garbage, but... I was using it for Synthesize_SubcodeFromStructure() :/ /// Really, what it is, is a series of points where the tno/index change. Kind of an agenda. And thats how that function uses it. /// Maybe I should rename it something different, or at least comment it + /// Or, you could look at this as a kind of compressed disc map /// public List Points; @@ -104,6 +105,9 @@ namespace BizHawk.Emulation.DiscSystem public int ABA, TrackNum, IndexNum; public Track Track; + public int ADR; + public EControlQ Control; + public int LBA { get { return ABA - 150; } @@ -116,23 +120,64 @@ namespace BizHawk.Emulation.DiscSystem public void Synthesize_TOCPointsFromSessions() { Points = new List(); - + int num = 0; foreach (var ses in Sessions) { - foreach (var track in ses.Tracks) - foreach (var index in track.Indexes) + for(int t=0;t 150) { - Num = num++, - ABA = index.aba, - TrackNum = track.Number, - IndexNum = index.Number, - Track = track - }; + int weirdPregapSize = distance - 150; + + //need a new point. fix the old one + tp.ADR = Points[Points.Count - 1].ADR; + tp.Control = Points[Points.Count - 1].Control; + Points.Add(tp); + + aba += weirdPregapSize; + repeat = true; + goto REPEAT; + } + } + + Points.Add(tp); } + } var tpLeadout = new TOCPoint(); var lastTrack = ses.Tracks[ses.Tracks.Count - 1]; @@ -167,6 +212,9 @@ namespace BizHawk.Emulation.DiscSystem /// public int Number; + /// + /// Conceptual track type, not necessarily stored this way anywhere + /// public ETrackType TrackType; /// @@ -176,6 +224,11 @@ namespace BizHawk.Emulation.DiscSystem /// public EControlQ Control; + /// + /// Well, it seems a track can have an ADR property (used to fill the subchannel Q). This is delivered from a CCD file but may have to be guessed from + /// + public int ADR = 1; + /// /// All the indexes related to the track. These will be 0-Indexed, but they could be non-consecutive. ///