diff --git a/BizHawk.Emulation.DiscSystem/MednaDiscAPI.cs b/BizHawk.Emulation.DiscSystem/API_MednaDisc.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/MednaDiscAPI.cs
rename to BizHawk.Emulation.DiscSystem/API_MednaDisc.cs
diff --git a/BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj b/BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj
index 3a949c95ee..221aa72841 100644
--- a/BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj
+++ b/BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj
@@ -50,54 +50,56 @@
VersionInfo.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
@@ -106,6 +108,7 @@
+
diff --git a/BizHawk.Emulation.DiscSystem/cdfs/EndianBitConverter.cs b/BizHawk.Emulation.DiscSystem/CDFS/EndianBitConverter.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/cdfs/EndianBitConverter.cs
rename to BizHawk.Emulation.DiscSystem/CDFS/EndianBitConverter.cs
diff --git a/BizHawk.Emulation.DiscSystem/cdfs/ISODirectoryNode.cs b/BizHawk.Emulation.DiscSystem/CDFS/ISODirectoryNode.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/cdfs/ISODirectoryNode.cs
rename to BizHawk.Emulation.DiscSystem/CDFS/ISODirectoryNode.cs
diff --git a/BizHawk.Emulation.DiscSystem/cdfs/ISOFile.cs b/BizHawk.Emulation.DiscSystem/CDFS/ISOFile.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/cdfs/ISOFile.cs
rename to BizHawk.Emulation.DiscSystem/CDFS/ISOFile.cs
diff --git a/BizHawk.Emulation.DiscSystem/cdfs/ISOFileNode.cs b/BizHawk.Emulation.DiscSystem/CDFS/ISOFileNode.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/cdfs/ISOFileNode.cs
rename to BizHawk.Emulation.DiscSystem/CDFS/ISOFileNode.cs
diff --git a/BizHawk.Emulation.DiscSystem/cdfs/ISONode.cs b/BizHawk.Emulation.DiscSystem/CDFS/ISONode.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/cdfs/ISONode.cs
rename to BizHawk.Emulation.DiscSystem/CDFS/ISONode.cs
diff --git a/BizHawk.Emulation.DiscSystem/cdfs/ISONodeRecord.cs b/BizHawk.Emulation.DiscSystem/CDFS/ISONodeRecord.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/cdfs/ISONodeRecord.cs
rename to BizHawk.Emulation.DiscSystem/CDFS/ISONodeRecord.cs
diff --git a/BizHawk.Emulation.DiscSystem/cdfs/ISOVolumeDescriptor.cs b/BizHawk.Emulation.DiscSystem/CDFS/ISOVolumeDescriptor.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/cdfs/ISOVolumeDescriptor.cs
rename to BizHawk.Emulation.DiscSystem/CDFS/ISOVolumeDescriptor.cs
diff --git a/BizHawk.Emulation.DiscSystem/cdfs/origin.txt b/BizHawk.Emulation.DiscSystem/CDFS/origin.txt
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/cdfs/origin.txt
rename to BizHawk.Emulation.DiscSystem/CDFS/origin.txt
diff --git a/BizHawk.Emulation.DiscSystem/Decoding.cs b/BizHawk.Emulation.DiscSystem/DiscDecoding.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/Decoding.cs
rename to BizHawk.Emulation.DiscSystem/DiscDecoding.cs
diff --git a/BizHawk.Emulation.DiscSystem/API/DiscExceptions.cs b/BizHawk.Emulation.DiscSystem/DiscExceptions.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/API/DiscExceptions.cs
rename to BizHawk.Emulation.DiscSystem/DiscExceptions.cs
diff --git a/BizHawk.Emulation.DiscSystem/Blobs/Blob_ECM.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_ECM.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/Blobs/Blob_ECM.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_ECM.cs
diff --git a/BizHawk.Emulation.DiscSystem/Blobs/Blob_RawFile.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_RawFile.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/Blobs/Blob_RawFile.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_RawFile.cs
diff --git a/BizHawk.Emulation.DiscSystem/Blobs/Blob_WaveFile.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_WaveFile.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/Blobs/Blob_WaveFile.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_WaveFile.cs
diff --git a/BizHawk.Emulation.DiscSystem/Blobs/Blob_ZeroPadAdapter.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_ZeroPadAdapter.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/Blobs/Blob_ZeroPadAdapter.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_ZeroPadAdapter.cs
diff --git a/BizHawk.Emulation.DiscSystem/Blobs/IBlob.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/IBlob.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/Blobs/IBlob.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/IBlob.cs
diff --git a/BizHawk.Emulation.DiscSystem/Blobs/RiffMaster.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/Blobs/RiffMaster.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs
diff --git a/BizHawk.Emulation.DiscSystem/CCD_format.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/CCD_format.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs
diff --git a/BizHawk.Emulation.DiscSystem/CUE/CUE_Compile.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs
similarity index 96%
rename from BizHawk.Emulation.DiscSystem/CUE/CUE_Compile.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs
index 9abb6951ef..0ca2c873b4 100644
--- a/BizHawk.Emulation.DiscSystem/CUE/CUE_Compile.cs
+++ b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs
@@ -120,7 +120,7 @@ namespace BizHawk.Emulation.DiscSystem
}
}
- internal class CompileCueJob : LoggedJob
+ internal class CompileCueJob : DiscJob
{
///
/// input: the CueFile to analyze
diff --git a/BizHawk.Emulation.DiscSystem/CUE/CUE_Format.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Context.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/CUE/CUE_Format.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Context.cs
diff --git a/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs
similarity index 96%
rename from BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs
index 9fa28f2de6..c07d3e95a3 100644
--- a/BizHawk.Emulation.DiscSystem/CUE/CUE_Load.cs
+++ b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs
@@ -32,7 +32,7 @@ namespace BizHawk.Emulation.DiscSystem
/// For this job, virtually all nonsense input is treated as errors, but the process will try to recover as best it can.
/// The user should still reject any jobs which generated errors
///
- internal class LoadCueJob : LoggedJob
+ internal class LoadCueJob : DiscJob
{
///
/// The results of the compile job, a prerequisite for this
diff --git a/BizHawk.Emulation.DiscSystem/CUE/CUE_Parse.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs
similarity index 96%
rename from BizHawk.Emulation.DiscSystem/CUE/CUE_Parse.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs
index 50d696e939..ee29c8414a 100644
--- a/BizHawk.Emulation.DiscSystem/CUE/CUE_Parse.cs
+++ b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs
@@ -14,7 +14,7 @@ namespace BizHawk.Emulation.DiscSystem
{
partial class CUE_Context
{
- public class ParseCueJob : LoggedJob
+ public class ParseCueJob : DiscJob
{
///
/// input: the cue string to parse
diff --git a/BizHawk.Emulation.DiscSystem/CUE/CUE_Synths.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Synths.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/CUE/CUE_Synths.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Synths.cs
diff --git a/BizHawk.Emulation.DiscSystem/CUE/CueFileResolver.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CueFileResolver.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/CUE/CueFileResolver.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CueFileResolver.cs
diff --git a/BizHawk.Emulation.DiscSystem/M3U_file.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/M3U_file.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/M3U_file.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/M3U_file.cs
diff --git a/BizHawk.Emulation.DiscSystem/SBI_format.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/SBI_format.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/SBI_format.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/SBI_format.cs
diff --git a/BizHawk.Emulation.DiscSystem/TOC_format.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/TOC_format.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/TOC_format.cs
rename to BizHawk.Emulation.DiscSystem/DiscFormats/TOC_format.cs
diff --git a/BizHawk.Emulation.DiscSystem/API/DiscHasher.cs b/BizHawk.Emulation.DiscSystem/DiscHasher.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/API/DiscHasher.cs
rename to BizHawk.Emulation.DiscSystem/DiscHasher.cs
diff --git a/BizHawk.Emulation.DiscSystem/API/DiscIdentifier.cs b/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/API/DiscIdentifier.cs
rename to BizHawk.Emulation.DiscSystem/DiscIdentifier.cs
diff --git a/BizHawk.Emulation.DiscSystem/Jobs/LoggedJob.cs b/BizHawk.Emulation.DiscSystem/DiscJob.cs
similarity index 93%
rename from BizHawk.Emulation.DiscSystem/Jobs/LoggedJob.cs
rename to BizHawk.Emulation.DiscSystem/DiscJob.cs
index 2d4aa62862..d96dc5be30 100644
--- a/BizHawk.Emulation.DiscSystem/Jobs/LoggedJob.cs
+++ b/BizHawk.Emulation.DiscSystem/DiscJob.cs
@@ -11,7 +11,7 @@ namespace BizHawk.Emulation.DiscSystem
/// Returns WARNINGS for things which will are irregular or erroneous but later jobs might be able to handle, or which can be worked around by configuration assumptions.
/// TODO - make IDisposable so I don't have to remember to Finish() it?
///
- public class LoggedJob
+ public class DiscJob
{
internal int CurrentLine = -1;
@@ -49,7 +49,7 @@ namespace BizHawk.Emulation.DiscSystem
///
/// Concatenates the log results from the provided job into this log
///
- public void ConcatenateJobLog(LoggedJob job)
+ public void ConcatenateJobLog(DiscJob job)
{
OUT_ErrorLevel |= job.OUT_ErrorLevel;
swLog.Write(job.OUT_Log);
diff --git a/BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.MednaDisc.cs b/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.MednaDisc.cs
rename to BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs
diff --git a/BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.cs b/BizHawk.Emulation.DiscSystem/DiscMountJob.cs
similarity index 73%
rename from BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.cs
rename to BizHawk.Emulation.DiscSystem/DiscMountJob.cs
index f2ad25118a..20f6eb8a94 100644
--- a/BizHawk.Emulation.DiscSystem/Jobs/DiscMountJob.cs
+++ b/BizHawk.Emulation.DiscSystem/DiscMountJob.cs
@@ -6,47 +6,9 @@ using System.Collections.Generic;
namespace BizHawk.Emulation.DiscSystem
{
- ///
- /// General disc policies to be logically applied at mounting time. The choices are irreversible once a disc is loaded.
- /// Maybe these are only for CUEs, but maybe not. Not sure yet.
- /// Could put caching policies here too (cached ecm calculations, etc.)
- ///
- public class DiscMountPolicy
- {
- ///
- /// "At the beginning of a Pause (i.e. Index = 00) the relative time is
- /// --A-- set to the duration of the Pause.
- /// During the Pause this relative time decreases and
- /// --B-- equals zero in the last Section"
- /// This is a contradiction.
- /// By choosing true, mode A is selected, and the final sector of the pause is -1.
- /// (I like this better. Defaulting until proven otherwise [write test case here])
- /// By choosing false, mode B is selected, and the final sector of the pause is 0.
- /// (Mednafen does it this way)
- /// Discs (including PSX) exist using A, or B, or possibly (reference please) neither.
- ///
- public bool CUE_PregapContradictionModeA = true;
-
- ///
- /// Mednafen sets mode2 pregap sectors as XA Form2 sectors.
- /// This is almost surely not right in every case.
- ///
- public bool CUE_PregapMode2_As_XA_Form2 = true;
-
- ///
- /// Mednafen loads SBI files oddly
- ///
- public bool SBI_As_Mednafen = true;
-
- public void SetForPSX()
- {
- CUE_PregapContradictionModeA = false;
- CUE_PregapMode2_As_XA_Form2 = true;
- SBI_As_Mednafen = true;
- }
- }
- public partial class DiscMountJob : LoggedJob
+
+ public partial class DiscMountJob : DiscJob
{
///
/// The filename to be loaded
diff --git a/BizHawk.Emulation.DiscSystem/DiscMountPolicy.cs b/BizHawk.Emulation.DiscSystem/DiscMountPolicy.cs
new file mode 100644
index 0000000000..03d1ff9354
--- /dev/null
+++ b/BizHawk.Emulation.DiscSystem/DiscMountPolicy.cs
@@ -0,0 +1,44 @@
+
+namespace BizHawk.Emulation.DiscSystem
+{
+ ///
+ /// General disc policies to be logically applied at mounting time. The choices are irreversible once a disc is loaded.
+ /// Maybe these are only for CUEs, but maybe not. Not sure yet.
+ /// Could put caching policies here too (cached ecm calculations, etc.)
+ ///
+ public class DiscMountPolicy
+ {
+ ///
+ /// "At the beginning of a Pause (i.e. Index = 00) the relative time is
+ /// --A-- set to the duration of the Pause.
+ /// During the Pause this relative time decreases and
+ /// --B-- equals zero in the last Section"
+ /// This is a contradiction.
+ /// By choosing true, mode A is selected, and the final sector of the pause is -1.
+ /// (I like this better. Defaulting until proven otherwise [write test case here])
+ /// By choosing false, mode B is selected, and the final sector of the pause is 0.
+ /// (Mednafen does it this way)
+ /// Discs (including PSX) exist using A, or B, or possibly (reference please) neither.
+ ///
+ public bool CUE_PregapContradictionModeA = true;
+
+ ///
+ /// Mednafen sets mode2 pregap sectors as XA Form2 sectors.
+ /// This is almost surely not right in every case.
+ ///
+ public bool CUE_PregapMode2_As_XA_Form2 = true;
+
+ ///
+ /// Mednafen loads SBI files oddly
+ ///
+ public bool SBI_As_Mednafen = true;
+
+ public void SetForPSX()
+ {
+ CUE_PregapContradictionModeA = false;
+ CUE_PregapMode2_As_XA_Form2 = true;
+ SBI_As_Mednafen = true;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/BizHawk.Emulation.DiscSystem/API/DiscSectorReader.cs b/BizHawk.Emulation.DiscSystem/DiscSectorReader.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/API/DiscSectorReader.cs
rename to BizHawk.Emulation.DiscSystem/DiscSectorReader.cs
diff --git a/BizHawk.Emulation.DiscSystem/API/DiscStream.cs b/BizHawk.Emulation.DiscSystem/DiscStream.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/API/DiscStream.cs
rename to BizHawk.Emulation.DiscSystem/DiscStream.cs
diff --git a/BizHawk.Emulation.DiscSystem/API/DiscStructure.cs b/BizHawk.Emulation.DiscSystem/DiscStructure.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/API/DiscStructure.cs
rename to BizHawk.Emulation.DiscSystem/DiscStructure.cs
diff --git a/BizHawk.Emulation.DiscSystem/Subcode.cs b/BizHawk.Emulation.DiscSystem/DiscSubQ.cs
similarity index 81%
rename from BizHawk.Emulation.DiscSystem/Subcode.cs
rename to BizHawk.Emulation.DiscSystem/DiscSubQ.cs
index c138ac5be7..a6081656ca 100644
--- a/BizHawk.Emulation.DiscSystem/Subcode.cs
+++ b/BizHawk.Emulation.DiscSystem/DiscSubQ.cs
@@ -131,44 +131,5 @@ namespace BizHawk.Emulation.DiscSystem
///
public EControlQ CONTROL { get { return (EControlQ)((q_status >> 4) & 0xF); } }
}
-
-
- //this has been checked against mednafen's and seems to match
- //there are a few dozen different ways to do CRC16-CCITT
- //this table is backwards or something. at any rate its tailored to the needs of the Q subchannel
- internal static class CRC16_CCITT
- {
- private static readonly ushort[] table = new ushort[256];
-
- static CRC16_CCITT()
- {
- for (ushort i = 0; i < 256; ++i)
- {
- ushort value = 0;
- ushort temp = (ushort)(i << 8);
- for (byte j = 0; j < 8; ++j)
- {
- if (((value ^ temp) & 0x8000) != 0)
- value = (ushort)((value << 1) ^ 0x1021);
- else
- value <<= 1;
- temp <<= 1;
- }
- table[i] = value;
- }
- }
-
- public static ushort Calculate(byte[] data, int offset, int length)
- {
- ushort Result = 0;
- for(int i=0;i> 8) & 0xFF));
- Result = (ushort)((Result << 8) ^ table[index]);
- }
- return Result;
- }
- }
-
+
}
diff --git a/BizHawk.Emulation.DiscSystem/API/DiscTOC.cs b/BizHawk.Emulation.DiscSystem/DiscTOC.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/API/DiscTOC.cs
rename to BizHawk.Emulation.DiscSystem/DiscTOC.cs
diff --git a/BizHawk.Emulation.DiscSystem/ECM.cs b/BizHawk.Emulation.DiscSystem/Internal/Algorithms/ECM.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/ECM.cs
rename to BizHawk.Emulation.DiscSystem/Internal/Algorithms/ECM.cs
diff --git a/BizHawk.Emulation.DiscSystem/GPL_ECM.cs b/BizHawk.Emulation.DiscSystem/Internal/Algorithms/GPL_ECM.cs
similarity index 100%
rename from BizHawk.Emulation.DiscSystem/GPL_ECM.cs
rename to BizHawk.Emulation.DiscSystem/Internal/Algorithms/GPL_ECM.cs
diff --git a/BizHawk.Emulation.DiscSystem/Internal/Algorithms/SubQ_CRC.cs b/BizHawk.Emulation.DiscSystem/Internal/Algorithms/SubQ_CRC.cs
new file mode 100644
index 0000000000..b11c7f22b6
--- /dev/null
+++ b/BizHawk.Emulation.DiscSystem/Internal/Algorithms/SubQ_CRC.cs
@@ -0,0 +1,43 @@
+namespace BizHawk.Emulation.DiscSystem
+{
+
+ //this has been checked against mednafen's and seems to match
+ //there are a few dozen different ways to do CRC16-CCITT
+ //this table is backwards or something. at any rate its tailored to the needs of the Q subchannel
+ internal static class CRC16_CCITT
+ {
+ private static readonly ushort[] table = new ushort[256];
+
+ static CRC16_CCITT()
+ {
+ for (ushort i = 0; i < 256; ++i)
+ {
+ ushort value = 0;
+ ushort temp = (ushort)(i << 8);
+ for (byte j = 0; j < 8; ++j)
+ {
+ if (((value ^ temp) & 0x8000) != 0)
+ value = (ushort)((value << 1) ^ 0x1021);
+ else
+ value <<= 1;
+ temp <<= 1;
+ }
+ table[i] = value;
+ }
+ }
+
+ public static ushort Calculate(byte[] data, int offset, int length)
+ {
+ ushort Result = 0;
+ for (int i = 0; i < length; i++)
+ {
+ byte b = data[offset + i];
+ int index = (b ^ ((Result >> 8) & 0xFF));
+ Result = (ushort)((Result << 8) ^ table[index]);
+ }
+ return Result;
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/BizHawk.Emulation.DiscSystem/Jobs/LoadSBIJob.cs b/BizHawk.Emulation.DiscSystem/Internal/Jobs/LoadSBIJob.cs
similarity index 94%
rename from BizHawk.Emulation.DiscSystem/Jobs/LoadSBIJob.cs
rename to BizHawk.Emulation.DiscSystem/Internal/Jobs/LoadSBIJob.cs
index 1becba0ee6..8f379e9940 100644
--- a/BizHawk.Emulation.DiscSystem/Jobs/LoadSBIJob.cs
+++ b/BizHawk.Emulation.DiscSystem/Internal/Jobs/LoadSBIJob.cs
@@ -10,7 +10,7 @@ namespace BizHawk.Emulation.DiscSystem.SBI
///
/// Loads SBI files into an internal representation.
///
- public class LoadSBIJob : LoggedJob
+ class LoadSBIJob : DiscJob
{
///
/// The file to be loaded
diff --git a/BizHawk.Emulation.DiscSystem/Jobs/Synthesize_A0A1A2_Job.cs b/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_A0A1A2_Job.cs
similarity index 94%
rename from BizHawk.Emulation.DiscSystem/Jobs/Synthesize_A0A1A2_Job.cs
rename to BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_A0A1A2_Job.cs
index e9fb7e20d2..1ae30c7d06 100644
--- a/BizHawk.Emulation.DiscSystem/Jobs/Synthesize_A0A1A2_Job.cs
+++ b/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_A0A1A2_Job.cs
@@ -12,7 +12,7 @@ namespace BizHawk.Emulation.DiscSystem
/// Synthesizes RawTCOEntry A0 A1 A2 from the provided information.
/// This might be reused by formats other than CUE later, so it isn't directly associated with that
///
- public class Synthesize_A0A1A2_Job
+ class Synthesize_A0A1A2_Job
{
///
/// "First Recorded Track Number" value for TOC (usually 1)
diff --git a/BizHawk.Emulation.DiscSystem/Jobs/Synthesize_DiscStructure_From_DiscTOC_Job.cs b/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscStructure_From_DiscTOC_Job.cs
similarity index 93%
rename from BizHawk.Emulation.DiscSystem/Jobs/Synthesize_DiscStructure_From_DiscTOC_Job.cs
rename to BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscStructure_From_DiscTOC_Job.cs
index 13eb30cdce..6ce0bae5d6 100644
--- a/BizHawk.Emulation.DiscSystem/Jobs/Synthesize_DiscStructure_From_DiscTOC_Job.cs
+++ b/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscStructure_From_DiscTOC_Job.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace BizHawk.Emulation.DiscSystem
{
- public class Synthesize_DiscStructure_From_DiscTOC_Job
+ class Synthesize_DiscStructure_From_DiscTOC_Job
{
public Disc IN_Disc;
public DiscTOC TOCRaw;
diff --git a/BizHawk.Emulation.DiscSystem/Jobs/Synthesize_DiscTOC_From_RawTOCEntries_Job.cs b/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTOC_From_RawTOCEntries_Job.cs
similarity index 95%
rename from BizHawk.Emulation.DiscSystem/Jobs/Synthesize_DiscTOC_From_RawTOCEntries_Job.cs
rename to BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTOC_From_RawTOCEntries_Job.cs
index 652baa8ff2..beb89c2c38 100644
--- a/BizHawk.Emulation.DiscSystem/Jobs/Synthesize_DiscTOC_From_RawTOCEntries_Job.cs
+++ b/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTOC_From_RawTOCEntries_Job.cs
@@ -8,7 +8,7 @@ namespace BizHawk.Emulation.DiscSystem
/// When a disc drive firmware reads the lead-in area, it builds this TOC from finding q-mode 1 sectors in the Q subchannel of the lead-in area.
/// Question: I guess it must ignore q-mode != 1? what else would it do with it?
///
- public class Synthesize_DiscTOC_From_RawTOCEntries_Job
+ class Synthesize_DiscTOC_From_RawTOCEntries_Job
{
public IEnumerable Entries;
public List Log = new List();
diff --git a/BizHawk.Emulation.DiscSystem/Jobs/Synthesize_Leadout_Job.cs b/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_Leadout_Job.cs
similarity index 94%
rename from BizHawk.Emulation.DiscSystem/Jobs/Synthesize_Leadout_Job.cs
rename to BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_Leadout_Job.cs
index 09fc0af1d5..cd4b4c85b1 100644
--- a/BizHawk.Emulation.DiscSystem/Jobs/Synthesize_Leadout_Job.cs
+++ b/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_Leadout_Job.cs
@@ -13,7 +13,7 @@ namespace BizHawk.Emulation.DiscSystem
/// generates lead-out sectors according to very crude approximations
/// TODO - this isnt being used right now
///
- public class Synthesize_LeadoutJob
+ class Synthesize_LeadoutJob
{
public int Length;
public Disc Disc;
diff --git a/BizHawk.Emulation.DiscSystem/SectorInterfaces.cs b/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs
similarity index 92%
rename from BizHawk.Emulation.DiscSystem/SectorInterfaces.cs
rename to BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs
index 33f81934c5..ef21c84e71 100644
--- a/BizHawk.Emulation.DiscSystem/SectorInterfaces.cs
+++ b/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs
@@ -2,8 +2,6 @@ using System;
using System.Collections.Generic;
using System.IO;
-//TODO - most of these sector interfaces are really only useful for CUEs, I guess. most other disc formats arent nearly as lame.. I think
-
namespace BizHawk.Emulation.DiscSystem
{
///