more misc cleanups

This commit is contained in:
adelikat 2017-04-24 07:41:55 -05:00
parent b488529a7b
commit 76b9367378
25 changed files with 413 additions and 274 deletions

View File

@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Common
/// <seealso cref="IEmulatorServiceProvider"/>
public class BasicServiceProvider : IEmulatorServiceProvider
{
private Dictionary<Type, object> Services = new Dictionary<Type, object>();
private readonly Dictionary<Type, object> Services = new Dictionary<Type, object>();
public BasicServiceProvider(IEmulator core)
{

View File

@ -63,6 +63,7 @@ namespace BizHawk.Emulation.Common
{
return _sink;
}
set
{
_sink = value;

View File

@ -31,37 +31,37 @@ namespace BizHawk.Emulation.Common
}
/// <summary>
/// The name of the controller definition
/// Gets or sets the name of the controller definition
/// </summary>
public string Name { get; set; }
/// <summary>
/// A list of all button types that have a boolean (on/off) value
/// Gets or sets a list of all button types that have a boolean (on/off) value
/// </summary>
public List<string> BoolButtons { get; set; }
/// <summary>
/// A list of all non-boolean types, that can be represented by a numerical value (such as analog controls, stylus coordinates, etc
/// Gets a list of all non-boolean types, that can be represented by a numerical value (such as analog controls, stylus coordinates, etc
/// </summary>
public List<string> FloatControls { get; private set; }
public List<string> FloatControls { get; }
/// <summary>
/// A list of all float ranges for each float control (must be one to one with FloatControls)
/// Gets a list of all float ranges for each float control (must be one to one with FloatControls)
/// FloatRanges include the min/max/default values
/// </summary>
public List<FloatRange> FloatRanges { get; private set; }
public List<FloatRange> FloatRanges { get; }
/// <summary>
/// Axis contraints apply artificial contraints to float values
/// For instance, a N64 controller's analog range is actually larger than the amount allowed by the plastic that artificially contrains it to lower values
/// Axis contraints provide a way to technically allow the full range but have a user option to contrain down to typical values that a real control would have
/// Gets the axis constraints that apply artificial constraints to float values
/// For instance, a N64 controller's analog range is actually larger than the amount allowed by the plastic that artificially constrains it to lower values
/// Axis constraints provide a way to technically allow the full range but have a user option to constrain down to typical values that a real control would have
/// </summary>
public List<AxisConstraint> AxisConstraints { get; private set; }
public List<AxisConstraint> AxisConstraints { get; }
/// <summary>
/// A means of categorizing controls in various controller display and config screens
/// Gets the category labels. These labels provide a means of categorizing controls in various controller display and config screens
/// </summary>
public Dictionary<string, string> CategoryLabels { get; private set; }
public Dictionary<string, string> CategoryLabels { get; }
public void ApplyAxisConstraints(string constraintClass, IDictionary<string, float> floatButtons)
{
@ -93,6 +93,7 @@ namespace BizHawk.Emulation.Common
xval *= ratio;
yval *= ratio;
}
floatButtons[xaxis] = (float)xval;
floatButtons[yaxis] = (float)yval;
break;
@ -214,5 +215,4 @@ namespace BizHawk.Emulation.Common
return BoolButtons.Any() || FloatControls.Any();
}
}
}

View File

@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Common
private bool _hasWrites;
private bool _hasExecutes;
public bool ExecuteCallbacksAvailable { get; set; }
public bool ExecuteCallbacksAvailable { get; }
public void Add(IMemoryCallback callback)
{
@ -222,12 +222,14 @@ namespace BizHawk.Emulation.Common
{
CallbackAdded?.Invoke(callback);
}
break;
case NotifyCollectionChangedAction.Remove:
foreach (IMemoryCallback callback in args.OldItems)
{
CallbackRemoved?.Invoke(callback);
}
break;
}
}

View File

@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Common
/// <param name="data">must remain valid as long as the MemoryDomain exists!</param>
/// <param name="writable">if false, writes will be ignored</param>
[Obsolete]
public unsafe static MemoryDomain FromIntPtr(string name, long size, Endian endian, IntPtr data, bool writable = true, int wordSize = 1)
public static unsafe MemoryDomain FromIntPtr(string name, long size, Endian endian, IntPtr data, bool writable = true, int wordSize = 1)
{
return new MemoryDomainIntPtr(name, endian, data, size, writable, wordSize);
}
@ -52,7 +52,7 @@ namespace BizHawk.Emulation.Common
/// <param name="data">must remain valid as long as the MemoryDomain exists!</param>
/// <param name="writable">if false, writes will be ignored</param>
[Obsolete]
public unsafe static MemoryDomain FromIntPtrSwap16(string name, long size, Endian endian, IntPtr data, bool writable = true)
public static unsafe MemoryDomain FromIntPtrSwap16(string name, long size, Endian endian, IntPtr data, bool writable = true)
{
return new MemoryDomainIntPtrSwap16(name, endian, data, size, writable);
}
@ -69,9 +69,9 @@ namespace BizHawk.Emulation.Common
{
default:
case Endian.Big:
return (ushort)((PeekByte(addr) << 8) | (PeekByte(addr + 1)));
return (ushort)((PeekByte(addr) << 8) | PeekByte(addr + 1));
case Endian.Little:
return (ushort)((PeekByte(addr)) | (PeekByte(addr + 1) << 8));
return (ushort)(PeekByte(addr) | (PeekByte(addr + 1) << 8));
}
}
@ -102,10 +102,10 @@ namespace BizHawk.Emulation.Common
default:
case Endian.Big:
PokeByte(addr + 0, (byte)(val >> 8));
PokeByte(addr + 1, (byte)(val));
PokeByte(addr + 1, (byte)val);
break;
case Endian.Little:
PokeByte(addr + 0, (byte)(val));
PokeByte(addr + 0, (byte)val);
PokeByte(addr + 1, (byte)(val >> 8));
break;
}
@ -121,10 +121,10 @@ namespace BizHawk.Emulation.Common
PokeByte(addr + 0, (byte)(val >> 24));
PokeByte(addr + 1, (byte)(val >> 16));
PokeByte(addr + 2, (byte)(val >> 8));
PokeByte(addr + 3, (byte)(val));
PokeByte(addr + 3, (byte)val);
break;
case Endian.Little:
PokeByte(addr + 0, (byte)(val));
PokeByte(addr + 0, (byte)val);
PokeByte(addr + 1, (byte)(val >> 8));
PokeByte(addr + 2, (byte)(val >> 16));
PokeByte(addr + 3, (byte)(val >> 24));

