use expression body in various places
This commit is contained in:
parent
e744511573
commit
e1bb93971a
|
@ -106,25 +106,12 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public override bool CanWrite => true;
|
public override bool CanWrite => true;
|
||||||
|
|
||||||
public override long Length
|
public override long Length => throw new NotImplementedException();
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override long Position
|
public override long Position
|
||||||
{
|
{
|
||||||
get
|
get => throw new NotImplementedException();
|
||||||
{
|
set => throw new NotImplementedException();
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +135,7 @@ namespace BizHawk.Client.Common
|
||||||
| dt.Month << 5
|
| dt.Month << 5
|
||||||
| (dt.Year - 1980) << 9;
|
| (dt.Year - 1980) << 9;
|
||||||
|
|
||||||
var modifiedDate = new byte[]
|
var modifiedDate = new[]
|
||||||
{
|
{
|
||||||
(byte)(mtime & 0xff),
|
(byte)(mtime & 0xff),
|
||||||
(byte)(mtime >> 8),
|
(byte)(mtime >> 8),
|
||||||
|
|
|
@ -234,16 +234,10 @@ namespace BizHawk.Client.Common
|
||||||
public int BackgroundColor => unchecked((int)0xff000000);
|
public int BackgroundColor => unchecked((int)0xff000000);
|
||||||
|
|
||||||
/// <exception cref="InvalidOperationException">always</exception>
|
/// <exception cref="InvalidOperationException">always</exception>
|
||||||
public int VsyncNumerator
|
public int VsyncNumerator => throw new InvalidOperationException();
|
||||||
{
|
|
||||||
get { throw new InvalidOperationException(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="InvalidOperationException">always</exception>
|
/// <exception cref="InvalidOperationException">always</exception>
|
||||||
public int VsyncDenominator
|
public int VsyncDenominator => throw new InvalidOperationException();
|
||||||
{
|
|
||||||
get { throw new InvalidOperationException(); }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static unsafe bool Load(IVideoProvider v, Stream s)
|
public static unsafe bool Load(IVideoProvider v, Stream s)
|
||||||
|
|
|
@ -600,11 +600,7 @@ namespace BizHawk.Client.Common
|
||||||
/// <exception cref="ArgumentException">Occurs when a <see cref="DisplayType"/> is incompatible with the <see cref="WatchSize"/></exception>
|
/// <exception cref="ArgumentException">Occurs when a <see cref="DisplayType"/> is incompatible with the <see cref="WatchSize"/></exception>
|
||||||
public DisplayType Type
|
public DisplayType Type
|
||||||
{
|
{
|
||||||
get
|
get => _type;
|
||||||
{
|
|
||||||
return _type;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (IsDiplayTypeAvailable(value))
|
if (IsDiplayTypeAvailable(value))
|
||||||
|
@ -622,11 +618,7 @@ namespace BizHawk.Client.Common
|
||||||
/// <exception cref="InvalidOperationException">(from setter) <paramref name="value"/> does not have the same name as this property's value</exception>
|
/// <exception cref="InvalidOperationException">(from setter) <paramref name="value"/> does not have the same name as this property's value</exception>
|
||||||
public MemoryDomain Domain
|
public MemoryDomain Domain
|
||||||
{
|
{
|
||||||
get
|
get => _domain;
|
||||||
{
|
|
||||||
return _domain;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal set
|
internal set
|
||||||
{
|
{
|
||||||
if (value != null && _domain.Name == value.Name)
|
if (value != null && _domain.Name == value.Name)
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics.OpenGL;
|
using OpenTK.Graphics.OpenGL;
|
||||||
|
|
||||||
|
@ -32,7 +28,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clear(OpenTK.Graphics.OpenGL.ClearBufferMask mask)
|
public void Clear(ClearBufferMask mask)
|
||||||
{
|
{
|
||||||
var g = GetCurrentGraphics();
|
var g = GetCurrentGraphics();
|
||||||
if((mask & ClearBufferMask.ColorBufferBit) != 0)
|
if((mask & ClearBufferMask.ColorBufferBit) != 0)
|
||||||
|
@ -41,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string API { get { return "GDIPLUS"; } }
|
public string API => "GDIPLUS";
|
||||||
|
|
||||||
public IBlendState CreateBlendState(BlendingFactorSrc colorSource, BlendEquationMode colorEquation, BlendingFactorDest colorDest,
|
public IBlendState CreateBlendState(BlendingFactorSrc colorSource, BlendEquationMode colorEquation, BlendingFactorDest colorDest,
|
||||||
BlendingFactorSrc alphaSource, BlendEquationMode alphaEquation, BlendingFactorDest alphaDest)
|
BlendingFactorSrc alphaSource, BlendEquationMode alphaEquation, BlendingFactorDest alphaDest)
|
||||||
|
@ -85,9 +81,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
class MyBlendState : IBlendState { }
|
class MyBlendState : IBlendState { }
|
||||||
static MyBlendState _rsBlendNoneVerbatim = new MyBlendState(), _rsBlendNoneOpaque = new MyBlendState(), _rsBlendNormal = new MyBlendState();
|
static MyBlendState _rsBlendNoneVerbatim = new MyBlendState(), _rsBlendNoneOpaque = new MyBlendState(), _rsBlendNormal = new MyBlendState();
|
||||||
|
|
||||||
public IBlendState BlendNoneCopy { get { return _rsBlendNoneVerbatim; } }
|
public IBlendState BlendNoneCopy => _rsBlendNoneVerbatim;
|
||||||
public IBlendState BlendNoneOpaque { get { return _rsBlendNoneOpaque; } }
|
public IBlendState BlendNoneOpaque => _rsBlendNoneOpaque;
|
||||||
public IBlendState BlendNormal { get { return _rsBlendNormal; } }
|
public IBlendState BlendNormal => _rsBlendNormal;
|
||||||
|
|
||||||
public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, Shader fragmentShader, bool required, string memo)
|
public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, Shader fragmentShader, bool required, string memo)
|
||||||
{
|
{
|
||||||
|
@ -96,7 +92,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void FreePipeline(Pipeline pipeline) {}
|
public void FreePipeline(Pipeline pipeline) {}
|
||||||
|
|
||||||
public VertexLayout CreateVertexLayout() { return new VertexLayout(this, new IntPtr(0)); }
|
public VertexLayout CreateVertexLayout() => new VertexLayout(this, new IntPtr(0));
|
||||||
|
|
||||||
public void SetTextureWrapMode(Texture2d tex, bool clamp)
|
public void SetTextureWrapMode(Texture2d tex, bool clamp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Pipeline _CurrPipeline;
|
Pipeline _CurrPipeline;
|
||||||
GLControlWrapper_SlimDX9 _CurrentControl;
|
GLControlWrapper_SlimDX9 _CurrentControl;
|
||||||
|
|
||||||
public string API { get { return "D3D9"; } }
|
public string API => "D3D9";
|
||||||
|
|
||||||
public IGL_SlimDX9()
|
public IGL_SlimDX9()
|
||||||
{
|
{
|
||||||
|
@ -369,9 +369,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
CacheBlendState _rsBlendNoneVerbatim, _rsBlendNoneOpaque, _rsBlendNormal;
|
CacheBlendState _rsBlendNoneVerbatim, _rsBlendNoneOpaque, _rsBlendNormal;
|
||||||
|
|
||||||
public IBlendState BlendNoneCopy { get { return _rsBlendNoneVerbatim; } }
|
public IBlendState BlendNoneCopy => _rsBlendNoneVerbatim;
|
||||||
public IBlendState BlendNoneOpaque { get { return _rsBlendNoneOpaque; } }
|
public IBlendState BlendNoneOpaque => _rsBlendNoneOpaque;
|
||||||
public IBlendState BlendNormal { get { return _rsBlendNormal; } }
|
public IBlendState BlendNormal => _rsBlendNormal;
|
||||||
|
|
||||||
/// <exception cref="InvalidOperationException">
|
/// <exception cref="InvalidOperationException">
|
||||||
/// <paramref name="required"/> is <see langword="true"/> and either <paramref name="vertexShader"/> or <paramref name="fragmentShader"/> is unavailable (their <see cref="Shader.Available"/> property is <see langword="false"/>), or
|
/// <paramref name="required"/> is <see langword="true"/> and either <paramref name="vertexShader"/> or <paramref name="fragmentShader"/> is unavailable (their <see cref="Shader.Available"/> property is <see langword="false"/>), or
|
||||||
|
|
|
@ -160,9 +160,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBlendState BlendNoneCopy { get { return _rsBlendNoneVerbatim; } }
|
public IBlendState BlendNoneCopy => _rsBlendNoneVerbatim;
|
||||||
public IBlendState BlendNoneOpaque { get { return _rsBlendNoneOpaque; } }
|
public IBlendState BlendNoneOpaque => _rsBlendNoneOpaque;
|
||||||
public IBlendState BlendNormal { get { return _rsBlendNormal; } }
|
public IBlendState BlendNormal => _rsBlendNormal;
|
||||||
|
|
||||||
class ShaderWrapper
|
class ShaderWrapper
|
||||||
{
|
{
|
||||||
|
|
|
@ -88,15 +88,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanProvideAsync
|
public bool CanProvideAsync => true;
|
||||||
{
|
|
||||||
get { return true; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public SyncSoundMode SyncMode
|
public SyncSoundMode SyncMode => SyncSoundMode.Async;
|
||||||
{
|
|
||||||
get { return SyncSoundMode.Async; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="NotSupportedException"><paramref name="mode"/> is not <see cref="SyncSoundMode.Async"/></exception>
|
/// <exception cref="NotSupportedException"><paramref name="mode"/> is not <see cref="SyncSoundMode.Async"/></exception>
|
||||||
public void SetSyncMode(SyncSoundMode mode)
|
public void SetSyncMode(SyncSoundMode mode)
|
||||||
|
|
|
@ -119,10 +119,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public bool LogDebug { get; set; }
|
public bool LogDebug { get; set; }
|
||||||
|
|
||||||
private double AdvertisedSamplesPerFrame
|
private double AdvertisedSamplesPerFrame => SampleRate / Global.Emulator.VsyncRate();
|
||||||
{
|
|
||||||
get { return SampleRate / Global.Emulator.VsyncRate(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="InvalidOperationException">not constructed in standalone mode</exception>
|
/// <exception cref="InvalidOperationException">not constructed in standalone mode</exception>
|
||||||
public void GetSamples(short[] samples)
|
public void GetSamples(short[] samples)
|
||||||
|
|
|
@ -18,15 +18,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_outputProvider.DiscardSamples();
|
_outputProvider.DiscardSamples();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanProvideAsync
|
public bool CanProvideAsync => true;
|
||||||
{
|
|
||||||
get { return true; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public SyncSoundMode SyncMode
|
public SyncSoundMode SyncMode => SyncSoundMode.Async;
|
||||||
{
|
|
||||||
get { return SyncSoundMode.Async; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="NotSupportedException"><paramref name="mode"/> is not <see cref="SyncSoundMode.Async"/></exception>
|
/// <exception cref="NotSupportedException"><paramref name="mode"/> is not <see cref="SyncSoundMode.Async"/></exception>
|
||||||
public void SetSyncMode(SyncSoundMode mode)
|
public void SetSyncMode(SyncSoundMode mode)
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public static void BeginCheck(bool skipCheck = false)
|
public static void BeginCheck(bool skipCheck = false)
|
||||||
{
|
{
|
||||||
if (skipCheck || String.IsNullOrEmpty(_latestVersionInfoURL) || !AutoCheckEnabled || LastCheckTimeUTC > DateTime.UtcNow - _minimumCheckDuration)
|
if (skipCheck || string.IsNullOrEmpty(_latestVersionInfoURL) || !AutoCheckEnabled || LastCheckTimeUTC > DateTime.UtcNow - _minimumCheckDuration)
|
||||||
{
|
{
|
||||||
OnCheckComplete();
|
OnCheckComplete();
|
||||||
return;
|
return;
|
||||||
|
@ -49,16 +49,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
ThreadPool.QueueUserWorkItem((s) => CheckInternal());
|
ThreadPool.QueueUserWorkItem((s) => CheckInternal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsNewVersionAvailable
|
public static bool IsNewVersionAvailable =>
|
||||||
{
|
AutoCheckEnabled
|
||||||
get
|
&& LatestVersion != IgnoreVersion
|
||||||
{
|
&& ParseVersion(VersionInfo.Mainversion) != 0 // Avoid notifying if current version string is invalid
|
||||||
return AutoCheckEnabled &&
|
&& ParseVersion(LatestVersion) > ParseVersion(VersionInfo.Mainversion);
|
||||||
LatestVersion != IgnoreVersion &&
|
|
||||||
ParseVersion(VersionInfo.Mainversion) != 0 && // Avoid notifying if current version string is invalid
|
|
||||||
ParseVersion(LatestVersion) > ParseVersion(VersionInfo.Mainversion);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void IgnoreNewVersion()
|
public static void IgnoreNewVersion()
|
||||||
{
|
{
|
||||||
|
|
|
@ -137,11 +137,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public bool Active
|
public bool Active
|
||||||
{
|
{
|
||||||
get
|
get => _active;
|
||||||
{
|
|
||||||
return _active;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!ReadOnly)
|
if (!ReadOnly)
|
||||||
|
|
|
@ -134,34 +134,21 @@ namespace BizHawk.Client.EmuHawk
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateBefore
|
public bool UpdateBefore => true;
|
||||||
{
|
public bool AskSaveChanges() => true;
|
||||||
get
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool AskSaveChanges()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FastUpdate()
|
public void FastUpdate()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Restart()
|
public void Restart()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NewUpdate(ToolFormUpdateType type) { }
|
public void NewUpdate(ToolFormUpdateType type) { }
|
||||||
|
|
||||||
public void UpdateValues()
|
public void UpdateValues()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//My Variables
|
//My Variables
|
||||||
|
@ -198,7 +185,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GEN();
|
GEN();
|
||||||
break;
|
break;
|
||||||
case "N64":
|
case "N64":
|
||||||
//This determies what kind of Code we have
|
// This determines what kind of Code we have
|
||||||
testo = SingleCheat.Remove(2, 11);
|
testo = SingleCheat.Remove(2, 11);
|
||||||
N64();
|
N64();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using BizHawk.Common;
|
using BizHawk.Common;
|
||||||
|
@ -109,7 +105,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _IsLibraryAvailable;
|
static bool _IsLibraryAvailable;
|
||||||
public static bool IsLibraryAvailable { get { return _IsLibraryAvailable; } }
|
public static bool IsLibraryAvailable => _IsLibraryAvailable;
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
@ -135,7 +131,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
//can't be a bool due to marshalling...
|
//can't be a bool due to marshalling...
|
||||||
[FieldOffset(8)] public byte _validByte;
|
[FieldOffset(8)] public byte _validByte;
|
||||||
|
|
||||||
public bool Valid { get { return _validByte != 0; } }
|
public bool Valid => _validByte != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("mednadisc.dll", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("mednadisc.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
|
|
@ -50,13 +50,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
fs.Position = target;
|
fs.Position = target;
|
||||||
return fs.Read(buffer, offset, count);
|
return fs.Read(buffer, offset, count);
|
||||||
}
|
}
|
||||||
public long Length
|
public long Length => length;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -29,10 +29,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
{
|
{
|
||||||
public string PhysicalPath
|
public string PhysicalPath
|
||||||
{
|
{
|
||||||
get
|
get => physicalPath;
|
||||||
{
|
|
||||||
return physicalPath;
|
|
||||||
}
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
physicalPath = value;
|
physicalPath = value;
|
||||||
|
@ -65,13 +62,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
fs.Position = target;
|
fs.Position = target;
|
||||||
return fs.Read(buffer, offset, count);
|
return fs.Read(buffer, offset, count);
|
||||||
}
|
}
|
||||||
public long Length
|
public long Length => length;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Load(byte[] waveData)
|
public void Load(byte[] waveData)
|
||||||
|
@ -144,12 +135,11 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
RiffMaster RiffSource;
|
RiffMaster RiffSource;
|
||||||
long waveDataStreamPos;
|
long waveDataStreamPos;
|
||||||
long mDataLength;
|
long mDataLength;
|
||||||
public long Length { get { return mDataLength; } }
|
public long Length => mDataLength;
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (RiffSource != null)
|
RiffSource?.Dispose();
|
||||||
RiffSource.Dispose();
|
|
||||||
RiffSource = null;
|
RiffSource = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The negated output (the typical result of the CRC calculation)
|
/// The negated output (the typical result of the CRC calculation)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint Result { get { return current ^ 0xFFFFFFFF; } }
|
public uint Result => current ^ 0xFFFFFFFF;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The raw non-negated output
|
/// The raw non-negated output
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
using BizHawk.Common.BufferExtensions;
|
|
||||||
|
|
||||||
namespace BizHawk.Emulation.DiscSystem
|
namespace BizHawk.Emulation.DiscSystem
|
||||||
{
|
{
|
||||||
|
@ -90,11 +87,11 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
cachedSectorBuffer = new byte[SectorSize];
|
cachedSectorBuffer = new byte[SectorSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanRead { get { return true; } }
|
public override bool CanRead => true;
|
||||||
public override bool CanSeek { get { return true; } }
|
public override bool CanSeek => true;
|
||||||
public override bool CanWrite { get { return false; } }
|
public override bool CanWrite => false;
|
||||||
public override void Flush() { throw new NotImplementedException(); }
|
public override void Flush() { throw new NotImplementedException(); }
|
||||||
public override long Length { get { return NumSectors * SectorSize; } }
|
public override long Length => NumSectors * SectorSize;
|
||||||
|
|
||||||
public override long Position
|
public override long Position
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace BizHawk.Emulation.DiscSystem
|
namespace BizHawk.Emulation.DiscSystem
|
||||||
{
|
{
|
||||||
|
@ -26,7 +24,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The LBA of the session's leadout. In other words, for all intents and purposes, the end of the session
|
/// The LBA of the session's leadout. In other words, for all intents and purposes, the end of the session
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int LeadoutLBA { get { return LeadoutTrack.LBA; } }
|
public int LeadoutLBA => LeadoutTrack.LBA;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The session number
|
/// The session number
|
||||||
|
@ -38,7 +36,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// This excludes the lead-in and lead-out tracks
|
/// This excludes the lead-in and lead-out tracks
|
||||||
/// Use this instead of Tracks.Count
|
/// Use this instead of Tracks.Count
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int InformationTrackCount { get { return Tracks.Count - 2; } }
|
public int InformationTrackCount => Tracks.Count - 2;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All the tracks in the session.. but... Tracks[0] is the lead-in track. Tracks[1] should be "Track 1". So beware of this.
|
/// All the tracks in the session.. but... Tracks[0] is the lead-in track. Tracks[1] should be "Track 1". So beware of this.
|
||||||
|
@ -51,24 +49,24 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// A reference to the first information track (Track 1)
|
/// A reference to the first information track (Track 1)
|
||||||
/// The raw TOC may have specified something different; it's not clear how this discrepancy is handled.
|
/// The raw TOC may have specified something different; it's not clear how this discrepancy is handled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Track FirstInformationTrack { get { return Tracks[1]; } }
|
public Track FirstInformationTrack => Tracks[1];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A reference to the last information track on the disc.
|
/// A reference to the last information track on the disc.
|
||||||
/// The raw TOC may have specified something different; it's not clear how this discrepancy is handled.
|
/// The raw TOC may have specified something different; it's not clear how this discrepancy is handled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Track LastInformationTrack { get { return Tracks[InformationTrackCount]; } }
|
public Track LastInformationTrack => Tracks[InformationTrackCount];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A reference to the lead-out track.
|
/// A reference to the lead-out track.
|
||||||
/// Effectively, the end of the user area of the disc.
|
/// Effectively, the end of the user area of the disc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Track LeadoutTrack { get { return Tracks[Tracks.Count - 1]; } }
|
public Track LeadoutTrack => Tracks[Tracks.Count - 1];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A reference to the lead-in track
|
/// A reference to the lead-in track
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Track LeadinTrack { get { return Tracks[0]; } }
|
public Track LeadinTrack => Tracks[0];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines which track of the session is at the specified LBA.
|
/// Determines which track of the session is at the specified LBA.
|
||||||
|
@ -144,12 +142,12 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is this track a Data track?
|
/// Is this track a Data track?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsData { get { return !IsAudio; } }
|
public bool IsData => !IsAudio;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is this track an Audio track?
|
/// Is this track an Audio track?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAudio { get { return Mode == 0; } }
|
public bool IsAudio => Mode == 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The 'control' properties of the track expected to be found in the track's subQ.
|
/// The 'control' properties of the track expected to be found in the track's subQ.
|
||||||
|
|
|
@ -130,12 +130,12 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrives the ADR field of the q_status member (low 4 bits)
|
/// Retrives the ADR field of the q_status member (low 4 bits)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ADR { get { return q_status & 0xF; } }
|
public int ADR => q_status & 0xF;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves the CONTROL field of the q_status member (high 4 bits)
|
/// Retrieves the CONTROL field of the q_status member (high 4 bits)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EControlQ CONTROL { get { return (EControlQ)((q_status >> 4) & 0xF); } }
|
public EControlQ CONTROL => (EControlQ)((q_status >> 4) & 0xF);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Text;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace BizHawk.Emulation.DiscSystem
|
namespace BizHawk.Emulation.DiscSystem
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -40,7 +36,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the Control indicates that this is data
|
/// Whether the Control indicates that this is data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsData { get { return (Control & EControlQ.DATA) != 0; } }
|
public bool IsData => (Control & EControlQ.DATA) != 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The location of the track (Index 1)
|
/// The location of the track (Index 1)
|
||||||
|
@ -63,9 +59,6 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The timestamp of the leadout track. In other words, the end of the user area.
|
/// The timestamp of the leadout track. In other words, the end of the user area.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int LeadoutLBA { get { return TOCItems[100].LBA; } }
|
public int LeadoutLBA => TOCItems[100].LBA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace BizHawk.Emulation.DiscSystem
|
namespace BizHawk.Emulation.DiscSystem
|
||||||
{
|
{
|
||||||
|
@ -146,7 +142,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The fully multiplied out flat-address Sector number
|
/// The fully multiplied out flat-address Sector number
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Sector { get { return MIN * 60 * 75 + SEC * 75 + FRAC; } }
|
public int Sector => MIN * 60 * 75 + SEC * 75 + FRAC;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// creates timestamp from the supplied MSF
|
/// creates timestamp from the supplied MSF
|
||||||
|
@ -177,9 +173,6 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
Valid = true;
|
Valid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString() => Value;
|
||||||
{
|
|
||||||
return Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue