diff --git a/BizHawk.Client.DiscoHawk/DiscoHawk.cs b/BizHawk.Client.DiscoHawk/DiscoHawk.cs index c674df6b8d..4d75aa387c 100644 --- a/BizHawk.Client.DiscoHawk/DiscoHawk.cs +++ b/BizHawk.Client.DiscoHawk/DiscoHawk.cs @@ -317,22 +317,22 @@ namespace BizHawk.Client.DiscoHawk { var hashedOffenders = new HashSet(); for (int i = 0; i < numoffenders; i++) hashedOffenders.Add(offenders[i]); - sw.Write(" "); + sw.Write(" "); for (int i = 0; i < count; i++) sw.Write((hashedOffenders.Contains(dispaddr + i)) ? "vvv " : " "); sw.WriteLine(); - sw.Write(" "); + sw.Write(" "); for (int i = 0; i < count; i++) sw.Write("{0:X3} ", dispaddr + i, (i == count - 1) ? " " : " "); sw.WriteLine(); - sw.Write(" "); + sw.Write(" "); sw.Write(new string('-', count * 4)); sw.WriteLine(); sw_dump_chunk_one(string.Format("SRC #{0,6} ({1})", lba, new Timestamp(lba)), lba, src_databuf, addr, count); sw_dump_chunk_one(string.Format("DST #{0,6} ({1})", lba, new Timestamp(lba)), lba, dst_databuf, addr, count); }; - //verify each sector contents (skip the pregap junk for now) + //verify each sector contents int nSectors = src_disc.LBACount; - for (int lba = 0; lba < nSectors; lba++) + for (int lba = -150; lba < nSectors; lba++) { if (lba % 1000 == 0) Console.WriteLine("LBA {0} of {1}", lba, src_disc.LBACount); diff --git a/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs b/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs index 06755739c8..8b0404e9f4 100644 --- a/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs +++ b/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs @@ -213,7 +213,9 @@ namespace BizHawk.Emulation.DiscSystem for (int s = 0; s < specifiedPregapLength; s++) { var se = new SectorEntry(null); - var ss = new SS_Gap(); + SS_Base ss; + if (cct.TrackType == CueFile.TrackType.Audio) ss = new SS_AudioGap(); + else ss = new SS_DataGap(); //-subq- byte ADR = 1; @@ -285,6 +287,12 @@ namespace BizHawk.Emulation.DiscSystem curr_blobOffset += 2048; break; + default: + case CueFile.TrackType.Mode2_2336: + throw new InvalidOperationException("Not supported: " + cct.TrackType); + + case CueFile.TrackType.CDI_2352: + case CueFile.TrackType.Mode1_2352: case CueFile.TrackType.Mode2_2352: case CueFile.TrackType.Audio: ss = new SS_2352() { Blob = curr_blobInfo.Blob, BlobOffset = curr_blobOffset }; @@ -335,7 +343,9 @@ namespace BizHawk.Emulation.DiscSystem for (int s = 0; s < specifiedPostgapLength; s++) { var se= new SectorEntry(null); - var ss = new SS_Gap(); + SS_Base ss; + if (cct.TrackType == CueFile.TrackType.Audio) ss = new SS_AudioGap(); + else ss = new SS_DataGap(); //-subq- byte ADR = 1; diff --git a/BizHawk.Emulation.DiscSystem/CUE/CUE_Synths.cs b/BizHawk.Emulation.DiscSystem/CUE/CUE_Synths.cs index 080b3e08e5..27a71160e5 100644 --- a/BizHawk.Emulation.DiscSystem/CUE/CUE_Synths.cs +++ b/BizHawk.Emulation.DiscSystem/CUE/CUE_Synths.cs @@ -106,13 +106,26 @@ namespace BizHawk.Emulation.DiscSystem } /// - /// Represents a pregap or postgap sector. - /// The Pause flag isn't set in here because it might need special logic varying between sectors + /// Represents a data pregap or postgap sector. + /// The Pause flag isn't set in here because it might need special logic varying between sectors and so that's setup by the cue loader /// Implemented as another sector type with a blob reading all zeros /// - class SS_Gap : SS_Mode1_2048 + class SS_DataGap : SS_Mode1_2048 { - public SS_Gap() + public SS_DataGap() + { + Blob = new Disc.Blob_Zeros(); + } + } + + /// + /// Represents an audio pregap or postgap sector. + /// The Pause flag isn't set in here because it might need special logic varying between sectors and so that's setup by the cue loader + /// Implemented as another sector type with a blob reading all zeros + /// + class SS_AudioGap : SS_2352 + { + public SS_AudioGap() { Blob = new Disc.Blob_Zeros(); }