View File

@ -24,6 +24,6 @@
return 0f;
}
public static NullController Instance = new NullController();
public static readonly NullController Instance = new NullController();
}
}

View File

@ -201,7 +201,7 @@ namespace BizHawk.Emulation.Common
private bool _frameBufferClear = true;
private bool _xmas;
private Pleg _pleg;
private readonly Pleg _pleg;
private NullEmulatorSettings _settings;
@ -356,9 +356,7 @@ namespace BizHawk.Emulation.Common
return;
}
var s = new SinMan(1500, n);
s.c = c;
s.n = n;
var s = new SinMan(1500, n) { c = c, n = n };
SinMen.Add(s);
}
@ -378,6 +376,7 @@ namespace BizHawk.Emulation.Common
ret += s.Next();
}
}
if (ret > 32767) ret = 32767;
if (ret < -32767) ret = -32767;
return (short)ret;
@ -432,10 +431,7 @@ namespace BizHawk.Emulation.Common
public bool fading = false;
public bool Done
{
get { return amp < 2.0; }
}
public bool Done => amp < 2.0;
static double GetFreq(int note)
{
@ -447,9 +443,15 @@ namespace BizHawk.Emulation.Common
short result = (short)(Math.Sin(theta) * amp);
theta += freq * Math.PI / 22050.0;
if (theta >= Math.PI * 2.0)
{
theta -= Math.PI * 2.0;
}
if (fading)
{
amp *= 0.87;
}
return result;
}

View File

@ -12,6 +12,8 @@
return new int[BufferWidth * BufferHeight];
}
public static NullVideo Instance { get; } = new NullVideo();
public int VirtualWidth => 256;
public int VirtualHeight => 192;
@ -21,9 +23,5 @@
public int BufferHeight => 192;
public int BackgroundColor => 0;
private static readonly NullVideo _nullVideo = new NullVideo();
public static NullVideo Instance => _nullVideo;
}
}

View File

@ -23,13 +23,18 @@ namespace BizHawk.Emulation.Common
{
var caller = e as MethodCallExpression;
if (caller == null)
{
throw new ArgumentException("Expression must be a method call");
}
return caller.Method;
}
private static MethodInfo Method(Expression<Action> f)
{
return FromExpression(f.Body);
}
private static MethodInfo Method<T>(Expression<Action<T>> f)
{
return FromExpression(f.Body);
@ -39,14 +44,17 @@ namespace BizHawk.Emulation.Common
#region read and write handlers for individual fields
private static Dictionary<Type, MethodInfo> readhandlers = new Dictionary<Type, MethodInfo>();
private static Dictionary<Type, MethodInfo> writehandlers = new Dictionary<Type, MethodInfo>();
private static readonly Dictionary<Type, MethodInfo> readhandlers = new Dictionary<Type, MethodInfo>();
private static readonly Dictionary<Type, MethodInfo> writehandlers = new Dictionary<Type, MethodInfo>();
private static void AddR<T>(Expression<Action<BinaryReader>> f)
{
var method = Method(f);
if (!typeof(T).IsAssignableFrom(method.ReturnType))
{
throw new InvalidOperationException("Type mismatch");
}
readhandlers.Add(typeof(T), method);
}
@ -54,7 +62,10 @@ namespace BizHawk.Emulation.Common
{
var method = Method(f);
if (!method.GetParameters()[0].ParameterType.IsAssignableFrom(typeof(T)))
{
throw new InvalidOperationException("Type mismatch");
}
writehandlers.Add(typeof(T), Method(f));
}
@ -125,12 +136,17 @@ namespace BizHawk.Emulation.Common
il.Emit(OpCodes.Ldarg_1);
MethodInfo m;
if (!readhandlers.TryGetValue(field.FieldType, out m))
{
throw new InvalidOperationException("(R) Can't handle nested type " + field.FieldType);
}
il.Emit(OpCodes.Callvirt, m);
il.Emit(OpCodes.Stfld, field);
}
il.Emit(OpCodes.Ret);
}
{
var il = wmeth.GetILGenerator();
var target = il.DeclareLocal(t);
@ -145,9 +161,13 @@ namespace BizHawk.Emulation.Common
il.Emit(OpCodes.Ldfld, field);
MethodInfo m;
if (!writehandlers.TryGetValue(field.FieldType, out m))
{
throw new InvalidOperationException("(W) Can't handle nested type " + field.FieldType);
}
il.Emit(OpCodes.Callvirt, m);
}
il.Emit(OpCodes.Ret);
}
@ -161,7 +181,7 @@ namespace BizHawk.Emulation.Common
#endregion
private static IDictionary<Type, SerializationFactory> serializers =
private static readonly IDictionary<Type, SerializationFactory> serializers =
new ConcurrentDictionary<Type, SerializationFactory>();
private static SerializationFactory GetFactory(Type t)
@ -172,6 +192,7 @@ namespace BizHawk.Emulation.Common
f = CreateFactory(t);
serializers[t] = f;
}
return f;
}

View File

