Use explicit visibility modifiers in DiscSystem
This commit is contained in:
parent
0706b96afe
commit
ae22cd9f1b
|
@ -31,13 +31,13 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
//leave the disc open until this is disposed so we can read sectors from it
|
||||
}
|
||||
|
||||
IntPtr handle;
|
||||
private IntPtr handle;
|
||||
|
||||
public MednadiscTOC TOC;
|
||||
public MednadiscTOCTrack[] TOCTracks;
|
||||
|
||||
[ThreadStatic] static byte[] buf2442 = new byte[2448];
|
||||
[ThreadStatic] static byte[] buf96 = new byte[96];
|
||||
[ThreadStatic] private static byte[] buf2442 = new byte[2448];
|
||||
[ThreadStatic] private static byte[] buf96 = new byte[96];
|
||||
|
||||
|
||||
public void Read_2442(int LBA, byte[] buffer, int offset)
|
||||
|
@ -91,7 +91,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
#endif
|
||||
|
||||
static void CheckLibrary()
|
||||
private static void CheckLibrary()
|
||||
{
|
||||
var lib = OSTailoredCode.LinkedLibManager.LoadOrZero("mednadisc.dll");
|
||||
_IsLibraryAvailable = lib != IntPtr.Zero
|
||||
|
@ -104,7 +104,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
CheckLibrary();
|
||||
}
|
||||
|
||||
static bool _IsLibraryAvailable;
|
||||
private static bool _IsLibraryAvailable;
|
||||
public static bool IsLibraryAvailable => _IsLibraryAvailable;
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
|
||||
//note: accepts . or : in the stream stream/substream separator in the stream ID format, since that changed at some point in FFMPEG history
|
||||
//if someone has a better idea how to make the determination of whether an audio stream is available, I'm all ears
|
||||
static readonly Regex rxHasAudio = new Regex(@"Stream \#(\d*(\.|\:)\d*)\: Audio", RegexOptions.Compiled);
|
||||
private static readonly Regex rxHasAudio = new Regex(@"Stream \#(\d*(\.|\:)\d*)\: Audio", RegexOptions.Compiled);
|
||||
public AudioQueryResult QueryAudio(string path)
|
||||
{
|
||||
var ret = new AudioQueryResult();
|
||||
|
@ -106,7 +106,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
}
|
||||
|
||||
class AudioDecoder
|
||||
internal class AudioDecoder
|
||||
{
|
||||
[Serializable]
|
||||
public class AudioDecoder_Exception : Exception
|
||||
|
@ -121,7 +121,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
{
|
||||
}
|
||||
|
||||
bool CheckForAudio(string path)
|
||||
private bool CheckForAudio(string path)
|
||||
{
|
||||
FFMpeg ffmpeg = new FFMpeg();
|
||||
var qa = ffmpeg.QueryAudio(path);
|
||||
|
@ -132,7 +132,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// finds audio at a path similar to the provided path (i.e. finds Track01.mp3 for Track01.wav)
|
||||
/// TODO - isnt this redundant with CueFileResolver?
|
||||
/// </summary>
|
||||
string FindAudio(string audioPath)
|
||||
private string FindAudio(string audioPath)
|
||||
{
|
||||
string basePath = Path.GetFileNameWithoutExtension(audioPath);
|
||||
//look for potential candidates
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
{
|
||||
internal class Blob_ECM : IBlob
|
||||
{
|
||||
FileStream stream;
|
||||
private FileStream stream;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// the ECMfile-provided EDC integrity checksum. not being used right now
|
||||
/// </summary>
|
||||
int EDC;
|
||||
private int EDC;
|
||||
|
||||
public long Length;
|
||||
|
||||
|
@ -143,7 +143,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
Length = logOffset;
|
||||
}
|
||||
|
||||
void MisformedException()
|
||||
private void MisformedException()
|
||||
{
|
||||
throw new InvalidOperationException("Mis-formed ECM file");
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// finds the IndexEntry for the specified logical offset
|
||||
/// </summary>
|
||||
int FindInIndex(long offset, int LastReadIndex)
|
||||
private int FindInIndex(long offset, int LastReadIndex)
|
||||
{
|
||||
//try to avoid searching the index. check the last index we we used.
|
||||
for(int i=0;i<2;i++) //try 2 times
|
||||
|
@ -201,7 +201,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return listIndex;
|
||||
}
|
||||
|
||||
void Reconstruct(byte[] secbuf, int type)
|
||||
private void Reconstruct(byte[] secbuf, int type)
|
||||
{
|
||||
//sync
|
||||
secbuf[0] = 0;
|
||||
|
@ -250,8 +250,8 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
|
||||
//we don't want to keep churning through this many big byte arrays while reading stuff, so we save a sector cache.
|
||||
readonly byte[] Read_SectorBuf = new byte[2352];
|
||||
int Read_LastIndex = 0;
|
||||
private readonly byte[] Read_SectorBuf = new byte[2352];
|
||||
private int Read_LastIndex = 0;
|
||||
|
||||
public int Read(long byte_pos, byte[] buffer, int offset, int _count)
|
||||
{
|
||||
|
|
|
@ -15,12 +15,13 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
length = new FileInfo(physicalPath).Length;
|
||||
}
|
||||
}
|
||||
string physicalPath;
|
||||
long length;
|
||||
|
||||
private string physicalPath;
|
||||
private long length;
|
||||
|
||||
public long Offset = 0;
|
||||
|
||||
BufferedStream fs;
|
||||
private BufferedStream fs;
|
||||
public void Dispose()
|
||||
{
|
||||
if (fs != null)
|
||||
|
|
|
@ -36,12 +36,13 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
length = new FileInfo(physicalPath).Length;
|
||||
}
|
||||
}
|
||||
string physicalPath;
|
||||
long length;
|
||||
|
||||
private string physicalPath;
|
||||
private long length;
|
||||
|
||||
public long Offset = 0;
|
||||
|
||||
BufferedStream fs;
|
||||
private BufferedStream fs;
|
||||
public void Dispose()
|
||||
{
|
||||
if (fs != null)
|
||||
|
@ -132,9 +133,9 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return RiffSource.BaseStream.Read(buffer, offset, count);
|
||||
}
|
||||
|
||||
RiffMaster RiffSource;
|
||||
long waveDataStreamPos;
|
||||
long mDataLength;
|
||||
private RiffMaster RiffSource;
|
||||
private long waveDataStreamPos;
|
||||
private long mDataLength;
|
||||
public long Length => mDataLength;
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -8,8 +8,8 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
{
|
||||
internal sealed class Blob_ZeroPadAdapter : IBlob
|
||||
{
|
||||
IBlob srcBlob;
|
||||
long srcBlobLength;
|
||||
private IBlob srcBlob;
|
||||
private long srcBlobLength;
|
||||
public Blob_ZeroPadAdapter(IBlob srcBlob, long srcBlobLength)
|
||||
{
|
||||
this.srcBlob = srcBlob;
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// Please be sure to test round-tripping when you make any changes. This architecture is a bit tricky to use, but it works if you're careful.
|
||||
/// TODO - clarify stream disposing semantics
|
||||
/// </summary>
|
||||
class RiffMaster : IDisposable
|
||||
internal class RiffMaster : IDisposable
|
||||
{
|
||||
public RiffMaster() { }
|
||||
|
||||
|
@ -152,7 +152,8 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
Flush();
|
||||
base.WriteStream(s);
|
||||
}
|
||||
void Flush()
|
||||
|
||||
private void Flush()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
BinaryWriter bw = new BinaryWriter(ms);
|
||||
|
|
|
@ -158,7 +158,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
public CCDParseException(string message) : base(message) { }
|
||||
}
|
||||
|
||||
class CCDSection : Dictionary<string,int>
|
||||
private class CCDSection : Dictionary<string,int>
|
||||
{
|
||||
public string Name;
|
||||
public int FetchOrDefault(int def, string key)
|
||||
|
@ -176,7 +176,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
}
|
||||
|
||||
List<CCDSection> ParseSections(Stream stream)
|
||||
private List<CCDSection> ParseSections(Stream stream)
|
||||
{
|
||||
List<CCDSection> sections = new List<CCDSection>();
|
||||
|
||||
|
@ -214,7 +214,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return sections;
|
||||
}
|
||||
|
||||
int PreParseIntegrityCheck(List<CCDSection> sections)
|
||||
private int PreParseIntegrityCheck(List<CCDSection> sections)
|
||||
{
|
||||
if (sections.Count == 0) throw new CCDParseException("Malformed CCD format: no sections");
|
||||
|
||||
|
@ -438,7 +438,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
}
|
||||
|
||||
class SS_CCD : ISectorSynthJob2448
|
||||
private class SS_CCD : ISectorSynthJob2448
|
||||
{
|
||||
public void Synth(SectorSynthJob job)
|
||||
{
|
||||
|
|
|
@ -160,14 +160,14 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
CompiledCDText curr_cdtext;
|
||||
int curr_blobIndex = -1;
|
||||
CompiledCueTrack curr_track = null;
|
||||
CompiledCueFile curr_file = null;
|
||||
bool discinfo_session1Format_determined = false;
|
||||
bool curr_fileHasTrack = false;
|
||||
private CompiledCDText curr_cdtext;
|
||||
private int curr_blobIndex = -1;
|
||||
private CompiledCueTrack curr_track = null;
|
||||
private CompiledCueFile curr_file = null;
|
||||
private bool discinfo_session1Format_determined = false;
|
||||
private bool curr_fileHasTrack = false;
|
||||
|
||||
void UpdateDiscInfo(CUE_File.Command.TRACK trackCommand)
|
||||
private void UpdateDiscInfo(CUE_File.Command.TRACK trackCommand)
|
||||
{
|
||||
if (OUT_CompiledDiscInfo.FirstRecordedTrackNumber == 0)
|
||||
OUT_CompiledDiscInfo.FirstRecordedTrackNumber = trackCommand.Number;
|
||||
|
@ -194,7 +194,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
}
|
||||
}
|
||||
|
||||
void CloseFile()
|
||||
private void CloseFile()
|
||||
{
|
||||
if (curr_track != null)
|
||||
{
|
||||
|
@ -205,7 +205,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
curr_file = null;
|
||||
}
|
||||
|
||||
void OpenFile(CUE_File.Command.FILE f)
|
||||
private void OpenFile(CUE_File.Command.FILE f)
|
||||
{
|
||||
if (curr_file != null)
|
||||
CloseFile();
|
||||
|
@ -284,7 +284,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
//TODO - check for mismatches between track types and file types, or is that best done when interpreting the commands?
|
||||
}
|
||||
|
||||
void CreateTrack1Pregap()
|
||||
private void CreateTrack1Pregap()
|
||||
{
|
||||
if (OUT_CompiledCueTracks[1].PregapLength.Sector == 0) { }
|
||||
else if (OUT_CompiledCueTracks[1].PregapLength.Sector == 150) { }
|
||||
|
@ -295,7 +295,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
OUT_CompiledCueTracks[1].PregapLength = new Timestamp(150);
|
||||
}
|
||||
|
||||
void FinalAnalysis()
|
||||
private void FinalAnalysis()
|
||||
{
|
||||
//some quick checks:
|
||||
if (OUT_CompiledCueFiles.Count == 0)
|
||||
|
@ -334,7 +334,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
}
|
||||
|
||||
|
||||
void CloseTrack()
|
||||
private void CloseTrack()
|
||||
{
|
||||
if (curr_track == null)
|
||||
return;
|
||||
|
@ -360,7 +360,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
curr_track = null;
|
||||
}
|
||||
|
||||
void OpenTrack(CUE_File.Command.TRACK trackCommand)
|
||||
private void OpenTrack(CUE_File.Command.TRACK trackCommand)
|
||||
{
|
||||
//assert that a file is open
|
||||
if(curr_file == null)
|
||||
|
@ -390,7 +390,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
UpdateDiscInfo(trackCommand);
|
||||
}
|
||||
|
||||
void AddIndex(CUE_File.Command.INDEX indexCommand)
|
||||
private void AddIndex(CUE_File.Command.INDEX indexCommand)
|
||||
{
|
||||
curr_track.Indexes.Add(new CompiledCueIndex
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
/// <summary>
|
||||
/// Represents the contents of a cue file
|
||||
/// </summary>
|
||||
class CUE_File
|
||||
internal class CUE_File
|
||||
{
|
||||
// (here are all the commands we can encounter)
|
||||
public static class Command
|
||||
|
|
|
@ -45,25 +45,25 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
Normal, Pregap, Postgap
|
||||
}
|
||||
|
||||
class BlobInfo
|
||||
private class BlobInfo
|
||||
{
|
||||
public IBlob Blob;
|
||||
public long Length;
|
||||
}
|
||||
|
||||
//not sure if we need this...
|
||||
class TrackInfo
|
||||
private class TrackInfo
|
||||
{
|
||||
public int Length;
|
||||
|
||||
public CompiledCueTrack CompiledCueTrack;
|
||||
}
|
||||
|
||||
List<BlobInfo> BlobInfos;
|
||||
List<TrackInfo> TrackInfos = new List<TrackInfo>();
|
||||
private List<BlobInfo> BlobInfos;
|
||||
private List<TrackInfo> TrackInfos = new List<TrackInfo>();
|
||||
|
||||
|
||||
void MountBlobs()
|
||||
private void MountBlobs()
|
||||
{
|
||||
IBlob file_blob = null;
|
||||
|
||||
|
@ -125,7 +125,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
}
|
||||
|
||||
|
||||
void AnalyzeTracks()
|
||||
private void AnalyzeTracks()
|
||||
{
|
||||
var compiledTracks = IN_CompileJob.OUT_CompiledCueTracks;
|
||||
|
||||
|
@ -148,7 +148,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
}
|
||||
}
|
||||
|
||||
void EmitRawTOCEntry(CompiledCueTrack cct)
|
||||
private void EmitRawTOCEntry(CompiledCueTrack cct)
|
||||
{
|
||||
SubchannelQ toc_sq = new SubchannelQ();
|
||||
//absent some kind of policy for how to set it, this is a safe assumption:
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
/// <summary>
|
||||
/// Performs minimum parse processing on a cue file
|
||||
/// </summary>
|
||||
class ParseCueJob : DiscJob
|
||||
internal class ParseCueJob : DiscJob
|
||||
{
|
||||
/// <summary>
|
||||
/// input: the cue string to parse
|
||||
|
@ -30,10 +30,10 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
public bool IN_Strict { private get; set; } = false;
|
||||
|
||||
|
||||
class CueLineParser
|
||||
private class CueLineParser
|
||||
{
|
||||
int index;
|
||||
string str;
|
||||
private int index;
|
||||
private string str;
|
||||
public bool EOF;
|
||||
public CueLineParser(string line)
|
||||
{
|
||||
|
@ -51,12 +51,12 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
return ret;
|
||||
}
|
||||
|
||||
enum Mode
|
||||
private enum Mode
|
||||
{
|
||||
Normal, Quotable
|
||||
}
|
||||
|
||||
string ReadToken(Mode mode)
|
||||
private string ReadToken(Mode mode)
|
||||
{
|
||||
if (EOF) return null;
|
||||
|
||||
|
@ -128,7 +128,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
}
|
||||
}
|
||||
|
||||
void LoadFromString(ParseCueJob job)
|
||||
private void LoadFromString(ParseCueJob job)
|
||||
{
|
||||
string cueString = job.IN_CueString;
|
||||
TextReader tr = new StringReader(cueString);
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
/// <summary>
|
||||
/// Represents a Mode1 2048-byte sector
|
||||
/// </summary>
|
||||
class SS_Mode1_2048 : SS_Base
|
||||
internal class SS_Mode1_2048 : SS_Base
|
||||
{
|
||||
public override void Synth(SectorSynthJob job)
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
/// <summary>
|
||||
/// Represents a 2352-byte sector of any sort
|
||||
/// </summary>
|
||||
class SS_2352 : SS_Base
|
||||
internal class SS_2352 : SS_Base
|
||||
{
|
||||
public override void Synth(SectorSynthJob job)
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
/// <summary>
|
||||
/// Encodes a pre-gap sector
|
||||
/// </summary>
|
||||
class SS_Gap : SS_Base
|
||||
internal class SS_Gap : SS_Base
|
||||
{
|
||||
public CueTrackType TrackType;
|
||||
|
||||
|
|
|
@ -10,20 +10,20 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
{
|
||||
public bool caseSensitive = false;
|
||||
public bool IsHardcodedResolve { get; private set; }
|
||||
string baseDir;
|
||||
private string baseDir;
|
||||
|
||||
/// <summary>
|
||||
/// Retrieving the FullName from a FileInfo can be slow (and probably other operations), so this will cache all the needed values
|
||||
/// TODO - could we treat it like an actual cache and only fill the FullName if it's null?
|
||||
/// </summary>
|
||||
struct MyFileInfo
|
||||
private struct MyFileInfo
|
||||
{
|
||||
public string FullName;
|
||||
public FileInfo FileInfo;
|
||||
}
|
||||
|
||||
DirectoryInfo diBasedir;
|
||||
MyFileInfo[] fisBaseDir;
|
||||
private DirectoryInfo diBasedir;
|
||||
private MyFileInfo[] fisBaseDir;
|
||||
|
||||
/// <summary>
|
||||
/// sets the base directory and caches the list of files in the directory
|
||||
|
@ -50,7 +50,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
|||
}
|
||||
}
|
||||
|
||||
MyFileInfo[] MyFileInfosFromFileInfos(FileInfo[] fis)
|
||||
private MyFileInfo[] MyFileInfosFromFileInfos(FileInfo[] fis)
|
||||
{
|
||||
var myfis = new MyFileInfo[fis.Length];
|
||||
for (int i = 0; i < fis.Length; i++)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return !ret.Parse(sr) ? null : ret;
|
||||
}
|
||||
|
||||
bool Parse(StreamReader sr)
|
||||
private bool Parse(StreamReader sr)
|
||||
{
|
||||
bool ext = false;
|
||||
int runtime = -1;
|
||||
|
|
|
@ -609,7 +609,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
|
||||
/// <exception cref="MDSParseException">path reference no longer points to file</exception>
|
||||
Dictionary<int, IBlob> MountBlobs(AFile mdsf, Disc disc)
|
||||
private Dictionary<int, IBlob> MountBlobs(AFile mdsf, Disc disc)
|
||||
{
|
||||
Dictionary<int, IBlob> BlobIndex = new Dictionary<int, IBlob>();
|
||||
|
||||
|
@ -651,7 +651,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return BlobIndex;
|
||||
}
|
||||
|
||||
RawTOCEntry EmitRawTOCEntry(ATOCEntry entry)
|
||||
private RawTOCEntry EmitRawTOCEntry(ATOCEntry entry)
|
||||
{
|
||||
BCD2 tno, ino;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
this.disc = disc;
|
||||
}
|
||||
|
||||
Disc disc;
|
||||
private Disc disc;
|
||||
|
||||
/// <summary>
|
||||
/// calculates the hash for quick PSX Disc identification
|
||||
|
@ -127,7 +127,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
}
|
||||
|
||||
uint current = 0xFFFFFFFF;
|
||||
private uint current = 0xFFFFFFFF;
|
||||
|
||||
/// <exception cref="ArgumentOutOfRangeException">
|
||||
/// <paramref name="offset"/> is negative, or
|
||||
|
@ -147,7 +147,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
}
|
||||
|
||||
byte[] smallbuf = new byte[8];
|
||||
private byte[] smallbuf = new byte[8];
|
||||
public void Add(int data)
|
||||
{
|
||||
smallbuf[0] = (byte)((data) & 0xFF);
|
||||
|
@ -171,7 +171,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
set => current = value;
|
||||
}
|
||||
|
||||
uint gf2_matrix_times(uint[] mat, uint vec)
|
||||
private uint gf2_matrix_times(uint[] mat, uint vec)
|
||||
{
|
||||
int matIdx = 0;
|
||||
uint sum = 0;
|
||||
|
@ -185,7 +185,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return sum;
|
||||
}
|
||||
|
||||
void gf2_matrix_square(uint[] square, uint[] mat)
|
||||
private void gf2_matrix_square(uint[] square, uint[] mat)
|
||||
{
|
||||
int n;
|
||||
for (n = 0; n < 32; n++)
|
||||
|
@ -202,10 +202,10 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
|
||||
//tables used by crc32_combine
|
||||
uint[] even, odd;
|
||||
private uint[] even, odd;
|
||||
|
||||
//algorithm from zlib's crc32_combine. read http://www.leapsecond.com/tools/crcomb.c for more
|
||||
uint crc32_combine(uint crc1, uint crc2, int len2)
|
||||
private uint crc32_combine(uint crc1, uint crc2, int len2)
|
||||
{
|
||||
if (even == null) even = new uint[32]; // even-power-of-two zeros operator
|
||||
if (odd == null) odd = new uint[32]; // odd-power-of-two zeros operator
|
||||
|
|
|
@ -227,7 +227,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// This is reasonable approach to ID saturn.
|
||||
/// </summary>
|
||||
bool DetectSegaSaturn()
|
||||
private bool DetectSegaSaturn()
|
||||
{
|
||||
return StringAt("SEGA SEGASATURN", 0);
|
||||
}
|
||||
|
@ -235,12 +235,12 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// probably wrong
|
||||
/// </summary>
|
||||
bool DetectMegaCD()
|
||||
private bool DetectMegaCD()
|
||||
{
|
||||
return StringAt("SEGADISCSYSTEM", 0) || StringAt("SEGADISCSYSTEM", 16);
|
||||
}
|
||||
|
||||
bool DetectPSX()
|
||||
private bool DetectPSX()
|
||||
{
|
||||
if (!StringAt(" Licensed by ", 0, 4)) return false;
|
||||
return (StringAt("Sony Computer Entertainment Euro", 32, 4)
|
||||
|
@ -250,7 +250,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
);
|
||||
}
|
||||
|
||||
bool DetectPCFX()
|
||||
private bool DetectPCFX()
|
||||
{
|
||||
var toc = _disc.TOC;
|
||||
for (int t = toc.FirstRecordedTrackNumber;
|
||||
|
@ -268,7 +268,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
//asni 20171011 - this ONLY works if a valid cuefile/ccd is passed into DiscIdentifier.
|
||||
//if an .iso is presented, the internally manufactured cue data does not work - possibly something to do with
|
||||
//track 01 being Audio. Not tested, but presumably PCFX has the same issue
|
||||
bool DetectTurboCD()
|
||||
private bool DetectTurboCD()
|
||||
{
|
||||
var toc = _disc.TOC;
|
||||
for (int t = toc.FirstRecordedTrackNumber;
|
||||
|
@ -283,7 +283,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Detect3DO()
|
||||
private bool Detect3DO()
|
||||
{
|
||||
var toc = _disc.TOC;
|
||||
for (int t = toc.FirstRecordedTrackNumber;
|
||||
|
@ -298,7 +298,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
|
||||
//asni - slightly longer running than the others due to its brute-force nature. Should run later in the method
|
||||
bool DetectDreamcast()
|
||||
private bool DetectDreamcast()
|
||||
{
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
|
@ -309,12 +309,12 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return false;
|
||||
}
|
||||
|
||||
bool DetectCDi()
|
||||
private bool DetectCDi()
|
||||
{
|
||||
return StringAt("CD-RTOS", 8, 16);
|
||||
}
|
||||
|
||||
bool DetectGameCube()
|
||||
private bool DetectGameCube()
|
||||
{
|
||||
var data = ReadSectorCached(0);
|
||||
if (data == null) return false;
|
||||
|
@ -326,7 +326,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return hexString == "C2339F3D";
|
||||
}
|
||||
|
||||
bool DetectWii()
|
||||
private bool DetectWii()
|
||||
{
|
||||
var data = ReadSectorCached(0);
|
||||
if (data == null) return false;
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
}
|
||||
|
||||
class DiscJobAbortException : Exception
|
||||
internal class DiscJobAbortException : Exception
|
||||
{
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
partial class DiscMountJob
|
||||
{
|
||||
class SS_MednaDisc : ISectorSynthJob2448
|
||||
private class SS_MednaDisc : ISectorSynthJob2448
|
||||
{
|
||||
public void Synth(SectorSynthJob job)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
void RunMednaDisc()
|
||||
private void RunMednaDisc()
|
||||
{
|
||||
var disc = new Disc();
|
||||
OUT_Disc = disc;
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
FinishLog();
|
||||
}
|
||||
|
||||
void RunBizHawk()
|
||||
private void RunBizHawk()
|
||||
{
|
||||
string infile = IN_FromPath;
|
||||
string cue_content = null;
|
||||
|
|
|
@ -58,21 +58,21 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
{
|
||||
public DiscSectorReaderPolicy Policy = new DiscSectorReaderPolicy();
|
||||
|
||||
Disc disc;
|
||||
private Disc disc;
|
||||
|
||||
public DiscSectorReader(Disc disc)
|
||||
{
|
||||
this.disc = disc;
|
||||
}
|
||||
|
||||
void PrepareJob(int lba)
|
||||
private void PrepareJob(int lba)
|
||||
{
|
||||
job.LBA = lba;
|
||||
job.Params = disc.SynthParams;
|
||||
job.Disc = disc;
|
||||
}
|
||||
|
||||
void PrepareBuffer(byte[] buffer, int offset, int size)
|
||||
private void PrepareBuffer(byte[] buffer, int offset, int size)
|
||||
{
|
||||
if (Policy.DeterministicClearBuffer) Array.Clear(buffer, offset, size);
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return 2448;
|
||||
}
|
||||
|
||||
int ReadLBA_2048_Mode1(int lba, byte[] buffer, int offset)
|
||||
private int ReadLBA_2048_Mode1(int lba, byte[] buffer, int offset)
|
||||
{
|
||||
//we can read the 2048 bytes directly
|
||||
var sector = disc.SynthProvider.Get(lba);
|
||||
|
@ -145,7 +145,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
return 2048;
|
||||
}
|
||||
|
||||
int ReadLBA_2048_Mode2_Form1(int lba, byte[] buffer, int offset)
|
||||
private int ReadLBA_2048_Mode2_Form1(int lba, byte[] buffer, int offset)
|
||||
{
|
||||
//we can read the 2048 bytes directly but we have to get them from the mode 2 data
|
||||
var sector = disc.SynthProvider.Get(lba);
|
||||
|
@ -297,8 +297,8 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
|
||||
//lets not try to these as a sector cache. it gets too complicated. its just a temporary variable.
|
||||
byte[] buf2442 = new byte[2448];
|
||||
byte[] buf12 = new byte[12];
|
||||
SectorSynthJob job = new SectorSynthJob();
|
||||
private byte[] buf2442 = new byte[2448];
|
||||
private byte[] buf12 = new byte[12];
|
||||
private SectorSynthJob job = new SectorSynthJob();
|
||||
}
|
||||
}
|
|
@ -51,14 +51,14 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// </summary>
|
||||
public class DiscStream : System.IO.Stream
|
||||
{
|
||||
int SectorSize;
|
||||
int NumSectors;
|
||||
Disc Disc;
|
||||
private int SectorSize;
|
||||
private int NumSectors;
|
||||
private Disc Disc;
|
||||
|
||||
long currPosition;
|
||||
byte[] cachedSectorBuffer;
|
||||
int cachedSector;
|
||||
DiscSectorReader dsr;
|
||||
private long currPosition;
|
||||
private byte[] cachedSectorBuffer;
|
||||
private int cachedSector;
|
||||
private DiscSectorReader dsr;
|
||||
|
||||
/// <exception cref="NotSupportedException"><paramref name="view"/> is not <see cref="DiscSectorReaderPolicy.EUserData2048Mode.AssumeMode1"/> or <see cref="DiscSectorReaderPolicy.EUserData2048Mode.AssumeMode2_Form1"/></exception>
|
||||
public DiscStream(Disc disc, EDiscStreamView view, int from_lba)
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
{
|
||||
public static class DiscUtils
|
||||
{
|
||||
static byte IntToBCD(int n)
|
||||
private static byte IntToBCD(int n)
|
||||
{
|
||||
int tens = Math.DivRem(n, 10, out var ones);
|
||||
return (byte)((tens << 4) | ones);
|
||||
|
|
|
@ -33,14 +33,14 @@ using BizHawk.Common;
|
|||
|
||||
namespace BizHawk.Emulation.DiscSystem
|
||||
{
|
||||
static class ECM
|
||||
internal static class ECM
|
||||
{
|
||||
//EDC (crc) acceleration table
|
||||
static readonly uint[] edc_table = new uint[256];
|
||||
private static readonly uint[] edc_table = new uint[256];
|
||||
|
||||
//math acceleration tables over GF(2^8) with yellowbook specified primitive polynomial 0x11D
|
||||
static readonly byte[] mul2tab = new byte[256];
|
||||
static readonly byte[] div3tab = new byte[256];
|
||||
private static readonly byte[] mul2tab = new byte[256];
|
||||
private static readonly byte[] div3tab = new byte[256];
|
||||
|
||||
static ECM()
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// calculate EDC crc tables
|
||||
/// </summary>
|
||||
static void Prep_EDC()
|
||||
private static void Prep_EDC()
|
||||
{
|
||||
//14.3 of yellowbook specifies EDC crc as P(x) = (x^16 + x^15 + x^2 + 1) . (x^16 + x^2 + x + 1)
|
||||
//confirmation at http://cdmagediscussion.yuku.com/topic/742/EDC-calculation
|
||||
|
@ -88,7 +88,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// calculate math lookup tables for ECC calculations.
|
||||
/// </summary>
|
||||
static void Prep_ECC()
|
||||
private static void Prep_ECC()
|
||||
{
|
||||
//create a table implementing f(i) = i*2
|
||||
for (int i = 0; i < 256; i++)
|
||||
|
@ -220,7 +220,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// returns the address from a sector. useful for saving it before zeroing it for ECC calculations
|
||||
/// </summary>
|
||||
static uint GetSectorAddress(byte[] sector, int sector_offset)
|
||||
private static uint GetSectorAddress(byte[] sector, int sector_offset)
|
||||
{
|
||||
return (uint)(
|
||||
(sector[sector_offset + 12 + 0] << 0)
|
||||
|
@ -233,7 +233,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// sets the address for a sector. useful for restoring it after zeroing it for ECC calculations
|
||||
/// </summary>
|
||||
static void SetSectorAddress(byte[] sector, int sector_offset, uint address)
|
||||
private static void SetSectorAddress(byte[] sector, int sector_offset, uint address)
|
||||
{
|
||||
sector[sector_offset + 12 + 0] = (byte)((address >> 0) & 0xFF);
|
||||
sector[sector_offset + 12 + 1] = (byte)((address >> 8) & 0xFF);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// TODO - generate correct Q subchannel CRC
|
||||
namespace BizHawk.Emulation.DiscSystem
|
||||
{
|
||||
class ApplySBIJob
|
||||
internal class ApplySBIJob
|
||||
{
|
||||
/// <summary>
|
||||
/// applies an SBI file to the disc
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace BizHawk.Emulation.DiscSystem.SBI
|
|||
/// <summary>
|
||||
/// Loads SBI files into an internal representation.
|
||||
/// </summary>
|
||||
class LoadSBIJob : DiscJob
|
||||
internal class LoadSBIJob : DiscJob
|
||||
{
|
||||
/// <summary>
|
||||
/// The file to be loaded
|
||||
|
|
|
@ -9,7 +9,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
|
||||
/// </summary>
|
||||
class Synthesize_A0A1A2_Job
|
||||
internal class Synthesize_A0A1A2_Job
|
||||
{
|
||||
/// <summary>
|
||||
/// "First Recorded Track Number" value for TOC (usually 1)
|
||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
|||
|
||||
namespace BizHawk.Emulation.DiscSystem
|
||||
{
|
||||
class Synthesize_DiscStructure_From_DiscTOC_Job
|
||||
internal class Synthesize_DiscStructure_From_DiscTOC_Job
|
||||
{
|
||||
public Disc IN_Disc { private get; set; }
|
||||
public DiscTOC TOCRaw;
|
||||
|
|
|
@ -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?
|
||||
/// </summary>
|
||||
class Synthesize_DiscTOC_From_RawTOCEntries_Job
|
||||
internal class Synthesize_DiscTOC_From_RawTOCEntries_Job
|
||||
{
|
||||
public IEnumerable<RawTOCEntry> Entries;
|
||||
public List<string> Log = new List<string>();
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// generates lead-out sectors according to very crude approximations
|
||||
/// TODO - this isn't being used right now
|
||||
/// </summary>
|
||||
class Synthesize_LeadoutJob
|
||||
internal class Synthesize_LeadoutJob
|
||||
{
|
||||
public int Length;
|
||||
public Disc Disc;
|
||||
|
|
|
@ -9,7 +9,8 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// TODO - add a flag indicating whether clearing has happened
|
||||
/// TODO - add output to the job indicating whether interleaving has happened. let the sector reader be responsible
|
||||
/// </summary>
|
||||
[Flags] enum ESectorSynthPart
|
||||
[Flags]
|
||||
internal enum ESectorSynthPart
|
||||
{
|
||||
/// <summary>
|
||||
/// The data sector header is required. There's no header for audio tracks/sectors.
|
||||
|
@ -100,7 +101,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// Basic unit of sector synthesis
|
||||
/// </summary>
|
||||
interface ISectorSynthJob2448
|
||||
internal interface ISectorSynthJob2448
|
||||
{
|
||||
/// <summary>
|
||||
/// Synthesizes a sctor with the given job parameters
|
||||
|
@ -111,7 +112,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// Not a proper job? maybe with additional flags, it could be
|
||||
/// </summary>
|
||||
class SectorSynthJob
|
||||
internal class SectorSynthJob
|
||||
{
|
||||
public int LBA;
|
||||
public ESectorSynthPart Parts;
|
||||
|
@ -124,7 +125,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// an ISectorSynthProvider that just returns a value from an array of pre-made sectors
|
||||
/// </summary>
|
||||
class ArraySectorSynthProvider : ISectorSynthProvider
|
||||
internal class ArraySectorSynthProvider : ISectorSynthProvider
|
||||
{
|
||||
public List<ISectorSynthJob2448> Sectors = new List<ISectorSynthJob2448>();
|
||||
public int FirstLBA;
|
||||
|
@ -140,7 +141,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// an ISectorSynthProvider that just returns a fixed synthesizer
|
||||
/// </summary>
|
||||
class SimpleSectorSynthProvider : ISectorSynthProvider
|
||||
internal class SimpleSectorSynthProvider : ISectorSynthProvider
|
||||
{
|
||||
public ISectorSynthJob2448 SS;
|
||||
|
||||
|
@ -150,11 +151,11 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// Returns 'Patch' synth if the provided condition is met
|
||||
/// </summary>
|
||||
class ConditionalSectorSynthProvider : ISectorSynthProvider
|
||||
internal class ConditionalSectorSynthProvider : ISectorSynthProvider
|
||||
{
|
||||
Func<int,bool> Condition;
|
||||
ISectorSynthJob2448 Patch;
|
||||
ISectorSynthProvider Parent;
|
||||
private Func<int,bool> Condition;
|
||||
private ISectorSynthJob2448 Patch;
|
||||
private ISectorSynthProvider Parent;
|
||||
public void Install(Disc disc, Func<int, bool> condition, ISectorSynthJob2448 patch)
|
||||
{
|
||||
Parent = disc.SynthProvider;
|
||||
|
@ -171,7 +172,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// When creating a disc, this is set with a callback that can deliver an ISectorSynthJob2448 for the given LBA
|
||||
/// </summary>
|
||||
interface ISectorSynthProvider
|
||||
internal interface ISectorSynthProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves an ISectorSynthJob2448 for the given LBA
|
||||
|
@ -184,14 +185,14 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// To cut down on resource utilization, these can be stored in a disc and are tightly coupled to
|
||||
/// the SectorSynths that have been setup for it
|
||||
/// </summary>
|
||||
struct SectorSynthParams
|
||||
internal struct SectorSynthParams
|
||||
{
|
||||
//public long[] BlobOffsets;
|
||||
public MednaDisc MednaDisc;
|
||||
}
|
||||
|
||||
|
||||
class SS_PatchQ : ISectorSynthJob2448
|
||||
internal class SS_PatchQ : ISectorSynthJob2448
|
||||
{
|
||||
public ISectorSynthJob2448 Original;
|
||||
public byte[] Buffer_SubQ = new byte[12];
|
||||
|
@ -208,7 +209,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
}
|
||||
|
||||
class SS_Leadout : ISectorSynthJob2448
|
||||
internal class SS_Leadout : ISectorSynthJob2448
|
||||
{
|
||||
public int SessionNumber;
|
||||
public DiscMountPolicy Policy;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace BizHawk.Emulation.DiscSystem
|
||||
{
|
||||
static class SynthUtils
|
||||
internal static class SynthUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Calculates the checksum of the provided Q subchannel buffer and emplaces it
|
||||
|
|
Loading…
Reference in New Issue