@ -36,7 +36,7 @@ namespace BizHawk.Emulation.Common.BizInvoke
/// <summary>
/// dictionary of all generated proxy implementations and their basetypes
/// </summary>
private static IDictionary<Type, InvokerImpl> Impls = new Dictionary<Type, InvokerImpl>();
private static readonly IDictionary<Type, InvokerImpl> Impls = new Dictionary<Type, InvokerImpl>();
/// <summary>
/// the assembly that all proxies are placed in
@ -138,14 +138,18 @@ namespace BizHawk.Emulation.Common.BizInvoke
{
var uo = baseMethods.FirstOrDefault(a => !a.Info.IsVirtual || a.Info.IsFinal);
if (uo != null)
{
throw new InvalidOperationException("Method " + uo.Info.Name + " cannot be overriden!");
}
// there's no technical reason to disallow this, but we wouldn't be doing anything
// with the base implementation, so it's probably a user error
var na = baseMethods.FirstOrDefault(a => !a.Info.IsAbstract);
if (na != null)
{
throw new InvalidOperationException("Method " + na.Info.Name + " is not abstract!");
}
}
// hooks that will be run on the created proxy object
var postCreateHooks = new List<Action<object, IImportResolver>>();
@ -171,7 +175,9 @@ namespace BizHawk.Emulation.Common.BizInvoke
ImplType = type.CreateType()
};
if (monitor)
{
ret.ConnectMonitor = (o, m) => o.GetType().GetField(monitorField.Name).SetValue(o, m);
}
return ret;
}
@ -234,7 +240,9 @@ namespace BizHawk.Emulation.Common.BizInvoke
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldfld, field);
for (int i = 0; i < paramTypes.Length; i++)
{
il.Emit(OpCodes.Ldarg, (short)(i + 1));
}
il.Emit(OpCodes.Callvirt, delegateInvoke);
@ -354,11 +362,18 @@ namespace BizHawk.Emulation.Common.BizInvoke
private static void LoadConstant(ILGenerator il, IntPtr p)
{
if (p == IntPtr.Zero)
{
il.Emit(OpCodes.Ldc_I4_0);
}
else if (IntPtr.Size == 4)
{
il.Emit(OpCodes.Ldc_I4, (int)p);
}
else
{
il.Emit(OpCodes.Ldc_I8, (long)p);
}
il.Emit(OpCodes.Conv_I);
}
@ -368,11 +383,18 @@ namespace BizHawk.Emulation.Common.BizInvoke
private static void LoadConstant(ILGenerator il, UIntPtr p)
{
if (p == UIntPtr.Zero)
{
il.Emit(OpCodes.Ldc_I4_0);
}
else if (UIntPtr.Size == 4)
{
il.Emit(OpCodes.Ldc_I4, (int)p);
}
else
{
il.Emit(OpCodes.Ldc_I8, (long)p);
}
il.Emit(OpCodes.Conv_U);
}
@ -382,12 +404,18 @@ namespace BizHawk.Emulation.Common.BizInvoke
private static Type EmitParamterLoad(ILGenerator il, int idx, Type type)
{
if (type.IsGenericType)
{
throw new InvalidOperationException("Generic types not supported");
}
if (type.IsByRef)
{
var et = type.GetElementType();
if (!et.IsPrimitive && !et.IsEnum)
{
throw new InvalidOperationException("Only refs of primitive or enum types are supported!");
}
var loc = il.DeclareLocal(type, true);
il.Emit(OpCodes.Ldarg, (short)idx);
il.Emit(OpCodes.Dup);
@ -395,17 +423,24 @@ namespace BizHawk.Emulation.Common.BizInvoke
il.Emit(OpCodes.Conv_I);
return typeof(IntPtr);
}
else if (type.IsArray)
if (type.IsArray)
{
var et = type.GetElementType();
if (!et.IsPrimitive && !et.IsEnum)
{
throw new InvalidOperationException("Only arrays of primitive or enum types are supported!");
}
// these two cases aren't too hard to add
if (type.GetArrayRank() > 1)
{
throw new InvalidOperationException("Multidimensional arrays are not supported!");
}
if (type.Name.Contains('*'))
{
throw new InvalidOperationException("Only 0-based 1-dimensional arrays are supported!");
}
var loc = il.DeclareLocal(type, true);
var end = il.DefineLabel();
@ -428,7 +463,8 @@ namespace BizHawk.Emulation.Common.BizInvoke
return typeof(IntPtr);
}
else if (typeof(Delegate).IsAssignableFrom(type))
if (typeof(Delegate).IsAssignableFrom(type))
{
var mi = typeof(Marshal).GetMethod("GetFunctionPointerForDelegate", new[] { typeof(Delegate) });
var end = il.DefineLabel();
@ -446,23 +482,25 @@ namespace BizHawk.Emulation.Common.BizInvoke
il.MarkLabel(end);
return typeof(IntPtr);
}
else if (type.IsPrimitive || type.IsEnum)
if (type.IsPrimitive || type.IsEnum)
{
il.Emit(OpCodes.Ldarg, (short)idx);
return type;
}
else
{
throw new InvalidOperationException("Unrecognized parameter type!");
}
}
private static CustomAttributeBuilder GetAttributeBuilder(object o)
{
// anything more clever we can do here?
var t = o.GetType();
if (t == typeof(OutAttribute) || t == typeof(InAttribute))
{
return new CustomAttributeBuilder(t.GetConstructor(Type.EmptyTypes), new object[0]);
}
throw new InvalidOperationException("Unknown parameter attribute " + t.Name);
}
}

View File

@ -1,14 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Common
{
// the idea here is that various connected peripherals have their controls all merged
// into one definition, including logic to unmerge the data back so each one can work
// with it without knowing what else is connected
public static class ControllerDefinitionMerger
{
private static string Allocate(string input, ref int plr, ref int plrnext)
@ -16,22 +13,24 @@ namespace BizHawk.Emulation.Common
int offset = int.Parse(input.Substring(0, 1));
int currplr = plr + offset;
if (currplr >= plrnext)
{
plrnext = currplr + 1;
return string.Format("P{0} {1}", currplr, input.Substring(1));
}
return $"P{currplr} {input.Substring(1)}";
}
/// <summary>
/// merge some controller definitions for different ports, and such. i promise to fully document this tomorrow
/// </summary>
/// <param name="Controllers"></param>
/// <returns></returns>
public static ControllerDefinition GetMerged(IEnumerable<ControllerDefinition> Controllers, out List<ControlDefUnMerger> Unmergers)
public static ControllerDefinition GetMerged(IEnumerable<ControllerDefinition> controllers, out List<ControlDefUnMerger> unmergers)
{
ControllerDefinition ret = new ControllerDefinition();
Unmergers = new List<ControlDefUnMerger>();
unmergers = new List<ControlDefUnMerger>();
int plr = 1;
int plrnext = 1;
foreach (var def in Controllers)
foreach (var def in controllers)
{
Dictionary<string, string> remaps = new Dictionary<string, string>();
@ -41,33 +40,37 @@ namespace BizHawk.Emulation.Common
ret.BoolButtons.Add(r);
remaps[s] = r;
}
foreach (string s in def.FloatControls)
{
string r = Allocate(s, ref plr, ref plrnext);
ret.FloatControls.Add(r);
remaps[s] = r;
}
ret.FloatRanges.AddRange(def.FloatRanges);
plr = plrnext;
Unmergers.Add(new ControlDefUnMerger(remaps));
unmergers.Add(new ControlDefUnMerger(remaps));
}
return ret;
}
}
public class ControlDefUnMerger
{
Dictionary<string, string> Remaps;
private readonly Dictionary<string, string> Remaps;
public ControlDefUnMerger(Dictionary<string, string> Remaps)
public ControlDefUnMerger(Dictionary<string, string> remaps)
{
this.Remaps = Remaps;
Remaps = remaps;
}
private class DummyController : IController
{
IController src;
Dictionary<string, string> remaps;
private readonly IController src;
private readonly Dictionary<string, string> remaps;
public DummyController(IController src, Dictionary<string, string> remaps)
{
this.src = src;
@ -76,7 +79,7 @@ namespace BizHawk.Emulation.Common
public ControllerDefinition Definition { get { throw new NotImplementedException(); } }
public bool this[string button] { get { return IsPressed(button); } }
public bool this[string button] => IsPressed(button);
public bool IsPressed(string button)
{
@ -93,6 +96,5 @@ namespace BizHawk.Emulation.Common
{
return new DummyController(c, Remaps);
}
}
}

View File

@ -11,10 +11,10 @@ namespace BizHawk.Emulation.Common
/// <seealso cref="IEmulator" />
public class CoreComm
{
public CoreComm(Action<string> showMessage, Action<string> NotifyMessage)
public CoreComm(Action<string> showMessage, Action<string> notifyMessage)
{
ShowMessage = showMessage;
Notify = NotifyMessage;
Notify = notifyMessage;
}
public ICoreFileProvider CoreFileProvider;

View File

@ -1,6 +1,5 @@
// we could get a little list of crcs from here and make it clear which crc this class was for, and expose others
// http://www.ross.net/crc/download/crc_v3.txt
namespace BizHawk.Emulation.Common
{
// TODO - why am I here? put me alongside hash_md5 and such in a non-emulation-related class
@ -18,10 +17,14 @@ namespace BizHawk.Emulation.Common
for (int j = 8; j > 0; --j)
{
if ((crc & 1) == 1)
crc = ((crc >> 1) ^ 0xEDB88320);
{
crc = (crc >> 1) ^ 0xEDB88320;
}
else
{
crc >>= 1;
}
}
CRC32Table[i] = crc;
}
@ -29,11 +32,13 @@ namespace BizHawk.Emulation.Common
public static int Calculate(byte[] data)
{
uint Result = 0xFFFFFFFF;
uint result = 0xFFFFFFFF;
foreach (var b in data)
Result = (((Result) >> 8) ^ CRC32Table[b ^ ((Result) & 0xFF)]);
{
result = (result >> 8) ^ CRC32Table[b ^ (result & 0xFF)];
}
return (int) ~Result;
return (int)~result;
}
}
}

View File

@ -212,7 +212,7 @@ namespace BizHawk.Emulation.Common
public static GameInfo GetGameInfo(byte[] romData, string fileName)
{
CompactGameInfo cgi;
var hash = string.Format("{0:X8}", CRC32.Calculate(romData));
var hash = $"{CRC32.Calculate(romData):X8}";
if (db.TryGetValue(hash, out cgi))
{
return new GameInfo(cgi);

View File

@ -168,12 +168,12 @@ namespace BizHawk.Emulation.Common
Option("PSX", "U", ps_30a);
Option("PSX", "J", ps_30j);
Option("PSX", "E", ps_30e);
// in general, alternates arent allowed.. their quality isnt known.
// we have this comment from fobby.net: "SCPH7502 works fine for European games" (TBD)
// however, we're sticking with the 3.0 series.
// please note: 2.1 or 2.2 would be a better choice, as the dates are the same and the bioses are more likely to matching in terms of entrypoints and such.
// but 3.0 is what mednafen used
Option("PSX", "J", ps_10j, FirmwareOptionStatus.Unacceptable);
Option("PSX", "J", ps_11j, FirmwareOptionStatus.Unacceptable);
Option("PSX", "U", ps_20a, FirmwareOptionStatus.Unacceptable);
@ -205,7 +205,7 @@ namespace BizHawk.Emulation.Common
}
// adds a defined firmware ID to the database
static void Firmware(string systemId, string id, string descr)
private static void Firmware(string systemId, string id, string descr)
{
var fr = new FirmwareRecord
{
@ -218,7 +218,7 @@ namespace BizHawk.Emulation.Common
}
// adds an acceptable option for a firmware ID to the database
static FirmwareOption Option(string hash, long size, string systemId, string id, FirmwareOptionStatus status = FirmwareOptionStatus.Acceptable)
private static FirmwareOption Option(string hash, long size, string systemId, string id, FirmwareOptionStatus status = FirmwareOptionStatus.Acceptable)
{
var fo = new FirmwareOption
{
@ -233,22 +233,29 @@ namespace BizHawk.Emulation.Common
// first option is automatically ideal
if (FirmwareOptions.Count == 1 && fo.status == FirmwareOptionStatus.Acceptable)
{
fo.status = FirmwareOptionStatus.Ideal;
}
return fo;
}
// adds an acceptable option for a firmware ID to the database
static FirmwareOption Option(string systemId, string id, FirmwareFile ff, FirmwareOptionStatus status = FirmwareOptionStatus.Acceptable)
private static FirmwareOption Option(string systemId, string id, FirmwareFile ff, FirmwareOptionStatus status = FirmwareOptionStatus.Acceptable)
{
var fo = Option(ff.hash, ff.size, systemId, id, status);
// make sure this goes in as bad
if(ff.bad) fo.status = FirmwareOptionStatus.Bad;
if (ff.bad)
{
fo.status = FirmwareOptionStatus.Bad;
}
return fo;
}
// defines a firmware file
static FirmwareFile File(string hash, long size, string recommendedName, string descr, string additionalInfo = "")
private static FirmwareFile File(string hash, long size, string recommendedName, string descr, string additionalInfo = "")
{
string hashfix = hash.ToUpperInvariant();
@ -266,7 +273,7 @@ namespace BizHawk.Emulation.Common
}
// adds a defined firmware ID and one file and option
static void FirmwareAndOption(string hash, long size, string systemId, string id, string name, string descr)
private static void FirmwareAndOption(string hash, long size, string systemId, string id, string name, string descr)
{
Firmware(systemId, id, descr);
File(hash, size, name, descr, "");
@ -274,9 +281,9 @@ namespace BizHawk.Emulation.Common
}
public static List<FirmwareRecord> FirmwareRecords = new List<FirmwareRecord>();
public static List<FirmwareOption> FirmwareOptions = new List<FirmwareOption>();
public static List<FirmwareFile> FirmwareFiles = new List<FirmwareFile>();
public static readonly List<FirmwareRecord> FirmwareRecords = new List<FirmwareRecord>();
public static readonly List<FirmwareOption> FirmwareOptions = new List<FirmwareOption>();
public static readonly List<FirmwareFile> FirmwareFiles = new List<FirmwareFile>();
public static Dictionary<string, FirmwareFile> FirmwareFilesByHash = new Dictionary<string, FirmwareFile>();
@ -295,7 +302,7 @@ namespace BizHawk.Emulation.Common
public string systemId;
public string firmwareId;
public string descr;
public string ConfigKey { get { return string.Format("{0}+{1}", systemId, firmwareId); } }
public string ConfigKey => $"{systemId}+{firmwareId}";
}
public enum FirmwareOptionStatus
@ -311,7 +318,7 @@ namespace BizHawk.Emulation.Common
public long size;
public FirmwareOptionStatus status;
public bool IsAcceptableOrIdeal { get { return status == FirmwareOptionStatus.Ideal || status == FirmwareOptionStatus.Acceptable; } }
public string ConfigKey { get { return string.Format("{0}+{1}", systemId, firmwareId); } }
public string ConfigKey => $"{systemId}+{firmwareId}";
}
@ -325,6 +332,5 @@ namespace BizHawk.Emulation.Common
return found.FirstOrDefault();
}
} // static class FirmwareDatabase
}

View File

@ -13,18 +13,20 @@ namespace BizHawk.Emulation.Common
return Status == RomStatus.BadDump || Status == RomStatus.Overdump;
}
public string Name;
public string System;
public string Hash;
public string Region;
public RomStatus Status = RomStatus.NotInDatabase;
public bool NotInDatabase = true;
public string FirmwareHash;
public string ForcedCore;
public string Name { get; set; }
public string System { get; set; }
public string Hash { get; set; }
public string Region { get; set; }
public RomStatus Status { get; set; } = RomStatus.NotInDatabase;
public bool NotInDatabase { get; set; } = true;
public string FirmwareHash { get; set; }
public string ForcedCore { get; private set; }
Dictionary<string, string> Options = new Dictionary<string, string>();
private Dictionary<string, string> Options { get; set; } = new Dictionary<string, string>();
public GameInfo() { }
public GameInfo()
{
}
public GameInfo Clone()
{
@ -33,27 +35,18 @@ namespace BizHawk.Emulation.Common
return ret;
}
public static GameInfo NullInstance
{
get
{
return new GameInfo
public static GameInfo NullInstance => new GameInfo
{
Name = "Null",
System = "NULL",
Hash = "",
Region = "",
Hash = string.Empty,
Region = string.Empty,
Status = RomStatus.GoodDump,
ForcedCore = "",
ForcedCore = string.Empty,
NotInDatabase = false
};
}
}
public bool IsNullInstance
{
get { return System == "NULL"; }
}
public bool IsNullInstance => System == "NULL";
internal GameInfo(CompactGameInfo cgi)
{
@ -82,10 +75,7 @@ namespace BizHawk.Emulation.Common
Options.Remove(option);
}
public bool this[string option]
{
get { return Options.ContainsKey(option); }
}
public bool this[string option] => Options.ContainsKey(option);
public bool OptionPresent(string option)
{
@ -95,7 +85,10 @@ namespace BizHawk.Emulation.Common
public string OptionValue(string option)
{
if (Options.ContainsKey(option))
{
return Options[option];
}
return null;
}
@ -114,25 +107,37 @@ namespace BizHawk.Emulation.Common
return int.Parse(Options[option], NumberStyles.HexNumber);
}
/// <summary>
/// /// Gets a boolean value from the database
/// </summary>
/// <param name="parameter">The option to look up</param>
/// <param name="defaultVal">The value to return if the option is invalid or doesn't exist</param>
/// <returns> The bool value from the database if present, otherwise the given default value</returns>
/// <returns> The boolean value from the database if present, otherwise the given default value</returns>
public bool GetBool(string parameter, bool defaultVal)
{
if (OptionPresent(parameter) && OptionValue(parameter) == "true")
{
return true;
else if (OptionPresent(parameter) && OptionValue(parameter) == "false")
}
if (OptionPresent(parameter) && OptionValue(parameter) == "false")
{
return false;
else
}
return defaultVal;
}
/// <summary>
/// /// Gets an integer value from the database
/// </summary>
/// <param name="parameter">The option to look up</param>
/// <param name="defaultVal">The value to return if the option is invalid or doesn't exist</param>
/// <returns> The int value from the database if present, otherwise the given default value</returns>
/// <returns> The integer value from the database if present, otherwise the given default value</returns>
public int GetInt(string parameter, int defaultVal)
{
if (OptionPresent(parameter))
{
try
{
return int.Parse(OptionValue(parameter));
@ -141,24 +146,27 @@ namespace BizHawk.Emulation.Common
{
return defaultVal;
}
else
}
return defaultVal;
}
public ICollection<string> GetOptions()
{
return Options.Keys;
}
public IDictionary<string, string> GetOptionsDict()
{
return new ReadOnlyDictionary<string, string>(Options);
}
void ParseOptionsDictionary(string metaData)
private void ParseOptionsDictionary(string metaData)
{
if (string.IsNullOrEmpty(metaData))
{
return;
}
var options = metaData.Split(';').Where(opt => string.IsNullOrEmpty(opt) == false).ToArray();
@ -166,7 +174,7 @@ namespace BizHawk.Emulation.Common
{
var parts = opt.Split('=');
var key = parts[0];
var value = parts.Length > 1 ? parts[1] : "";
var value = parts.Length > 1 ? parts[1] : string.Empty;
Options[key] = value;
}
}

View File

@ -1,6 +1,6 @@
namespace BizHawk.Emulation.Common
{
public enum SyncSoundMode { Sync, Async };
public enum SyncSoundMode { Sync, Async }
/// <summary>
/// This service provides the ability to output sound from the client,

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace BizHawk.Emulation.Common
namespace BizHawk.Emulation.Common
{
public interface ITraceSink
{

View File

@ -6,30 +6,31 @@ namespace BizHawk.Emulation.Common
{
public sealed class Equalizer
{
double lowFilter;
double lowFilterPole0;
double lowFilterPole1;
double lowFilterPole2;
double lowFilterPole3;
private double lowFilter;
private double lowFilterPole0;
private double lowFilterPole1;
private double lowFilterPole2;
private double lowFilterPole3;
double highFilter;
double highFilterPole0;
double highFilterPole1;
double highFilterPole2;
double highFilterPole3;
private double highFilter;
private double highFilterPole0;
private double highFilterPole1;
private double highFilterPole2;
private double highFilterPole3;
double sampleDataMinus1;
double sampleDataMinus2;
double sampleDataMinus3;
private double sampleDataMinus1;
private double sampleDataMinus2;
private double sampleDataMinus3;
double lowGain;
double midGain;
double highGain;
private double lowGain;
private double midGain;
private double highGain;
const double sampleRate = 44100.0;
const double verySmallAmount = (1.0 / 4294967295.0);
private const double sampleRate = 44100.0;
private const double verySmallAmount = 1.0 / 4294967295.0;
private double lowfreq;
double lowfreq;
public double LowFreqCutoff
{
get { return lowfreq; }
@ -40,7 +41,7 @@ namespace BizHawk.Emulation.Common
}
}
double highfreq;
private double highfreq;
public double HighFreqCutoff
{
get { return highfreq; }
@ -89,7 +90,9 @@ namespace BizHawk.Emulation.Common
public void Equalize(short[] samples)
{
for (int i = 0; i < samples.Length; i++)
{
samples[i] = EqualizeSample(samples[i]);
}
}
}
}

View File

@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Common
// is to provide exact amounts of output samples,
// even when the input provided varies....
int output_samples(short[] buf, int samples_requested);
};
}
public enum ESynchMethod
{
@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Common
ESynchMethod_Z, // zero's
//ESynchMethod_P, //PCSX2 spu2-x //ohno! not available yet in c#
ESynchMethod_V // vecna
};
}
public static class Metaspu
{
@ -136,8 +136,10 @@ namespace BizHawk.Emulation.Common
if (!mixqueue_go)
{
if (adjustobuf.size > 200)
{
mixqueue_go = true;
}
}
else
{
for (int i = 0; i < samples_requested; i++)
@ -147,6 +149,7 @@ namespace BizHawk.Emulation.Common
mixqueue_go = false;
break;
}
done++;
short left, right;
adjustobuf.dequeue(out left, out right);
@ -159,7 +162,8 @@ namespace BizHawk.Emulation.Common
}
private readonly Adjustobuf adjustobuf;
class Adjustobuf
private class Adjustobuf
{
public Adjustobuf(int _minLatency, int _maxLatency)
{
@ -168,12 +172,12 @@ namespace BizHawk.Emulation.Common
clear();
}
float rate, cursor;
int minLatency, targetLatency, maxLatency;
Queue<short> buffer = new Queue<short>();
Queue<int> statsHistory = new Queue<int>();
private float rate, cursor;
private int minLatency, targetLatency, maxLatency;
private readonly Queue<short> buffer = new Queue<short>();
private readonly Queue<int> statsHistory = new Queue<int>();
public int size = 0;
short[] curr = new short[2];
private readonly short[] curr = new short[2];
public void clear()
{
@ -195,11 +199,11 @@ namespace BizHawk.Emulation.Common
size++;
}
long rollingTotalSize;
private long rollingTotalSize;
uint kAverageSize;
private uint kAverageSize;
void addStatistic()
private void addStatistic()
{
statsHistory.Enqueue(size);
rollingTotalSize += size;
@ -227,15 +231,17 @@ namespace BizHawk.Emulation.Common
}
}
}
public void dequeue(out short left, out short right)
{
left = right = 0;
addStatistic();
if (size == 0) { return; }
if (size == 0)
{
return;
}
cursor += rate;
while (cursor > 1.0f)
{
@ -254,22 +260,29 @@ namespace BizHawk.Emulation.Common
}
}
class NitsujaSynchronizer : ISynchronizingAudioBuffer
internal class NitsujaSynchronizer : ISynchronizingAudioBuffer
{
struct ssamp
private struct ssamp
{
public short l, r;
public ssamp(short ll, short rr) { l = ll; r = rr; }
};
readonly List<ssamp> sampleQueue = new List<ssamp>();
public ssamp(short ll, short rr)
{
l = ll; r = rr;
}
}
private readonly List<ssamp> sampleQueue = new List<ssamp>();
// returns values going between 0 and y-1 in a saw wave pattern, based on x
static int pingpong(int x, int y)
private static int pingpong(int x, int y)
{
x %= 2 * y;
if (x >= y)
x = 2 * y - x - 1;
{
x = (2 * y) - x - 1;
}
return x;
// in case we want to switch to odd buffer sizes for more sharpness
@ -279,12 +292,17 @@ namespace BizHawk.Emulation.Common
//return x;
}
static ssamp crossfade(ssamp lhs, ssamp rhs, int cur, int start, int end)
private static ssamp crossfade(ssamp lhs, ssamp rhs, int cur, int start, int end)
{
if (cur <= start)
{
return lhs;
}
if (cur >= end)
{
return rhs;
}
// in case we want sine wave interpolation instead of linear here
//float ang = 3.14159f * (float)(cur - start) / (float)(end - start);
@ -305,28 +323,38 @@ namespace BizHawk.Emulation.Common
sampleQueue.Clear();
}
static void emit_sample(short[] outbuf, ref int cursor, ssamp sample)
private static void emit_sample(short[] outbuf, ref int cursor, ssamp sample)
{
outbuf[cursor++] = sample.l;
outbuf[cursor++] = sample.r;
}
static void emit_samples(short[] outbuf, ref int outcursor, ssamp[] samplebuf, int incursor, int samples)
private static void emit_samples(short[] outbuf, ref int outcursor, ssamp[] samplebuf, int incursor, int samples)
{
for (int i = 0; i < samples; i++)
{
emit_sample(outbuf, ref outcursor, samplebuf[i + incursor]);
}
static short abs(short value)
{
if (value < 0) return (short)-value;
else return value;
}
static int abs(int value)
private static short abs(short value)
{
if (value < 0) return -value;
else return value;
if (value < 0)
{
return (short)-value;
}
return value;
}
private static int abs(int value)
{
if (value < 0)
{
return -value;
}
return value;
}
public void enqueue_samples(short[] buf, int samples_provided)
@ -420,6 +448,7 @@ namespace BizHawk.Emulation.Common
beststart = i;
}
}
for (int i = queued - 3; i > queued - 3 - 128; i -= 2)
{
int diff = abs(sampleQueue[i].l - sampleQueue[i + 1].l) + abs(sampleQueue[i].r - sampleQueue[i + 1].r);
@ -435,13 +464,17 @@ namespace BizHawk.Emulation.Common
int oksize = queued;
while (oksize + queued * 2 + beststart + extraAtEnd <= samples_requested)
{
oksize += queued * 2;
}
audiosize = oksize;
for (int x = 0; x < beststart; x++)
{
emit_sample(buf, ref bufcursor, sampleQueue[x]);
}
// sampleQueue.erase(sampleQueue.begin(), sampleQueue.begin() + beststart);
sampleQueue.RemoveRange(0, beststart);
// zero 08-nov-2010: did i do this right?
@ -456,7 +489,6 @@ namespace BizHawk.Emulation.Common
// midpointXOffset = min(something,somethingElse);
// but it's a little difficult to work it out exactly
// so here's a stupid search for the value for now:
int prevA = 999999;
int midpointXOffset = queued / 2;
while (true)
@ -494,9 +526,14 @@ namespace BizHawk.Emulation.Common
int dyMidLeft = (leftMidpointY < midpointY) ? 1 : -1;
int dyMidRight = (rightMidpointY > midpointY) ? 1 : -1;
for (int x = leftMidpointX; x < midpointX; x++, y += dyMidLeft)
{
emit_sample(buf, ref bufcursor, sampleQueue[y]);
}
for (int x = midpointX; x < rightMidpointX; x++, y += dyMidRight)
{
emit_sample(buf, ref bufcursor, sampleQueue[y]);
}
// output the end of the queued sound (section "C")
for (int x = rightMidpointX; x < audiosize; x++)
@ -510,12 +547,14 @@ namespace BizHawk.Emulation.Common
int i = queued + x;
emit_sample(buf, ref bufcursor, sampleQueue[i]);
}
queued += extraAtEnd;
audiosize += beststart + extraAtEnd;
} // end else
// sampleQueue.erase(sampleQueue.begin(), sampleQueue.begin() + queued);
sampleQueue.RemoveRange(0, queued);
// zero 08-nov-2010: did i do this right?
return audiosize;
}
@ -529,20 +568,23 @@ namespace BizHawk.Emulation.Common
// and entering the "slow motion speed" branch above.
// but that's ok! because all of these branches sound similar enough that we can get away with it.
// so the two cases actually complement each other.
if (audiosize >= queued)
{
emit_samples(buf, ref bufcursor, sampleQueue.ToArray(), 0, queued);
// sampleQueue.erase(sampleQueue.begin(), sampleQueue.begin() + queued);
sampleQueue.RemoveRange(0, queued);
// zero 08-nov-2010: did i do this right?
return queued;
}
else
{
emit_samples(buf, ref bufcursor, sampleQueue.ToArray(), 0, audiosize);
// sampleQueue.erase(sampleQueue.begin(), sampleQueue.begin()+audiosize);
sampleQueue.RemoveRange(0, audiosize);
// zero 08-nov-2010: did i do this right?
return audiosize;
}
@ -554,13 +596,10 @@ namespace BizHawk.Emulation.Common
{
return 0;
}
} // output_samples
} // NitsujaSynchronizer
}; //NitsujaSynchronizer
class VecnaSynchronizer : ISynchronizingAudioBuffer
internal class VecnaSynchronizer : ISynchronizingAudioBuffer
{
// vecna's attempt at a fully synchronous sound provider.
// It's similar in philosophy to my "BufferedAsync" provider, but BufferedAsync is not
@ -580,7 +619,7 @@ namespace BizHawk.Emulation.Common
// Since it has done this, it will go ahead and generate some excess silence in order
// to restock its excess buffer.
struct Sample
private struct Sample
{
public short left, right;
public Sample(short l, short r)
@ -590,11 +629,11 @@ namespace BizHawk.Emulation.Common
}
}
Queue<Sample> buffer;
Sample[] resampleBuffer;
private Queue<Sample> buffer;
private Sample[] resampleBuffer;
const int SamplesInOneFrame = 735;
const int MaxExcessSamples = 2048;
private const int SamplesInOneFrame = 735;
private const int MaxExcessSamples = 2048;
public VecnaSynchronizer()
{
@ -603,8 +642,10 @@ namespace BizHawk.Emulation.Common
// Give us a little buffer wiggle-room
for (int i = 0; i < 367; i++)
{
buffer.Enqueue(new Sample(0, 0));
}
}
public void enqueue_samples(short[] buf, int samples_provided)
{
@ -624,6 +665,7 @@ namespace BizHawk.Emulation.Common
// if buffer is overfull, dequeue old samples to make room for new samples.
buffer.Dequeue();
}
buffer.Enqueue(new Sample(left, right));
}
@ -641,7 +683,6 @@ namespace BizHawk.Emulation.Common
{
// if we're within 75% of target, then I guess we suck it up and resample.
// we sample in a goofy way, we could probably do it a bit smarter, if we cared more.
int samples_available = buffer.Count;
for (int i = 0; buffer.Count > 0; i++)
resampleBuffer[i] = buffer.Dequeue();
@ -672,6 +713,7 @@ namespace BizHawk.Emulation.Common
buf[index++] += sample.right;
}
}
return samples_requested;
}
}

View File

@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Common
/// </summary>
public class SpeexResampler : IDisposable, ISoundProvider
{
static class LibSpeexDSP
private static class LibSpeexDSP
{
public const int QUALITY_MAX = 10;
public const int QUALITY_MIN = 0;
@ -24,7 +24,7 @@ namespace BizHawk.Emulation.Common
INVALID_ARG = 3,
PTR_OVERLAP = 4,
MAX_ERROR
};
}
/// <summary>
/// Create a new resampler with integer input and output rates.
@ -281,7 +281,7 @@ namespace BizHawk.Emulation.Common
/// throw an exception based on error state
/// </summary>
/// <param name="e"></param>
static void CheckError(LibSpeexDSP.RESAMPLER_ERR e)
private static void CheckError(LibSpeexDSP.RESAMPLER_ERR e)
{
switch (e)
{
@ -299,7 +299,6 @@ namespace BizHawk.Emulation.Common
}
/// <summary>
///
/// </summary>
/// <param name="quality">0 to 10</param>
/// <param name="rationum">numerator of srate change ratio (inrate / outrate)</param>
@ -311,13 +310,17 @@ namespace BizHawk.Emulation.Common
public SpeexResampler(int quality, uint rationum, uint ratioden, uint sratein, uint srateout, Action<short[], int> drainer = null, ISoundProvider input = null)
{
if (drainer != null && input != null)
{
throw new ArgumentException("Can't autofetch without being an ISyncSoundProvider?");
}
LibSpeexDSP.RESAMPLER_ERR err = LibSpeexDSP.RESAMPLER_ERR.SUCCESS;
st = LibSpeexDSP.speex_resampler_init_frac(2, rationum, ratioden, sratein, srateout, quality, ref err);
if (st == IntPtr.Zero)
{
throw new Exception("LibSpeexDSP returned null!");
}
CheckError(err);
@ -349,8 +352,10 @@ namespace BizHawk.Emulation.Common
inbuf[inbufpos++] = right;
if (inbufpos == inbuf.Length)
{
Flush();
}
}
/// <summary>
/// add multiple samples to the queue
@ -369,9 +374,11 @@ namespace BizHawk.Emulation.Common
numused += shortstocopy / 2;
if (inbufpos == inbuf.Length)
{
Flush();
}
}
}
/// <summary>
@ -386,9 +393,11 @@ namespace BizHawk.Emulation.Common
LibSpeexDSP.speex_resampler_process_interleaved_int(st, inbuf, ref inal, outbuf, ref outal);
// reset inbuf
if (inal != inbufpos / 2)
{
throw new Exception("Speexresampler didn't eat the whole array?");
}
inbufpos = 0;
//Buffer.BlockCopy(inbuf, (int)inal * 2 * sizeof(short), inbuf, 0, inbufpos - (int)inal * 2);
@ -413,7 +422,7 @@ namespace BizHawk.Emulation.Common
Dispose();
}
void InternalDrain(short[] buf, int nsamp)
private void InternalDrain(short[] buf, int nsamp)
{
if (outbuf2pos + nsamp * 2 > outbuf2.Length)
{
@ -421,6 +430,7 @@ namespace BizHawk.Emulation.Common
Buffer.BlockCopy(outbuf2, 0, newbuf, 0, outbuf2pos * sizeof(short));
outbuf2 = newbuf;
}
Buffer.BlockCopy(buf, 0, outbuf2, outbuf2pos * sizeof(short), nsamp * 2 * sizeof(short));
outbuf2pos += nsamp * 2;
}
@ -434,6 +444,7 @@ namespace BizHawk.Emulation.Common
input.GetSamplesSync(out sampin, out nsampin);
EnqueueSamples(sampin, nsampin);
}
Flush();
nsamp = outbuf2pos / 2;
samples = outbuf2;
@ -445,15 +456,9 @@ namespace BizHawk.Emulation.Common
outbuf2pos = 0;
}
public bool CanProvideAsync
{
get { return false; }
}
public bool CanProvideAsync => false;
public SyncSoundMode SyncMode
{
get { return SyncSoundMode.Sync; }
}
public SyncSoundMode SyncMode => SyncSoundMode.Sync;
public void GetSamplesAsync(short[] samples)
{

View File

@ -29,8 +29,10 @@
{
int r = rnd.Next();
if ((r & 1) > 0)
{
NoiseWave[i] = short.MaxValue;
}
}
/*TriangleWave = new short[512];
for (int i = 0; i < 256; i++)

View File

@ -18,8 +18,8 @@ namespace BizHawk.Emulation.Common
public class Node
{
public Dictionary<string, byte[]> Data = new Dictionary<string, byte[]>();
public Dictionary<string, Node> Objects = new Dictionary<string, Node>();
public readonly Dictionary<string, byte[]> Data = new Dictionary<string, byte[]>();
public readonly Dictionary<string, Node> Objects = new Dictionary<string, Node>();
// methods named "ShouldSerialize*" are detected and dynamically invoked by JSON.NET
// if they return false during serialization, the field/prop is omitted from the created json
@ -34,13 +34,13 @@ namespace BizHawk.Emulation.Common
}
}
public Node Root = new Node();
public readonly Node Root = new Node();
[JsonIgnore]
Stack<Node> Nodes;
[JsonIgnore]
Node Current { get { return Nodes.Peek(); } }
private Node Current => Nodes.Peek();
public void Prepare()
{
@ -59,7 +59,10 @@ namespace BizHawk.Emulation.Common
{
byte[] d = Current.Data[name];
if (length != d.Length)
{
throw new InvalidOperationException();
}
Marshal.Copy(d, 0, data, length);
}
@ -87,6 +90,7 @@ namespace BizHawk.Emulation.Common
next = new Node();
Current.Objects.Add(name, next);
}
Nodes.Push(next);
}
@ -94,8 +98,10 @@ namespace BizHawk.Emulation.Common
{
Node last = Nodes.Pop();
if (Current.Objects[name] != last)
{
throw new InvalidOperationException();
}
}
// other data besides the core
public T ExtraData;

View File

@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCaseLabel/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1101/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1108/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1126/@EntryIndexedValue">DO_NOT_SHOW</s:String>

View File

@ -1,4 +1,3 @@
using System;
using System.IO;
static class VersionInfo