diff --git a/src/BizHawk.BizInvoke/BizExvoker.cs b/src/BizHawk.BizInvoke/BizExvoker.cs index bef00409c12..3920284e1c1 100644 --- a/src/BizHawk.BizInvoke/BizExvoker.cs +++ b/src/BizHawk.BizInvoke/BizExvoker.cs @@ -23,7 +23,7 @@ public static class BizExvoker static BizExvoker() { - AssemblyName aname = new AssemblyName("BizExvokeProxyAssembly"); + AssemblyName aname = new("BizExvokeProxyAssembly"); ImplAssemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(aname, AssemblyBuilderAccess.Run); ImplModuleBuilder = ImplAssemblyBuilder.DefineDynamicModule("BizExvokerModule"); } diff --git a/src/BizHawk.BizInvoke/BizInvokeUtilities.cs b/src/BizHawk.BizInvoke/BizInvokeUtilities.cs index 31681188567..dc2ae4fbeb5 100644 --- a/src/BizHawk.BizInvoke/BizInvokeUtilities.cs +++ b/src/BizHawk.BizInvoke/BizInvokeUtilities.cs @@ -64,7 +64,7 @@ public static TypeBuilder CreateDelegateType(MethodInfo method, CallingConventio delegateInvoke.SetImplementationFlags(MethodImplAttributes.Runtime | MethodImplAttributes.Managed); // add the [UnmanagedFunctionPointer] to the delegate so interop will know how to call it - CustomAttributeBuilder attr = new CustomAttributeBuilder( + CustomAttributeBuilder attr = new( typeof(UnmanagedFunctionPointerAttribute).GetConstructor(new[] { typeof(CallingConvention) })!, new object[] { nativeCall }); delegateType.SetCustomAttribute(attr); diff --git a/src/BizHawk.BizInvoke/BizInvoker.cs b/src/BizHawk.BizInvoke/BizInvoker.cs index 2b34e1e163f..37ba23a4e8c 100644 --- a/src/BizHawk.BizInvoke/BizInvoker.cs +++ b/src/BizHawk.BizInvoke/BizInvoker.cs @@ -93,7 +93,7 @@ public object Create(IImportResolver dll, IMonitor? monitor, ICallingConventionA static BizInvoker() { - AssemblyName aname = new AssemblyName("BizInvokeProxyAssembly"); + AssemblyName aname = new("BizInvokeProxyAssembly"); ImplAssemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(aname, AssemblyBuilderAccess.Run); ImplModuleBuilder = ImplAssemblyBuilder.DefineDynamicModule("BizInvokerModule"); ClassFieldOffset = BizInvokerUtilities.ComputeClassFirstFieldOffset(); @@ -174,7 +174,7 @@ private static InvokerImpl CreateProxy(Type baseType, bool monitor, bool nonTriv } // hooks that will be run on the created proxy object - List> postCreateHooks = new List>(); + List> postCreateHooks = new(); var type = ImplModuleBuilder.DefineType($"Bizhawk.BizInvokeProxy{baseType.Name}", TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed, baseType); @@ -331,7 +331,7 @@ private static Action Implem { var paramInfos = baseMethod.GetParameters(); var paramTypes = paramInfos.Select(p => p.ParameterType).ToArray(); - List paramLoadInfos = new List(); + List paramLoadInfos = new(); var returnType = baseMethod.ReturnType; if (returnType != typeof(void) && !returnType.IsPrimitive && !returnType.IsPointer && !returnType.IsEnum) { diff --git a/src/BizHawk.BizInvoke/BizInvokerUtilities.cs b/src/BizHawk.BizInvoke/BizInvokerUtilities.cs index ff96979381b..d3436d14626 100644 --- a/src/BizHawk.BizInvoke/BizInvokerUtilities.cs +++ b/src/BizHawk.BizInvoke/BizInvokerUtilities.cs @@ -58,7 +58,7 @@ private class CF /// public static int ComputeStringOffset() { - string s = new string(Array.Empty()); + string s = new(Array.Empty()); int ret; fixed(char* fx = s) { @@ -92,7 +92,7 @@ public static int ComputeValueArrayElementOffset() public static int ComputeObjectArrayElementOffset() { object[] obj = new object[4]; - DynamicMethod method = new DynamicMethod("ComputeObjectArrayElementOffsetHelper", typeof(int), new[] { typeof(object[]) }, typeof(string).Module, true); + DynamicMethod method = new("ComputeObjectArrayElementOffsetHelper", typeof(int), new[] { typeof(object[]) }, typeof(string).Module, true); var il = method.GetILGenerator(); var local = il.DeclareLocal(typeof(object[]), true); il.Emit(OpCodes.Ldarg_0); @@ -122,7 +122,7 @@ public static int ComputeFieldOffset(FieldInfo fi) } object obj = FormatterServices.GetUninitializedObject(fi.DeclaringType); - DynamicMethod method = new DynamicMethod("ComputeFieldOffsetHelper", typeof(int), new[] { typeof(object) }, typeof(string).Module, true); + DynamicMethod method = new("ComputeFieldOffsetHelper", typeof(int), new[] { typeof(object) }, typeof(string).Module, true); var il = method.GetILGenerator(); var local = il.DeclareLocal(fi.DeclaringType, true); il.Emit(OpCodes.Ldarg_0); diff --git a/src/BizHawk.BizInvoke/CallingConventionAdapter.cs b/src/BizHawk.BizInvoke/CallingConventionAdapter.cs index 06df1537cbd..2f72f622ea5 100644 --- a/src/BizHawk.BizInvoke/CallingConventionAdapter.cs +++ b/src/BizHawk.BizInvoke/CallingConventionAdapter.cs @@ -277,7 +277,7 @@ private void WriteThunk(IntPtr thunkFunctionAddress, IntPtr calleeAddress, int i { _memory.Protect(_memory.Start, _memory.Size, MemoryBlock.Protection.RW); var ss = _memory.GetStream(_memory.Start + (ulong)index * BlockSize, BlockSize, true); - BinaryWriter bw = new BinaryWriter(ss); + BinaryWriter bw = new(ss); // The thunks all take the expected parameters in the expected places, but additionally take the parameter // of the function to call as a hidden extra parameter in rax. diff --git a/src/BizHawk.BizInvoke/FPCtrl.cs b/src/BizHawk.BizInvoke/FPCtrl.cs index 84f01b860f5..7cd22407691 100644 --- a/src/BizHawk.BizInvoke/FPCtrl.cs +++ b/src/BizHawk.BizInvoke/FPCtrl.cs @@ -37,7 +37,7 @@ static FPCtrl() _memory = new(4096); _memory.Protect(_memory.Start, _memory.Size, MemoryBlock.Protection.RW); var ss = _memory.GetStream(_memory.Start, 64, true); - BinaryWriter bw = new BinaryWriter(ss); + BinaryWriter bw = new(ss); // FYI: The push/pop is only needed on Windows, but doesn't do any harm on Linux diff --git a/src/BizHawk.Bizware.Audio/DirectSoundSoundOutput.cs b/src/BizHawk.Bizware.Audio/DirectSoundSoundOutput.cs index 9ef8bf7495a..b555c577d96 100644 --- a/src/BizHawk.Bizware.Audio/DirectSoundSoundOutput.cs +++ b/src/BizHawk.Bizware.Audio/DirectSoundSoundOutput.cs @@ -78,7 +78,7 @@ private void StartPlaying() blockAlign: _sound.BlockAlign, bitsPerSample: _sound.BytesPerSample * 8); - SoundBufferDescription desc = new SoundBufferDescription + SoundBufferDescription desc = new() { Format = format, Flags = diff --git a/src/BizHawk.Bizware.Audio/XAudio2SoundOutput.cs b/src/BizHawk.Bizware.Audio/XAudio2SoundOutput.cs index 2af3ffb6652..fc4cb3430db 100644 --- a/src/BizHawk.Bizware.Audio/XAudio2SoundOutput.cs +++ b/src/BizHawk.Bizware.Audio/XAudio2SoundOutput.cs @@ -27,7 +27,7 @@ private static string GetDeviceId(string deviceName) return null; } - using IMMDeviceEnumerator enumerator = new IMMDeviceEnumerator(); + using IMMDeviceEnumerator enumerator = new(); var devices = enumerator.EnumAudioEndpoints(DataFlow.Render); var device = devices.FirstOrDefault(capDevice => capDevice.FriendlyName == deviceName); if (device is null) @@ -62,7 +62,7 @@ public void Dispose() public static IEnumerable GetDeviceNames() { - using IMMDeviceEnumerator enumerator = new IMMDeviceEnumerator(); + using IMMDeviceEnumerator enumerator = new(); var devices = enumerator.EnumAudioEndpoints(DataFlow.Render); return devices.Select(capDevice => capDevice.FriendlyName); } @@ -78,7 +78,7 @@ public void StartSound() BufferSizeSamples = _sound.MillisecondsToSamples(_sound.ConfigBufferSizeMs); MaxSamplesDeficit = BufferSizeSamples; - WaveFormat format = new WaveFormat(_sound.SampleRate, _sound.BytesPerSample * 8, _sound.ChannelCount); + WaveFormat format = new(_sound.SampleRate, _sound.BytesPerSample * 8, _sound.ChannelCount); _sourceVoice = _device.CreateSourceVoice(format); _bufferPool = new(); diff --git a/src/BizHawk.Bizware.BizwareGL/ArtManager.cs b/src/BizHawk.Bizware.BizwareGL/ArtManager.cs index 9a9155c9db7..503b6bde371 100644 --- a/src/BizHawk.Bizware.BizwareGL/ArtManager.cs +++ b/src/BizHawk.Bizware.BizwareGL/ArtManager.cs @@ -46,7 +46,7 @@ public void Open() /// public Art LoadArt(string path) { - using FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fs = new(path, FileMode.Open, FileAccess.Read, FileShare.Read); return LoadArtInternal(new BitmapBuffer(path, new BitmapLoadOptions())); } @@ -54,7 +54,7 @@ private Art LoadArtInternal(BitmapBuffer tex) { AssertIsOpen(true); - Art a = new Art(this); + Art a = new(this); ArtLooseTextureAssociation.Add((a, tex)); ManagedArts.Add(a); @@ -91,7 +91,7 @@ public void Close(bool forever = true) throw new InvalidOperationException("Art files too big for atlas"); // prepare the output buffer - BitmapBuffer bmpResult = new BitmapBuffer(results[0].Size); + BitmapBuffer bmpResult = new(results[0].Size); //for each item, copy it into the output buffer and set the tex parameters on them for (int i = 0; i < atlasItems.Count; i++) @@ -111,8 +111,8 @@ public void Close(bool forever = true) } } - float myDestWidth = (float)bmpResult.Width; - float myDestHeight = (float)bmpResult.Height; + float myDestWidth = bmpResult.Width; + float myDestHeight = bmpResult.Height; art.u0 = dx / myDestWidth; art.v0 = dy / myDestHeight; diff --git a/src/BizHawk.Bizware.BizwareGL/BitmapBuffer.cs b/src/BizHawk.Bizware.BizwareGL/BitmapBuffer.cs index f2c35711f26..956543b4cf1 100644 --- a/src/BizHawk.Bizware.BizwareGL/BitmapBuffer.cs +++ b/src/BizHawk.Bizware.BizwareGL/BitmapBuffer.cs @@ -205,7 +205,7 @@ public BitmapBuffer Trim(out int xofs, out int yofs) int w = maxx - minx + 1; int h = maxy - miny + 1; - BitmapBuffer bbRet = new BitmapBuffer(w, h); + BitmapBuffer bbRet = new(w, h); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) @@ -249,7 +249,7 @@ public void Pad() /// public BitmapBuffer(string fname, BitmapLoadOptions options) { - using FileStream fs = new FileStream(fname, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fs = new(fname, FileMode.Open, FileAccess.Read, FileShare.Read); LoadInternal(fs, null, options); } @@ -534,7 +534,7 @@ public Bitmap ToSysdrawingBitmap() } var pf = HasAlpha ? PixelFormat.Format32bppArgb : PixelFormat.Format24bppRgb; - Bitmap bmp = new Bitmap(Width, Height, pf); + Bitmap bmp = new(Width, Height, pf); ToSysdrawingBitmap(bmp); return bmp; } diff --git a/src/BizHawk.Bizware.BizwareGL/StringRenderer.cs b/src/BizHawk.Bizware.BizwareGL/StringRenderer.cs index 705a8a17f52..47ae2d17e20 100644 --- a/src/BizHawk.Bizware.BizwareGL/StringRenderer.cs +++ b/src/BizHawk.Bizware.BizwareGL/StringRenderer.cs @@ -118,7 +118,7 @@ public void RenderString(IGuiRenderer renderer, float x, float y, string str) var tex = TexturePages[bfc.TexturePage]; float w = tex.Width; float h = tex.Height; - Rectangle bounds = new Rectangle(bfc.X, bfc.Y, bfc.Width, bfc.Height); + Rectangle bounds = new(bfc.X, bfc.Y, bfc.Width, bfc.Height); float u0 = bounds.Left / w; float v0 = bounds.Top / h; float u1 = bounds.Right / w; diff --git a/src/BizHawk.Bizware.BizwareGL/TexAtlas.cs b/src/BizHawk.Bizware.BizwareGL/TexAtlas.cs index 1bbd72e2364..011545de5de 100644 --- a/src/BizHawk.Bizware.BizwareGL/TexAtlas.cs +++ b/src/BizHawk.Bizware.BizwareGL/TexAtlas.cs @@ -50,14 +50,14 @@ static void AddAtlas(ICollection<(Size, List)> atlases, IEnumerable todoSizes = new List(); + List todoSizes = new(); for (int i = 3; i <= MaxSizeBits; i++) { for (int j = 3; j <= MaxSizeBits; j++) { int w = 1 << i; int h = 1 << j; - TryFitParam tfp = new TryFitParam(w, h); + TryFitParam tfp = new(w, h); todoSizes.Add(tfp); } } @@ -65,7 +65,7 @@ static void AddAtlas(ICollection<(Size, List)> atlases, IEnumerable { - RectangleBinPack rbp = new RectangleBinPack(); + RectangleBinPack rbp = new(); rbp.Init(16384, 16384); param.rbp.Init(param.w, param.h); diff --git a/src/BizHawk.Bizware.Graphics/D3D9/IGL_D3D9.cs b/src/BizHawk.Bizware.Graphics/D3D9/IGL_D3D9.cs index 1259283ace0..d4dc622cee0 100644 --- a/src/BizHawk.Bizware.Graphics/D3D9/IGL_D3D9.cs +++ b/src/BizHawk.Bizware.Graphics/D3D9/IGL_D3D9.cs @@ -65,7 +65,7 @@ public IGL_D3D9() } // get the native window handle - SDL_SysWMinfo wminfo = default(SDL_SysWMinfo); + SDL_SysWMinfo wminfo = default; SDL_GetVersion(out wminfo.version); SDL_GetWindowWMInfo(_offscreenSdl2Window, ref wminfo); if (wminfo.subsystem != SDL_SYSWM_TYPE.SDL_SYSWM_WINDOWS) @@ -93,7 +93,7 @@ public void AlternateVsyncPass(int pass) private void CreateDevice() { // this object is only used for creating a device, it's not needed afterwards - using Direct3D d3d9 = new Direct3D(); + using Direct3D d3d9 = new(); var pp = MakePresentParameters(); @@ -230,7 +230,7 @@ public Shader CreateFragmentShader(string source, string entry, bool required) { try { - ShaderWrapper sw = new ShaderWrapper(); + ShaderWrapper sw = new(); // ShaderFlags.EnableBackwardsCompatibility - used this once upon a time (please leave a note about why) var result = ShaderBytecode.Compile( @@ -242,7 +242,7 @@ public Shader CreateFragmentShader(string source, string entry, bool required) sw.PS = new(_device, result); sw.Bytecode = result; - Shader s = new Shader(this, sw, true); + Shader s = new(this, sw, true); sw.IGLShader = s; return s; @@ -263,7 +263,7 @@ public Shader CreateVertexShader(string source, string entry, bool required) { try { - ShaderWrapper sw = new ShaderWrapper(); + ShaderWrapper sw = new(); var result = ShaderBytecode.Compile( shaderSource: source, @@ -274,7 +274,7 @@ public Shader CreateVertexShader(string source, string entry, bool required) sw.VS = new(_device, result); sw.Bytecode = result; - Shader s = new Shader(this, sw, true); + Shader s = new(this, sw, true); sw.IGLShader = s; return s; @@ -375,7 +375,7 @@ public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, S // must be placed at the end ves[vertexLayout.Items.Count] = VertexElement.VertexDeclarationEnd; - PipelineWrapper pw = new PipelineWrapper + PipelineWrapper pw = new() { VertexDeclaration = new(_device, ves), VertexShader = (ShaderWrapper)vertexShader.Opaque, @@ -384,12 +384,12 @@ public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, S }; // scan uniforms from reflection - List uniforms = new List(); + List uniforms = new(); var vsct = pw.VertexShader.Bytecode.ConstantTable; var psct = pw.FragmentShader.Bytecode.ConstantTable; foreach (var ct in new[] { vsct, psct }) { - Queue<(string, EffectHandle)> todo = new Queue<(string, EffectHandle)>(); + Queue<(string, EffectHandle)> todo = new(); int n = ct.Description.Constants; for (int i = 0; i < n; i++) { @@ -416,8 +416,8 @@ public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, S continue; } - UniformInfo ui = new UniformInfo(); - UniformWrapper uw = new UniformWrapper(); + UniformInfo ui = new(); + UniformWrapper uw = new(); ui.Opaque = uw; string name = prefix + descr.Name; @@ -606,21 +606,21 @@ public void SetMagFilter(Texture2d texture, TextureMagFilter magFilter) public Texture2d LoadTexture(Bitmap bitmap) { - using BitmapBuffer bmp = new BitmapBuffer(bitmap, new()); + using BitmapBuffer bmp = new(bitmap, new()); return LoadTexture(bmp); } public Texture2d LoadTexture(Stream stream) { - using BitmapBuffer bmp = new BitmapBuffer(stream, new()); + using BitmapBuffer bmp = new(stream, new()); return LoadTexture(bmp); } public Texture2d CreateTexture(int width, int height) { - Texture tex = new Texture(_device, width, height, 1, Usage.None, Format.A8R8G8B8, Pool.Managed); - TextureWrapper tw = new TextureWrapper { Texture = tex }; - Texture2d ret = new Texture2d(this, tw, width, height); + Texture tex = new(_device, width, height, 1, Usage.None, Format.A8R8G8B8, Pool.Managed); + TextureWrapper tw = new() { Texture = tex }; + Texture2d ret = new(this, tw, width, height); return ret; } @@ -644,8 +644,8 @@ public unsafe void LoadTextureData(Texture2d tex, BitmapBuffer bmp) throw new InvalidOperationException(); } - ReadOnlySpan srcSpan = new ReadOnlySpan(bmpData.Scan0.ToPointer(), bmpData.Stride * bmp.Height); - Span dstSpan = new Span(dr.DataPointer.ToPointer(), dr.Pitch * bmp.Height); + ReadOnlySpan srcSpan = new(bmpData.Scan0.ToPointer(), bmpData.Stride * bmp.Height); + Span dstSpan = new(dr.DataPointer.ToPointer(), dr.Pitch * bmp.Height); srcSpan.CopyTo(dstSpan); } finally @@ -666,7 +666,7 @@ public Texture2d LoadTexture(BitmapBuffer bmp) public BitmapBuffer ResolveTexture2d(Texture2d tex) { // TODO - lazy create and cache resolving target in RT - using Texture target = new Texture(_device, tex.IntWidth, tex.IntHeight, 1, Usage.None, Format.A8R8G8B8, Pool.SystemMemory); + using Texture target = new(_device, tex.IntWidth, tex.IntHeight, 1, Usage.None, Format.A8R8G8B8, Pool.SystemMemory); TextureWrapper tw = (TextureWrapper)tex.Opaque; _device.GetRenderTargetData(tw.Texture.GetSurfaceLevel(0), target.GetSurfaceLevel(0)); @@ -692,7 +692,7 @@ public BitmapBuffer ResolveTexture2d(Texture2d tex) public Texture2d LoadTexture(string path) { - using FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fs = new(path, FileMode.Open, FileAccess.Read, FileShare.Read); return LoadTexture(fs); } @@ -739,9 +739,9 @@ public void FreeRenderTarget(RenderTarget rt) public RenderTarget CreateRenderTarget(int w, int h) { - TextureWrapper tw = new TextureWrapper { Texture = CreateRenderTargetTexture(w, h) }; - Texture2d tex = new Texture2d(this, tw, w, h); - RenderTarget rt = new RenderTarget(this, tw, tex); + TextureWrapper tw = new() { Texture = CreateRenderTargetTexture(w, h) }; + Texture2d tex = new(this, tw, w, h); + RenderTarget rt = new(this, tw, tex); _renderTargets.Add(rt); return rt; } diff --git a/src/BizHawk.Bizware.Graphics/GDIPlus/IGL_GDIPlus.cs b/src/BizHawk.Bizware.Graphics/GDIPlus/IGL_GDIPlus.cs index aff407afb13..814ea0dbab5 100644 --- a/src/BizHawk.Bizware.Graphics/GDIPlus/IGL_GDIPlus.cs +++ b/src/BizHawk.Bizware.Graphics/GDIPlus/IGL_GDIPlus.cs @@ -120,13 +120,13 @@ public void SetMagFilter(Texture2d texture, TextureMagFilter magFilter) public Texture2d LoadTexture(Bitmap bitmap) { Bitmap sdBitmap = (Bitmap)bitmap.Clone(); - GDIPlusTexture gtex = new GDIPlusTexture { SDBitmap = sdBitmap }; + GDIPlusTexture gtex = new() { SDBitmap = sdBitmap }; return new(this, gtex, bitmap.Width, bitmap.Height); } public Texture2d LoadTexture(Stream stream) { - using BitmapBuffer bmp = new BitmapBuffer(stream, new()); + using BitmapBuffer bmp = new(stream, new()); return LoadTexture(bmp); } @@ -147,25 +147,25 @@ public Texture2d LoadTexture(BitmapBuffer bmp) { // definitely needed (by TextureFrugalizer at least) var sdBitmap = bmp.ToSysdrawingBitmap(); - GDIPlusTexture gtex = new GDIPlusTexture { SDBitmap = sdBitmap }; + GDIPlusTexture gtex = new() { SDBitmap = sdBitmap }; return new(this, gtex, bmp.Width, bmp.Height); } public BitmapBuffer ResolveTexture2d(Texture2d tex) { GDIPlusTexture gtex = (GDIPlusTexture)tex.Opaque; - BitmapLoadOptions blow = new BitmapLoadOptions + BitmapLoadOptions blow = new() { AllowWrap = false // must be an independent resource }; - BitmapBuffer bb = new BitmapBuffer(gtex.SDBitmap, blow); + BitmapBuffer bb = new(gtex.SDBitmap, blow); return bb; } public Texture2d LoadTexture(string path) { - using FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fs = new(path, FileMode.Open, FileAccess.Read, FileShare.Read); return LoadTexture(fs); } @@ -210,14 +210,14 @@ public void FreeRenderTarget(RenderTarget rt) public RenderTarget CreateRenderTarget(int w, int h) { - GDIPlusTexture gtex = new GDIPlusTexture + GDIPlusTexture gtex = new() { SDBitmap = new(w, h, PixelFormat.Format32bppArgb) }; - Texture2d tex = new Texture2d(this, gtex, w, h); + Texture2d tex = new(this, gtex, w, h); - GDIPlusRenderTarget grt = new GDIPlusRenderTarget(() => BufferedGraphicsContext); - RenderTarget rt = new RenderTarget(this, grt, tex); + GDIPlusRenderTarget grt = new(() => BufferedGraphicsContext); + RenderTarget rt = new(this, grt, tex); grt.Target = rt; return rt; } diff --git a/src/BizHawk.Bizware.Graphics/OpenGL/IGL_OpenGL.cs b/src/BizHawk.Bizware.Graphics/OpenGL/IGL_OpenGL.cs index 6d29fa75576..0b199620531 100644 --- a/src/BizHawk.Bizware.Graphics/OpenGL/IGL_OpenGL.cs +++ b/src/BizHawk.Bizware.Graphics/OpenGL/IGL_OpenGL.cs @@ -194,16 +194,16 @@ public Pipeline CreatePipeline(VertexLayout vertexLayout, BizShader vertexShader #endif // get all the uniforms - List uniforms = new List(); + List uniforms = new(); GL.GetProgram(pid, GLEnum.ActiveUniforms, out int nUniforms); - List samplers = new List(); + List samplers = new(); for (uint i = 0; i < nUniforms; i++) { GL.GetActiveUniform(pid, i, 1024, out _, out _, out UniformType type, out string name); int loc = GL.GetUniformLocation(pid, name); - UniformInfo ui = new UniformInfo { Name = name, Opaque = loc }; + UniformInfo ui = new() { Name = name, Opaque = loc }; if (type == UniformType.Sampler2D) { @@ -222,7 +222,7 @@ public Pipeline CreatePipeline(VertexLayout vertexLayout, BizShader vertexShader if (!vertexShader.Available) success = false; if (!fragmentShader.Available) success = false; - PipelineWrapper pw = new PipelineWrapper { pid = pid, VertexShader = vertexShader, FragmentShader = fragmentShader, SamplerLocs = samplers }; + PipelineWrapper pw = new() { pid = pid, VertexShader = vertexShader, FragmentShader = fragmentShader, SamplerLocs = samplers }; return new(this, pw, success, vertexLayout, uniforms, memo); } @@ -282,7 +282,7 @@ private class VertexLayoutWrapper public VertexLayout CreateVertexLayout() { - VertexLayoutWrapper vlw = new VertexLayoutWrapper() + VertexLayoutWrapper vlw = new() { vao = GL.GenVertexArray(), vbo = GL.GenBuffer(), @@ -387,7 +387,7 @@ public void Draw(IntPtr data, int count) unsafe { - ReadOnlySpan vertexes = new ReadOnlySpan(data.ToPointer(), count * stride); + ReadOnlySpan vertexes = new(data.ToPointer(), count * stride); // BufferData reallocs and BufferSubData doesn't, so only use the former if size changes if (vertexes.Length != vlw.bufferLen) @@ -485,13 +485,13 @@ public void SetMagFilter(Texture2d texture, BizTextureMagFilter magFilter) public Texture2d LoadTexture(Bitmap bitmap) { - using BitmapBuffer bmp = new BitmapBuffer(bitmap, new()); + using BitmapBuffer bmp = new(bitmap, new()); return LoadTexture(bmp); } public Texture2d LoadTexture(Stream stream) { - using BitmapBuffer bmp = new BitmapBuffer(stream, new()); + using BitmapBuffer bmp = new(stream, new()); return LoadTexture(bmp); } @@ -528,7 +528,7 @@ public unsafe RenderTarget CreateRenderTarget(int w, int h) { // create a texture for it uint texId = GL.GenTexture(); - Texture2d tex = new Texture2d(this, texId, w, h); + Texture2d tex = new(this, texId, w, h); GL.BindTexture(TextureTarget.Texture2D, texId); GL.TexImage2D(TextureTarget.Texture2D, 0, InternalFormat.Rgba8, (uint)w, (uint)h, 0, PixelFormat.Bgra, PixelType.UnsignedByte, null); @@ -597,7 +597,7 @@ public unsafe BitmapBuffer ResolveTexture2d(Texture2d tex) { // note - this is dangerous since it changes the bound texture. could we save it? BindTexture2d(tex); - BitmapBuffer bb = new BitmapBuffer(tex.IntWidth, tex.IntHeight); + BitmapBuffer bb = new(tex.IntWidth, tex.IntHeight); var bmpdata = bb.LockBits(); GL.GetTexImage(TextureTarget.Texture2D, 0, PixelFormat.Bgra, PixelType.UnsignedByte, bmpdata.Scan0.ToPointer()); bb.UnlockBits(bmpdata); @@ -606,7 +606,7 @@ public unsafe BitmapBuffer ResolveTexture2d(Texture2d tex) public Texture2d LoadTexture(string path) { - using FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fs = new(path, FileMode.Open, FileAccess.Read, FileShare.Read); return LoadTexture(fs); } @@ -650,7 +650,7 @@ public void SetViewport(int x, int y, int width, int height) private BizShader CreateShader(ShaderType type, string source, bool required) { - ShaderWrapper sw = new ShaderWrapper(); + ShaderWrapper sw = new(); string info = string.Empty; _ = GL.GetError(); @@ -663,7 +663,7 @@ private BizShader CreateShader(ShaderType type, string source, bool required) sid = 0; } - BizShader ret = new BizShader(this, sw, ok) + BizShader ret = new(this, sw, ok) { Errors = info }; diff --git a/src/BizHawk.Bizware.Graphics/Renderers/GDIPlusGuiRenderer.cs b/src/BizHawk.Bizware.Graphics/Renderers/GDIPlusGuiRenderer.cs index 667039ab293..38925efa2c4 100644 --- a/src/BizHawk.Bizware.Graphics/Renderers/GDIPlusGuiRenderer.cs +++ b/src/BizHawk.Bizware.Graphics/Renderers/GDIPlusGuiRenderer.cs @@ -82,7 +82,7 @@ public void SetModulateColor(Color color) new float[] { 0, 0, 0, 0, 1 }, }; - ColorMatrix colorMatrix = new ColorMatrix(colorMatrixElements); + ColorMatrix colorMatrix = new(colorMatrixElements); CurrentImageAttributes.SetColorMatrix(colorMatrix,ColorMatrixFlag.Default, ColorAdjustType.Bitmap); } diff --git a/src/BizHawk.Bizware.Graphics/Renderers/GuiRenderer.cs b/src/BizHawk.Bizware.Graphics/Renderers/GuiRenderer.cs index e56bb232d39..fdb169185c2 100644 --- a/src/BizHawk.Bizware.Graphics/Renderers/GuiRenderer.cs +++ b/src/BizHawk.Bizware.Graphics/Renderers/GuiRenderer.cs @@ -212,7 +212,7 @@ public void RectFill(float x, float y, float w, float h) private void DrawInternal(Texture2d tex, float x, float y, float w, float h) { - Art art = new Art((ArtManager)null) + Art art = new((ArtManager)null) { Width = w, Height = h diff --git a/src/BizHawk.Bizware.Input/DirectX/DGamepad.cs b/src/BizHawk.Bizware.Input/DirectX/DGamepad.cs index b4d2553f08c..6f0c6090baf 100644 --- a/src/BizHawk.Bizware.Input/DirectX/DGamepad.cs +++ b/src/BizHawk.Bizware.Input/DirectX/DGamepad.cs @@ -60,7 +60,7 @@ public static void Initialize(IntPtr mainFormHandle) #endif joystick.Acquire(); - DGamepad p = new DGamepad(joystick, Devices.Count); + DGamepad p = new(joystick, Devices.Count); Devices.Add(p); } } @@ -261,7 +261,7 @@ public void SetVibration(int left, int right) // my first clue that it doesn't work is that LEFT and RIGHT _AREN'T USED_ // I should just look for C++ examples instead of trying to look for SlimDX examples - EffectParameters parameters = new EffectParameters + EffectParameters parameters = new() { Duration = 0x2710, Gain = 0x2710, diff --git a/src/BizHawk.Bizware.Input/DirectX/DKeyInput.cs b/src/BizHawk.Bizware.Input/DirectX/DKeyInput.cs index 775dbe7bf8c..b82697c66d9 100644 --- a/src/BizHawk.Bizware.Input/DirectX/DKeyInput.cs +++ b/src/BizHawk.Bizware.Input/DirectX/DKeyInput.cs @@ -57,7 +57,7 @@ public static IEnumerable Update(Config config) { if (_keyboard == null || _keyboard.Acquire().Failure || _keyboard.Poll().Failure) return Enumerable.Empty(); - List eventList = new List(); + List eventList = new(); while (true) { try diff --git a/src/BizHawk.Bizware.Input/IPC/IPCKeyInput.cs b/src/BizHawk.Bizware.Input/IPC/IPCKeyInput.cs index 268a10c7083..0590a96ddc9 100644 --- a/src/BizHawk.Bizware.Input/IPC/IPCKeyInput.cs +++ b/src/BizHawk.Bizware.Input/IPC/IPCKeyInput.cs @@ -15,7 +15,7 @@ public static void Initialize() { if (!IPCActive) { - Thread t = new Thread(IPCThread) { IsBackground = true }; + Thread t = new(IPCThread) { IsBackground = true }; t.Start(); IPCActive = true; } @@ -31,12 +31,12 @@ private static void IPCThread() while (true) { - using NamedPipeServerStream pipe = new NamedPipeServerStream(pipeName, PipeDirection.In, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous, 1024, 1024); + using NamedPipeServerStream pipe = new(pipeName, PipeDirection.In, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous, 1024, 1024); try { pipe.WaitForConnection(); - BinaryReader br = new BinaryReader(pipe); + BinaryReader br = new(pipe); while (true) { diff --git a/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs b/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs index 48ef4c0d709..81b3212f6eb 100644 --- a/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs +++ b/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs @@ -78,7 +78,7 @@ public static void AddDevice(int deviceIndex) int instanceId = SDL_JoystickGetDeviceInstanceID(deviceIndex); if (!Gamepads.ContainsKey(instanceId)) { - SDL2Gamepad gamepad = new SDL2Gamepad(deviceIndex); + SDL2Gamepad gamepad = new(deviceIndex); Gamepads.Add(gamepad.InstanceID, gamepad); } else diff --git a/src/BizHawk.Bizware.Input/X11/X11KeyInput.cs b/src/BizHawk.Bizware.Input/X11/X11KeyInput.cs index 39c9cbb249c..ba06f609de9 100644 --- a/src/BizHawk.Bizware.Input/X11/X11KeyInput.cs +++ b/src/BizHawk.Bizware.Input/X11/X11KeyInput.cs @@ -74,7 +74,7 @@ public static unsafe IEnumerable Update() _ = XQueryKeymap(Display, keys); } - List eventList = new List(); + List eventList = new(); for (int keycode = 0; keycode < 256; keycode++) { bool keystate = (keys[keycode >> 3] >> (keycode & 0x07) & 0x01) != 0; @@ -106,7 +106,7 @@ private static unsafe void CreateKeyMap(bool supportsXkb) for (int i = keyboard->min_key_code; i <= keyboard->max_key_code; i++) { - string name = new string(keyboard->names->keys[i].name, 0, 4); + string name = new(keyboard->names->keys[i].name, 0, 4); var key = name switch { "TLDE" => DistinctKey.OemTilde, @@ -201,7 +201,7 @@ private static unsafe void CreateKeyMap(bool supportsXkb) } else { - XKeyEvent e = new XKeyEvent + XKeyEvent e = new() { display = Display, keycode = i, diff --git a/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs b/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs index 73d3e608980..969be547f2e 100644 --- a/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs @@ -114,7 +114,7 @@ public void OnBeforeQuickLoad(object sender, string quickSaveSlotName, out bool eventHandled = false; return; } - BeforeQuickLoadEventArgs e = new BeforeQuickLoadEventArgs(quickSaveSlotName); + BeforeQuickLoadEventArgs e = new(quickSaveSlotName); BeforeQuickLoad(sender, e); eventHandled = e.Handled; } @@ -126,7 +126,7 @@ public void OnBeforeQuickSave(object sender, string quickSaveSlotName, out bool eventHandled = false; return; } - BeforeQuickSaveEventArgs e = new BeforeQuickSaveEventArgs(quickSaveSlotName); + BeforeQuickSaveEventArgs e = new(quickSaveSlotName); BeforeQuickSave(sender, e); eventHandled = e.Handled; } diff --git a/src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs b/src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs index a934c27c435..69107b09c96 100644 --- a/src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs @@ -113,7 +113,7 @@ public IReadOnlyDictionary GetRegisters() { if (DebuggableCore != null) { - Dictionary table = new Dictionary(); + Dictionary table = new(); foreach (var (name, rv) in DebuggableCore.GetCpuFlagsAndRegisters()) table[name] = rv.Value; return table; } diff --git a/src/BizHawk.Client.Common/Api/Classes/GameInfoApi.cs b/src/BizHawk.Client.Common/Api/Classes/GameInfoApi.cs index 1db82613182..5dccfaf7018 100644 --- a/src/BizHawk.Client.Common/Api/Classes/GameInfoApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/GameInfoApi.cs @@ -27,7 +27,7 @@ public string GetBoardType() public IReadOnlyDictionary GetOptions() { - Dictionary options = new Dictionary(); + Dictionary options = new(); if (_game == null) return options; foreach (var (k, v) in ((GameInfo) _game).GetOptions()) options[k] = v; return options; diff --git a/src/BizHawk.Client.Common/Api/Classes/GuiApi.cs b/src/BizHawk.Client.Common/Api/Classes/GuiApi.cs index 7fc59a3e734..ef230b2608b 100644 --- a/src/BizHawk.Client.Common/Api/Classes/GuiApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/GuiApi.cs @@ -504,7 +504,7 @@ public void DrawString(int x, int y, string message, Color? forecolor = null, Co // The text isn't written out using GenericTypographic, so measuring it using GenericTypographic seemed to make it worse. // And writing it out with GenericTypographic just made it uglier. :p - Font font = new Font(family, fontsize ?? 12, fstyle, GraphicsUnit.Pixel); + Font font = new(family, fontsize ?? 12, fstyle, GraphicsUnit.Pixel); Size sizeOfText = g.MeasureString(message, font, 0, new StringFormat(StringFormat.GenericDefault)).ToSize(); switch (horizalign?.ToLowerInvariant()) @@ -595,7 +595,7 @@ public void PixelText( break; } using var g = GetGraphics(surfaceID); - Font font = new Font(_displayManager.CustomFonts.Families[index], 8, FontStyle.Regular, GraphicsUnit.Pixel); + Font font = new(_displayManager.CustomFonts.Families[index], 8, FontStyle.Regular, GraphicsUnit.Pixel); Size sizeOfText = g.MeasureString(message, font, width: 0, PixelTextFormat).ToSize(); if (backcolor.HasValue) g.FillRectangle(GetBrush(backcolor.Value), new Rectangle(new Point(x, y), sizeOfText + new Size(1, 0))); g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit; @@ -632,7 +632,7 @@ public void Text(int x, int y, string message, Color? forecolor = null, string a y -= oy; } - MessagePosition pos = new MessagePosition{ X = x, Y = y, Anchor = (MessagePosition.AnchorType)a }; + MessagePosition pos = new() { X = x, Y = y, Anchor = (MessagePosition.AnchorType)a }; _displayManager.OSD.AddGuiText(message, pos, Color.Black, forecolor ?? Color.White); } diff --git a/src/BizHawk.Client.Common/Api/Classes/InputApi.cs b/src/BizHawk.Client.Common/Api/Classes/InputApi.cs index ff186a63d70..c61d27e28a8 100644 --- a/src/BizHawk.Client.Common/Api/Classes/InputApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/InputApi.cs @@ -19,7 +19,7 @@ public InputApi(DisplayManagerBase displayManager, InputManager inputManager) public Dictionary Get() { - Dictionary buttons = new Dictionary(); + Dictionary buttons = new(); foreach (var (button, _) in _inputManager.ControllerInputCoalescer.BoolButtons().Where(kvp => kvp.Value)) buttons[button] = true; return buttons; } diff --git a/src/BizHawk.Client.Common/Api/Classes/MemorySaveStateApi.cs b/src/BizHawk.Client.Common/Api/Classes/MemorySaveStateApi.cs index af4274fa0da..d117d9a741a 100644 --- a/src/BizHawk.Client.Common/Api/Classes/MemorySaveStateApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/MemorySaveStateApi.cs @@ -24,7 +24,7 @@ public string SaveCoreStateToMemory() public void LoadCoreStateFromMemory(string identifier) { - Guid guid = new Guid(identifier); + Guid guid = new(identifier); try { StatableCore.LoadStateBinary(_memorySavestates[guid]); diff --git a/src/BizHawk.Client.Common/Api/Classes/SQLiteApi.cs b/src/BizHawk.Client.Common/Api/Classes/SQLiteApi.cs index 8c345a65c09..08913ab2900 100644 --- a/src/BizHawk.Client.Common/Api/Classes/SQLiteApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/SQLiteApi.cs @@ -31,7 +31,7 @@ public string OpenDatabase(string name) _dbConnection?.Dispose(); _dbConnection = new(new SqliteConnectionStringBuilder { DataSource = name }.ToString()); _dbConnection.Open(); - using SqliteCommand initCmds = new SqliteCommand(null, _dbConnection); + using SqliteCommand initCmds = new(null, _dbConnection); // Allows for reads and writes to happen at the same time initCmds.CommandText = "PRAGMA journal_mode = 'wal'"; initCmds.ExecuteNonQuery(); @@ -55,7 +55,7 @@ public string WriteCommand(string query = null) try { _dbConnection.Open(); - using SqliteCommand cmd = new SqliteCommand(query, _dbConnection); + using SqliteCommand cmd = new(query, _dbConnection); cmd.ExecuteNonQuery(); result = "Command ran successfully"; } @@ -75,14 +75,14 @@ public object ReadCommand(string query = null) try { _dbConnection.Open(); - using SqliteCommand command = new SqliteCommand($"PRAGMA read_uncommitted =1;{query}", _dbConnection); + using SqliteCommand command = new($"PRAGMA read_uncommitted =1;{query}", _dbConnection); using var reader = command.ExecuteReader(); if (reader.HasRows) { string[] columns = new string[reader.FieldCount]; for (int i = 0, l = reader.FieldCount; i < l; i++) columns[i] = reader.GetName(i); long rowCount = 0; - Dictionary table = new Dictionary(); + Dictionary table = new(); while (reader.Read()) { for (int i = 0, l = reader.FieldCount; i < l; i++) table[$"{columns[i]} {rowCount}"] = reader.GetValue(i); diff --git a/src/BizHawk.Client.Common/Api/HttpCommunication.cs b/src/BizHawk.Client.Common/Api/HttpCommunication.cs index 5862874524d..b3d6d0f96e9 100644 --- a/src/BizHawk.Client.Common/Api/HttpCommunication.cs +++ b/src/BizHawk.Client.Common/Api/HttpCommunication.cs @@ -67,7 +67,7 @@ public async Task Post(string url, FormUrlEncodedContent content) public string SendScreenshot(string url = null, string parameter = "screenshot") { string url1 = url ?? PostUrl; - FormUrlEncodedContent content = new FormUrlEncodedContent(new Dictionary { [parameter] = Convert.ToBase64String(_takeScreenshotCallback()) }); + FormUrlEncodedContent content = new(new Dictionary { [parameter] = Convert.ToBase64String(_takeScreenshotCallback()) }); Task postResponse = null; int trials = 5; while (postResponse == null && trials > 0) diff --git a/src/BizHawk.Client.Common/DisplayManager/DisplayManagerBase.cs b/src/BizHawk.Client.Common/DisplayManager/DisplayManagerBase.cs index 7820eb30d11..4c959c48767 100644 --- a/src/BizHawk.Client.Common/DisplayManager/DisplayManagerBase.cs +++ b/src/BizHawk.Client.Common/DisplayManager/DisplayManagerBase.cs @@ -87,20 +87,20 @@ protected DisplayManagerBase( if (dispMethod is EDispMethod.OpenGL or EDispMethod.D3D9) { - FileInfo fiHq2x = new FileInfo(Path.Combine(PathUtils.ExeDirectoryPath, "Shaders/BizHawk/hq2x.cgp")); + FileInfo fiHq2x = new(Path.Combine(PathUtils.ExeDirectoryPath, "Shaders/BizHawk/hq2x.cgp")); if (fiHq2x.Exists) { using var stream = fiHq2x.OpenRead(); _shaderChainHq2X = new(_gl, new(stream), Path.Combine(PathUtils.ExeDirectoryPath, "Shaders/BizHawk")); } - FileInfo fiScanlines = new FileInfo(Path.Combine(PathUtils.ExeDirectoryPath, "Shaders/BizHawk/BizScanlines.cgp")); + FileInfo fiScanlines = new(Path.Combine(PathUtils.ExeDirectoryPath, "Shaders/BizHawk/BizScanlines.cgp")); if (fiScanlines.Exists) { using var stream = fiScanlines.OpenRead(); _shaderChainScanlines = new(_gl, new(stream), Path.Combine(PathUtils.ExeDirectoryPath, "Shaders/BizHawk")); } string bicubicPath = dispMethod == EDispMethod.D3D9 ? "Shaders/BizHawk/bicubic-normal.cgp" : "Shaders/BizHawk/bicubic-fast.cgp"; - FileInfo fiBicubic = new FileInfo(Path.Combine(PathUtils.ExeDirectoryPath, bicubicPath)); + FileInfo fiBicubic = new(Path.Combine(PathUtils.ExeDirectoryPath, bicubicPath)); if (fiBicubic.Exists) { using var stream = fiBicubic.Open(FileMode.Open, FileAccess.Read, FileShare.Read); @@ -213,7 +213,7 @@ public void RefreshUserShader() _shaderChainUser?.Dispose(); if (File.Exists(GlobalConfig.DispUserFilterPath)) { - FileInfo fi = new FileInfo(GlobalConfig.DispUserFilterPath); + FileInfo fi = new(GlobalConfig.DispUserFilterPath); using var stream = fi.OpenRead(); _shaderChainUser = new(_gl, new(stream), Path.GetDirectoryName(GlobalConfig.DispUserFilterPath)); } @@ -260,7 +260,7 @@ public void RefreshUserShader() private FilterProgram BuildDefaultChain(Size chainInSize, Size chainOutSize, bool includeOSD, bool includeUserFilters) { // select user special FX shader chain - Dictionary selectedChainProperties = new Dictionary(); + Dictionary selectedChainProperties = new(); RetroShaderChain selectedChain = null; switch (GlobalConfig.TargetDisplayFilter) { @@ -283,11 +283,11 @@ private FilterProgram BuildDefaultChain(Size chainInSize, Size chainOutSize, boo var fCoreScreenControl = CreateCoreScreenControl(); - FinalPresentation fPresent = new FinalPresentation(chainOutSize); - SourceImage fInput = new SourceImage(chainInSize); - OSD fOSD = new OSD(includeOSD, OSD, _theOneFont); + FinalPresentation fPresent = new(chainOutSize); + SourceImage fInput = new(chainInSize); + OSD fOSD = new(includeOSD, OSD, _theOneFont); - FilterProgram chain = new FilterProgram(); + FilterProgram chain = new(); //add the first filter, encompassing output from the emulator core chain.AddFilter(fInput, "input"); @@ -314,7 +314,7 @@ private FilterProgram BuildDefaultChain(Size chainInSize, Size chainOutSize, boo if (size.Width < 1) size.Width = 1; if (size.Height < 1) size.Height = 1; - FinalPresentation fPadding = new FinalPresentation(size); + FinalPresentation fPadding = new(size); chain.AddFilter(fPadding, "padding"); fPadding.Config_PadOnly = true; fPadding.Padding = padding; @@ -327,7 +327,7 @@ private FilterProgram BuildDefaultChain(Size chainInSize, Size chainOutSize, boo { if (GlobalConfig.DispPrescale != 1) { - PrescaleFilter fPrescale = new PrescaleFilter() { Scale = GlobalConfig.DispPrescale }; + PrescaleFilter fPrescale = new() { Scale = GlobalConfig.DispPrescale }; chain.AddFilter(fPrescale, "user_prescale"); } } @@ -341,7 +341,7 @@ private FilterProgram BuildDefaultChain(Size chainInSize, Size chainOutSize, boo // AutoPrescale makes no sense for a None final filter if (GlobalConfig.DispAutoPrescale && GlobalConfig.DispFinalFilter != (int)FinalPresentation.eFilterOption.None) { - AutoPrescaleFilter apf = new AutoPrescaleFilter(); + AutoPrescaleFilter apf = new(); chain.AddFilter(apf, "auto_prescale"); } @@ -391,7 +391,7 @@ private static void AppendRetroShaderChain(FilterProgram program, string name, R { for (int i = 0; i < retroChain.Passes.Length; i++) { - RetroShaderPass rsp = new RetroShaderPass(retroChain, i); + RetroShaderPass rsp = new(retroChain, i); string fname = $"{name}[{i}]"; program.AddFilter(rsp, fname); rsp.Parameters = properties; @@ -407,7 +407,7 @@ private void AppendApiHawkLayer(FilterProgram chain, DisplaySurfaceID surfaceID) } var luaNativeTexture = _apiHawkSurfaceFrugalizers[surfaceID].Get(luaNativeSurface); - LuaLayer fLuaLayer = new LuaLayer(); + LuaLayer fLuaLayer = new(); fLuaLayer.SetTexture(luaNativeTexture); chain.AddFilter(fLuaLayer, surfaceID.GetName()); } @@ -426,7 +426,7 @@ public Point UntransformPoint(Point p) if (_currentFilterProgram == null) return p; // otherwise, have the filter program untransform it - Vector2 v = new Vector2(p.X, p.Y); + Vector2 v = new(p.X, p.Y); v = _currentFilterProgram.UntransformPoint("default", v); return new((int)v.X, (int)v.Y); @@ -444,7 +444,7 @@ public Point TransformPoint(Point p) } // otherwise, have the filter program untransform it - Vector2 v = new Vector2(p.X, p.Y); + Vector2 v = new(p.X, p.Y); v = _currentFilterProgram.TransformPoint("default", v); return new((int)v.X, (int)v.Y); } @@ -460,7 +460,7 @@ public Point TransformPoint(Point p) public void UpdateSource(IVideoProvider videoProvider) { bool displayNothing = GlobalConfig.DispSpeedupFeatures == 0; - JobInfo job = new JobInfo + JobInfo job = new() { VideoProvider = videoProvider, Simulate = displayNothing, @@ -487,7 +487,7 @@ private BaseFilter CreateCoreScreenControl() /// public BitmapBuffer RenderOffscreen(IVideoProvider videoProvider, bool includeOSD) { - JobInfo job = new JobInfo + JobInfo job = new() { VideoProvider = videoProvider, Simulate = false, @@ -505,7 +505,7 @@ public BitmapBuffer RenderOffscreen(IVideoProvider videoProvider, bool includeOS /// public BitmapBuffer RenderOffscreenLua(IVideoProvider videoProvider) { - JobInfo job = new JobInfo + JobInfo job = new() { VideoProvider = videoProvider, Simulate = false, @@ -617,7 +617,7 @@ public Size CalculateClientSize(IVideoProvider videoProvider, int zoom) if (bufferHeight < 1) bufferHeight = 1; // old stuff - FakeVideoProvider fvp = new FakeVideoProvider(bufferWidth, bufferHeight, virtualWidth, virtualHeight); + FakeVideoProvider fvp = new(bufferWidth, bufferHeight, virtualWidth, virtualHeight); Size chainOutsize; if (arActive) @@ -627,7 +627,7 @@ public Size CalculateClientSize(IVideoProvider videoProvider, int zoom) if (arInteger) { // ALERT COPYPASTE LAUNDROMAT - Vector2 AR = new Vector2(virtualWidth / (float) bufferWidth, virtualHeight / (float) bufferHeight); + Vector2 AR = new(virtualWidth / (float) bufferWidth, virtualHeight / (float) bufferHeight); float targetPar = AR.X / AR.Y; // this would malfunction for AR <= 0.5 or AR >= 2.0 @@ -702,7 +702,7 @@ public Size CalculateClientSize(IVideoProvider videoProvider, int zoom) chainOutsize.Width += ClientExtraPadding.Left + ClientExtraPadding.Right; chainOutsize.Height += ClientExtraPadding.Top + ClientExtraPadding.Bottom; - JobInfo job = new JobInfo + JobInfo job = new() { VideoProvider = fvp, Simulate = true, @@ -844,7 +844,7 @@ private FilterProgram UpdateSourceInternal(JobInfo job) _currEmuHeight = bufferHeight; //build the default filter chain and set it up with services filters will need - Size chainInsize = new Size(bufferWidth, bufferHeight); + Size chainInsize = new(bufferWidth, bufferHeight); var filterProgram = BuildDefaultChain(chainInsize, chainOutsize, job.IncludeOSD, job.IncludeUserFilters); filterProgram.GuiRenderer = _renderer; diff --git a/src/BizHawk.Client.Common/DisplayManager/FilterManager.cs b/src/BizHawk.Client.Common/DisplayManager/FilterManager.cs index f321292c1eb..16a9c226f1a 100644 --- a/src/BizHawk.Client.Common/DisplayManager/FilterManager.cs +++ b/src/BizHawk.Client.Common/DisplayManager/FilterManager.cs @@ -164,7 +164,7 @@ public void Compile(string channel, Size inSize, Size outsize, bool finalTarget) } bool obtainedFirstOutput = false; - SurfaceState currState = new SurfaceState(null); + SurfaceState currState = new(null); for (int i = 0; i < Filters.Count; i++) { @@ -193,7 +193,7 @@ public void Compile(string channel, Size inSize, Size outsize, bool finalTarget) // (if so, insert a render filter) case SurfaceDisposition.RenderTarget when currState.SurfaceDisposition == SurfaceDisposition.Texture: { - Render renderer = new Render(); + Render renderer = new(); Filters.Insert(i, renderer); Compile(channel, inSize, outsize, finalTarget); return; @@ -202,7 +202,7 @@ public void Compile(string channel, Size inSize, Size outsize, bool finalTarget) // (if so, the current render target gets resolved, and made no longer current case SurfaceDisposition.Texture when currState.SurfaceDisposition == SurfaceDisposition.RenderTarget: { - Resolve resolver = new Resolve(); + Resolve resolver = new(); Filters.Insert(i, resolver); Compile(channel, inSize, outsize, finalTarget); return; @@ -264,7 +264,7 @@ public void Compile(string channel, Size inSize, Size outsize, bool finalTarget) // if the current output disposition is a texture, we need to render it if (currState.SurfaceDisposition == SurfaceDisposition.Texture) { - Render renderer = new Render(); + Render renderer = new(); Filters.Insert(Filters.Count, renderer); Compile(channel, inSize, outsize, finalTarget); return; diff --git a/src/BizHawk.Client.Common/DisplayManager/Filters/BaseFilter.cs b/src/BizHawk.Client.Common/DisplayManager/Filters/BaseFilter.cs index 627f1ba34b1..afabab3e368 100644 --- a/src/BizHawk.Client.Common/DisplayManager/Filters/BaseFilter.cs +++ b/src/BizHawk.Client.Common/DisplayManager/Filters/BaseFilter.cs @@ -114,7 +114,7 @@ protected IOSurfaceInfo DeclareOutput(SurfaceState state, string channel = "defa private IOSurfaceInfo DeclareIO(SurfaceDirection direction, string channel, SurfaceDisposition disposition) { - IOSurfaceInfo iosi = new IOSurfaceInfo + IOSurfaceInfo iosi = new() { SurfaceDirection = direction, Channel = channel, diff --git a/src/BizHawk.Client.Common/DisplayManager/Filters/Gui.cs b/src/BizHawk.Client.Common/DisplayManager/Filters/Gui.cs index 2781b6b61af..2e123a43bb0 100644 --- a/src/BizHawk.Client.Common/DisplayManager/Filters/Gui.cs +++ b/src/BizHawk.Client.Common/DisplayManager/Filters/Gui.cs @@ -71,7 +71,7 @@ public LetterboxingLogic(bool maintainAspect, bool maintainInteger, int targetWi // apply the zooming algorithm (pasted and reworked, for now) // ALERT COPYPASTE LAUNDROMAT - Vector2 AR = new Vector2(virtualWidth / (float) textureWidth, virtualHeight / (float) textureHeight); + Vector2 AR = new(virtualWidth / (float) textureWidth, virtualHeight / (float) textureHeight); float targetPar = AR.X / AR.Y; var PS = Vector2.One; // this would malfunction for AR <= 0.5 or AR >= 2.0 @@ -349,7 +349,7 @@ public override Size PresizeOutput(string channel, Size size) public override void SetInputFormat(string channel, SurfaceState state) { CrunchNumbers(); - SurfaceState ss = new SurfaceState(new(outputSize), SurfaceDisposition.RenderTarget); + SurfaceState ss = new(new(outputSize), SurfaceDisposition.RenderTarget); DeclareOutput(ss, channel); } @@ -462,8 +462,8 @@ public override Vector2 UntransformPoint(string channel, Vector2 point) { var rect = _citra.TouchScreenRectangle; bool rotated = _citra.TouchScreenRotated; - float bufferWidth = (float)_citra.AsVideoProvider().BufferWidth; - float bufferHeight = (float)_citra.AsVideoProvider().BufferHeight; + float bufferWidth = _citra.AsVideoProvider().BufferWidth; + float bufferHeight = _citra.AsVideoProvider().BufferHeight; // reset the point's origin to the top left of the screen point.X -= rect.X; @@ -692,7 +692,7 @@ public override void SetInputFormat(string channel, SurfaceState state) var outputSize = state.SurfaceFormat.Size; outputSize.Width *= Scale; outputSize.Height *= Scale; - SurfaceState ss = new SurfaceState(new(outputSize), SurfaceDisposition.RenderTarget); + SurfaceState ss = new(new(outputSize), SurfaceDisposition.RenderTarget); DeclareOutput(ss, channel); } @@ -807,7 +807,7 @@ public override void Run() var size = FindInput().SurfaceFormat.Size; FilterProgram.GuiRenderer.Begin(size.Width, size.Height); - OSDBlitter blitter = new OSDBlitter(_font, FilterProgram.GuiRenderer, new(0, 0, size.Width, size.Height)); + OSDBlitter blitter = new(_font, FilterProgram.GuiRenderer, new(0, 0, size.Width, size.Height)); FilterProgram.GuiRenderer.EnableBlending(); _manager.DrawScreenInfo(blitter); _manager.DrawMessages(blitter); diff --git a/src/BizHawk.Client.Common/DisplayManager/Filters/Retro.cs b/src/BizHawk.Client.Common/DisplayManager/Filters/Retro.cs index b827356d893..0e49bb7c0b8 100644 --- a/src/BizHawk.Client.Common/DisplayManager/Filters/Retro.cs +++ b/src/BizHawk.Client.Common/DisplayManager/Filters/Retro.cs @@ -137,7 +137,7 @@ public class RetroShaderPreset public RetroShaderPreset(Stream stream) { string content = new StreamReader(stream).ReadToEnd(); - Dictionary dict = new Dictionary(); + Dictionary dict = new(); // parse the key-value-pair format of the file content = content.Replace("\r", ""); @@ -180,7 +180,7 @@ public RetroShaderPreset(Stream stream) int nShaders = FetchInt(dict, "shaders", 0); for (int i = 0; i < nShaders; i++) { - ShaderPass sp = new ShaderPass { Index = i }; + ShaderPass sp = new() { Index = i }; Passes.Add(sp); sp.InputFilterLinear = FetchBool(dict, $"filter_linear{i}", false); // Should this value not be defined, the filtering option is implementation defined. diff --git a/src/BizHawk.Client.Common/DisplayManager/OSDManager.cs b/src/BizHawk.Client.Common/DisplayManager/OSDManager.cs index 3afaafff35c..ac519d83ae3 100644 --- a/src/BizHawk.Client.Common/DisplayManager/OSDManager.cs +++ b/src/BizHawk.Client.Common/DisplayManager/OSDManager.cs @@ -55,7 +55,7 @@ private string MakeFrameCounter() { if (_movieSession.Movie.IsFinished()) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb .Append(_emulator.Frame) .Append('/') @@ -66,7 +66,7 @@ private string MakeFrameCounter() if (_movieSession.Movie.IsPlayingOrFinished()) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb .Append(_emulator.Frame) .Append('/') @@ -317,7 +317,7 @@ public void DrawScreenInfo(IBlitter g) if (_inputManager.ClientControls["Autohold"] || _inputManager.ClientControls["Autofire"]) { - StringBuilder sb = new StringBuilder("Held: "); + StringBuilder sb = new("Held: "); foreach (string sticky in _inputManager.StickyXorAdapter.CurrentStickies) { diff --git a/src/BizHawk.Client.Common/DisplayManager/TextureFrugalizer.cs b/src/BizHawk.Client.Common/DisplayManager/TextureFrugalizer.cs index 36e59041d25..0d908108f8a 100644 --- a/src/BizHawk.Client.Common/DisplayManager/TextureFrugalizer.cs +++ b/src/BizHawk.Client.Common/DisplayManager/TextureFrugalizer.cs @@ -33,7 +33,7 @@ public void Dispose() public Texture2d Get(IDisplaySurface ds) { - using BitmapBuffer bb = new BitmapBuffer(ds.PeekBitmap(), new BitmapLoadOptions()); + using BitmapBuffer bb = new(ds.PeekBitmap(), new BitmapLoadOptions()); return Get(bb); } public Texture2d Get(BitmapBuffer bb) diff --git a/src/BizHawk.Client.Common/OpenAdvanced.cs b/src/BizHawk.Client.Common/OpenAdvanced.cs index fd2c96ae988..2d05f95a0f0 100644 --- a/src/BizHawk.Client.Common/OpenAdvanced.cs +++ b/src/BizHawk.Client.Common/OpenAdvanced.cs @@ -67,7 +67,7 @@ private static IOpenAdvanced Deserialize(string text) public static string Serialize(IOpenAdvanced ioa) { - StringWriter sw = new StringWriter(); + StringWriter sw = new(); sw.Write("{0}*", ioa.TypeName); ioa.Serialize(sw); return sw.ToString(); diff --git a/src/BizHawk.Client.Common/QuickBmpFile.cs b/src/BizHawk.Client.Common/QuickBmpFile.cs index 8a2acd0c1d3..83f0356e5dc 100644 --- a/src/BizHawk.Client.Common/QuickBmpFile.cs +++ b/src/BizHawk.Client.Common/QuickBmpFile.cs @@ -284,8 +284,8 @@ public static unsafe bool Load(IVideoProvider v, Stream s) public static unsafe void Save(IVideoProvider v, Stream s, int w, int h) { - BITMAPFILEHEADER bf = new BITMAPFILEHEADER(); - BITMAPINFOHEADER bi = new BITMAPINFOHEADER(); + BITMAPFILEHEADER bf = new(); + BITMAPINFOHEADER bi = new(); bf.bfType = 0x4d42; bf.bfOffBits = bf.bfSize + bi.biSize; diff --git a/src/BizHawk.Client.Common/RomGame.cs b/src/BizHawk.Client.Common/RomGame.cs index b46c7f954c0..33f794de926 100644 --- a/src/BizHawk.Client.Common/RomGame.cs +++ b/src/BizHawk.Client.Common/RomGame.cs @@ -147,7 +147,7 @@ public RomGame(HawkFile file, string patch) CheckForPatchOptions(); if (patch is null) return; - using HawkFile patchFile = new HawkFile(patch); + using HawkFile patchFile = new(patch); patchFile.BindFirstOf(".ips"); if (!patchFile.IsBound) patchFile.BindFirstOf(".bps"); if (!patchFile.IsBound) return; diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index 5c69dffe775..9ecac749a5a 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -78,7 +78,7 @@ private TSync GetCoreSyncSettings() private object GetCoreSettings(Type t, Type settingsType) { - SettingsLoadArgs e = new SettingsLoadArgs(t, settingsType); + SettingsLoadArgs e = new(t, settingsType); if (OnLoadSettings == null) throw new InvalidOperationException("Frontend failed to provide a settings getter"); OnLoadSettings(this, e); @@ -89,7 +89,7 @@ private object GetCoreSettings(Type t, Type settingsType) private object GetCoreSyncSettings(Type t, Type syncSettingsType) { - SettingsLoadArgs e = new SettingsLoadArgs(t, syncSettingsType); + SettingsLoadArgs e = new(t, syncSettingsType); if (OnLoadSyncSettings == null) throw new InvalidOperationException("Frontend failed to provide a sync settings getter"); OnLoadSyncSettings(this, e); @@ -222,7 +222,7 @@ private GameInfo MakeGameFromDisc(Disc disc, string ext, string name) { // TODO - use more sophisticated IDer var discType = new DiscIdentifier(disc).DetectDiscType(); - DiscHasher discHasher = new DiscHasher(disc); + DiscHasher discHasher = new(disc); string discHash = discType == DiscType.SonyPSX ? discHasher.Calculate_PSX_BizIDHash() : discHasher.OldHash(); @@ -273,7 +273,7 @@ private bool LoadDisc(string path, CoreComm nextComm, HawkFile file, string ext, game = MakeGameFromDisc(disc, ext, Path.GetFileNameWithoutExtension(file.Name)); - CoreInventoryParameters cip = new CoreInventoryParameters(this) + CoreInventoryParameters cip = new(this) { Comm = nextComm, Game = game, @@ -294,7 +294,7 @@ private bool LoadDisc(string path, CoreComm nextComm, HawkFile file, string ext, private void LoadM3U(string path, CoreComm nextComm, HawkFile file, string forcedCoreName, out IEmulator nextEmulator, out GameInfo game) { M3U_File m3u; - using (StreamReader sr = new StreamReader(path)) + using (StreamReader sr = new(path)) m3u = M3U_File.Read(sr); if (m3u.Entries.Count == 0) throw new InvalidOperationException("Can't load an empty M3U"); @@ -316,7 +316,7 @@ private void LoadM3U(string path, CoreComm nextComm, HawkFile file, string force throw new InvalidOperationException("Couldn't load any contents of the M3U as discs"); game = MakeGameFromDisc(discs[0].DiscData, Path.GetExtension(m3u.Entries[0].Path), discs[0].DiscName); - CoreInventoryParameters cip = new CoreInventoryParameters(this) + CoreInventoryParameters cip = new(this) { Comm = nextComm, Game = game, @@ -355,7 +355,7 @@ private IEmulator MakeCoreFromCoreInventory(CoreInventoryParameters cip, string .ToList(); if (cores.Count == 0) throw new InvalidOperationException("No core was found to try on the game"); } - List exceptions = new List(); + List exceptions = new(); foreach (var core in cores) { try @@ -473,7 +473,7 @@ private void LoadOther( nextEmulator = nextEmulatorBak; break; } - CoreInventoryParameters cip = new CoreInventoryParameters(this) + CoreInventoryParameters cip = new(this) { Comm = nextComm, Game = game, @@ -499,7 +499,7 @@ static byte[] CbDeflater(Stream instream, int size) { return new GZipStream(instream, CompressionMode.Decompress).ReadAllBytes(); } - PSF psf = new PSF(); + PSF psf = new(); psf.Load(path, CbDeflater); nextEmulator = new Octoshock( nextComm, @@ -524,7 +524,7 @@ private bool LoadXML(string path, CoreComm nextComm, HawkFile file, string force game = xmlGame.GI; string system = game.System; - CoreInventoryParameters cip = new CoreInventoryParameters(this) + CoreInventoryParameters cip = new(this) { Comm = nextComm, Game = game, @@ -599,7 +599,7 @@ private void LoadMAME( { try { - using HawkFile f = new HawkFile(path, allowArchives: true); + using HawkFile f = new(path, allowArchives: true); if (!HandleArchiveBinding(f)) throw; LoadOther(nextComm, f, ext: ext, forcedCoreName: null, out nextEmulator, out rom, out game, out cancel); } @@ -623,7 +623,7 @@ public bool LoadRom(string path, CoreComm nextComm, string launchLibretroCore, s bool allowArchives = true; if (OpenAdvanced is OpenAdvanced_MAME || MAMEMachineDB.IsMAMEMachine(path)) allowArchives = false; - using HawkFile file = new HawkFile(path, false, allowArchives); + using HawkFile file = new(path, false, allowArchives); if (!file.Exists && OpenAdvanced is not OpenAdvanced_LibretroNoGame) return false; // if the provided file doesn't even exist, give up! (unless libretro no game is used) CanonicalFullPath = file.CanonicalFullPath; @@ -641,7 +641,7 @@ public bool LoadRom(string path, CoreComm nextComm, string launchLibretroCore, s // must be done before LoadNoGame (which triggers retro_init and the paths to be consumed by the core) // game name == name of core Game = game = new GameInfo { Name = Path.GetFileNameWithoutExtension(launchLibretroCore), System = VSystemID.Raw.Libretro }; - LibretroHost retro = new LibretroHost(nextComm, game, launchLibretroCore); + LibretroHost retro = new(nextComm, game, launchLibretroCore); nextEmulator = retro; if (retro.Description.SupportsNoGame && string.IsNullOrEmpty(path)) diff --git a/src/BizHawk.Client.Common/SaveSlotManager.cs b/src/BizHawk.Client.Common/SaveSlotManager.cs index 6ecc4f8ef91..6a5609248de 100644 --- a/src/BizHawk.Client.Common/SaveSlotManager.cs +++ b/src/BizHawk.Client.Common/SaveSlotManager.cs @@ -31,7 +31,7 @@ public void Update(IEmulator emulator, IMovie movie, string saveStatePrefix) } else { - FileInfo file = new FileInfo($"{saveStatePrefix}.QuickSave{i % 10}.State"); + FileInfo file = new($"{saveStatePrefix}.QuickSave{i % 10}.State"); if (file.Directory != null && file.Directory.Exists == false) { file.Directory.Create(); @@ -77,9 +77,9 @@ public bool IsRedo(IMovie movie, int slot) public void SwapBackupSavestate(IMovie movie, string path, int currentSlot) { // Takes the .state and .bak files and swaps them - FileInfo state = new FileInfo(path); - FileInfo backup = new FileInfo($"{path}.bak"); - FileInfo temp = new FileInfo($"{path}.bak.tmp"); + FileInfo state = new(path); + FileInfo backup = new($"{path}.bak"); + FileInfo temp = new($"{path}.bak.tmp"); if (!state.Exists || !backup.Exists) { diff --git a/src/BizHawk.Client.Common/XmlGame.cs b/src/BizHawk.Client.Common/XmlGame.cs index ed641f8815f..ea54193c4d3 100644 --- a/src/BizHawk.Client.Common/XmlGame.cs +++ b/src/BizHawk.Client.Common/XmlGame.cs @@ -24,7 +24,7 @@ public static XmlGame Create(HawkFile f) { try { - XmlDocument x = new XmlDocument(); + XmlDocument x = new(); x.Load(f.GetStream()); var y = x.SelectSingleNode("./BizHawk-XMLGame"); if (y == null) @@ -32,7 +32,7 @@ public static XmlGame Create(HawkFile f) return null; } - XmlGame ret = new XmlGame + XmlGame ret = new() { GI = { @@ -47,7 +47,7 @@ public static XmlGame Create(HawkFile f) var n = y.SelectSingleNode("./LoadAssets"); if (n != null) { - MemoryStream hashStream = new MemoryStream(); + MemoryStream hashStream = new(); int? originalIndex = null; foreach (XmlNode a in n.ChildNodes) @@ -77,7 +77,7 @@ public static XmlGame Create(HawkFile f) fullPath = Path.Combine(fullPath, filename.SubstringBefore('|')); try { - using HawkFile hf = new HawkFile(fullPath, allowArchives: !MAMEMachineDB.IsMAMEMachine(fullPath)); + using HawkFile hf = new(fullPath, allowArchives: !MAMEMachineDB.IsMAMEMachine(fullPath)); if (hf.IsArchive) { var archiveItem = hf.ArchiveItems.First(ai => ai.Name == filename.Split('|').Skip(1).First()); diff --git a/src/BizHawk.Client.Common/cheats/GbGameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/GbGameSharkDecoder.cs index 6038fe51418..1edb77dc2f1 100644 --- a/src/BizHawk.Client.Common/cheats/GbGameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/GbGameSharkDecoder.cs @@ -28,7 +28,7 @@ public static IDecodeResult Decode(string code) return new InvalidCheatCode("All GameShark Codes for GameBoy need to start with 00 or 01"); } - DecodeResult result = new DecodeResult { Size = WatchSize.Byte }; + DecodeResult result = new() { Size = WatchSize.Byte }; code = code.Remove(0, 2); diff --git a/src/BizHawk.Client.Common/cheats/GbGgGameGenieDecoder.cs b/src/BizHawk.Client.Common/cheats/GbGgGameGenieDecoder.cs index 34f177308b2..78501306fe9 100644 --- a/src/BizHawk.Client.Common/cheats/GbGgGameGenieDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/GbGgGameGenieDecoder.cs @@ -45,7 +45,7 @@ public static IDecodeResult Decode(string _code) // Bit # |3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0| // maps to| Value |A|B|C|D|E|F|G|H|I|J|K|L|XOR 0xF|a|b|c|c|NotUsed|e|f|g|h| // proper | Value |XOR 0xF|A|B|C|D|E|F|G|H|I|J|K|L|g|h|a|b|Nothing|c|d|e|f| - DecodeResult result = new DecodeResult { Size = WatchSize.Byte }; + DecodeResult result = new() { Size = WatchSize.Byte }; int x; diff --git a/src/BizHawk.Client.Common/cheats/GbaGameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/GbaGameSharkDecoder.cs index 94f6dd3ff4f..c4b0d2205aa 100644 --- a/src/BizHawk.Client.Common/cheats/GbaGameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/GbaGameSharkDecoder.cs @@ -64,7 +64,7 @@ public static IDecodeResult Decode(string code) return new InvalidCheatCode("All GBA GameShark Codes need to be 17 characters in length with a space after the first eight."); } - DecodeResult result = new DecodeResult + DecodeResult result = new() { Size = code.First() switch { diff --git a/src/BizHawk.Client.Common/cheats/NesGameGenieDecoder.cs b/src/BizHawk.Client.Common/cheats/NesGameGenieDecoder.cs index 531349b9192..64d6ca84bc7 100644 --- a/src/BizHawk.Client.Common/cheats/NesGameGenieDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/NesGameGenieDecoder.cs @@ -37,7 +37,7 @@ public static IDecodeResult Decode(string code) return new InvalidCheatCode("Game Genie codes need to be six or eight characters in length."); } - DecodeResult result = new DecodeResult { Size = WatchSize.Byte }; + DecodeResult result = new() { Size = WatchSize.Byte }; // char 3 bit 3 denotes the code length. if (code.Length == 6) { diff --git a/src/BizHawk.Client.Common/cheats/PsxGameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/PsxGameSharkDecoder.cs index f99f6cc8112..206ffe79dd6 100644 --- a/src/BizHawk.Client.Common/cheats/PsxGameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/PsxGameSharkDecoder.cs @@ -24,7 +24,7 @@ public static IDecodeResult Decode(string code) return new InvalidCheatCode("All PSX GameShark Cheats need to be 13 characters in length."); } - DecodeResult result = new DecodeResult(); + DecodeResult result = new(); string type = code.Substring(0, 2); result.Size = type switch diff --git a/src/BizHawk.Client.Common/cheats/SaturnGameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/SaturnGameSharkDecoder.cs index 023d23509ff..3d8dbeb353d 100644 --- a/src/BizHawk.Client.Common/cheats/SaturnGameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/SaturnGameSharkDecoder.cs @@ -28,7 +28,7 @@ public static IDecodeResult Decode(string code) return new InvalidCheatCode("All Saturn GameShark Cheats need to be 13 characters in length."); } - DecodeResult result = new DecodeResult { Size = WatchSize.Word }; + DecodeResult result = new() { Size = WatchSize.Word }; // Only the first character really matters? 16 or 36? string test = code.Remove(2, 11).Remove(1, 1); diff --git a/src/BizHawk.Client.Common/cheats/SmsActionReplayDecoder.cs b/src/BizHawk.Client.Common/cheats/SmsActionReplayDecoder.cs index 2aef7043f3d..12c5b6fa075 100644 --- a/src/BizHawk.Client.Common/cheats/SmsActionReplayDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/SmsActionReplayDecoder.cs @@ -17,7 +17,7 @@ public static IDecodeResult Decode(string code) return new InvalidCheatCode("Action Replay Codes must be 9 characters with a dash after the third character"); } - DecodeResult result = new DecodeResult { Size = WatchSize.Byte }; + DecodeResult result = new() { Size = WatchSize.Byte }; string s = code.Remove(0, 2); string ramAddress = s.Remove(4, 2).Replace("-", ""); diff --git a/src/BizHawk.Client.Common/cheats/SnesGameGenieDecoder.cs b/src/BizHawk.Client.Common/cheats/SnesGameGenieDecoder.cs index 455bcaacb1c..a11dd208444 100644 --- a/src/BizHawk.Client.Common/cheats/SnesGameGenieDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/SnesGameGenieDecoder.cs @@ -48,7 +48,7 @@ public static IDecodeResult Decode(string code) // Bit # |3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0| // maps to| Value |i|j|k|l|q|r|s|t|o|p|a|b|c|d|u|v|w|x|e|f|g|h|m|n| // order | Value |a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x| - DecodeResult result = new DecodeResult { Size = WatchSize.Byte }; + DecodeResult result = new() { Size = WatchSize.Byte }; int x; diff --git a/src/BizHawk.Client.Common/config/Binding.cs b/src/BizHawk.Client.Common/config/Binding.cs index b86697831a7..946e78cb729 100644 --- a/src/BizHawk.Client.Common/config/Binding.cs +++ b/src/BizHawk.Client.Common/config/Binding.cs @@ -14,7 +14,7 @@ public class HotkeyInfo static HotkeyInfo() { - Dictionary dict = new Dictionary(); + Dictionary dict = new(); int i = 0; #if true void Bind(string tabGroup, string displayName, string defaultBinding = "", string toolTip = "") diff --git a/src/BizHawk.Client.Common/config/ConfigExtensions.cs b/src/BizHawk.Client.Common/config/ConfigExtensions.cs index 4f903b52236..7f9da1a4e7f 100644 --- a/src/BizHawk.Client.Common/config/ConfigExtensions.cs +++ b/src/BizHawk.Client.Common/config/ConfigExtensions.cs @@ -17,7 +17,7 @@ private class TypeNameEncapsulator } private static JToken Serialize(object o) { - TypeNameEncapsulator tne = new TypeNameEncapsulator { o = o }; + TypeNameEncapsulator tne = new() { o = o }; return JToken.FromObject(tne, ConfigService.Serializer)["o"]; // Maybe todo: This code is identical to the code above, except that it does not emit the legacy "$type" diff --git a/src/BizHawk.Client.Common/config/ConfigService.cs b/src/BizHawk.Client.Common/config/ConfigService.cs index cf6d189efdc..0394f9d6175 100644 --- a/src/BizHawk.Client.Common/config/ConfigService.cs +++ b/src/BizHawk.Client.Common/config/ConfigService.cs @@ -89,11 +89,11 @@ public static bool IsFromSameVersion(string filepath, out string msg) try { - FileInfo file = new FileInfo(filepath); + FileInfo file = new(filepath); if (file.Exists) { using var reader = file.OpenText(); - JsonTextReader r = new JsonTextReader(reader); + JsonTextReader r = new(reader); config = (T)Serializer.Deserialize(r, typeof(T)); } } @@ -107,11 +107,11 @@ public static bool IsFromSameVersion(string filepath, out string msg) public static void Save(string filepath, object config) { - FileInfo file = new FileInfo(filepath); + FileInfo file = new(filepath); try { using var writer = file.CreateText(); - JsonTextWriter w = new JsonTextWriter(writer) { Formatting = Formatting.Indented }; + JsonTextWriter w = new(writer) { Formatting = Formatting.Indented }; Serializer.Serialize(w, config); } catch @@ -128,8 +128,8 @@ private class TypeNameEncapsulator public static object LoadWithType(string serialized) { - using StringReader tr = new StringReader(serialized); - using JsonTextReader jr = new JsonTextReader(tr); + using StringReader tr = new(serialized); + using JsonTextReader jr = new(tr); TypeNameEncapsulator tne = (TypeNameEncapsulator)Serializer.Deserialize(jr, typeof(TypeNameEncapsulator)); // in the case of trying to deserialize nothing, tne will be nothing @@ -139,9 +139,9 @@ public static object LoadWithType(string serialized) public static string SaveWithType(object o) { - using StringWriter sw = new StringWriter(); - using JsonTextWriter jw = new JsonTextWriter(sw) { Formatting = Formatting.None }; - TypeNameEncapsulator tne = new TypeNameEncapsulator { o = o }; + using StringWriter sw = new(); + using JsonTextWriter jw = new(sw) { Formatting = Formatting.None }; + TypeNameEncapsulator tne = new() { o = o }; Serializer.Serialize(jw, tne, typeof(TypeNameEncapsulator)); sw.Flush(); return sw.ToString(); diff --git a/src/BizHawk.Client.Common/config/PathEntryCollection.cs b/src/BizHawk.Client.Common/config/PathEntryCollection.cs index 53d292acca9..4154989b5a8 100644 --- a/src/BizHawk.Client.Common/config/PathEntryCollection.cs +++ b/src/BizHawk.Client.Common/config/PathEntryCollection.cs @@ -148,7 +148,7 @@ public void ResolveWithDefaults() if (!Paths.Exists(p => p.System == defaultPath.System && p.Type == defaultPath.Type)) Paths.Add(defaultPath); } - List entriesToRemove = new List(); + List entriesToRemove = new(); // Remove entries that no longer exist in defaults foreach (var pathEntry in Paths) diff --git a/src/BizHawk.Client.Common/display/IInputDisplayGenerator.cs b/src/BizHawk.Client.Common/display/IInputDisplayGenerator.cs index 3e533bd5091..e74cfa80bc7 100644 --- a/src/BizHawk.Client.Common/display/IInputDisplayGenerator.cs +++ b/src/BizHawk.Client.Common/display/IInputDisplayGenerator.cs @@ -31,7 +31,7 @@ public Bk2InputDisplayGenerator(string systemId, IController source) public string Generate() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (var (button, range, mnemonicChar) in _cachedInputSpecs) { diff --git a/src/BizHawk.Client.Common/fwmanager/FirmwareManager.cs b/src/BizHawk.Client.Common/fwmanager/FirmwareManager.cs index e7863a08c47..d5b09f40683 100644 --- a/src/BizHawk.Client.Common/fwmanager/FirmwareManager.cs +++ b/src/BizHawk.Client.Common/fwmanager/FirmwareManager.cs @@ -123,14 +123,14 @@ public bool CanFileBeImported(string f) { try { - FileInfo fi = new FileInfo(f); + FileInfo fi = new(f); if (!fi.Exists) return false; // weed out filesizes first to reduce the unnecessary overhead of a hashing operation if (!_firmwareSizes.Contains(fi.Length)) return false; // check the hash - RealFirmwareReader reader = new RealFirmwareReader(); + RealFirmwareReader reader = new(); reader.Read(fi); string hash = reader.Dict.Values.First().Hash; return FirmwareDatabase.FirmwareFiles.Any(a => a.Hash == hash); @@ -143,10 +143,10 @@ public bool CanFileBeImported(string f) public void DoScanAndResolve(PathEntryCollection pathEntries, IDictionary userSpecifications) { - RealFirmwareReader reader = new RealFirmwareReader(); + RealFirmwareReader reader = new(); // build a list of files under the global firmwares path, and build a hash for each of them (as ResolutionInfo) while we're at it - Queue todo = new Queue(new[] { new DirectoryInfo(pathEntries.AbsolutePathFor(pathEntries.FirmwaresPathFragment, null)) }); + Queue todo = new(new[] { new DirectoryInfo(pathEntries.AbsolutePathFor(pathEntries.FirmwaresPathFragment, null)) }); while (todo.Count != 0) { var di = todo.Dequeue(); @@ -192,7 +192,7 @@ public void DoScanAndResolve(PathEntryCollection pathEntries, IDictionary> analogBinds, IDictionary> feedbackBinds) { - Controller ret = new Controller(def); + Controller ret = new(def); if (allBinds.TryGetValue(def.Name, out var binds)) { foreach (string btn in def.BoolButtons) @@ -138,7 +138,7 @@ private static AutofireController BindToDefinitionAF( int on, int off) { - AutofireController ret = new AutofireController(emulator, on, off); + AutofireController ret = new(emulator, on, off); if (allBinds.TryGetValue(emulator.ControllerDefinition.Name, out var binds)) { foreach (string btn in emulator.ControllerDefinition.BoolButtons) diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs index dfe57c4db4b..30dcfbc4264 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs @@ -386,7 +386,7 @@ public void AddCheat(string code) return; } - GameSharkDecoder decoder = new GameSharkDecoder(MainForm.Emulator.AsMemoryDomains(), MainForm.Emulator.SystemId); + GameSharkDecoder decoder = new(MainForm.Emulator.AsMemoryDomains(), MainForm.Emulator.SystemId); var result = decoder.Decode(code); if (result.IsValid(out var valid)) @@ -415,7 +415,7 @@ public void RemoveCheat(string code) return; } - GameSharkDecoder decoder = new GameSharkDecoder(MainForm.Emulator.AsMemoryDomains(), MainForm.Emulator.SystemId); + GameSharkDecoder decoder = new(MainForm.Emulator.AsMemoryDomains(), MainForm.Emulator.SystemId); var result = decoder.Decode(code); if (result.IsValid(out var valid)) diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/CommLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/CommLuaLibrary.cs index 9755bdd6a1c..62422c2faaf 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/CommLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/CommLuaLibrary.cs @@ -22,7 +22,7 @@ public CommLuaLibrary(ILuaLibraries luaLibsImpl, ApiContainer apiContainer, Acti [LuaMethod("getluafunctionslist", "returns a list of implemented functions")] public static string GetLuaFunctionsList() { - StringBuilder list = new StringBuilder(); + StringBuilder list = new(); foreach (var function in typeof(CommLuaLibrary).GetMethods()) { list.AppendLine(function.ToString()); diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/JoypadLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/JoypadLuaLibrary.cs index 2db8cb0f5b6..bc48d834e8a 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/JoypadLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/JoypadLuaLibrary.cs @@ -37,7 +37,7 @@ public void SetFromMnemonicStr(string inputLogEntry) [LuaMethod("set", "sets the given buttons to their provided values for the current frame")] public void Set(LuaTable buttons, int? controller = null) { - Dictionary dict = new Dictionary(); + Dictionary dict = new(); foreach (var (k, v) in _th.EnumerateEntries(buttons)) { dict[k.ToString()] = Convert.ToBoolean(v); // Accepts 1/0 or true/false @@ -49,7 +49,7 @@ public void Set(LuaTable buttons, int? controller = null) [LuaMethod("setanalog", "sets the given analog controls to their provided values for the current frame. Note that unlike set() there is only the logic of overriding with the given value.")] public void SetAnalog(LuaTable controls, int? controller = null) { - Dictionary dict = new Dictionary(); + Dictionary dict = new(); foreach (var (k, v) in _th.EnumerateEntries(controls)) { dict[k.ToString()] = long.TryParse(v.ToString(), out long d) ? (int) d : null; diff --git a/src/BizHawk.Client.Common/lua/LuaDocumentation.cs b/src/BizHawk.Client.Common/lua/LuaDocumentation.cs index 54bc1ccc6d6..ff347599746 100644 --- a/src/BizHawk.Client.Common/lua/LuaDocumentation.cs +++ b/src/BizHawk.Client.Common/lua/LuaDocumentation.cs @@ -10,7 +10,7 @@ public class LuaDocumentation : List { public string ToTASVideosWikiMarkup() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb.AppendLine("__This is an autogenerated page, do not edit.__ (To update, open the function list dialog on a Debug build and click the wiki button.)") .AppendLine() @@ -135,16 +135,16 @@ public class Completion public string ToSublime2CompletionList() { - SublimeCompletions sc = new SublimeCompletions(); + SublimeCompletions sc = new(); foreach (var f in this.OrderBy(lf => lf.Library).ThenBy(lf => lf.Name)) { - SublimeCompletions.Completion completion = new SublimeCompletions.Completion + SublimeCompletions.Completion completion = new() { Trigger = $"{f.Library}.{f.Name}" }; - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); if (f.ParameterList.Any()) { @@ -229,7 +229,7 @@ public string ParameterList { var parameters = Method.GetParameters(); - StringBuilder list = new StringBuilder(); + StringBuilder list = new(); list.Append('('); for (int i = 0; i < parameters.Length; i++) { diff --git a/src/BizHawk.Client.Common/lua/LuaFileList.cs b/src/BizHawk.Client.Common/lua/LuaFileList.cs index 13c45ae38fd..7643480ac28 100644 --- a/src/BizHawk.Client.Common/lua/LuaFileList.cs +++ b/src/BizHawk.Client.Common/lua/LuaFileList.cs @@ -65,7 +65,7 @@ public LuaFileList(IReadOnlyCollection collection, Action onChanged) public bool Load(string path, bool disableOnLoad) { - FileInfo file = new FileInfo(path); + FileInfo file = new(path); if (!file.Exists) { return false; @@ -104,8 +104,8 @@ public bool Load(string path, bool disableOnLoad) public void Save(string path) { - using StreamWriter sw = new StreamWriter(path); - StringBuilder sb = new StringBuilder(); + using StreamWriter sw = new(path); + StringBuilder sb = new(); string saveDirectory = Path.GetDirectoryName(Path.GetFullPath(path)); foreach (var file in this) { diff --git a/src/BizHawk.Client.Common/lua/LuaSandbox.cs b/src/BizHawk.Client.Common/lua/LuaSandbox.cs index 7438c536daa..0c6a62baaeb 100644 --- a/src/BizHawk.Client.Common/lua/LuaSandbox.cs +++ b/src/BizHawk.Client.Common/lua/LuaSandbox.cs @@ -76,7 +76,7 @@ private void Sandbox(Action callback, Action exceptionCallback) public static LuaSandbox CreateSandbox(LuaThread thread, string initialDirectory) { - LuaSandbox sandbox = new LuaSandbox(); + LuaSandbox sandbox = new(); SandboxForThread.Add(thread, sandbox); sandbox.SetSandboxCurrentDirectory(initialDirectory); return sandbox; diff --git a/src/BizHawk.Client.Common/movie/BasicMovieInfo.cs b/src/BizHawk.Client.Common/movie/BasicMovieInfo.cs index 3d06add69c9..e68ada702f6 100644 --- a/src/BizHawk.Client.Common/movie/BasicMovieInfo.cs +++ b/src/BizHawk.Client.Common/movie/BasicMovieInfo.cs @@ -146,7 +146,7 @@ public virtual string FirmwareHash public bool Load() { - FileInfo file = new FileInfo(Filename); + FileInfo file = new(Filename); if (!file.Exists) { return false; diff --git a/src/BizHawk.Client.Common/movie/Subtitle.cs b/src/BizHawk.Client.Common/movie/Subtitle.cs index 55b3ac3fddd..78bc98a52cb 100644 --- a/src/BizHawk.Client.Common/movie/Subtitle.cs +++ b/src/BizHawk.Client.Common/movie/Subtitle.cs @@ -33,7 +33,7 @@ public Subtitle(Subtitle s) public override string ToString() { - StringBuilder sb = new StringBuilder("subtitle "); + StringBuilder sb = new("subtitle "); sb .Append(Frame).Append(' ') .Append(X).Append(' ') @@ -47,7 +47,7 @@ public override string ToString() public string ToSubRip(int index, double fps, bool addColorTag) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb.Append(index); sb.Append("\r\n"); diff --git a/src/BizHawk.Client.Common/movie/SubtitleList.cs b/src/BizHawk.Client.Common/movie/SubtitleList.cs index ea941dae3ee..7d779955e95 100644 --- a/src/BizHawk.Client.Common/movie/SubtitleList.cs +++ b/src/BizHawk.Client.Common/movie/SubtitleList.cs @@ -22,7 +22,7 @@ public SubtitleList() public override string ToString() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); Sort(); ForEach(subtitle => sb.AppendLine(subtitle.ToString())); return sb.ToString(); @@ -76,8 +76,8 @@ public bool AddFromString(string subtitleStr) public string ToSubRip(double fps) { int index = 1; - StringBuilder sb = new StringBuilder(); - List subs = new List(); + StringBuilder sb = new(); + List subs = new(); foreach (var subtitle in this) { subs.Add(new Subtitle(subtitle)); diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2Header.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2Header.cs index 20c9955ab28..7eb464d8346 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2Header.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2Header.cs @@ -15,7 +15,7 @@ public class Bk2Header : Dictionary public override string ToString() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (var (k, v) in this) sb.Append(k).Append(' ').Append(v).AppendLine(); return sb.ToString(); } diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs index 6aa1f19a6b9..8d8985e3a8d 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs @@ -47,7 +47,7 @@ public Bk2LogEntryGenerator(string systemId, IController source) /// public string GenerateLogKey() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb.Append("LogKey:"); foreach (var group in _source.Definition.ControlsOrdered.Where(static c => c.Count is not 0)) @@ -67,7 +67,7 @@ public string GenerateLogKey() /// public IDictionary Map() { - Dictionary dict = new Dictionary(); + Dictionary dict = new(); foreach (string button in _source.Definition.OrderedControlsFlat) { if (_source.Definition.BoolButtons.Contains(button)) @@ -85,7 +85,7 @@ public IDictionary Map() private string CreateLogEntry(bool createEmpty = false) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb.Append('|'); diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.HeaderApi.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.HeaderApi.cs index 047dbe74e64..bcd2152002a 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.HeaderApi.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.HeaderApi.cs @@ -180,7 +180,7 @@ public override string FirmwareHash protected string CommentsString() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (string comment in Comments) { diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs index 3ddfdfd2240..0bd56671cd0 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs @@ -37,7 +37,7 @@ protected virtual void Write(string fn, bool isBackup = false) Header[HeaderKeys.EmulatorVersion] = VersionInfo.GetEmuVersion(); CreateDirectoryIfNotExists(fn); - using ZipStateSaver bs = new ZipStateSaver(fn, Session.Settings.MovieCompressionLevel); + using ZipStateSaver bs = new(fn, Session.Settings.MovieCompressionLevel); AddLumps(bs, isBackup); if (!isBackup) @@ -66,7 +66,7 @@ private void SetCycleValues() private static void CreateDirectoryIfNotExists(string fn) { - FileInfo file = new FileInfo(fn); + FileInfo file = new(fn); if (file.Directory != null && !file.Directory.Exists) { Directory.CreateDirectory(file.Directory.ToString()); diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs index f6baab9f313..660b98124b4 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs @@ -113,7 +113,7 @@ public bool CheckTimeLines(TextReader reader, out string errorMessage) { // This function will compare the movie data to the savestate movie data to see if they match errorMessage = ""; - List newLog = new List(); + List newLog = new(); int stateFrame = 0; string line; while ((line = reader.ReadLine()) != null) diff --git a/src/BizHawk.Client.Common/movie/bk2/StringLogs.cs b/src/BizHawk.Client.Common/movie/bk2/StringLogs.cs index 94cd3e0f976..32c24643775 100644 --- a/src/BizHawk.Client.Common/movie/bk2/StringLogs.cs +++ b/src/BizHawk.Client.Common/movie/bk2/StringLogs.cs @@ -43,7 +43,7 @@ public static IStringLog MakeStringLog() public static string ToInputLog(this IStringLog log) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (string record in log) { sb.AppendLine(record); @@ -72,7 +72,7 @@ internal class ListStringLog : List, IStringLog { public IStringLog Clone() { - ListStringLog ret = new ListStringLog(); + ListStringLog ret = new(); ret.AddRange(this); return ret; } @@ -114,7 +114,7 @@ public StreamStringLog(bool disk) public IStringLog Clone() { - StreamStringLog ret = new StreamStringLog(_mDisk); // doesn't necessarily make sense to copy the mDisk value, they could be designated for different targets... + StreamStringLog ret = new(_mDisk); // doesn't necessarily make sense to copy the mDisk value, they could be designated for different targets... for (int i = 0; i < Count; i++) { ret.Add(this[i]); diff --git a/src/BizHawk.Client.Common/movie/import/BkmImport.cs b/src/BizHawk.Client.Common/movie/import/BkmImport.cs index b39364d6f5b..cfe00c842c4 100644 --- a/src/BizHawk.Client.Common/movie/import/BkmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/BkmImport.cs @@ -8,7 +8,7 @@ internal class BkmImport : MovieImporter { protected override void RunImport() { - BkmMovie bkm = new BkmMovie { Filename = SourceFile.FullName }; + BkmMovie bkm = new() { Filename = SourceFile.FullName }; bkm.Load(); for (int i = 0; i < bkm.InputLogLength; i++) diff --git a/src/BizHawk.Client.Common/movie/import/DsmImport.cs b/src/BizHawk.Client.Common/movie/import/DsmImport.cs index 50177d20412..90ba3353a51 100644 --- a/src/BizHawk.Client.Common/movie/import/DsmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/DsmImport.cs @@ -27,7 +27,7 @@ protected override void RunImport() { Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NDS; - NDS.NDSSyncSettings syncSettings = new NDS.NDSSyncSettings(); + NDS.NDSSyncSettings syncSettings = new(); using var sr = SourceFile.OpenText(); string line; diff --git a/src/BizHawk.Client.Common/movie/import/FcmImport.cs b/src/BizHawk.Client.Common/movie/import/FcmImport.cs index 3bb3c364bf1..e5b99d406b0 100644 --- a/src/BizHawk.Client.Common/movie/import/FcmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/FcmImport.cs @@ -20,8 +20,8 @@ protected override void RunImport() { Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.NesHawk; - using BinaryReader r = new BinaryReader(SourceFile.Open(FileMode.Open, FileAccess.Read)); - string signature = new string(r.ReadChars(4)); + using BinaryReader r = new(SourceFile.Open(FileMode.Open, FileAccess.Read)); + string signature = new(r.ReadChars(4)); if (signature != "FCM\x1A") { Result.Errors.Add("This is not a valid .FCM file."); @@ -30,9 +30,9 @@ protected override void RunImport() Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NES; - NES.NESSyncSettings syncSettings = new NES.NESSyncSettings(); + NES.NESSyncSettings syncSettings = new(); - NESControlSettings controllerSettings = new NESControlSettings + NESControlSettings controllerSettings = new() { NesLeftPort = nameof(ControllerNES), NesRightPort = nameof(ControllerNES) @@ -114,7 +114,7 @@ The savestate offset is . T Result.Movie.Comments.Add($"{EmulationOrigin} FCEU {emuVersion}"); // 034 name of the ROM used - UTF8 encoded nul-terminated string. - List gameBytes = new List(); + List gameBytes = new(); while (r.PeekChar() != 0) { gameBytes.Add(r.ReadByte()); @@ -130,7 +130,7 @@ The savestate offset is . T name and ends at the savestate offset. This string is displayed as "Author Info" in the Windows version of the emulator. */ - List authorBytes = new List(); + List authorBytes = new(); while (r.PeekChar() != 0) { authorBytes.Add(r.ReadByte()); diff --git a/src/BizHawk.Client.Common/movie/import/Fm2Import.cs b/src/BizHawk.Client.Common/movie/import/Fm2Import.cs index c43a8f92aca..b695f3856da 100644 --- a/src/BizHawk.Client.Common/movie/import/Fm2Import.cs +++ b/src/BizHawk.Client.Common/movie/import/Fm2Import.cs @@ -19,9 +19,9 @@ protected override void RunImport() const string emulator = "FCEUX"; string platform = VSystemID.Raw.NES; // TODO: FDS? - NES.NESSyncSettings syncSettings = new NES.NESSyncSettings(); + NES.NESSyncSettings syncSettings = new(); - NESControlSettings controllerSettings = new NESControlSettings + NESControlSettings controllerSettings = new() { NesLeftPort = nameof(UnpluggedNES), NesRightPort = nameof(UnpluggedNES) diff --git a/src/BizHawk.Client.Common/movie/import/FmvImport.cs b/src/BizHawk.Client.Common/movie/import/FmvImport.cs index e9ab20eddc7..9eeff7d87d7 100644 --- a/src/BizHawk.Client.Common/movie/import/FmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/FmvImport.cs @@ -15,9 +15,9 @@ internal class FmvImport : MovieImporter protected override void RunImport() { using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read); - using BinaryReader r = new BinaryReader(fs); + using BinaryReader r = new(fs); // 000 4-byte signature: 46 4D 56 1A "FMV\x1A" - string signature = new string(r.ReadChars(4)); + string signature = new(r.ReadChars(4)); if (signature != "FMV\x1A") { Result.Errors.Add("This is not a valid .FMV file."); @@ -35,7 +35,7 @@ protected override void RunImport() } Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NES; - NES.NESSyncSettings syncSettings = new NES.NESSyncSettings(); + NES.NESSyncSettings syncSettings = new(); // other bits: unknown, set to 0 // 005 1-byte flags: @@ -89,7 +89,7 @@ the file. Result.Warnings.Add("No input recorded."); } - NESControlSettings controllerSettings = new NESControlSettings + NESControlSettings controllerSettings = new() { NesLeftPort = controller1 ? nameof(ControllerNES) : nameof(UnpluggedNES), NesRightPort = controller2 ? nameof(ControllerNES) : nameof(UnpluggedNES) diff --git a/src/BizHawk.Client.Common/movie/import/GmvImport.cs b/src/BizHawk.Client.Common/movie/import/GmvImport.cs index f89fe55ff8e..dd31d3d94a5 100644 --- a/src/BizHawk.Client.Common/movie/import/GmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/GmvImport.cs @@ -14,7 +14,7 @@ internal class GmvImport : MovieImporter protected override void RunImport() { using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read); - using BinaryReader r = new BinaryReader(fs); + using BinaryReader r = new(fs); // 000 16-byte signature and format version: "Gens Movie TEST9" string signature = new(r.ReadChars(15)); @@ -72,7 +72,7 @@ protected override void RunImport() ? LibGPGX.INPUT_DEVICE.DEVICE_PAD6B : LibGPGX.INPUT_DEVICE.DEVICE_PAD3B; - GPGX.GPGXSyncSettings ss = new GPGX.GPGXSyncSettings + GPGX.GPGXSyncSettings ss = new() { UseSixButton = player1Config == '6' || player2Config == '6', ControlTypeLeft = GPGX.ControlType.Normal, @@ -88,7 +88,7 @@ protected override void RunImport() : LibGPGX.INPUT_DEVICE.DEVICE_PAD3B; } - GPGXControlConverter controlConverter = new GPGXControlConverter(input, false); + GPGXControlConverter controlConverter = new(input, false); SimpleController controller = new(controlConverter.ControllerDef); diff --git a/src/BizHawk.Client.Common/movie/import/IMovieImport.cs b/src/BizHawk.Client.Common/movie/import/IMovieImport.cs index d3dc182da59..fe78e180cea 100644 --- a/src/BizHawk.Client.Common/movie/import/IMovieImport.cs +++ b/src/BizHawk.Client.Common/movie/import/IMovieImport.cs @@ -93,7 +93,7 @@ private string PromptForRom(MatchesMovieHash matchesMovieHash) if (result is null) return null; // skip hash migration when the dialog was canceled - using HawkFile rom = new HawkFile(result); + using HawkFile rom = new(result); if (rom.IsArchive) rom.BindFirst(); ReadOnlySpan romData = (ReadOnlySpan) rom.ReadAllBytes(); if (romData.Length % 1024 == 512) @@ -161,7 +161,7 @@ public class ImportResult public static ImportResult Error(string errorMsg) { - ImportResult result = new ImportResult(); + ImportResult result = new(); result.Errors.Add(errorMsg); return result; } diff --git a/src/BizHawk.Client.Common/movie/import/LsmvImport.cs b/src/BizHawk.Client.Common/movie/import/LsmvImport.cs index 4ab8c5b7e85..1e1772ab40b 100644 --- a/src/BizHawk.Client.Common/movie/import/LsmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/LsmvImport.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Linq; @@ -28,7 +27,7 @@ protected override void RunImport() Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.SubBsnes115; // .LSMV movies are .zip files containing data files. - using FileStream fs = new FileStream(SourceFile.FullName, FileMode.Open, FileAccess.Read); + using FileStream fs = new(SourceFile.FullName, FileMode.Open, FileAccess.Read); { byte[] data = new byte[4]; fs.Read(data, 0, 4); @@ -40,9 +39,9 @@ protected override void RunImport() fs.Position = 0; } - using ZipArchive zip = new ZipArchive(fs, ZipArchiveMode.Read, true); + using ZipArchive zip = new(fs, ZipArchiveMode.Read, true); - BsnesCore.SnesSyncSettings ss = new BsnesCore.SnesSyncSettings(); + BsnesCore.SnesSyncSettings ss = new(); string platform = VSystemID.Raw.SNES; @@ -92,7 +91,7 @@ protected override void RunImport() string authors = Encoding.UTF8.GetString(stream.ReadAllBytes()); string authorList = ""; string authorLast = ""; - using (StringReader reader = new StringReader(authors)) + using (StringReader reader = new(authors)) { // Each author is on a different line. while (reader.ReadLine() is string line) @@ -167,7 +166,7 @@ protected override void RunImport() // Insert an empty frame in lsmv snes movies // see https://github.com/TASEmulators/BizHawk/issues/721 Result.Movie.AppendFrame(EmptyLmsvFrame()); - using (StringReader reader = new StringReader(input)) + using (StringReader reader = new(input)) { while(reader.ReadLine() is string line) { @@ -229,7 +228,7 @@ protected override void RunImport() { using var stream = item.Open(); string subtitles = Encoding.UTF8.GetString(stream.ReadAllBytes()); - using StringReader reader = new StringReader(subtitles); + using StringReader reader = new(subtitles); while (reader.ReadLine() is string line) { string subtitle = ImportTextSubtitle(line); diff --git a/src/BizHawk.Client.Common/movie/import/Mc2Import.cs b/src/BizHawk.Client.Common/movie/import/Mc2Import.cs index d01179a68f3..b1843f81016 100644 --- a/src/BizHawk.Client.Common/movie/import/Mc2Import.cs +++ b/src/BizHawk.Client.Common/movie/import/Mc2Import.cs @@ -13,7 +13,7 @@ internal class Mc2Import : MovieImporter protected override void RunImport() { - PCEngine.PCESyncSettings ss = new PCEngine.PCESyncSettings + PCEngine.PCESyncSettings ss = new() { Port1 = PceControllerType.Unplugged, Port2 = PceControllerType.Unplugged, diff --git a/src/BizHawk.Client.Common/movie/import/MmvImport.cs b/src/BizHawk.Client.Common/movie/import/MmvImport.cs index 57d4d3d2324..48c11d03536 100644 --- a/src/BizHawk.Client.Common/movie/import/MmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/MmvImport.cs @@ -13,7 +13,7 @@ internal class MmvImport : MovieImporter protected override void RunImport() { using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read); - using BinaryReader r = new BinaryReader(fs); + using BinaryReader r = new(fs); // 0000: 4-byte signature: "MMV\0" string signature = new(r.ReadChars(4)); @@ -94,8 +94,8 @@ protected override void RunImport() byte[] md5 = r.ReadBytes(16); Result.Movie.HeaderEntries[HeaderKeys.Md5] = md5.BytesToHexString().ToLowerInvariant(); - SMS.SmsSyncSettings ss = new SMS.SmsSyncSettings(); - SMSControllerDeck cd = new SMSControllerDeck(ss.Port1, ss.Port2, isGameGear, ss.UseKeyboard); + SMS.SmsSyncSettings ss = new(); + SMSControllerDeck cd = new(ss.Port1, ss.Port2, isGameGear, ss.UseKeyboard); SimpleController controllers = new(cd.Definition); /* diff --git a/src/BizHawk.Client.Common/movie/import/PjmImport.cs b/src/BizHawk.Client.Common/movie/import/PjmImport.cs index 3c355c3c1e8..f5f962c1728 100644 --- a/src/BizHawk.Client.Common/movie/import/PjmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/PjmImport.cs @@ -14,7 +14,7 @@ protected override void RunImport() Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.PSX; using var fs = SourceFile.OpenRead(); - using BinaryReader br = new BinaryReader(fs); + using BinaryReader br = new(fs); var info = ParseHeader(Result.Movie, "PJM ", br); fs.Seek(info.ControllerDataOffset, SeekOrigin.Begin); @@ -31,7 +31,7 @@ protected override void RunImport() protected MiscHeaderInfo ParseHeader(IMovie movie, string expectedMagic, BinaryReader br) { - MiscHeaderInfo info = new MiscHeaderInfo(); + MiscHeaderInfo info = new(); string magic = new(br.ReadChars(4)); if (magic != expectedMagic) @@ -125,7 +125,7 @@ protected MiscHeaderInfo ParseHeader(IMovie movie, string expectedMagic, BinaryR return info; } - Octoshock.SyncSettings syncSettings = new Octoshock.SyncSettings + Octoshock.SyncSettings syncSettings = new() { FIOConfig = { @@ -172,7 +172,7 @@ protected MiscHeaderInfo ParseHeader(IMovie movie, string expectedMagic, BinaryR protected void ParseBinaryInputLog(BinaryReader br, IMovie movie, MiscHeaderInfo info) { - Octoshock.SyncSettings settings = new Octoshock.SyncSettings(); + Octoshock.SyncSettings settings = new(); settings.FIOConfig.Devices8 = new[] { info.Player1Type, @@ -307,7 +307,7 @@ protected void ParseTextInputLog(BinaryReader br, IMovie movie, MiscHeaderInfo i for (int frame = 0; frame < info.FrameCount; ++frame) { - string mnemonicStr = new string(br.ReadChars(strCount)); + string mnemonicStr = new(br.ReadChars(strCount)); // Junk whitespace at the end of a file if (string.IsNullOrWhiteSpace(mnemonicStr)) diff --git a/src/BizHawk.Client.Common/movie/import/PxmImport.cs b/src/BizHawk.Client.Common/movie/import/PxmImport.cs index f497bf7c3bf..3e1b0c27265 100644 --- a/src/BizHawk.Client.Common/movie/import/PxmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/PxmImport.cs @@ -20,7 +20,7 @@ protected override void RunImport() movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.PSX; using var fs = SourceFile.OpenRead(); - using BinaryReader br = new BinaryReader(fs); + using BinaryReader br = new(fs); var info = ParseHeader(movie, "PXM ", br); fs.Seek(info.ControllerDataOffset, SeekOrigin.Begin); diff --git a/src/BizHawk.Client.Common/movie/import/SmvImport.cs b/src/BizHawk.Client.Common/movie/import/SmvImport.cs index edfbbd5ed62..2305ab262a0 100644 --- a/src/BizHawk.Client.Common/movie/import/SmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/SmvImport.cs @@ -19,7 +19,7 @@ protected override void RunImport() Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.Snes9X; using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read); - using BinaryReader r = new BinaryReader(fs); + using BinaryReader r = new(fs); // 000 4-byte signature: 53 4D 56 1A "SMV\x1A" string signature = new(r.ReadChars(4)); @@ -74,7 +74,7 @@ recording time in Unix epoch format } int highestControllerIndex = 1 + Array.LastIndexOf(controllersUsed, true); - Snes9x.SyncSettings ss = new Snes9x.SyncSettings(); + Snes9x.SyncSettings ss = new(); switch (highestControllerIndex) { @@ -190,7 +190,7 @@ is used (and MOVIE_SYNC_DATA_EXISTS is set), 0 bytes otherwise. Result.Movie.HeaderEntries[HeaderKeys.GameName] = gameName; } - Snes9xControllers _controllers = new Snes9xControllers(ss); + Snes9xControllers _controllers = new(ss); Result.Movie.LogKey = new Bk2LogEntryGenerator("SNES", new Bk2Controller(_controllers.ControllerDefinition)).GenerateLogKey(); SimpleController controllers = new(_controllers.ControllerDefinition); diff --git a/src/BizHawk.Client.Common/movie/import/VbmImport.cs b/src/BizHawk.Client.Common/movie/import/VbmImport.cs index 6d189a68578..93f1a541c3a 100644 --- a/src/BizHawk.Client.Common/movie/import/VbmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/VbmImport.cs @@ -16,7 +16,7 @@ internal class VbmImport : MovieImporter protected override void RunImport() { using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read); - using BinaryReader r = new BinaryReader(fs); + using BinaryReader r = new(fs); bool is_GBC = false; // 000 4-byte signature: 56 42 4D 1A "VBM\x1A" diff --git a/src/BizHawk.Client.Common/movie/import/YmvImport.cs b/src/BizHawk.Client.Common/movie/import/YmvImport.cs index 73b6c0c4573..617516e60f9 100644 --- a/src/BizHawk.Client.Common/movie/import/YmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/YmvImport.cs @@ -13,7 +13,7 @@ internal class YmvImport : MovieImporter protected override void RunImport() { Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.SAT; - Emulation.Cores.Waterbox.NymaCore.NymaSyncSettings ss = new Emulation.Cores.Waterbox.NymaCore.NymaSyncSettings + Emulation.Cores.Waterbox.NymaCore.NymaSyncSettings ss = new() { PortDevices = { diff --git a/src/BizHawk.Client.Common/movie/import/bkm/BkmControllerAdapter.cs b/src/BizHawk.Client.Common/movie/import/bkm/BkmControllerAdapter.cs index e5d30448c49..e7c9e198135 100644 --- a/src/BizHawk.Client.Common/movie/import/bkm/BkmControllerAdapter.cs +++ b/src/BizHawk.Client.Common/movie/import/bkm/BkmControllerAdapter.cs @@ -98,7 +98,7 @@ public void SetControllersAsMnemonic(string mnemonic) } } - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); @@ -220,7 +220,7 @@ public void SetControllersAsMnemonic(string mnemonic) private void SetGBAControllersAsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); if (mnemonic.Length < 2) { @@ -241,7 +241,7 @@ private void SetGBAControllersAsMnemonic(string mnemonic) private void SetGenesis6ControllersAsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); if (mnemonic.Length < 2) @@ -282,7 +282,7 @@ private void SetGenesis6ControllersAsMnemonic(string mnemonic) private void SetGenesis3ControllersAsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); if (mnemonic.Length < 2) @@ -323,7 +323,7 @@ private void SetGenesis3ControllersAsMnemonic(string mnemonic) private void SetSNESControllersAsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); if (mnemonic.Length < 2) @@ -359,7 +359,7 @@ private void SetSNESControllersAsMnemonic(string mnemonic) private void SetLynxControllersAsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); if (mnemonic.Length < 2) @@ -391,7 +391,7 @@ private void SetLynxControllersAsMnemonic(string mnemonic) private void SetN64ControllersAsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); if (mnemonic.Length < 2) @@ -433,7 +433,7 @@ private void SetN64ControllersAsMnemonic(string mnemonic) private void SetSaturnControllersAsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); if (mnemonic.Length < 2) @@ -469,7 +469,7 @@ private void SetSaturnControllersAsMnemonic(string mnemonic) private void SetAtari7800AsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); if (mnemonic.Length < 5) @@ -515,7 +515,7 @@ private void SetAtari7800AsMnemonic(string mnemonic) private void SetDualGameBoyControllerAsMnemonic(string mnemonic) { - MnemonicChecker checker = new MnemonicChecker(mnemonic); + MnemonicChecker checker = new(mnemonic); _myBoolButtons.Clear(); for (int i = 0; i < BkmMnemonicConstants.DgbMnemonic.Length; i++) { @@ -529,7 +529,7 @@ private void SetDualGameBoyControllerAsMnemonic(string mnemonic) private void SetWonderSwanControllerAsMnemonic(string mnemonic) { - MnemonicChecker checker = new MnemonicChecker(mnemonic); + MnemonicChecker checker = new(mnemonic); _myBoolButtons.Clear(); for (int i = 0; i < BkmMnemonicConstants.WsMnemonic.Length; i++) { @@ -543,7 +543,7 @@ private void SetWonderSwanControllerAsMnemonic(string mnemonic) private void SetC64ControllersAsMnemonic(string mnemonic) { - MnemonicChecker c = new MnemonicChecker(mnemonic); + MnemonicChecker c = new(mnemonic); _myBoolButtons.Clear(); for (int player = 1; player <= BkmMnemonicConstants.Players[ControlType]; player++) diff --git a/src/BizHawk.Client.Common/movie/import/bkm/BkmMovie.cs b/src/BizHawk.Client.Common/movie/import/bkm/BkmMovie.cs index 47d498c2220..f59bd08e534 100644 --- a/src/BizHawk.Client.Common/movie/import/bkm/BkmMovie.cs +++ b/src/BizHawk.Client.Common/movie/import/bkm/BkmMovie.cs @@ -19,7 +19,7 @@ public BkmControllerAdapter GetInputState(int frame, ControllerDefinition defini { if (frame < InputLogLength && frame >= 0) { - BkmControllerAdapter adapter = new BkmControllerAdapter(definition, sytemId); + BkmControllerAdapter adapter = new(definition, sytemId); adapter.SetControllersAsMnemonic(_log[frame]); return adapter; } @@ -41,7 +41,7 @@ public string SyncSettingsJson public bool Load() { - FileInfo file = new FileInfo(Filename); + FileInfo file = new(Filename); if (file.Exists == false) { diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs b/src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs index 262d93d62e3..ef3c3ecace0 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs @@ -127,13 +127,13 @@ public void Replace(TasBranch old, TasBranch newBranch) public void Save(ZipStateSaver bs) { - IndexedStateLump nheader = new IndexedStateLump(BinaryStateLump.BranchHeader); - IndexedStateLump ncore = new IndexedStateLump(BinaryStateLump.BranchCoreData); - IndexedStateLump ninput = new IndexedStateLump(BinaryStateLump.BranchInputLog); - IndexedStateLump nframebuffer = new IndexedStateLump(BinaryStateLump.BranchFrameBuffer); - IndexedStateLump ncoreframebuffer = new IndexedStateLump(BinaryStateLump.BranchCoreFrameBuffer); - IndexedStateLump nmarkers = new IndexedStateLump(BinaryStateLump.BranchMarkers); - IndexedStateLump nusertext = new IndexedStateLump(BinaryStateLump.BranchUserText); + IndexedStateLump nheader = new(BinaryStateLump.BranchHeader); + IndexedStateLump ncore = new(BinaryStateLump.BranchCoreData); + IndexedStateLump ninput = new(BinaryStateLump.BranchInputLog); + IndexedStateLump nframebuffer = new(BinaryStateLump.BranchFrameBuffer); + IndexedStateLump ncoreframebuffer = new(BinaryStateLump.BranchCoreFrameBuffer); + IndexedStateLump nmarkers = new(BinaryStateLump.BranchMarkers); + IndexedStateLump nusertext = new(BinaryStateLump.BranchUserText); foreach (var b in this) { bs.PutLump(nheader, tw => tw.WriteLine(JsonConvert.SerializeObject(b.ForSerial))); @@ -151,13 +151,13 @@ public void Save(ZipStateSaver bs) bs.PutLump(nframebuffer, s => { - BitmapBufferVideoProvider vp = new BitmapBufferVideoProvider(b.OSDFrameBuffer); + BitmapBufferVideoProvider vp = new(b.OSDFrameBuffer); QuickBmpFile.Save(vp, s, b.OSDFrameBuffer.Width, b.OSDFrameBuffer.Height); }); bs.PutLump(ncoreframebuffer, s => { - BitmapBufferVideoProvider vp = new BitmapBufferVideoProvider(b.CoreFrameBuffer); + BitmapBufferVideoProvider vp = new(b.CoreFrameBuffer); QuickBmpFile.Save(vp, s, b.CoreFrameBuffer.Width, b.CoreFrameBuffer.Height); }); @@ -177,23 +177,23 @@ public void Save(ZipStateSaver bs) public void Load(ZipStateLoader bl, ITasMovie movie) { - IndexedStateLump nheader = new IndexedStateLump(BinaryStateLump.BranchHeader); - IndexedStateLump ncore = new IndexedStateLump(BinaryStateLump.BranchCoreData); - IndexedStateLump ninput = new IndexedStateLump(BinaryStateLump.BranchInputLog); - IndexedStateLump nframebuffer = new IndexedStateLump(BinaryStateLump.BranchFrameBuffer); - IndexedStateLump ncoreframebuffer = new IndexedStateLump(BinaryStateLump.BranchCoreFrameBuffer); - IndexedStateLump nmarkers = new IndexedStateLump(BinaryStateLump.BranchMarkers); - IndexedStateLump nusertext = new IndexedStateLump(BinaryStateLump.BranchUserText); + IndexedStateLump nheader = new(BinaryStateLump.BranchHeader); + IndexedStateLump ncore = new(BinaryStateLump.BranchCoreData); + IndexedStateLump ninput = new(BinaryStateLump.BranchInputLog); + IndexedStateLump nframebuffer = new(BinaryStateLump.BranchFrameBuffer); + IndexedStateLump ncoreframebuffer = new(BinaryStateLump.BranchCoreFrameBuffer); + IndexedStateLump nmarkers = new(BinaryStateLump.BranchMarkers); + IndexedStateLump nusertext = new(BinaryStateLump.BranchUserText); Clear(); while (true) { - TasBranch b = new TasBranch(); + TasBranch b = new(); if (!bl.GetLump(nheader, abort: false, tr => { - dynamic header = (dynamic)JsonConvert.DeserializeObject(tr.ReadLine()); + dynamic header = JsonConvert.DeserializeObject(tr.ReadLine()); b.Frame = (int)header.Frame; var timestamp = header.TimeStamp; diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs index 5cf229a4ad0..9bb05264e0a 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs @@ -187,7 +187,7 @@ public void RemoveFrames(int removeStart, int removeUpTo) public void InsertInput(int frame, string inputState) { - List inputLog = new List { inputState }; + List inputLog = new() { inputState }; InsertInput(frame, inputLog); // ChangeLog handled within } @@ -206,7 +206,7 @@ public void InsertInput(int frame, IEnumerable inputLog) public void InsertInput(int frame, IEnumerable inputStates) { // ChangeLog is done in the InsertInput call. - List inputLog = new List(); + List inputLog = new(); foreach (var input in inputStates) { diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index be9f33f62bc..d6fb9d2bc24 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -52,7 +52,7 @@ public override void Attach(IEmulator emulator) } else { - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); if (StartsFromSaveRam && emulator.HasSaveRam()) { emulator.AsSaveRam().StoreSaveRam(SaveRam!); @@ -214,7 +214,7 @@ public override bool ExtractInputLog(TextReader reader, out string errorMessage) errorMessage = ""; int? stateFrame = null; - List newLog = new List(); + List newLog = new(); int? timelineBranchFrame = null; // We are in record mode so replace the movie log with the one from the savestate diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs index 92ec7906319..d50c1d2abc4 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs @@ -86,7 +86,7 @@ public TasMovieMarkerList(ITasMovie movie) public TasMovieMarkerList DeepClone() { - TasMovieMarkerList ret = new TasMovieMarkerList(_movie); + TasMovieMarkerList ret = new(_movie); for (int i = 0; i < Count; i++) { // used to copy markers between branches @@ -104,7 +104,7 @@ private void OnListChanged(NotifyCollectionChangedAction action) => public override string ToString() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (var marker in this) { sb.AppendLine(marker.ToString()); diff --git a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs index d151b637283..89de1a0dd7d 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs @@ -267,7 +267,7 @@ internal void CaptureReserved(int frame, IStatable source) return; } - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); source.SaveStateBinary(new BinaryWriter(ms)); _reserved.Add(frame, ms.ToArray()); AddStateCache(frame); @@ -547,7 +547,7 @@ public static ZwinderStateManager Create(BinaryReader br, ZwinderStateManagerSet if (version == 0) settings.AncientStateInterval = br.ReadInt32(); - ZwinderStateManager ret = new ZwinderStateManager(current, recent, gaps, reserveCallback, settings); + ZwinderStateManager ret = new(current, recent, gaps, reserveCallback, settings); int ancientCount = br.ReadInt32(); for (int i = 0; i < ancientCount; i++) diff --git a/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs b/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs index e4e6007bdb4..aba69ec7c47 100644 --- a/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs +++ b/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs @@ -88,7 +88,7 @@ public unsafe void Capture(int frame) return; if (_masterFrame == -1) { - SaveStateStream sss = new SaveStateStream(this); + SaveStateStream sss = new(this); _stateSource.SaveStateBinary(new BinaryWriter(sss)); (_master, _scratch) = (_scratch, _master); _masterLength = (int)sss.Position; @@ -100,7 +100,7 @@ public unsafe void Capture(int frame) return; { - SaveStateStream sss = new SaveStateStream(this); + SaveStateStream sss = new(this); _stateSource.SaveStateBinary(new BinaryWriter(sss)); Work(() => @@ -116,7 +116,7 @@ public unsafe void Capture(int frame) } int lengthHolder = _masterLength; - ReadOnlySpan lengthHolderSpan = new ReadOnlySpan(&lengthHolder, 4); + ReadOnlySpan lengthHolderSpan = new(&lengthHolder, 4); zeldas.Write(lengthHolderSpan); @@ -192,7 +192,7 @@ public unsafe void Capture(int frame) private unsafe void RefillMaster(ZwinderBuffer.StateInformation state) { int lengthHolder = 0; - Span lengthHolderSpan = new Span(&lengthHolder, 4); + Span lengthHolderSpan = new(&lengthHolder, 4); using var rs = state.GetReadStream(); var zeldas = SpanStream.GetOrBuild(rs); zeldas.Read(lengthHolderSpan); diff --git a/src/BizHawk.Client.Common/rewind/Zwinder.cs b/src/BizHawk.Client.Common/rewind/Zwinder.cs index 15f99dbc61a..79836ba3570 100644 --- a/src/BizHawk.Client.Common/rewind/Zwinder.cs +++ b/src/BizHawk.Client.Common/rewind/Zwinder.cs @@ -72,7 +72,7 @@ public bool Rewind(int frameToAvoid) { state = _buffer.GetState(index - 1); } - using BinaryReader br = new BinaryReader(state.GetReadStream()); + using BinaryReader br = new(state.GetReadStream()); _stateSource.LoadStateBinary(br); _buffer.InvalidateEnd(index); } @@ -80,7 +80,7 @@ public bool Rewind(int frameToAvoid) { // The emulator will frame advance without giving us a chance to // re-capture this frame, so we shouldn't invalidate this state just yet. - using BinaryReader br = new BinaryReader(state.GetReadStream()); + using BinaryReader br = new(state.GetReadStream()); _stateSource.LoadStateBinary(br); } return true; diff --git a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs index 1a0382efa4d..277c7c6319b 100644 --- a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs +++ b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs @@ -33,7 +33,7 @@ public ZwinderBuffer(IRewindSettings settings) { case IRewindSettings.BackingStoreType.Memory: { - MemoryBlock buffer = new MemoryBlock((ulong)Size); + MemoryBlock buffer = new((ulong)Size); buffer.Protect(buffer.Start, buffer.Size, MemoryBlock.Protection.RW); _disposables.Add(buffer); _backingStore = new MemoryViewStream(true, true, (long)buffer.Start, (long)buffer.Size); @@ -42,8 +42,8 @@ public ZwinderBuffer(IRewindSettings settings) } case IRewindSettings.BackingStoreType.TempFile: { - string filename = TempFileManager.GetTempFilename("ZwinderBuffer"); - FileStream filestream = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 4096, FileOptions.DeleteOnClose); + string filename = TempFileManager.GetTempFilename("ZwinderBuffer"); + FileStream filestream = new(filename, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 4096, FileOptions.DeleteOnClose); filestream.SetLength(Size); _backingStore = filestream; _disposables.Add(filestream); @@ -230,7 +230,7 @@ long notifySizeReached() ? (_states[_firstStateIndex].Start - start) & _sizeMask : Size; } - SaveStateStream stream = new SaveStateStream(_backingStore, start, _sizeMask, initialMaxSize, notifySizeReached); + SaveStateStream stream = new(_backingStore, start, _sizeMask, initialMaxSize, notifySizeReached); if (_useCompression) { diff --git a/src/BizHawk.Client.Common/savestates/SavestateFile.cs b/src/BizHawk.Client.Common/savestates/SavestateFile.cs index defd701cc13..036823636fc 100644 --- a/src/BizHawk.Client.Common/savestates/SavestateFile.cs +++ b/src/BizHawk.Client.Common/savestates/SavestateFile.cs @@ -45,7 +45,7 @@ public void Create(string filename, SaveStateConfig config) { // the old method of text savestate save is now gone. // a text savestate is just like a binary savestate, but with a different core lump - using ZipStateSaver bs = new ZipStateSaver(filename, config.CompressionLevelNormal); + using ZipStateSaver bs = new(filename, config.CompressionLevelNormal); using (new SimpleTime("Save Core")) { diff --git a/src/BizHawk.Client.Common/savestates/ZipStateLoader.cs b/src/BizHawk.Client.Common/savestates/ZipStateLoader.cs index 66c0775f6f6..79bc07290bb 100644 --- a/src/BizHawk.Client.Common/savestates/ZipStateLoader.cs +++ b/src/BizHawk.Client.Common/savestates/ZipStateLoader.cs @@ -45,7 +45,7 @@ private void ReadZipVersion(Stream s, long length) } else { - StreamReader sr = new StreamReader(s); + StreamReader sr = new(s); _ver = new Version(1, 0, int.Parse(sr.ReadLine())); } @@ -71,9 +71,9 @@ private void PopulateEntries() private static readonly byte[] Zipheader = { 0x50, 0x4b, 0x03, 0x04 }; public static ZipStateLoader LoadAndDetect(string filename, bool isMovieLoad = false) { - ZipStateLoader ret = new ZipStateLoader(); + ZipStateLoader ret = new(); - using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)) + using (FileStream fs = new(filename, FileMode.Open, FileAccess.Read)) { byte[] data = new byte[4]; fs.Read(data, 0, 4); diff --git a/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs b/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs index fcd448c1ef5..f2d849ea368 100644 --- a/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs +++ b/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs @@ -12,13 +12,13 @@ public class ZipStateSaver : IDisposable private static void WriteZipVersion(Stream s) { - using StreamWriter sw = new StreamWriter(s); + using StreamWriter sw = new(s); sw.WriteLine("2"); // version 1.0.2 } private static void WriteEmuVersion(Stream s) { - using StreamWriter sw = new StreamWriter(s); + using StreamWriter sw = new(s); sw.WriteLine(VersionInfo.GetEmuVersion()); } @@ -38,7 +38,7 @@ public void PutLump(BinaryStateLump lump, Action callback) { PutLump(lump, s => { - BinaryWriter bw = new BinaryWriter(s); + BinaryWriter bw = new(s); callback(bw); bw.Flush(); }); diff --git a/src/BizHawk.Client.Common/tools/CheatList.cs b/src/BizHawk.Client.Common/tools/CheatList.cs index f8f63e349a7..641c54126d6 100644 --- a/src/BizHawk.Client.Common/tools/CheatList.cs +++ b/src/BizHawk.Client.Common/tools/CheatList.cs @@ -82,7 +82,7 @@ public bool Changes /// public bool AttemptToLoadCheatFile(IMemoryDomains domains) { - FileInfo file = new FileInfo(_defaultFileName); + FileInfo file = new(_defaultFileName); return file.Exists && Load(domains, file.FullName, false); } @@ -256,13 +256,13 @@ public bool SaveFile(string path) { try { - FileInfo file = new FileInfo(path); + FileInfo file = new(path); if (file.Directory != null && !file.Directory.Exists) { file.Directory.Create(); } - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (var cheat in _cheatList) { @@ -309,7 +309,7 @@ public bool SaveFile(string path) public bool Load(IMemoryDomains domains, string path, bool append) { - FileInfo file = new FileInfo(path); + FileInfo file = new(path); if (file.Exists == false) { return false; diff --git a/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs b/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs index 70d5c5e9c52..e99121cbb3b 100644 --- a/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs +++ b/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs @@ -199,7 +199,7 @@ public void ClearChangeCounts() /// Defines the order of the sort. Ascending (true) or descending (false) public void OrderWatches(string column, bool reverse) { - List separatorIndices = new List(); + List separatorIndices = new(); for (int i = 0; i < _watchList.Count; i++) { if (_watchList[i].IsSeparator) @@ -330,9 +330,9 @@ public bool Save() return false; } - using (StreamWriter sw = new StreamWriter(CurrentFileName)) + using (StreamWriter sw = new(CurrentFileName)) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb.Append("SystemID ").AppendLine(_systemId); foreach (var watch in _watchList) @@ -360,7 +360,7 @@ public bool SaveAs(FileInfo file) private bool LoadFile(string path, bool append) { - FileInfo file = new FileInfo(path); + FileInfo file = new(path); if (file.Exists == false) { return false; diff --git a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs b/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs index e9a3381d693..b3367116cd6 100644 --- a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs +++ b/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs @@ -91,7 +91,7 @@ private void LblMagicDragArea_DragEnter(object sender, DragEventArgs e) private static List ValidateDrop(IDataObject ido) { - List ret = new List(); + List ret = new(); string[] files = (string[])ido.GetData(DataFormats.FileDrop); if (files == null) return new(); foreach (string str in files) diff --git a/src/BizHawk.Client.DiscoHawk/Program.cs b/src/BizHawk.Client.DiscoHawk/Program.cs index f7ef4cfbda6..0fa3e816c0f 100644 --- a/src/BizHawk.Client.DiscoHawk/Program.cs +++ b/src/BizHawk.Client.DiscoHawk/Program.cs @@ -32,7 +32,7 @@ static Program() // otherwise, some people will have crashes at boot-up due to .net security disliking MOTW. // some people are getting MOTW through a combination of browser used to download BizHawk, and program used to dearchive it static void RemoveMOTW(string path) => DeleteFileW($"{path}:Zone.Identifier"); - Queue todo = new Queue(new[] { new DirectoryInfo(dllDir) }); + Queue todo = new(new[] { new DirectoryInfo(dllDir) }); while (todo.Count != 0) { var di = todo.Dequeue(); @@ -70,7 +70,7 @@ private static void SubMain(string[] args) if (args.Length == 0) { - using MainDiscoForm dialog = new MainDiscoForm(); + using MainDiscoForm dialog = new(); dialog.ShowDialog(); } else @@ -79,7 +79,7 @@ private static void SubMain(string[] args) args, results => { - using ComparisonResults cr = new ComparisonResults { textBox1 = { Text = results } }; + using ComparisonResults cr = new() { textBox1 = { Text = results } }; cr.ShowDialog(); }); } diff --git a/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs index 4d33cccc834..205e7041830 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs @@ -259,7 +259,7 @@ private void Segment() /// public IDisposable AcquireVideoCodecToken(Config config) { - Parameters tempParams = new Parameters + Parameters tempParams = new() { height = 256, width = 256, @@ -269,7 +269,7 @@ public IDisposable AcquireVideoCodecToken(Config config) a_samplerate = 44100, a_channels = 2 }; - AviWriterSegment temp = new AviWriterSegment(); + AviWriterSegment temp = new(); string tempfile = Path.GetTempFileName(); File.Delete(tempfile); tempfile = Path.ChangeExtension(tempfile, "avi"); @@ -427,7 +427,7 @@ private static string Decode_mmioFOURCC(int code) public static CodecToken CreateFromAVICOMPRESSOPTIONS(ref AVIWriterImports.AVICOMPRESSOPTIONS opts) { - CodecToken ret = new CodecToken + CodecToken ret = new() { _comprOptions = opts, codec = Decode_mmioFOURCC(opts.fccHandler), @@ -477,8 +477,8 @@ public void AllocateToAVICOMPRESSOPTIONS(ref AVIWriterImports.AVICOMPRESSOPTIONS private byte[] SerializeToByteArray() { - MemoryStream m = new MemoryStream(); - BinaryWriter b = new BinaryWriter(m); + MemoryStream m = new(); + BinaryWriter b = new(m); b.Write(_comprOptions.fccType); b.Write(_comprOptions.fccHandler); @@ -499,8 +499,8 @@ private byte[] SerializeToByteArray() private static CodecToken DeSerializeFromByteArray(byte[] data) { - MemoryStream m = new MemoryStream(data, false); - BinaryReader b = new BinaryReader(m); + MemoryStream m = new(data, false); + BinaryReader b = new(m); AVIWriterImports.AVICOMPRESSOPTIONS comprOptions = new(); @@ -535,7 +535,7 @@ private static CodecToken DeSerializeFromByteArray(byte[] data) b.Close(); } - CodecToken ret = new CodecToken + CodecToken ret = new() { _comprOptions = comprOptions, Format = format, diff --git a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs index a0c92b90662..cc1db0d280e 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs @@ -37,9 +37,9 @@ private void Download() try { - using (ManualResetEvent evt = new ManualResetEvent(false)) + using (ManualResetEvent evt = new(false)) { - using System.Net.WebClient client = new System.Net.WebClient(); + using System.Net.WebClient client = new(); System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; client.DownloadFileAsync(new Uri(FFmpegService.Url), fn); client.DownloadProgressChanged += (object sender, System.Net.DownloadProgressChangedEventArgs e) => @@ -74,7 +74,7 @@ private void Download() return; //try acquiring file - using (HawkFile hf = new HawkFile(fn)) + using (HawkFile hf = new(fn)) { using var exe = OSTailoredCode.IsUnixHost ? hf.BindArchiveMember("ffmpeg") : hf.BindFirstOf(".exe"); byte[] data = exe!.ReadAllBytes(); @@ -116,7 +116,7 @@ private void btnDownload_Click(object sender, EventArgs e) failed = false; succeeded = false; pct = 0; - Thread t = new Thread(ThreadProc); + Thread t = new(ThreadProc); t.Start(); } diff --git a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs index ec25d9d1ac8..2c77a7a28a5 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs @@ -168,7 +168,7 @@ private string FfmpegGetError() _ffmpeg.CancelErrorRead(); } - StringBuilder s = new StringBuilder(); + StringBuilder s = new(); s.Append(_commandline); s.Append('\n'); while (_stderr.Count > 0) @@ -212,7 +212,7 @@ public IDisposable AcquireVideoCodecToken(Config config) { if (!FFmpegService.QueryServiceAvailable()) { - using FFmpegDownloaderForm form = new FFmpegDownloaderForm(); + using FFmpegDownloaderForm form = new(); _dialogParent.ShowDialogWithTempMute(form); if (!FFmpegService.QueryServiceAvailable()) return null; } diff --git a/src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs index 3804b2506d9..6c0e3a81aa6 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs @@ -168,7 +168,7 @@ public void AddFrame(IVideoProvider source) return; // skip this frame } - using Bitmap bmp = new Bitmap(source.BufferWidth, source.BufferHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb); + using Bitmap bmp = new(source.BufferWidth, source.BufferHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb); var data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Runtime.InteropServices.Marshal.Copy(source.GetVideoBuffer(), 0, data.Scan0, bmp.Width * bmp.Height); bmp.UnlockBits(data); diff --git a/src/BizHawk.Client.EmuHawk/AVOut/GifWriterForm.cs b/src/BizHawk.Client.EmuHawk/AVOut/GifWriterForm.cs index 282f5406c95..87132af371e 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/GifWriterForm.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/GifWriterForm.cs @@ -13,7 +13,7 @@ public GifWriterForm() public static GifWriter.GifToken DoTokenForm(IWin32Window parent, Config config) { - using GifWriterForm dlg = new GifWriterForm + using GifWriterForm dlg = new() { numericUpDown1 = { Value = config.GifWriterFrameskip }, numericUpDown2 = { Value = config.GifWriterDelay } diff --git a/src/BizHawk.Client.EmuHawk/AVOut/JMDForm.cs b/src/BizHawk.Client.EmuHawk/AVOut/JMDForm.cs index 0ca3fec4c87..cd137ddc0c1 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/JMDForm.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/JMDForm.cs @@ -35,7 +35,7 @@ private void CompressionBar_Scroll(object sender, EventArgs e) /// false if user canceled; true if user consented public static bool DoCompressionDlg(ref int threads, ref int compLevel, int tMin, int tMax, int cMin, int cMax, IWin32Window hwnd) { - JmdForm j = new JmdForm + JmdForm j = new() { threadsBar = { Minimum = tMin, Maximum = tMax }, compressionBar = { Minimum = cMin, Maximum = cMax } diff --git a/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs index 1b7ecd9437e..0d82509bd02 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs @@ -375,7 +375,7 @@ private void WriteActual(JmdPacket j) /// zlibed frame with width and height prepended public void AddVideo(byte[] source) { - JmdPacket j = new JmdPacket + JmdPacket j = new() { Stream = 0, Subtype = 1,// zlib compressed, other possibility is 0 = uncompressed @@ -416,7 +416,7 @@ public void AddSamples(short[] samples) /// right sample private void DoAudioPacket(short l, short r) { - JmdPacket j = new JmdPacket + JmdPacket j = new() { Stream = 1, Subtype = 1, // raw PCM audio @@ -542,7 +542,7 @@ public void SetVideoCodecToken(IDisposable token) public IDisposable AcquireVideoCodecToken(Config config) { - CodecToken ret = new CodecToken(); + CodecToken ret = new(); // load from config and sanitize int t = Math.Min(Math.Max(config.JmdThreads, 1), 6); @@ -712,7 +712,7 @@ public VideoCopy(IVideoProvider c) /// zlib compressed frame, with width and height prepended private byte[] GzipFrame(VideoCopy v) { - MemoryStream m = new MemoryStream(); + MemoryStream m = new(); // write frame height and width first m.WriteByte((byte)(v.BufferWidth >> 8)); @@ -720,7 +720,7 @@ private byte[] GzipFrame(VideoCopy v) m.WriteByte((byte)(v.BufferHeight >> 8)); m.WriteByte((byte)(v.BufferHeight & 255)); - GZipStream g = new GZipStream(m, GetCompressionLevel(_token.CompressionLevel), true); // leave memory stream open so we can pick its contents + GZipStream g = new(m, GetCompressionLevel(_token.CompressionLevel), true); // leave memory stream open so we can pick its contents g.Write(v.VideoBuffer, 0, v.VideoBuffer.Length); g.Flush(); g.Close(); diff --git a/src/BizHawk.Client.EmuHawk/AVOut/NutMuxer.cs b/src/BizHawk.Client.EmuHawk/AVOut/NutMuxer.cs index b4ea1442828..2b20e1ed375 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/NutMuxer.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/NutMuxer.cs @@ -230,7 +230,7 @@ public NutPacket(StartCode startCode, Stream underlying) public override void Flush() { // first, prep header - MemoryStream header = new MemoryStream(); + MemoryStream header = new(); WriteBe64((ulong)_startCode, header); WriteVarU(_data.Length + 4, header); // +4 for checksum if (_data.Length > 4092) @@ -323,7 +323,7 @@ private void WriteMainHeader() byte[] tmp = Encoding.ASCII.GetBytes("nut/multimedia container\0"); _output.Write(tmp, 0, tmp.Length); - NutPacket header = new NutPacket(NutPacket.StartCode.Main, _output); + NutPacket header = new(NutPacket.StartCode.Main, _output); WriteVarU(3, header); // version WriteVarU(2, header); // stream_count @@ -355,7 +355,7 @@ private void WriteMainHeader() // write out the 0th stream header (video) private void WriteVideoHeader() { - NutPacket header = new NutPacket(NutPacket.StartCode.Stream, _output); + NutPacket header = new(NutPacket.StartCode.Stream, _output); WriteVarU(0, header); // stream_id WriteVarU(0, header); // stream_class = video WriteString("BGRA", header); // fourcc = "BGRA" @@ -379,7 +379,7 @@ private void WriteVideoHeader() // write out the 1st stream header (audio) private void WriteAudioHeader() { - NutPacket header = new NutPacket(NutPacket.StartCode.Stream, _output); + NutPacket header = new(NutPacket.StartCode.Stream, _output); WriteVarU(1, header); // stream_id WriteVarU(1, header); // stream_class = audio WriteString("\x01\x00\x00\x00", header); // fourcc = 01 00 00 00 @@ -445,16 +445,16 @@ public NutFrame(byte[] payload, int payLoadLen, ulong pts, ulong ptsNum, ulong p _pool = pool; _data = pool.GetBufferAtLeast(payLoadLen + 2048); - MemoryStream frame = new MemoryStream(_data); + MemoryStream frame = new(_data); // create syncpoint - NutPacket sync = new NutPacket(NutPacket.StartCode.Syncpoint, frame); + NutPacket sync = new(NutPacket.StartCode.Syncpoint, frame); WriteVarU(pts * 2 + (ulong)ptsIndex, sync); // global_key_pts WriteVarU(1, sync); // back_ptr_div_16, this is wrong sync.Flush(); - MemoryStream frameHeader = new MemoryStream(); + MemoryStream frameHeader = new(); frameHeader.WriteByte(0); // frame_code // frame_flags = FLAG_CODED, so: @@ -532,7 +532,7 @@ public void WriteVideoFrame(int[] video) _videoDone = true; } - NutFrame f = new NutFrame(data, dataLen, _videoOpts, (ulong) _avParams.FpsDen, (ulong) _avParams.FpsNum, 0, _bufferPool); + NutFrame f = new(data, dataLen, _videoOpts, (ulong) _avParams.FpsDen, (ulong) _avParams.FpsNum, 0, _bufferPool); _bufferPool.ReleaseBuffer(data); _videoOpts++; _videoQueue.Enqueue(f); @@ -566,7 +566,7 @@ public void WriteAudioFrame(short[] samples) _audioDone = true; } - NutFrame f = new NutFrame(data, dataLen, _audioPts, 1, (ulong)_avParams.Samplerate, 1, _bufferPool); + NutFrame f = new(data, dataLen, _audioPts, 1, (ulong)_avParams.Samplerate, 1, _bufferPool); _bufferPool.ReleaseBuffer(data); _audioPts += (ulong)samples.Length / (ulong)_avParams.Channels; _audioQueue.Enqueue(f); diff --git a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecorder.cs b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecorder.cs index 3a4cb05f496..90a5a307267 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecorder.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecorder.cs @@ -39,7 +39,7 @@ public void OpenFile(string projFile) _mBaseDirectory = dir ?? string.Empty; string framesDirFragment = $"{fileNoExt}_frames"; _mFramesDirectory = Path.Combine(_mBaseDirectory, framesDirFragment); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb.AppendLine("version=1"); sb.AppendLine($"framesdir={framesDirFragment}"); File.WriteAllText(_mProjectFile, sb.ToString()); @@ -51,7 +51,7 @@ public void CloseFile() public void AddFrame(IVideoProvider source) { - using BitmapBuffer bb = new BitmapBuffer(source.BufferWidth, source.BufferHeight, source.GetVideoBuffer()); + using BitmapBuffer bb = new(source.BufferWidth, source.BufferHeight, source.GetVideoBuffer()); string subPath = GetAndCreatePathForFrameNum(_mCurrFrame); string path = $"{subPath}.png"; bb.ToSysdrawingBitmap().Save(path, ImageFormat.Png); @@ -61,7 +61,7 @@ public void AddSamples(short[] samples) { string subPath = GetAndCreatePathForFrameNum(_mCurrFrame); string path = $"{subPath}.wav"; - WavWriterV wwv = new WavWriterV(); + WavWriterV wwv = new(); wwv.SetAudioParameters(_paramSampleRate, _paramChannels, _paramBits); wwv.OpenFile(path); wwv.AddSamples(samples); @@ -120,7 +120,7 @@ private static List StringChunkSplit(string s, int len) } int numChunks = (s.Length + len - 1) / len; - List output = new List(numChunks); + List output = new(numChunks); for (int i = 0, j = 0; i < numChunks; i++, j += len) { int todo = len; diff --git a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs index c9d194a3404..2d4c6613697 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs @@ -108,7 +108,7 @@ private void BtnExport_Click(object sender, EventArgs e) } int width, height; - using(Bitmap bmp = new Bitmap(_mFrameInfos[0].PngPath)) + using(Bitmap bmp = new(_mFrameInfos[0].PngPath)) { width = bmp.Width; height = bmp.Height; @@ -120,7 +120,7 @@ private void BtnExport_Click(object sender, EventArgs e) initFileName: initFileName); if (result is null) return; - using AviWriter avw = new AviWriter(this); + using AviWriter avw = new(this); avw.SetAudioParameters(44100, 2, 16); // hacky avw.SetMovieParameters(60, 1); // hacky avw.SetVideoParameters(width, height); @@ -129,17 +129,17 @@ private void BtnExport_Click(object sender, EventArgs e) avw.OpenFile(result); foreach (var fi in _mFrameInfos) { - using (BitmapBuffer bb = new BitmapBuffer(fi.PngPath, new BitmapLoadOptions())) + using (BitmapBuffer bb = new(fi.PngPath, new BitmapLoadOptions())) { - BitmapBufferVideoProvider bbvp = new BitmapBufferVideoProvider(bb); + BitmapBufferVideoProvider bbvp = new(bb); avw.AddFrame(bbvp); } // offset = 44 dec byte[] wavBytes = File.ReadAllBytes(fi.WavPath); - MemoryStream ms = new MemoryStream(wavBytes) { Position = 44 }; - BinaryReader br = new BinaryReader(ms); - List sampleData = new List(); + MemoryStream ms = new(wavBytes) { Position = 44 }; + BinaryReader br = new(ms); + List sampleData = new(); while (br.BaseStream.Position != br.BaseStream.Length) { sampleData.Add(br.ReadInt16()); diff --git a/src/BizHawk.Client.EmuHawk/AVOut/VideoWriterChooserForm.cs b/src/BizHawk.Client.EmuHawk/AVOut/VideoWriterChooserForm.cs index 520e14e4a44..d4e21ddf8d8 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/VideoWriterChooserForm.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/VideoWriterChooserForm.cs @@ -64,7 +64,7 @@ public static IVideoWriter DoVideoWriterChooserDlg( Config config) where T : IMainFormForTools, IDialogParent { - VideoWriterChooserForm dlg = new VideoWriterChooserForm(owner, emulator, config) + VideoWriterChooserForm dlg = new(owner, emulator, config) { checkBoxASync = { Checked = config.VideoWriterAudioSyncEffective }, checkBoxPad = { Checked = config.AVWriterPad }, diff --git a/src/BizHawk.Client.EmuHawk/Api/ApiManager.cs b/src/BizHawk.Client.EmuHawk/Api/ApiManager.cs index 35575e28ef0..bff9cfb81ac 100644 --- a/src/BizHawk.Client.EmuHawk/Api/ApiManager.cs +++ b/src/BizHawk.Client.EmuHawk/Api/ApiManager.cs @@ -16,7 +16,7 @@ public static class ApiManager static ApiManager() { - List<(Type, Type, ConstructorInfo, Type[])> list = new List<(Type, Type, ConstructorInfo, Type[])>(); + List<(Type, Type, ConstructorInfo, Type[])> list = new(); foreach (var implType in Common.ReflectionCache.Types.Concat(ReflectionCache.Types) .Where(t => /*t.IsClass &&*/t.IsSealed)) // small optimisation; api impl. types are all sealed classes { @@ -44,7 +44,7 @@ private static ApiContainer Register( IEmulator emulator, IGameInfo game) { - Dictionary avail = new Dictionary + Dictionary avail = new() { [typeof(Action)] = logCallback, [typeof(IMainFormForApi)] = mainForm, diff --git a/src/BizHawk.Client.EmuHawk/ArchiveChooser.cs b/src/BizHawk.Client.EmuHawk/ArchiveChooser.cs index 813d9789b61..1e6a9e09fe9 100644 --- a/src/BizHawk.Client.EmuHawk/ArchiveChooser.cs +++ b/src/BizHawk.Client.EmuHawk/ArchiveChooser.cs @@ -30,7 +30,7 @@ public ArchiveChooser(HawkFile hawkFile) for (int i = 0; i < items.Count; i++) { var item = items[i]; - ListViewItem lvi = new ListViewItem { Tag = i }; + ListViewItem lvi = new() { Tag = i }; lvi.SubItems.Add(new ListViewItem.ListViewSubItem()); lvi.Text = item.Name; long size = item.Size; diff --git a/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs b/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs index f779cb2ed42..56ddef5b511 100644 --- a/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs +++ b/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs @@ -29,7 +29,7 @@ public CoreInfo(IEmulator emu) var ser = emu.ServiceProvider; foreach (var t in ser.AvailableServices.Where(type => type != emu.GetType())) { - ServiceInfo si = new ServiceInfo(t, ser.GetService(t)); + ServiceInfo si = new(t, ser.GetService(t)); Services.Add(si.TypeName, si); } @@ -123,7 +123,7 @@ public CoreFeatureAnalysis() private TreeNode CreateCoreTree(CoreInfo ci) { - TreeNode ret = new TreeNode + TreeNode ret = new() { Text = ci.CoreName + (ci.Released ? "" : " (UNRELEASED)"), ForeColor = ci.Released ? Color.Black : Color.DarkGray @@ -132,7 +132,7 @@ private TreeNode CreateCoreTree(CoreInfo ci) foreach (var service in ci.Services.Values) { string img = service.Complete ? "Good" : "Bad"; - TreeNode serviceNode = new TreeNode + TreeNode serviceNode = new() { Text = service.TypeName, ForeColor = service.Complete ? Color.Black : Color.Red, @@ -162,7 +162,7 @@ private TreeNode CreateCoreTree(CoreInfo ci) && !ci.Services.ContainsKey(t.ToString()) && !ci.NotApplicableTypes.Contains(t.ToString()))) { string img = "Bad"; - TreeNode serviceNode = new TreeNode + TreeNode serviceNode = new() { Text = service.ToString(), ForeColor = Color.Red, @@ -222,7 +222,7 @@ private void DoAllCoresTree(CoreInfo current_ci) if (!KnownCores.ContainsKey(core.Name)) { string img = "Unknown"; - TreeNode coreNode = new TreeNode + TreeNode coreNode = new() { Text = core.Name + (core.CoreAttr.Released ? "" : " (UNRELEASED)"), ForeColor = core.CoreAttr.Released ? Color.Black : Color.DarkGray, @@ -239,7 +239,7 @@ private void DoAllCoresTree(CoreInfo current_ci) public override void Restart() { - CoreInfo ci = new CoreInfo(Emulator); + CoreInfo ci = new(Emulator); KnownCores[ci.CoreName] = ci; DoCurrentCoreTree(ci); diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.cs b/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.cs index a5b03efd0a9..705d2afd7a2 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.cs @@ -67,7 +67,7 @@ protected override void OnPaint(PaintEventArgs e) { var rc = ClientRectangle; StringFormat fmt = new(StringFormat.GenericTypographic); - using SolidBrush br = new SolidBrush(ForeColor); + using SolidBrush br = new(ForeColor); e.Graphics.DrawString(this.Text, this.Font, br, rc, fmt); } } diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/FolderBrowserDialogEx.cs b/src/BizHawk.Client.EmuHawk/CustomControls/FolderBrowserDialogEx.cs index 72dae12316a..bb2958a0298 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/FolderBrowserDialogEx.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/FolderBrowserDialogEx.cs @@ -57,7 +57,7 @@ int Callback(IntPtr hwnd, uint uMsg, IntPtr lParam, IntPtr lpData) try { var buffer = Marshal.AllocHGlobal(Win32Imports.MAX_PATH); - Win32Imports.BROWSEINFO bi = new Win32Imports.BROWSEINFO + Win32Imports.BROWSEINFO bi = new() { hwndOwner = hWndOwner, pidlRoot = pidlRoot, @@ -69,7 +69,7 @@ int Callback(IntPtr hwnd, uint uMsg, IntPtr lParam, IntPtr lpData) pidlRet = Win32Imports.SHBrowseForFolder(ref bi); Marshal.FreeHGlobal(buffer); if (pidlRet == IntPtr.Zero) return DialogResult.Cancel; // user clicked Cancel - StringBuilder sb = new StringBuilder(Win32Imports.MAX_PATH); + StringBuilder sb = new(Win32Imports.MAX_PATH); if (Win32Imports.SHGetPathFromIDList(pidlRet, sb) == 0) return DialogResult.Cancel; SelectedPath = sb.ToString(); } diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs index aef2e1ec33a..a910ba8796a 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs @@ -625,7 +625,7 @@ private void DoBackGroundCallback(List visibleColumns, Rectangle rec if (itemColor != Color.White) // An easy optimization, don't draw unless the user specified something other than the default { - Cell cell = new Cell + Cell cell = new() { Column = column, RowIndex = i diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index 11875e4f652..459b1191ba9 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -957,7 +957,7 @@ public IEnumerable GenerateContextMenuItems() { yield return new ToolStripSeparator(); - ToolStripMenuItem rotate = new ToolStripMenuItem + ToolStripMenuItem rotate = new() { Name = "RotateMenuItem", Text = "Rotate", @@ -1841,7 +1841,7 @@ private bool IsPointingOnCellEdge(int? x) => x.HasValue /// The cell with row number and RollColumn reference, both of which can be null. private Cell CalculatePointedCell(int x, int y) { - Cell newCell = new Cell(); + Cell newCell = new(); List columns = AllColumns.VisibleColumns.ToList(); // If pointing to a column header diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/MiscControls.cs b/src/BizHawk.Client.EmuHawk/CustomControls/MiscControls.cs index db614c7c2b4..36dda079b79 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/MiscControls.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/MiscControls.cs @@ -29,15 +29,15 @@ public bool? ForceChecked protected override void OnPaint(PaintEventArgs pevent) { // draw text-label part of the control with something so that it isn't hallofmirrorsy - using(SolidBrush brush = new SolidBrush(Parent.BackColor)) + using(SolidBrush brush = new(Parent.BackColor)) pevent.Graphics.FillRectangle(brush, ClientRectangle); - Rectangle r = new Rectangle(ClientRectangle.Location, SystemInformation.MenuCheckSize); + Rectangle r = new(ClientRectangle.Location, SystemInformation.MenuCheckSize); var glyphLoc = ClientRectangle; glyphLoc.Size = SystemInformation.MenuCheckSize; // draw the selectedbackdrop color roughly where the glyph belongs - using (SolidBrush brush = new SolidBrush(_checkBackColor)) + using (SolidBrush brush = new(_checkBackColor)) pevent.Graphics.FillRectangle(brush, glyphLoc); // draw a checkbox menu glyph (we could do this more elegantly with DrawFrameControl) diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/ViewportPanel.cs b/src/BizHawk.Client.EmuHawk/CustomControls/ViewportPanel.cs index cbb429e11a5..d9a306d43ea 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/ViewportPanel.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/ViewportPanel.cs @@ -74,7 +74,7 @@ private void DoPaint() } else { - using (SolidBrush sb = new SolidBrush(Color.Black)) + using (SolidBrush sb = new(Color.Black)) { g.FillRectangle(sb, _bmp.Width, 0, Width - _bmp.Width, Height); g.FillRectangle(sb, 0, _bmp.Height, _bmp.Width, Height - _bmp.Height); diff --git a/src/BizHawk.Client.EmuHawk/EmuHawkUtil.cs b/src/BizHawk.Client.EmuHawk/EmuHawkUtil.cs index 3d4f9c3cf04..ae9888a8818 100644 --- a/src/BizHawk.Client.EmuHawk/EmuHawkUtil.cs +++ b/src/BizHawk.Client.EmuHawk/EmuHawkUtil.cs @@ -16,14 +16,14 @@ public static class EmuHawkUtil public static string ResolveShortcut(string filename) { if (filename.Contains("|") || OSTailoredCode.IsUnixHost || !".lnk".Equals(Path.GetExtension(filename), StringComparison.OrdinalIgnoreCase)) return filename; // archive internal files are never shortcuts (and choke when analyzing any further) - ShellLinkImports.ShellLink link = new ShellLinkImports.ShellLink(); + ShellLinkImports.ShellLink link = new(); const uint STGM_READ = 0; ((ShellLinkImports.IPersistFile) link).Load(filename, STGM_READ); #if false // TODO: if I can get hold of the hwnd call resolve first. This handles moved and renamed files. ((ShellLinkImports.IShellLinkW) link).Resolve(hwnd, 0); #endif - StringBuilder sb = new StringBuilder(Win32Imports.MAX_PATH); + StringBuilder sb = new(Win32Imports.MAX_PATH); ((ShellLinkImports.IShellLinkW) link).GetPath(sb, sb.Capacity, out _, 0); return sb.Length == 0 ? filename : sb.ToString(); // maybe? what if it's invalid? } diff --git a/src/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs b/src/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs index 378ccba02d5..b458970e734 100644 --- a/src/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs +++ b/src/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs @@ -38,7 +38,7 @@ public static void BeginInvoke(this Control control, Action action) public static ToolStripMenuItem ToColumnsMenu(this InputRoll inputRoll, Action changeCallback) { - ToolStripMenuItem menu = new ToolStripMenuItem + ToolStripMenuItem menu = new() { Name = "GeneratedColumnsSubMenu", Text = "Columns" @@ -48,7 +48,7 @@ public static ToolStripMenuItem ToColumnsMenu(this InputRoll inputRoll, Action c foreach (var column in columns) { - ToolStripMenuItem menuItem = new ToolStripMenuItem + ToolStripMenuItem menuItem = new() { Name = column.Name, Text = $"{column.Text} ({column.Name})", @@ -148,7 +148,7 @@ public static string CopyItemsAsText(this ListView listViewControl) return ""; } - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); // walk over each selected item and subitem within it to generate a string from it foreach (int index in indexes) @@ -185,8 +185,8 @@ public static void SetSortIcon(this ListView listViewControl, int columnIndex, S var columnHeader = Win32Imports.SendMessage(listViewControl.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero); for (int columnNumber = 0, l = listViewControl.Columns.Count; columnNumber < l; columnNumber++) { - IntPtr columnPtr = new IntPtr(columnNumber); - Win32Imports.HDITEM item = new Win32Imports.HDITEM { mask = Win32Imports.HDITEM.Mask.Format }; + IntPtr columnPtr = new(columnNumber); + Win32Imports.HDITEM item = new() { mask = Win32Imports.HDITEM.Mask.Format }; if (Win32Imports.SendMessage(columnHeader, HDM_GETITEM, columnPtr, ref item) == IntPtr.Zero) throw new Win32Exception(); if (columnNumber != columnIndex || order == SortOrder.None) { @@ -220,8 +220,8 @@ public static void Set(this DragEventArgs e, DragDropEffects effect) public static Bitmap ToBitMap(this Control control) { - Bitmap b = new Bitmap(control.Width, control.Height); - Rectangle rect = new Rectangle(new Point(0, 0), control.Size); + Bitmap b = new(control.Width, control.Height); + Rectangle rect = new(new Point(0, 0), control.Size); control.DrawToBitmap(b, rect); return b; } diff --git a/src/BizHawk.Client.EmuHawk/Extensions/ToolExtensions.cs b/src/BizHawk.Client.EmuHawk/Extensions/ToolExtensions.cs index 6c3a72b2179..36821884791 100644 --- a/src/BizHawk.Client.EmuHawk/Extensions/ToolExtensions.cs +++ b/src/BizHawk.Client.EmuHawk/Extensions/ToolExtensions.cs @@ -23,11 +23,11 @@ public static ToolStripItem[] RecentMenu( bool noAutoload = false, bool romLoading = false) { - List items = new List(); + List items = new(); if (recent.Empty) { - ToolStripMenuItem none = new ToolStripMenuItem { Enabled = false, Text = "None" }; + ToolStripMenuItem none = new() { Enabled = false, Text = "None" }; items.Add(none); } else @@ -57,7 +57,7 @@ public static ToolStripItem[] RecentMenu( } // TODO - do TSMI and TSDD need disposing? yuck - ToolStripMenuItem item = new ToolStripMenuItem { Text = caption.Replace("&", "&&") }; + ToolStripMenuItem item = new() { Text = caption.Replace("&", "&&") }; items.Add(item); item.Click += (o, ev) => @@ -65,19 +65,19 @@ public static ToolStripItem[] RecentMenu( loadFileCallback(path); }; - ToolStripDropDownMenu tsdd = new ToolStripDropDownMenu(); + ToolStripDropDownMenu tsdd = new(); if (crazyStuff) { //TODO - use standard methods to split filename (hawkfile acquire?) - HawkFile hf = new HawkFile(physicalPath ?? throw new Exception("this will probably never appear but I can't be bothered checking --yoshi"), delayIOAndDearchive: true); + HawkFile hf = new(physicalPath ?? throw new Exception("this will probably never appear but I can't be bothered checking --yoshi"), delayIOAndDearchive: true); bool canExplore = File.Exists(hf.FullPathWithoutMember); if (canExplore) { //make a menuitem to show the last modified timestamp var timestamp = File.GetLastWriteTime(hf.FullPathWithoutMember); - ToolStripLabel tsmiTimestamp = new ToolStripLabel { Text = timestamp.ToString(DateTimeFormatInfo.InvariantInfo) }; + ToolStripLabel tsmiTimestamp = new() { Text = timestamp.ToString(DateTimeFormatInfo.InvariantInfo) }; tsdd.Items.Add(tsmiTimestamp); tsdd.Items.Add(new ToolStripSeparator()); @@ -85,22 +85,22 @@ public static ToolStripItem[] RecentMenu( if (hf.IsArchive) { //make a menuitem to let you copy the path - ToolStripMenuItem tsmiCopyCanonicalPath = new ToolStripMenuItem { Text = "&Copy Canonical Path" }; + ToolStripMenuItem tsmiCopyCanonicalPath = new() { Text = "&Copy Canonical Path" }; tsmiCopyCanonicalPath.Click += (o, ev) => { Clipboard.SetText(physicalPath); }; tsdd.Items.Add(tsmiCopyCanonicalPath); - ToolStripMenuItem tsmiCopyArchivePath = new ToolStripMenuItem { Text = "Copy Archive Path" }; + ToolStripMenuItem tsmiCopyArchivePath = new() { Text = "Copy Archive Path" }; tsmiCopyArchivePath.Click += (o, ev) => { Clipboard.SetText(hf.FullPathWithoutMember); }; tsdd.Items.Add(tsmiCopyArchivePath); - ToolStripMenuItem tsmiOpenArchive = new ToolStripMenuItem { Text = "Open &Archive" }; + ToolStripMenuItem tsmiOpenArchive = new() { Text = "Open &Archive" }; tsmiOpenArchive.Click += (o, ev) => { System.Diagnostics.Process.Start(hf.FullPathWithoutMember); }; tsdd.Items.Add(tsmiOpenArchive); } else { // make a menuitem to let you copy the path - ToolStripMenuItem tsmiCopyPath = new ToolStripMenuItem { Text = "&Copy Path" }; + ToolStripMenuItem tsmiCopyPath = new() { Text = "&Copy Path" }; tsmiCopyPath.Click += (o, ev) => { Clipboard.SetText(physicalPath); }; tsdd.Items.Add(tsmiCopyPath); } @@ -108,13 +108,13 @@ public static ToolStripItem[] RecentMenu( tsdd.Items.Add(new ToolStripSeparator()); // make a menuitem to let you explore to it - ToolStripMenuItem tsmiExplore = new ToolStripMenuItem { Text = "&Explore" }; + ToolStripMenuItem tsmiExplore = new() { Text = "&Explore" }; string explorePath = $"\"{hf.FullPathWithoutMember}\""; tsmiExplore.Click += (o, ev) => { System.Diagnostics.Process.Start("explorer.exe", $"/select, {explorePath}"); }; tsdd.Items.Add(tsmiExplore); - ToolStripMenuItem tsmiCopyFile = new ToolStripMenuItem { Text = "Copy &File" }; - System.Collections.Specialized.StringCollection lame = new System.Collections.Specialized.StringCollection + ToolStripMenuItem tsmiCopyFile = new() { Text = "Copy &File" }; + System.Collections.Specialized.StringCollection lame = new() { hf.FullPathWithoutMember }; @@ -124,7 +124,7 @@ public static ToolStripItem[] RecentMenu( if (!OSTailoredCode.IsUnixHost) { - ToolStripMenuItem tsmiTest = new ToolStripMenuItem { Text = "&Shell Context Menu" }; + ToolStripMenuItem tsmiTest = new() { Text = "&Shell Context Menu" }; tsmiTest.Click += (o, ev) => { ToolStripDropDownItem tsddi = (ToolStripDropDownItem)o; @@ -139,7 +139,7 @@ public static ToolStripItem[] RecentMenu( else { //make a menuitem to show the last modified timestamp - ToolStripLabel tsmiMissingFile = new ToolStripLabel { Text = "-Missing-" }; + ToolStripLabel tsmiMissingFile = new() { Text = "-Missing-" }; tsdd.Items.Add(tsmiMissingFile); tsdd.Items.Add(new ToolStripSeparator()); } @@ -147,7 +147,7 @@ public static ToolStripItem[] RecentMenu( } //crazystuff //in any case, make a menuitem to let you remove the item - ToolStripMenuItem tsmiRemovePath = new ToolStripMenuItem { Text = "&Remove" }; + ToolStripMenuItem tsmiRemovePath = new() { Text = "&Remove" }; tsmiRemovePath.Click += (o, ev) => { recent.Remove(path); }; @@ -181,11 +181,11 @@ public static ToolStripItem[] RecentMenu( items.Add(new ToolStripSeparator()); - ToolStripMenuItem clearItem = new ToolStripMenuItem { Text = "&Clear", Enabled = !recent.Frozen }; + ToolStripMenuItem clearItem = new() { Text = "&Clear", Enabled = !recent.Frozen }; clearItem.Click += (o, ev) => recent.Clear(); items.Add(clearItem); - ToolStripMenuItem freezeItem = new ToolStripMenuItem + ToolStripMenuItem freezeItem = new() { Text = recent.Frozen ? "&Unfreeze" : "&Freeze", Image = recent.Frozen ? Properties.Resources.Unfreeze : Properties.Resources.Freeze @@ -195,15 +195,15 @@ public static ToolStripItem[] RecentMenu( if (!noAutoload) { - ToolStripMenuItem auto = new ToolStripMenuItem { Text = $"&Autoload {entrySemantic}", Checked = recent.AutoLoad }; + ToolStripMenuItem auto = new() { Text = $"&Autoload {entrySemantic}", Checked = recent.AutoLoad }; auto.Click += (o, ev) => recent.ToggleAutoLoad(); items.Add(auto); } - ToolStripMenuItem settingsItem = new ToolStripMenuItem { Text = "&Recent Settings..." }; + ToolStripMenuItem settingsItem = new() { Text = "&Recent Settings..." }; settingsItem.Click += (o, ev) => { - using InputPrompt prompt = new InputPrompt + using InputPrompt prompt = new() { TextInputType = InputPrompt.InputType.Unsigned, Message = "Number of recent files to track", @@ -243,7 +243,7 @@ public static IEnumerable MenuItems(this IMemoryDomains domains, foreach (var domain in domains) { string name = domain.Name; - ToolStripMenuItem item = new ToolStripMenuItem + ToolStripMenuItem item = new() { Text = name, Enabled = !(maxSize.HasValue && domain.Size > maxSize.Value), diff --git a/src/BizHawk.Client.EmuHawk/Input/Input.cs b/src/BizHawk.Client.EmuHawk/Input/Input.cs index ede5fd12191..565ee62b29d 100644 --- a/src/BizHawk.Client.EmuHawk/Input/Input.cs +++ b/src/BizHawk.Client.EmuHawk/Input/Input.cs @@ -121,12 +121,12 @@ private void HandleButton(string button, bool newState, ClientInputFocus source) else if (currentModifier is not 0U) mods &= ~currentModifier; - InputEvent ie = new InputEvent - { - EventType = newState ? InputEventType.Press : InputEventType.Release, - LogicalButton = new(button1, mods, () => _getConfigCallback().ModifierKeysEffective), - Source = source - }; + InputEvent ie = new() + { + EventType = newState ? InputEventType.Press : InputEventType.Release, + LogicalButton = new(button1, mods, () => _getConfigCallback().ModifierKeysEffective), + Source = source + }; _lastState[button1] = newState; if (!_ignoreEventsNextPoll) diff --git a/src/BizHawk.Client.EmuHawk/LogWindow.cs b/src/BizHawk.Client.EmuHawk/LogWindow.cs index 6f044b964eb..3da76dd5fc6 100644 --- a/src/BizHawk.Client.EmuHawk/LogWindow.cs +++ b/src/BizHawk.Client.EmuHawk/LogWindow.cs @@ -163,7 +163,7 @@ private void ButtonCopy_Click(object sender, EventArgs e) private void ButtonCopyAll_Click(object sender, EventArgs e) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); lock(_lines) foreach (string s in _lines) sb.AppendLine(s); @@ -179,7 +179,7 @@ private void HideShowGameDbButton() private void AddToGameDbBtn_Click(object sender, EventArgs e) { - using RomStatusPicker picker = new RomStatusPicker(); + using RomStatusPicker picker = new(); var result = picker.ShowDialog(); if (result.IsOk()) { diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs index 6f84850ce49..67d63839d19 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -292,12 +292,12 @@ private void ScreenshotSubMenu_DropDownOpening(object sender, EventArgs e) private void OpenAdvancedMenuItem_Click(object sender, EventArgs e) { - using OpenAdvancedChooser oac = new OpenAdvancedChooser(this, Config, CreateCoreComm, Game, RunLibretroCoreChooser); + using OpenAdvancedChooser oac = new(this, Config, CreateCoreComm, Game, RunLibretroCoreChooser); if (this.ShowDialogWithTempMute(oac) == DialogResult.Cancel) return; if (oac.Result == AdvancedRomLoaderType.LibretroLaunchNoGame) { - LoadRomArgs argsNoGame = new LoadRomArgs + LoadRomArgs argsNoGame = new() { OpenAdvanced = new OpenAdvanced_LibretroNoGame(Config.LibretroCore) }; @@ -305,7 +305,7 @@ private void OpenAdvancedMenuItem_Click(object sender, EventArgs e) return; } - LoadRomArgs args = new LoadRomArgs(); + LoadRomArgs args = new(); var filter = RomLoader.RomFilter; @@ -416,7 +416,7 @@ private void RecordMovieMenuItem_Click(object sender, EventArgs e) // Nag user to user a more accurate core, but let them continue anyway EnsureCoreIsAccurate(); - using RecordMovie form = new RecordMovie(this, Config, Game, Emulator, MovieSession, FirmwareManager); + using RecordMovie form = new(this, Config, Game, Emulator, MovieSession, FirmwareManager); this.ShowDialogWithTempMute(form); } @@ -430,7 +430,7 @@ private string CanProvideFirmware(FirmwareID id, string hash) private void PlayMovieMenuItem_Click(object sender, EventArgs e) { - using PlayMovie form = new PlayMovie(this, Config, Game, Emulator, MovieSession, CanProvideFirmware); + using PlayMovie form = new(this, Config, Game, Emulator, MovieSession, CanProvideFirmware); this.ShowDialogWithTempMute(form); } @@ -760,7 +760,7 @@ private void KeyPriorityMenuItem_DropDownOpened(object sender, EventArgs e) private void ControllersMenuItem_Click(object sender, EventArgs e) { - using ControllerConfig controller = new ControllerConfig(this, Emulator, Config); + using ControllerConfig controller = new(this, Emulator, Config); if (!this.ShowDialogWithTempMute(controller).IsOk()) return; AddOnScreenMessage("Controller settings saved"); @@ -770,7 +770,7 @@ private void ControllersMenuItem_Click(object sender, EventArgs e) private void HotkeysMenuItem_Click(object sender, EventArgs e) { - using HotkeyConfig hotkeyConfig = new HotkeyConfig(Config); + using HotkeyConfig hotkeyConfig = new(Config); if (!this.ShowDialogWithTempMute(hotkeyConfig).IsOk()) return; AddOnScreenMessage("Hotkey settings saved"); @@ -792,19 +792,19 @@ private void OpenFWConfigRomLoadFailed(RomLoader.RomErrorArgs args) private void FirmwaresMenuItem_Click(object sender, EventArgs e) { - using FirmwaresConfig configForm = new FirmwaresConfig(this, FirmwareManager, Config.FirmwareUserSpecifications, Config.PathEntries); + using FirmwaresConfig configForm = new(this, FirmwareManager, Config.FirmwareUserSpecifications, Config.PathEntries); this.ShowDialogWithTempMute(configForm); } private void MessagesMenuItem_Click(object sender, EventArgs e) { - using MessageConfig form = new MessageConfig(Config); + using MessageConfig form = new(Config); if (this.ShowDialogWithTempMute(form).IsOk()) AddOnScreenMessage("Message settings saved"); } private void PathsMenuItem_Click(object sender, EventArgs e) { - using PathConfig form = new PathConfig(Config.PathEntries, Game.System, newPath => MovieSession.BackupDirectory = newPath); + using PathConfig form = new(Config.PathEntries, Game.System, newPath => MovieSession.BackupDirectory = newPath); if (this.ShowDialogWithTempMute(form).IsOk()) AddOnScreenMessage("Path settings saved"); } @@ -819,7 +819,7 @@ private void SoundMenuItem_Click(object sender, EventArgs e) }; var oldOutputMethod = Config.SoundOutputMethod; string oldDevice = Config.SoundDevice; - using SoundConfig form = new SoundConfig(this, Config, GetDeviceNamesCallback); + using SoundConfig form = new(this, Config, GetDeviceNamesCallback); if (!this.ShowDialogWithTempMute(form).IsOk()) return; AddOnScreenMessage("Sound settings saved"); @@ -838,7 +838,7 @@ private void SoundMenuItem_Click(object sender, EventArgs e) private void AutofireMenuItem_Click(object sender, EventArgs e) { - using AutofireConfig form = new AutofireConfig(Config, InputManager.AutoFireController, InputManager.AutofireStickyXorAdapter); + using AutofireConfig form = new(Config, InputManager.AutoFireController, InputManager.AutofireStickyXorAdapter); if (this.ShowDialogWithTempMute(form).IsOk()) AddOnScreenMessage("Autofire settings saved"); } @@ -856,7 +856,7 @@ private void RewindOptionsMenuItem_Click(object sender, EventArgs e) private void FileExtensionsMenuItem_Click(object sender, EventArgs e) { - using FileExtensionPreferences form = new FileExtensionPreferences(Config.PreferredPlatformsForExtensions); + using FileExtensionPreferences form = new(Config.PreferredPlatformsForExtensions); if (this.ShowDialogWithTempMute(form).IsOk()) AddOnScreenMessage("Rom Extension Preferences changed"); } @@ -870,14 +870,14 @@ private void BumpAutoFlushSaveRamTimer() private void CustomizeMenuItem_Click(object sender, EventArgs e) { - using EmuHawkOptions form = new EmuHawkOptions(Config, BumpAutoFlushSaveRamTimer); + using EmuHawkOptions form = new(Config, BumpAutoFlushSaveRamTimer); if (!this.ShowDialogWithTempMute(form).IsOk()) return; AddOnScreenMessage("Custom configurations saved."); } private void ProfilesMenuItem_Click(object sender, EventArgs e) { - using ProfileConfig form = new ProfileConfig(Config, this); + using ProfileConfig form = new(Config, this); if (!this.ShowDialogWithTempMute(form).IsOk()) return; AddOnScreenMessage("Profile settings saved"); @@ -1143,7 +1143,7 @@ private void TAStudioMenuItem_Click(object sender, EventArgs e) private void BatchRunnerMenuItem_Click(object sender, EventArgs e) { - using BatchRun form = new BatchRun(this, Config, CreateCoreComm); + using BatchRun form = new(this, Config, CreateCoreComm); this.ShowDialogWithTempMute(form); } @@ -1710,7 +1710,7 @@ private void AppleDisksSubMenu_DropDownOpened(object sender, EventArgs e) { for (int i = 0; i < appleII.DiskCount; i++) { - ToolStripMenuItem menuItem = new ToolStripMenuItem + ToolStripMenuItem menuItem = new() { Name = $"Disk{i + 1}", Text = $"Disk{i + 1}", @@ -1744,7 +1744,7 @@ private void C64DisksSubMenu_DropDownOpened(object sender, EventArgs e) { for (int i = 0; i < c64.DiskCount; i++) { - ToolStripMenuItem menuItem = new ToolStripMenuItem + ToolStripMenuItem menuItem = new() { Name = $"Disk{i + 1}", Text = $"Disk{i + 1}", @@ -1874,7 +1874,7 @@ private void ZXSpectrumTapesSubMenu_DropDownOpened(object sender, EventArgs e) { string name = speccy._tapeInfo[i].Name; - ToolStripMenuItem menuItem = new ToolStripMenuItem + ToolStripMenuItem menuItem = new() { Name = $"{i}_{name}", Text = $"{i}: {name}", @@ -1908,7 +1908,7 @@ private void ZXSpectrumDisksSubMenu_DropDownOpened(object sender, EventArgs e) { string name = speccy._diskInfo[i].Name; - ToolStripMenuItem menuItem = new ToolStripMenuItem + ToolStripMenuItem menuItem = new() { Name = $"{i}_{name}", Text = $"{i}: {name}", @@ -2003,7 +2003,7 @@ private void AmstradCpcTapesSubMenu_DropDownOpened(object sender, EventArgs e) { string name = ams._tapeInfo[i].Name; - ToolStripMenuItem menuItem = new ToolStripMenuItem + ToolStripMenuItem menuItem = new() { Name = $"{i}_{name}", Text = $"{i}: {name}", @@ -2037,7 +2037,7 @@ private void AmstradCpcDisksSubMenu_DropDownOpened(object sender, EventArgs e) { string name = ams._diskInfo[i].Name; - ToolStripMenuItem menuItem = new ToolStripMenuItem + ToolStripMenuItem menuItem = new() { Name = $"{i}_{name}", Text = $"{i}: {name}", @@ -2082,7 +2082,7 @@ private void AmstradCpcNonSyncSettingsMenuItem_Click(object sender, EventArgs e) private void AboutMenuItem_Click(object sender, EventArgs e) { - using BizBox form = new BizBox(); + using BizBox form = new(); this.ShowDialogWithTempMute(form); } @@ -2158,7 +2158,7 @@ private void MainFormContextMenu_Opening(object sender, System.ComponentModel.Ca } } - FileInfo file = new FileInfo($"{SaveStatePrefix()}.QuickSave{Config.SaveSlot % 10}.State.bak"); + FileInfo file = new($"{SaveStatePrefix()}.QuickSave{Config.SaveSlot % 10}.State.bak"); if (file.Exists) { @@ -2225,11 +2225,11 @@ private void ViewSubtitlesContextMenuItem_Click(object sender, EventArgs e) private void AddSubtitleContextMenuItem_Click(object sender, EventArgs e) { // TODO: rethink this? - SubtitleMaker subForm = new SubtitleMaker(); + SubtitleMaker subForm = new(); subForm.DisableFrame(); int index = -1; - Subtitle sub = new Subtitle(); + Subtitle sub = new(); for (int i = 0; i < MovieSession.Movie.Subtitles.Count; i++) { sub = MovieSession.Movie.Subtitles[i]; @@ -2329,7 +2329,7 @@ private void ProfileFirstBootLabel_Click(object sender, EventArgs e) { // We do not check if the user is actually setting a profile here. // This is intentional. - using ProfileConfig profileForm = new ProfileConfig(Config, this); + using ProfileConfig profileForm = new(Config, this); this.ShowDialogWithTempMute(profileForm); Config.FirstBoot = false; ProfileFirstBootLabel.Visible = false; diff --git a/src/BizHawk.Client.EmuHawk/MainForm.FileLoader.cs b/src/BizHawk.Client.EmuHawk/MainForm.FileLoader.cs index 84fa98cd44f..7596be4e53d 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.FileLoader.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.FileLoader.cs @@ -100,7 +100,7 @@ public bool LoadMovie(string filename, string archive = null) private bool LoadRom(string filename, string archive = null) { - LoadRomArgs args = new LoadRomArgs + LoadRomArgs args = new() { OpenAdvanced = new OpenAdvanced_OpenRom {Path = filename} }; diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs b/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs index b2d4acf4ef7..77bd121ec9d 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs @@ -22,7 +22,7 @@ public bool StartNewMovie(IMovie movie, bool record) if (result is null) return false; if (result is false) CheatList.DisableAll(); } - Dictionary oldPreferredCores = new Dictionary(Config.PreferredCores); + Dictionary oldPreferredCores = new(Config.PreferredCores); try { try @@ -31,7 +31,7 @@ public bool StartNewMovie(IMovie movie, bool record) } catch (MoviePlatformMismatchException ex) { - using Form ownerForm = new Form { TopMost = true }; + using Form ownerForm = new() { TopMost = true }; MessageBox.Show(ownerForm, ex.Message, "Movie/Platform Mismatch", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index f62507248f2..f5a8ca0243f 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -69,7 +69,7 @@ private void MainForm_Load(object sender, EventArgs e) foreach (var (groupLabel, appliesTo, coreNames) in Config.CorePickerUIData.Select(static tuple => (GroupLabel: tuple.AppliesTo[0], tuple.AppliesTo, tuple.CoreNames)) .OrderBy(static tuple => tuple.GroupLabel)) { - ToolStripMenuItem submenu = new ToolStripMenuItem { Text = groupLabel }; + ToolStripMenuItem submenu = new() { Text = groupLabel }; void ClickHandler(object clickSender, EventArgs clickArgs) { string coreName = ((ToolStripMenuItem) clickSender).Text; @@ -80,7 +80,7 @@ void ClickHandler(object clickSender, EventArgs clickArgs) } } submenu.DropDownItems.AddRange(coreNames.Select(coreName => { - ToolStripMenuItem entry = new ToolStripMenuItem { Text = coreName }; + ToolStripMenuItem entry = new() { Text = coreName }; entry.Click += ClickHandler; return (ToolStripItem) entry; }).ToArray()); @@ -92,14 +92,14 @@ void ClickHandler(object clickSender, EventArgs clickArgs) CoresSubMenu.DropDownItems.Add(submenu); } CoresSubMenu.DropDownItems.Add(new ToolStripSeparator { AutoSize = true }); - ToolStripMenuItem GBInSGBMenuItem = new ToolStripMenuItem { Text = "GB in SGB" }; + ToolStripMenuItem GBInSGBMenuItem = new() { Text = "GB in SGB" }; GBInSGBMenuItem.Click += (_, _) => { Config.GbAsSgb ^= true; if (Emulator.SystemId is VSystemID.Raw.GB or VSystemID.Raw.GBC or VSystemID.Raw.SGB) FlagNeedsReboot(); }; CoresSubMenu.DropDownItems.Add(GBInSGBMenuItem); - ToolStripMenuItem setLibretroCoreToolStripMenuItem = new ToolStripMenuItem { Text = "Set Libretro Core..." }; + ToolStripMenuItem setLibretroCoreToolStripMenuItem = new() { Text = "Set Libretro Core..." }; setLibretroCoreToolStripMenuItem.Click += (_, _) => RunLibretroCoreChooser(); CoresSubMenu.DropDownItems.Add(setLibretroCoreToolStripMenuItem); CoresSubMenu.DropDownOpened += (_, _) => GBInSGBMenuItem.Checked = Config.GbAsSgb; @@ -213,7 +213,7 @@ static MainForm() public CoreComm CreateCoreComm() { - CoreFileProvider cfp = new CoreFileProvider( + CoreFileProvider cfp = new( this, FirmwareManager, Config.PathEntries, @@ -1300,7 +1300,7 @@ public void TakeScreenshot() public void TakeScreenshot(string path) { - FileInfo fi = new FileInfo(path); + FileInfo fi = new(path); if (fi.Directory != null && !fi.Directory.Exists) { fi.Directory.Create(); @@ -1757,7 +1757,7 @@ protected override string WindowTitle { get { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); if (_inResizeLoop) { @@ -1793,7 +1793,7 @@ protected override string WindowTitleStatic { get { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb.Append(string.IsNullOrEmpty(VersionInfo.CustomBuildString) ? "BizHawk" : VersionInfo.CustomBuildString); @@ -1916,8 +1916,8 @@ private void LoadSaveRam() string saveRamPath = Config.PathEntries.SaveRamAbsolutePath(Game, MovieSession.Movie); if (Config.AutosaveSaveRAM) { - FileInfo saveram = new FileInfo(saveRamPath); - FileInfo autosave = new FileInfo(Config.PathEntries.AutoSaveRamAbsolutePath(Game, MovieSession.Movie)); + FileInfo saveram = new(saveRamPath); + FileInfo autosave = new(Config.PathEntries.AutoSaveRamAbsolutePath(Game, MovieSession.Movie)); if (autosave.Exists && autosave.LastWriteTime > saveram.LastWriteTime) { AddOnScreenMessage("AutoSaveRAM is newer than last saved SaveRAM"); @@ -1944,7 +1944,7 @@ private void LoadSaveRam() // why do we silently truncate\pad here instead of warning\erroring? sram = new byte[oldRam.Length]; - using BinaryReader reader = new BinaryReader(new FileStream(saveRamPath, FileMode.Open, FileAccess.Read)); + using BinaryReader reader = new(new FileStream(saveRamPath, FileMode.Open, FileAccess.Read)); reader.Read(sram, 0, sram.Length); } @@ -1973,11 +1973,11 @@ public bool FlushSaveRAM(bool autosave = false) path = Config.PathEntries.SaveRamAbsolutePath(Game, MovieSession.Movie); } - FileInfo file = new FileInfo(path); + FileInfo file = new(path); string newPath = $"{path}.new"; - FileInfo newFile = new FileInfo(newPath); + FileInfo newFile = new(newPath); string backupPath = $"{path}.bak"; - FileInfo backupFile = new FileInfo(backupPath); + FileInfo backupFile = new(backupPath); if (file.Directory != null && !file.Directory.Exists) { try @@ -1995,7 +1995,7 @@ public bool FlushSaveRAM(bool autosave = false) if (saveram == null) return true; - using (BinaryWriter writer = new BinaryWriter(new FileStream(newPath, FileMode.Create, FileAccess.Write))) + using (BinaryWriter writer = new(new FileStream(newPath, FileMode.Create, FileAccess.Write))) writer.Write(saveram, 0, saveram.Length); if (file.Exists) @@ -2170,7 +2170,7 @@ private void DisplayDefaultCoreMenu() GenericCoreSubMenu.Text = sysID; GenericCoreSubMenu.DropDownItems.Clear(); - ToolStripMenuItem settingsMenuItem = new ToolStripMenuItem { Text = "&Settings" }; + ToolStripMenuItem settingsMenuItem = new() { Text = "&Settings" }; settingsMenuItem.Click += GenericCoreSettingsMenuItem_Click; GenericCoreSubMenu.DropDownItems.Add(settingsMenuItem); @@ -2222,7 +2222,7 @@ private void LoadRomFromRecent(string rom) { var ioa = OpenAdvancedSerializer.ParseWithLegacy(rom); - LoadRomArgs args = new LoadRomArgs + LoadRomArgs args = new() { OpenAdvanced = ioa }; @@ -2373,7 +2373,7 @@ private void AutohideCursor(bool hide) public BitmapBuffer MakeScreenshotImage() { - BitmapBuffer ret = new BitmapBuffer(_currentVideoProvider.BufferWidth, _currentVideoProvider.BufferHeight, _currentVideoProvider.GetVideoBuffer().ToArray()); + BitmapBuffer ret = new(_currentVideoProvider.BufferWidth, _currentVideoProvider.BufferHeight, _currentVideoProvider.GetVideoBuffer().ToArray()); ret.DiscardAlpha(); return ret; } @@ -2426,7 +2426,7 @@ private void SaveSlotSelectedMessage() // sends a simulation of a plain alt key keystroke private void SendPlainAltKey(int lparam) { - Message m = new Message { WParam = new IntPtr(0xF100), LParam = new IntPtr(lparam), Msg = 0x0112, HWnd = Handle }; + Message m = new() { WParam = new IntPtr(0xF100), LParam = new IntPtr(lparam), Msg = 0x0112, HWnd = Handle }; base.WndProc(ref m); } @@ -3411,7 +3411,7 @@ private void RecordAvBase(string videoWriterName, string filename, bool unattend // handle directories first if (ext == "") { - using FolderBrowserEx fbd = new FolderBrowserEx(); + using FolderBrowserEx fbd = new(); if (this.ShowDialogWithTempMute(fbd) is DialogResult.Cancel) { aw.Dispose(); @@ -3619,7 +3619,7 @@ private void AvFrameAdvance() private int? LoadArchiveChooser(HawkFile file) { - using ArchiveChooser ac = new ArchiveChooser(file); + using ArchiveChooser ac = new(file); if (this.ShowDialogAsChild(ac).IsOk()) { return ac.SelectedMemberIndex; @@ -3683,7 +3683,7 @@ private void ShowLoadError(object sender, RomLoader.RomErrorArgs e) private string ChoosePlatformForRom(RomGame rom) { - using PlatformChooser platformChooser = new PlatformChooser(Config) + using PlatformChooser platformChooser = new(Config) { RomGame = rom }; @@ -3748,7 +3748,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr return false; } - RomLoader loader = new RomLoader(Config) + RomLoader loader = new(Config) { ChooseArchive = LoadArchiveChooser, ChoosePlatform = ChoosePlatformForRom, @@ -3834,7 +3834,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr // determine the xml assets and create RomStatusDetails for all of them XmlGame xmlGame = XmlGame.Create(new HawkFile(oaOpenrom.Path)); - using StringWriter xSw = new StringWriter(); + using StringWriter xSw = new(); for (int xg = 0; xg < xmlGame.Assets.Count; xg++) { @@ -4297,7 +4297,7 @@ public void SaveQuickSave(int slot, bool suppressOSD = false, bool fromLua = fal string path = $"{SaveStatePrefix()}.{quickSlotName}.State"; - FileInfo file = new FileInfo(path); + FileInfo file = new(path); if (file.Directory != null && !file.Directory.Exists) { file.Directory.Create(); @@ -4321,7 +4321,7 @@ public bool EnsureCoreIsAccurate() { bool PromptToSwitchCore(string currentCore, string recommendedCore, Action disableCurrentCore) { - using MsgBox box = new MsgBox( + using MsgBox box = new( $"While the {currentCore} core is faster, it is not nearly as accurate as {recommendedCore}.{Environment.NewLine}It is recommended that you switch to the {recommendedCore} core for movie recording.{Environment.NewLine}Switch to {recommendedCore}?", "Accuracy Warning", MessageBoxIcon.Warning); @@ -4370,7 +4370,7 @@ private void SaveStateAs() string path = Config.PathEntries.SaveStateAbsolutePath(Game.System); - FileInfo file = new FileInfo(path); + FileInfo file = new(path); if (file.Directory != null && !file.Directory.Exists) { file.Directory.Create(); @@ -4682,7 +4682,7 @@ private bool SingleInstanceInit(string[] args) private void ForwardSingleInstanceStartup(string[] args) { - using NamedPipeClientStream namedPipeClientStream = new NamedPipeClientStream(".", "pipe-{84125ACB-F570-4458-9748-321F887FE795}", PipeDirection.Out); + using NamedPipeClientStream namedPipeClientStream = new(".", "pipe-{84125ACB-F570-4458-9748-321F887FE795}", PipeDirection.Out); try { namedPipeClientStream.Connect(0); @@ -4702,13 +4702,13 @@ private void StartSingleInstanceServer() //MIT LICENSE - https://www.autoitconsulting.com/site/development/single-instance-winform-app-csharp-mutex-named-pipes/ // Create a new pipe accessible by local authenticated users, disallow network - SecurityIdentifier sidNetworkService = new SecurityIdentifier(WellKnownSidType.NetworkServiceSid, null); - SecurityIdentifier sidWorld = new SecurityIdentifier(WellKnownSidType.WorldSid, null); + SecurityIdentifier sidNetworkService = new(WellKnownSidType.NetworkServiceSid, null); + SecurityIdentifier sidWorld = new(WellKnownSidType.WorldSid, null); - PipeSecurity pipeSecurity = new PipeSecurity(); + PipeSecurity pipeSecurity = new(); // Deny network access to the pipe - PipeAccessRule accessRule = new PipeAccessRule(sidNetworkService, PipeAccessRights.ReadWrite, AccessControlType.Deny); + PipeAccessRule accessRule = new(sidNetworkService, PipeAccessRights.ReadWrite, AccessControlType.Deny); pipeSecurity.AddAccessRule(accessRule); // Alow Everyone to read/write @@ -4749,7 +4749,7 @@ private void SingleInstanceServerPipeCallback(IAsyncResult iAsyncResult) //a bit over-engineered in case someone wants to send a script or a rom or something //buffer size is set to something tiny so that we are continually testing it - MemoryStream payloadBytes = new MemoryStream(); + MemoryStream payloadBytes = new(); while (true) { byte[] bytes = new byte[16]; diff --git a/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs b/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs index eccfe3dd709..1b7759d3adf 100644 --- a/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs +++ b/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs @@ -83,7 +83,7 @@ private void RefreshLibretroCore(bool bootstrap) try { var coreComm = _createCoreComm(); - using LibretroHost retro = new LibretroHost(coreComm, _game, core, true); + using LibretroHost retro = new(coreComm, _game, core, true); btnLibretroLaunchGame.Enabled = true; if (retro.Description.SupportsNoGame) btnLibretroLaunchNoGame.Enabled = true; @@ -111,7 +111,7 @@ private void RefreshLibretroCore(bool bootstrap) private void btnLibretroLaunchGame_Click(object sender, EventArgs e) { - List entries = new List { new FilesystemFilter("ROMs", _currentDescription.ValidExtensions.Split('|')) }; + List entries = new() { new FilesystemFilter("ROMs", _currentDescription.ValidExtensions.Split('|')) }; if (!_currentDescription.NeedsArchives) entries.Add(FilesystemFilter.Archives); // "needs archives" means the relevant archive extensions are already in the list, and we shouldn't scan archives for roms SuggestedExtensionFilter = new(entries.ToArray()); Result = AdvancedRomLoaderType.LibretroLaunchGame; diff --git a/src/BizHawk.Client.EmuHawk/PlatformChooser.cs b/src/BizHawk.Client.EmuHawk/PlatformChooser.cs index fcaa2d3bf8e..473c8cd4842 100644 --- a/src/BizHawk.Client.EmuHawk/PlatformChooser.cs +++ b/src/BizHawk.Client.EmuHawk/PlatformChooser.cs @@ -38,7 +38,7 @@ private void PlatformChooser_Load(object sender, EventArgs e) int spacing = 25; foreach (var platform in _availableSystems) { - RadioButton radio = new RadioButton + RadioButton radio = new() { Text = platform.FullName, Location = UIHelper.Scale(new Point(15, 15 + (count * spacing))), diff --git a/src/BizHawk.Client.EmuHawk/Program.cs b/src/BizHawk.Client.EmuHawk/Program.cs index aa04f12bec5..63600c8e7fe 100644 --- a/src/BizHawk.Client.EmuHawk/Program.cs +++ b/src/BizHawk.Client.EmuHawk/Program.cs @@ -29,7 +29,7 @@ static Program() // quickly check if the user is running this as a 32 bit process somehow if (!Environment.Is64BitProcess) { - using (ExceptionBox box = new ExceptionBox($"EmuHawk requires a 64 bit environment in order to run! EmuHawk will now close.")) box.ShowDialog(); + using (ExceptionBox box = new($"EmuHawk requires a 64 bit environment in order to run! EmuHawk will now close.")) box.ShowDialog(); Process.GetCurrentProcess().Kill(); return; } @@ -76,7 +76,7 @@ static Program() // some people are getting MOTW through a combination of browser used to download bizhawk, and program used to dearchive it // We need to do it here too... otherwise people get exceptions when externaltools we distribute try to startup static void RemoveMOTW(string path) => DeleteFileW($"{path}:Zone.Identifier"); - Queue todo = new Queue(new[] { new DirectoryInfo(dllDir) }); + Queue todo = new(new[] { new DirectoryInfo(dllDir) }); while (todo.Count != 0) { var di = todo.Dequeue(); @@ -232,7 +232,7 @@ IGL CheckRenderer(IGL gl) new ExceptionBox(new Exception($"Initialization of OpenGL Display Method failed; falling back to {Name}")).ShowDialog(); return TryInitIGL(initialConfig.DispMethod = Method); } - IGL_OpenGL igl = new IGL_OpenGL(); + IGL_OpenGL igl = new(); // need to have a context active for checking renderer, will be disposed afterwards using (new SDL2OpenGLContext(3, 0, false, false)) { diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.Update.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.Update.cs index 5f6365e78f1..4c1e7045bde 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.Update.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.Update.cs @@ -53,7 +53,7 @@ private static bool DownloadDll(string url) url = url.Replace("http:", "https:"); } - using RAIntegrationDownloaderForm downloadForm = new RAIntegrationDownloaderForm(url); + using RAIntegrationDownloaderForm downloadForm = new(url); downloadForm.ShowDialog(); return downloadForm.DownloadSucceeded(); } @@ -62,12 +62,12 @@ public static bool CheckUpdateRA(IMainFormForRetroAchievements mainForm) { try { - HttpCommunication http = new HttpCommunication(null, "https://retroachievements.org/dorequest.php?r=latestintegration", null); + HttpCommunication http = new(null, "https://retroachievements.org/dorequest.php?r=latestintegration", null); var info = JsonConvert.DeserializeObject>(http.ExecGet()); if (info.TryGetValue("Success", out object success) && (bool)success) { - Version lastestVer = new Version((string)info["LatestVersion"]); - Version minVer = new Version((string)info["MinimumVersion"]); + Version lastestVer = new((string)info["LatestVersion"]); + Version minVer = new((string)info["MinimumVersion"]); if (_version < minVer) { diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs index 961a668d67d..7c7c7b10311 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs @@ -59,7 +59,7 @@ private void RebuildMenu() var tsmiddi = _raDropDownItems; tsmiddi.Clear(); { - ToolStripMenuItem tsi = new ToolStripMenuItem("Shutdown RetroAchievements"); + ToolStripMenuItem tsi = new("Shutdown RetroAchievements"); tsi.Click += (_, _) => _shutdownRACallback(); tsmiddi.Add(tsi); @@ -71,14 +71,14 @@ private void RebuildMenu() tsi.CheckedChanged += (_, _) => _getConfig().RAAutostart ^= true; tsmiddi.Add(tsi); - ToolStripSeparator tss = new ToolStripSeparator(); + ToolStripSeparator tss = new(); tsmiddi.Add(tss); } for (int i = 0; i < numItems; i++) { if (_menuItems[i].Label != IntPtr.Zero) { - ToolStripMenuItem tsi = new ToolStripMenuItem(Marshal.PtrToStringUni(_menuItems[i].Label)) + ToolStripMenuItem tsi = new(Marshal.PtrToStringUni(_menuItems[i].Label)) { Checked = _menuItems[i].Checked != 0, }; @@ -92,7 +92,7 @@ private void RebuildMenu() } else { - ToolStripSeparator tss = new ToolStripSeparator(); + ToolStripSeparator tss = new(); tsmiddi.Add(tss); } } @@ -251,7 +251,7 @@ public override void Update() if (!OverlayActive) return; - RAInterface.ControllerInput ci = new RAInterface.ControllerInput + RAInterface.ControllerInput ci = new() { UpPressed = _inputManager.ClientControls["RA Up"], DownPressed = _inputManager.ClientControls["RA Down"], diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegrationDownloaderForm.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegrationDownloaderForm.cs index 85b41702859..ca577cd5995 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegrationDownloaderForm.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegrationDownloaderForm.cs @@ -53,9 +53,9 @@ private void Download() try { - using (ManualResetEvent evt = new ManualResetEvent(false)) + using (ManualResetEvent evt = new(false)) { - using System.Net.WebClient client = new System.Net.WebClient(); + using System.Net.WebClient client = new(); System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; client.DownloadFileAsync(new Uri(_url), fn); client.DownloadProgressChanged += (object sender, System.Net.DownloadProgressChangedEventArgs e) => @@ -90,7 +90,7 @@ private void Download() return; //try acquiring file - using (HawkFile dll = new HawkFile(fn)) + using (HawkFile dll = new(fn)) { byte[] data = dll!.ReadAllBytes(); diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Debug.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Debug.cs index 2c33f86dc30..4542c456f5a 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Debug.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Debug.cs @@ -28,7 +28,7 @@ private static void VerboseMessageCallback(string message) private static IntPtr OpenFileCallback(string utf8_path) { - HawkFile file = new HawkFile(utf8_path); + HawkFile file = new(utf8_path); // this probably shouldn't ever happen if (!file.Exists || !file.IsBound || !file.GetStream().CanSeek || !file.GetStream().CanRead) @@ -207,7 +207,7 @@ public int ReadSector(int lba, IntPtr buffer, ulong requestedBytes) private static IntPtr OpenTrackCallback(string path, int tracknum) { - RCTrack track = new RCTrack(path, tracknum); + RCTrack track = new(path, tracknum); if (!track.IsAvailable) { @@ -244,7 +244,7 @@ private static uint FirstTrackSectorCallback(IntPtr track_handle) // outputs results in the console public static void DebugHash() { - using OpenFileDialog ofd = new OpenFileDialog + using OpenFileDialog ofd = new() { CheckFileExists = true, CheckPathExists = true, @@ -269,9 +269,9 @@ public static void DebugHash() { case ".m3u": { - using HawkFile file = new HawkFile(path); - using StreamReader sr = new StreamReader(file.GetStream()); - M3U_File m3u = M3U_File.Read(sr); + using HawkFile file = new(path); + using StreamReader sr = new(file.GetStream()); + M3U_File m3u = M3U_File.Read(sr); m3u.Rebase(Path.GetDirectoryName(path)); foreach (var entry in m3u.Entries) { @@ -282,7 +282,7 @@ public static void DebugHash() } case ".xml": { - XmlGame xml = XmlGame.Create(new(path)); + XmlGame xml = XmlGame.Create(new(path)); foreach (var kvp in xml.Assets) { InternalDebugHash(kvp.Key); @@ -312,10 +312,10 @@ static string ResolvePath(string path) return Path.GetFileName(path).ToLowerInvariant(); } - using HawkFile file = new HawkFile(path); + using HawkFile file = new(path); if (file.IsArchive && !file.IsBound) { - using ArchiveChooser ac = new ArchiveChooser(file); + using ArchiveChooser ac = new(file); if (ac.ShowDialog().IsOk()) { file.BindArchiveMember(ac.SelectedMemberIndex); @@ -371,8 +371,8 @@ static ConsoleID IdentifyConsole(string path) return ConsoleID.Arcade; } - using HawkFile file = new HawkFile(path); - RomGame rom = new RomGame(file); + using HawkFile file = new(path); + RomGame rom = new(file); return rom.GameInfo.System switch { VSystemID.Raw.A26 => ConsoleID.Atari2600, diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.GameInfo.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.GameInfo.cs index 8b5641495e8..0fb04bb7413 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.GameInfo.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.GameInfo.cs @@ -114,7 +114,7 @@ protected override void ResponseCallback(byte[] serv_resp) { try { - Bitmap image = new Bitmap(new MemoryStream(serv_resp)); + Bitmap image = new(new MemoryStream(serv_resp)); Image = image; } catch @@ -166,7 +166,7 @@ public class GameData public IEnumerable LoadImages() { - List requests = new List(1 + (_cheevos?.Count ?? 0) * 2); + List requests = new(1 + (_cheevos?.Count ?? 0) * 2); _gameBadgeImageRequest = new(ImageName, LibRCheevos.rc_api_image_type_t.RC_IMAGE_TYPE_GAME); requests.Add(_gameBadgeImageRequest); @@ -192,7 +192,7 @@ public unsafe GameData(in LibRCheevos.rc_api_fetch_game_data_response_t resp, Fu ImageName = resp.ImageName; RichPresenseScript = resp.RichPresenceScript; - Dictionary cheevos = new Dictionary(); + Dictionary cheevos = new(); LibRCheevos.rc_api_achievement_definition_t* cptr = (LibRCheevos.rc_api_achievement_definition_t*)resp.achievements; for (int i = 0; i < resp.num_achievements; i++) { @@ -201,7 +201,7 @@ public unsafe GameData(in LibRCheevos.rc_api_fetch_game_data_response_t resp, Fu _cheevos = cheevos; - Dictionary lboards = new Dictionary(); + Dictionary lboards = new(); LibRCheevos.rc_api_leaderboard_definition_t* lptr = (LibRCheevos.rc_api_leaderboard_definition_t*)resp.leaderboards; for (int i = 0; i < resp.num_leaderboards; i++) { @@ -267,7 +267,7 @@ public ResolveHashRequest(string hash) private int SendHash(string hash) { - ResolveHashRequest resolveHashRequest = new ResolveHashRequest(hash); + ResolveHashRequest resolveHashRequest = new(hash); PushRequest(resolveHashRequest); resolveHashRequest.Wait(); // currently, this is done synchronously return resolveHashRequest.GameID; @@ -314,7 +314,7 @@ private void InitGameData() private GameData GetGameData(int id) { - GameDataRequest gameDataRequest = new GameDataRequest(Username, ApiToken, id, () => AllowUnofficialCheevos); + GameDataRequest gameDataRequest = new(Username, ApiToken, id, () => AllowUnofficialCheevos); PushRequest(gameDataRequest); gameDataRequest.Wait(); return gameDataRequest.GameData; diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Http.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Http.cs index 56fb29d2e83..0c9953385bd 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Http.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Http.cs @@ -247,7 +247,7 @@ private static async Task HttpPost(string url, string post) { try { - using StringContent content = new StringContent(post, Encoding.UTF8, "application/x-www-form-urlencoded"); + using StringContent content = new(post, Encoding.UTF8, "application/x-www-form-urlencoded"); using var response = await _http.PostAsync(url, content).ConfigureAwait(false); return response.IsSuccessStatusCode ? await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false) diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Login.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Login.cs index 2dfceba1654..8415a1e769d 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Login.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Login.cs @@ -45,7 +45,7 @@ protected override void ResponseCallback(byte[] serv_resp) private bool DoLogin(string username, string apiToken = null, string password = null) { - LoginRequest loginRequest = new LoginRequest(username, apiToken, password); + LoginRequest loginRequest = new(username, apiToken, password); PushRequest(loginRequest); loginRequest.Wait(); @@ -73,7 +73,7 @@ private void Login() } } - using RCheevosLoginForm loginForm = new RCheevosLoginForm((username, password) => DoLogin(username, password: password)); + using RCheevosLoginForm loginForm = new((username, password) => DoLogin(username, password: password)); loginForm.ShowDialog(); config.RAUsername = Username; diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs index c7ef4d9d88f..1697bc18c07 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs @@ -19,7 +19,7 @@ public partial class RCheevos : RetroAchievements static RCheevos() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( OSTailoredCode.IsUnixHost ? "librcheevos.so" : "librcheevos.dll", hasLimitedLifetime: false); _lib = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); @@ -58,11 +58,11 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) { raDropDownItems.Clear(); - ToolStripMenuItem shutDownRAItem = new ToolStripMenuItem("Shutdown RetroAchievements"); + ToolStripMenuItem shutDownRAItem = new("Shutdown RetroAchievements"); shutDownRAItem.Click += (_, _) => _shutdownRACallback(); raDropDownItems.Add(shutDownRAItem); - ToolStripMenuItem autoStartRAItem = new ToolStripMenuItem("Autostart RetroAchievements") + ToolStripMenuItem autoStartRAItem = new("Autostart RetroAchievements") { Checked = _getConfig().RAAutostart, CheckOnClick = true, @@ -70,7 +70,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) autoStartRAItem.CheckedChanged += (_, _) => _getConfig().RAAutostart ^= true; raDropDownItems.Add(autoStartRAItem); - ToolStripMenuItem loginItem = new ToolStripMenuItem("Login") + ToolStripMenuItem loginItem = new("Login") { Visible = !LoggedIn }; @@ -83,7 +83,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) }; raDropDownItems.Add(loginItem); - ToolStripMenuItem logoutItem = new ToolStripMenuItem("Logout") + ToolStripMenuItem logoutItem = new("Logout") { Visible = LoggedIn }; @@ -97,10 +97,10 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) LoginStatusChanged += () => loginItem.Visible = !LoggedIn; LoginStatusChanged += () => logoutItem.Visible = LoggedIn; - ToolStripSeparator tss = new ToolStripSeparator(); + ToolStripSeparator tss = new(); raDropDownItems.Add(tss); - ToolStripMenuItem enableCheevosItem = new ToolStripMenuItem("Enable Achievements") + ToolStripMenuItem enableCheevosItem = new("Enable Achievements") { Checked = CheevosActive, CheckOnClick = true @@ -108,7 +108,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) enableCheevosItem.CheckedChanged += (_, _) => CheevosActive ^= true; raDropDownItems.Add(enableCheevosItem); - ToolStripMenuItem enableLboardsItem = new ToolStripMenuItem("Enable Leaderboards") + ToolStripMenuItem enableLboardsItem = new("Enable Leaderboards") { Checked = LBoardsActive, CheckOnClick = true, @@ -117,7 +117,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) enableLboardsItem.CheckedChanged += (_, _) => LBoardsActive ^= true; raDropDownItems.Add(enableLboardsItem); - ToolStripMenuItem enableRichPresenceItem = new ToolStripMenuItem("Enable Rich Presence") + ToolStripMenuItem enableRichPresenceItem = new("Enable Rich Presence") { Checked = RichPresenceActive, CheckOnClick = true @@ -125,7 +125,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) enableRichPresenceItem.CheckedChanged += (_, _) => RichPresenceActive ^= true; raDropDownItems.Add(enableRichPresenceItem); - ToolStripMenuItem enableHardcoreItem = new ToolStripMenuItem("Enable Hardcore Mode") + ToolStripMenuItem enableHardcoreItem = new("Enable Hardcore Mode") { Checked = HardcoreMode, CheckOnClick = true @@ -149,7 +149,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) _hardcoreModeMenuItem = enableHardcoreItem; - ToolStripMenuItem enableSoundEffectsItem = new ToolStripMenuItem("Enable Sound Effects") + ToolStripMenuItem enableSoundEffectsItem = new("Enable Sound Effects") { Checked = EnableSoundEffects, CheckOnClick = true @@ -157,7 +157,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) enableSoundEffectsItem.CheckedChanged += (_, _) => EnableSoundEffects ^= true; raDropDownItems.Add(enableSoundEffectsItem); - ToolStripMenuItem enableUnofficialCheevosItem = new ToolStripMenuItem("Test Unofficial Achievements") + ToolStripMenuItem enableUnofficialCheevosItem = new("Test Unofficial Achievements") { Checked = AllowUnofficialCheevos, CheckOnClick = true @@ -168,7 +168,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) tss = new ToolStripSeparator(); raDropDownItems.Add(tss); - ToolStripMenuItem viewGameInfoItem = new ToolStripMenuItem("View Game Info"); + ToolStripMenuItem viewGameInfoItem = new("View Game Info"); viewGameInfoItem.Click += (_, _) => { _gameInfoForm.OnFrameAdvance(_gameData.GameBadge, _gameData.TotalCheevoPoints(HardcoreMode), @@ -179,7 +179,7 @@ private void BuildMenu(ToolStripItemCollection raDropDownItems) }; raDropDownItems.Add(viewGameInfoItem); - ToolStripMenuItem viewCheevoListItem = new ToolStripMenuItem("View Achievement List"); + ToolStripMenuItem viewCheevoListItem = new("View Achievement List"); viewCheevoListItem.Click += (_, _) => { _cheevoListForm.OnFrameAdvance(HardcoreMode, true); diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevosAchievementForm.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevosAchievementForm.cs index 60ed54133e5..f5cf87a2953 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevosAchievementForm.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevosAchievementForm.cs @@ -44,7 +44,7 @@ public RCheevosAchievementForm(RCheevos.Cheevo cheevo, Func getChee private static Bitmap UpscaleBadge(Bitmap src) { - Bitmap ret = new Bitmap(120, 120); + Bitmap ret = new(120, 120); using Graphics g = Graphics.FromImage(ret); g.InterpolationMode = InterpolationMode.NearestNeighbor; g.PixelOffsetMode = PixelOffsetMode.Half; diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevosAchievementListForm.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevosAchievementListForm.cs index 66e33819abb..c055931d39d 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevosAchievementListForm.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevosAchievementListForm.cs @@ -36,7 +36,7 @@ public void Restart(IEnumerable cheevos, Func getC { flowLayoutPanel1.Controls.Clear(); DisposeCheevoForms(); - List cheevoForms = new List(); + List cheevoForms = new(); foreach (var cheevo in cheevos) { cheevoForms.Add(new(cheevo, getCheevoProgress)); diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.GameVerification.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.GameVerification.cs index d02cb3573fe..048ef7ca6a5 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.GameVerification.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.GameVerification.cs @@ -20,13 +20,13 @@ private int HashDisc(string path, ConsoleID consoleID) { // this shouldn't throw in practice, this is only called when loading was successful! using var disc = DiscExtensions.CreateAnyType(path, e => throw new(e)); - DiscSectorReader dsr = new DiscSectorReader(disc) + DiscSectorReader dsr = new(disc) { Policy = { DeterministicClearBuffer = false } // let's make this a little faster }; byte[] buf2048 = new byte[2048]; - List buffer = new List(); + List buffer = new(); int FirstDataTrackLBA() { @@ -168,7 +168,7 @@ static string HashJaguar(DiscTrack bootTrack, DiscSectorReader dsr, bool commonH { const string _jaguarHeader = "ATARI APPROVED DATA HEADER ATRI"; const string _jaguarBSHeader = "TARA IPARPVODED TA AEHDAREA RT"; - List buffer = new List(); + List buffer = new(); byte[] buf2352 = new byte[2352]; // find the boot track header @@ -294,7 +294,7 @@ private int Hash3DS(string path) protected IReadOnlyList GetRAGameIds(IOpenAdvanced ioa, ConsoleID consoleID) { - List ret = new List(); + List ret = new(); switch (ioa.TypeName) { case OpenAdvancedTypes.OpenRom: @@ -303,8 +303,8 @@ protected IReadOnlyList GetRAGameIds(IOpenAdvanced ioa, ConsoleID consoleID if (ext == ".m3u") { - using HawkFile file = new HawkFile(ioa.SimplePath); - using StreamReader sr = new StreamReader(file.GetStream()); + using HawkFile file = new(ioa.SimplePath); + using StreamReader sr = new(file.GetStream()); M3U_File m3u = M3U_File.Read(sr); m3u.Rebase(Path.GetDirectoryName(ioa.SimplePath)); ret.AddRange(m3u.Entries.Select(entry => HashDisc(entry.Path, consoleID))); @@ -351,7 +351,7 @@ protected IReadOnlyList GetRAGameIds(IOpenAdvanced ioa, ConsoleID consoleID } else { - using HawkFile file = new HawkFile(ioa.SimplePath); + using HawkFile file = new(ioa.SimplePath); byte[] rom = file.ReadAllBytes(); ret.Add(IdentifyRom(rom)); } @@ -369,7 +369,7 @@ protected IReadOnlyList GetRAGameIds(IOpenAdvanced ioa, ConsoleID consoleID case OpenAdvancedTypes.Libretro: { // can't know what's here exactly, so we'll just hash the entire thing - using HawkFile file = new HawkFile(ioa.SimplePath); + using HawkFile file = new(ioa.SimplePath); byte[] rom = file.ReadAllBytes(); ret.Add(IdentifyRom(rom)); break; diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Memory.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Memory.cs index f871f9a7eaa..1cc055eda7a 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Memory.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Memory.cs @@ -377,7 +377,7 @@ public ChanFMemFunctions(IDebuggable debuggable, MemoryDomain vram) protected static IReadOnlyList CreateMemoryBanks(ConsoleID consoleId, IMemoryDomains domains, IDebuggable debuggable) { - List mfs = new List(); + List mfs = new(); void TryAddDomain(string domain, int? size = null, int addressMangler = 0) { diff --git a/src/BizHawk.Client.EmuHawk/UIHelper.cs b/src/BizHawk.Client.EmuHawk/UIHelper.cs index f9f38acb77a..e55a73bec64 100644 --- a/src/BizHawk.Client.EmuHawk/UIHelper.cs +++ b/src/BizHawk.Client.EmuHawk/UIHelper.cs @@ -22,13 +22,13 @@ public static class UIHelper public static int ScaleY(int size) => (int)Math.Round(size * AutoScaleFactorY); - public static Point Scale(Point p) => new Point(ScaleX(p.X), ScaleY(p.Y)); + public static Point Scale(Point p) => new(ScaleX(p.X), ScaleY(p.Y)); - public static Size Scale(Size s) => new Size(ScaleX(s.Width), ScaleY(s.Height)); + public static Size Scale(Size s) => new(ScaleX(s.Width), ScaleY(s.Height)); private static SizeF GetCurrentAutoScaleSize(AutoScaleMode autoScaleMode) { - using Form form = new Form { AutoScaleMode = autoScaleMode }; + using Form form = new() { AutoScaleMode = autoScaleMode }; return form.CurrentAutoScaleDimensions; } diff --git a/src/BizHawk.Client.EmuHawk/UpdateChecker.cs b/src/BizHawk.Client.EmuHawk/UpdateChecker.cs index ab3a566cdbb..5f6efe202c0 100644 --- a/src/BizHawk.Client.EmuHawk/UpdateChecker.cs +++ b/src/BizHawk.Client.EmuHawk/UpdateChecker.cs @@ -91,7 +91,7 @@ private static string DownloadURLAsString(string url) request.UserAgent = "BizHawk"; request.KeepAlive = false; using HttpWebResponse response = (HttpWebResponse)request.GetResponse(); - using StreamReader responseStream = new StreamReader(response.GetResponseStream()); + using StreamReader responseStream = new(response.GetResponseStream()); return responseStream.ReadToEnd(); } diff --git a/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs b/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs index 0ace035cf5f..06b573cfbf7 100644 --- a/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs @@ -118,8 +118,8 @@ PanelCreator createPanel // split the list of all settings into buckets by player number, or supplied category // the order that buttons appeared in determines the order of the tabs - List>> orderedBuckets = new List>>(); - Dictionary> buckets = new Dictionary>(); + List>> orderedBuckets = new(); + Dictionary> buckets = new(); // by iterating through only the controller's active buttons, we're silently // discarding anything that's not on the controller right now. due to the way @@ -136,7 +136,7 @@ PanelCreator createPanel if (!buckets.ContainsKey(categoryLabel)) { - List l = new List(); + List l = new(); buckets.Add(categoryLabel, l); orderedBuckets.Add(new KeyValuePair>(categoryLabel, l)); } @@ -152,7 +152,7 @@ PanelCreator createPanel else { // create multiple tabs - TabControl tt = new TabControl { Dock = DockStyle.Fill }; + TabControl tt = new() { Dock = DockStyle.Fill }; dest.Controls.Add(tt); int pageIdx = 0; foreach (var (tabName, buttons) in orderedBuckets) @@ -268,11 +268,11 @@ private void SetControllerPicture(string controlName) // Uberhack if (controlName == "Commodore 64 Controller") { - PictureBox pictureBox2 = new PictureBox - { - Image = Properties.Resources.C64Keyboard.Value, - Size = Properties.Resources.C64Keyboard.Value.Size - }; + PictureBox pictureBox2 = new() + { + Image = Properties.Resources.C64Keyboard.Value, + Size = Properties.Resources.C64Keyboard.Value.Size + }; tableLayoutPanel1.ColumnStyles[1].Width = Properties.Resources.C64Keyboard.Value.Width; pictureBox1.Height /= 2; pictureBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; diff --git a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindPanel.cs b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindPanel.cs index 7d841a0ee79..89a616cb300 100644 --- a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindPanel.cs +++ b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindPanel.cs @@ -23,7 +23,7 @@ private void LoadSettings(IEnumerable buttonList) int y = 4; foreach (string buttonName in buttonList) { - AnalogBindControl ctrl = new AnalogBindControl(buttonName, _realConfigObject[buttonName]) + AnalogBindControl ctrl = new(buttonName, _realConfigObject[buttonName]) { Location = new Point(x, y) }; diff --git a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs index 2bed4674435..ce0ff9c31a8 100644 --- a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs +++ b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs @@ -121,7 +121,7 @@ private void Startup() x += columnWidth; } - InputCompositeWidget iw = new InputCompositeWidget(_effectiveModList) + InputCompositeWidget iw = new(_effectiveModList) { Location = new Point(x, y), Size = new Size(_inputSize, UIHelper.ScaleY(23)), @@ -134,7 +134,7 @@ private void Startup() iw.BringToFront(); Controls.Add(iw); _inputs.Add(iw); - Label label = new Label + Label label = new() { Location = new Point(x + _inputSize + _labelPadding, y + UIHelper.ScaleY(3)), Size = new Size(labelWidth, UIHelper.ScaleY(15)), diff --git a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs index a05dfb3f4e3..08b95c7fa30 100755 --- a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs @@ -279,21 +279,21 @@ private void BtnSelectUserFilter_Click(object sender, EventArgs e) //test the preset using (var stream = File.OpenRead(choice)) { - RetroShaderPreset cgp = new RetroShaderPreset(stream); + RetroShaderPreset cgp = new(stream); // try compiling it bool ok = false; string errors = ""; try { - RetroShaderChain filter = new RetroShaderChain(_gl, cgp, Path.GetDirectoryName(choice)); + RetroShaderChain filter = new(_gl, cgp, Path.GetDirectoryName(choice)); ok = filter.Available; errors = filter.Errors; } catch {} if (!ok) { - using ExceptionBox errorForm = new ExceptionBox(errors); + using ExceptionBox errorForm = new(errors); this.ShowDialogAsChild(errorForm); return; } diff --git a/src/BizHawk.Client.EmuHawk/config/FileExtensionPreferences.cs b/src/BizHawk.Client.EmuHawk/config/FileExtensionPreferences.cs index 1aab2926db4..8d4f0e3434d 100644 --- a/src/BizHawk.Client.EmuHawk/config/FileExtensionPreferences.cs +++ b/src/BizHawk.Client.EmuHawk/config/FileExtensionPreferences.cs @@ -24,7 +24,7 @@ private void FileExtensionPreferences_Load(object sender, EventArgs e) int count = 0; foreach (var (fileExt, sysID) in _preferredPlatformsForExtensions) { - FileExtensionPreferencesPicker picker = new FileExtensionPreferencesPicker(_preferredPlatformsForExtensions) + FileExtensionPreferencesPicker picker = new(_preferredPlatformsForExtensions) { FileExtension = fileExt, OriginalPreference = sysID, diff --git a/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs b/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs index 536ef7ac079..2832165cce3 100644 --- a/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs @@ -192,11 +192,11 @@ ListViewGroup AddGroup(string sysID) _boldFixedFont = new Font(_fixedFont, FontStyle.Bold); // populate ListView from firmware DB - Dictionary groups = new Dictionary(); + Dictionary groups = new(); foreach (var fr in FirmwareDatabase.FirmwareRecords) { string sysID = fr.ID.System; - ListViewItem lvi = new ListViewItem + ListViewItem lvi = new() { Tag = fr, UseItemStyleForSubItems = false, @@ -452,7 +452,7 @@ private void TsmiSetCustomization_Click(object sender, EventArgs e) // to always be copied to the global firmwares directory if (hf.IsArchive) { - ArchiveChooser ac = new ArchiveChooser(new HawkFile(filePath)); + ArchiveChooser ac = new(new HawkFile(filePath)); if (!ac.ShowDialog(this).IsOk()) return; var insideFile = hf.BindArchiveMember(ac.SelectedMemberIndex); @@ -473,7 +473,7 @@ private void TsmiSetCustomization_Click(object sender, EventArgs e) { try { - FileInfo fi = new FileInfo(filePath); + FileInfo fi = new(filePath); filePath = Path.Combine(firmwarePath, fi.Name); File.Copy(result, filePath); } @@ -518,7 +518,7 @@ private void TsmiInfo_Click(object sender, EventArgs e) // get all options for this firmware (in order) var options = FirmwareDatabase.FirmwareOptions.Where(fo => fo.ID == fr.ID); - FirmwaresConfigInfo fciDialog = new FirmwaresConfigInfo + FirmwaresConfigInfo fciDialog = new() { lblFirmware = { @@ -576,7 +576,7 @@ private bool RunImportJobSingle(string basePath, string f, ref string errors) { try { - FileInfo fi = new FileInfo(f); + FileInfo fi = new(f); if (!fi.Exists) { return false; @@ -619,7 +619,7 @@ private void RunImportJob(IEnumerable files) string errors = ""; foreach(string f in files) { - using HawkFile hf = new HawkFile(f); + using HawkFile hf = new(f); if (hf.IsArchive) { // blech. the worst extraction code in the universe. diff --git a/src/BizHawk.Client.EmuHawk/config/GB/BmpView.cs b/src/BizHawk.Client.EmuHawk/config/GB/BmpView.cs index f430f962160..056b9bfb02f 100644 --- a/src/BizHawk.Client.EmuHawk/config/GB/BmpView.cs +++ b/src/BizHawk.Client.EmuHawk/config/GB/BmpView.cs @@ -23,7 +23,7 @@ protected override void ScaleControl(SizeF factor, BoundsSpecified specified) x = (int)(x * factor.Width); if (specified.HasFlag(BoundsSpecified.Y)) y = (int)(y * factor.Height); - Point pt = new Point(x, y); + Point pt = new(x, y); if (pt != Location) Location = pt; } diff --git a/src/BizHawk.Client.EmuHawk/config/GB/CGBColorChooserForm.cs b/src/BizHawk.Client.EmuHawk/config/GB/CGBColorChooserForm.cs index 9a87bad0077..58d986031a5 100644 --- a/src/BizHawk.Client.EmuHawk/config/GB/CGBColorChooserForm.cs +++ b/src/BizHawk.Client.EmuHawk/config/GB/CGBColorChooserForm.cs @@ -127,7 +127,7 @@ private void RadioButton1_CheckedChanged(object sender, EventArgs e) public static void DoCGBColorChooserFormDialog(IDialogParent parent, Gameboy.GambatteSettings s) { - using CGBColorChooserForm dlg = new CGBColorChooserForm(); + using CGBColorChooserForm dlg = new(); dlg.LoadType(s); if (!parent.ShowDialogAsChild(dlg).IsOk()) return; s.CGBColors = dlg._type; diff --git a/src/BizHawk.Client.EmuHawk/config/GB/ColorChooserForm.cs b/src/BizHawk.Client.EmuHawk/config/GB/ColorChooserForm.cs index 6768cd98c13..3719c905eeb 100644 --- a/src/BizHawk.Client.EmuHawk/config/GB/ColorChooserForm.cs +++ b/src/BizHawk.Client.EmuHawk/config/GB/ColorChooserForm.cs @@ -119,7 +119,7 @@ private void Panel12_DoubleClick(object sender, EventArgs e) else return; // i = -1; - using ColorDialog dlg = new ColorDialog + using ColorDialog dlg = new() { AllowFullOpen = true, AnyColor = true, @@ -170,7 +170,7 @@ private void Panel12_DoubleClick(object sender, EventArgs e) /// null on failure public static int[] LoadPalFile(TextReader f) { - Dictionary lines = new Dictionary(); + Dictionary lines = new(); string line; while ((line = f.ReadLine()) != null) @@ -229,7 +229,7 @@ private void SetAllColors(int[] colors) public static void DoColorChooserFormDialog(IDialogParent parent, Config config, IGameInfo game, Gameboy.GambatteSettings s) { - using ColorChooserForm dlg = new ColorChooserForm(parent.DialogController, config, game); + using ColorChooserForm dlg = new(parent.DialogController, config, game); dlg.SetAllColors(s.GBPalette); @@ -250,7 +250,7 @@ private void LoadColorFile(string filename, bool alert) { try { - using StreamReader f = new StreamReader(filename); + using StreamReader f = new(filename); int[] newColors = LoadPalFile(f) ?? throw new Exception(); SetAllColors(newColors); } @@ -267,7 +267,7 @@ private void SaveColorFile(string filename) { try { - using StreamWriter f = new StreamWriter(filename); + using StreamWriter f = new(filename); int[] saveColors = new int[12]; for (int i = 0; i < 12; i++) { diff --git a/src/BizHawk.Client.EmuHawk/config/GB/GBLPrefs.cs b/src/BizHawk.Client.EmuHawk/config/GB/GBLPrefs.cs index ace27778482..66aa15ca5bd 100644 --- a/src/BizHawk.Client.EmuHawk/config/GB/GBLPrefs.cs +++ b/src/BizHawk.Client.EmuHawk/config/GB/GBLPrefs.cs @@ -58,7 +58,7 @@ public static DialogResult DoGBLPrefsDialog( GambatteLink.GambatteLinkSettings s = (GambatteLink.GambatteLinkSettings) settable.GetSettings(); GambatteLink.GambatteLinkSyncSettings ss = (GambatteLink.GambatteLinkSyncSettings) settable.GetSyncSettings(); - using GBLPrefs dlg = new GBLPrefs(dialogParent.DialogController, config, game, movieSession); + using GBLPrefs dlg = new(dialogParent.DialogController, config, game, movieSession); dlg.PutSettings(s, ss); var result = dialogParent.ShowDialogAsChild(dlg); diff --git a/src/BizHawk.Client.EmuHawk/config/GB/GBPrefs.cs b/src/BizHawk.Client.EmuHawk/config/GB/GBPrefs.cs index df2c5a3329c..6f24ad860ab 100644 --- a/src/BizHawk.Client.EmuHawk/config/GB/GBPrefs.cs +++ b/src/BizHawk.Client.EmuHawk/config/GB/GBPrefs.cs @@ -27,7 +27,7 @@ public static DialogResult DoGBPrefsDialog( Gameboy.GambatteSettings s = (Gameboy.GambatteSettings) settable.GetSettings(); Gameboy.GambatteSyncSettings ss = (Gameboy.GambatteSyncSettings) settable.GetSyncSettings(); - using GBPrefs dlg = new GBPrefs(dialogParent.DialogController); + using GBPrefs dlg = new(dialogParent.DialogController); dlg.gbPrefControl1.PutSettings(config, game, movieSession, s, ss); var result = dialogParent.ShowDialogAsChild(dlg); if (result.IsOk()) diff --git a/src/BizHawk.Client.EmuHawk/config/GB/SameBoyColorChooserForm.cs b/src/BizHawk.Client.EmuHawk/config/GB/SameBoyColorChooserForm.cs index ba6b948109b..20a0140e52a 100644 --- a/src/BizHawk.Client.EmuHawk/config/GB/SameBoyColorChooserForm.cs +++ b/src/BizHawk.Client.EmuHawk/config/GB/SameBoyColorChooserForm.cs @@ -88,7 +88,7 @@ private void Panel12_DoubleClick(object sender, EventArgs e) else return; // i = -1; - using ColorDialog dlg = new ColorDialog + using ColorDialog dlg = new() { AllowFullOpen = true, AnyColor = true, @@ -146,7 +146,7 @@ private void Panel12_DoubleClick(object sender, EventArgs e) /// null on failure public static int[] LoadPalFile(TextReader f) { - Dictionary lines = new Dictionary(); + Dictionary lines = new(); string line; while ((line = f.ReadLine()) != null) @@ -218,7 +218,7 @@ private void LoadColorFile(string filename, bool alert) { try { - using StreamReader f = new StreamReader(filename); + using StreamReader f = new(filename); int[] newColors = LoadPalFile(f) ?? throw new Exception(); SetAllColors(newColors); } @@ -235,7 +235,7 @@ private void SaveColorFile(string filename) { try { - using StreamWriter f = new StreamWriter(filename); + using StreamWriter f = new(filename); int[] saveColors = new int[5]; for (int i = 0; i < 5; i++) { diff --git a/src/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs b/src/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs index 7136a5c4609..a2b3fb7676d 100644 --- a/src/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs @@ -36,7 +36,7 @@ protected override void OnDeactivate(EventArgs e) private void HotkeyConfig_Load(object sender, EventArgs e) { - AutoCompleteStringCollection source = new AutoCompleteStringCollection(); + AutoCompleteStringCollection source = new(); source.AddRange(HotkeyInfo.AllHotkeys.Keys.ToArray()); SearchBox.AutoCompleteCustomSource = source; @@ -81,7 +81,7 @@ private void DoTabs() continue; // skip RA hotkeys if it can't be used } - TabPage tb = new TabPage { Name = tab, Text = tab }; + TabPage tb = new() { Name = tab, Text = tab }; var bindings = HotkeyInfo.AllHotkeys.Where(kvp => kvp.Value.TabGroup == tab) .OrderBy(static kvp => kvp.Value.Ordinal).ThenBy(static kvp => kvp.Value.DisplayName); int x = UIHelper.ScaleX(6); @@ -94,14 +94,14 @@ private void DoTabs() foreach (var (k, b) in bindings) { - Label l = new Label + Label l = new() { Text = b.DisplayName, Location = new Point(x, y), Size = new Size(iwOffsetX - UIHelper.ScaleX(2), UIHelper.ScaleY(15)) }; - InputCompositeWidget w = new InputCompositeWidget(_config.ModifierKeysEffective) + InputCompositeWidget w = new(_config.ModifierKeysEffective) { Location = new Point(x + iwOffsetX, y + iwOffsetY), AutoTab = AutoTabCheckBox.Checked, diff --git a/src/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs b/src/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs index ab215ef2fe7..ebdfb958dcd 100644 --- a/src/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs +++ b/src/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs @@ -22,7 +22,7 @@ public InputCompositeWidget(IReadOnlyList effectiveModList) _dropdownMenu.PreviewKeyDown += DropdownMenu_PreviewKeyDown; foreach (var spec in InputWidget.SpecialBindings) { - ToolStripMenuItem tsi = new ToolStripMenuItem(spec.BindingName) { ToolTipText = spec.TooltipText }; + ToolStripMenuItem tsi = new(spec.BindingName) { ToolTipText = spec.TooltipText }; _dropdownMenu.Items.Add(tsi); } diff --git a/src/BizHawk.Client.EmuHawk/config/Messages/ColorRow.cs b/src/BizHawk.Client.EmuHawk/config/Messages/ColorRow.cs index 8de4f12be8a..1a27d498429 100644 --- a/src/BizHawk.Client.EmuHawk/config/Messages/ColorRow.cs +++ b/src/BizHawk.Client.EmuHawk/config/Messages/ColorRow.cs @@ -36,7 +36,7 @@ private void SetColor() private void ColorPanel_Click(object sender, EventArgs e) { - using ColorDialog colorPicker = new ColorDialog + using ColorDialog colorPicker = new() { FullOpen = true, Color = Color.FromArgb(_selectedColor) }; diff --git a/src/BizHawk.Client.EmuHawk/config/Messages/MessageConfig.cs b/src/BizHawk.Client.EmuHawk/config/Messages/MessageConfig.cs index 18bf0f6f7f3..740ecc4fed9 100644 --- a/src/BizHawk.Client.EmuHawk/config/Messages/MessageConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/Messages/MessageConfig.cs @@ -104,7 +104,7 @@ void SetMessagePosition(MessageRow row, MessagePosition position) int y = 12; foreach (var (name, pos) in Positions) { - MessageRow row = new MessageRow + MessageRow row = new() { Name = name, Location = new Point(10, y) @@ -128,7 +128,7 @@ private void CreateColorBoxes() int y = 20; foreach (var (name, argb) in Colors) { - ColorRow row = new ColorRow + ColorRow row = new() { Name = name, Location = new Point(10, y), diff --git a/src/BizHawk.Client.EmuHawk/config/Messages/MessageEdit.cs b/src/BizHawk.Client.EmuHawk/config/Messages/MessageEdit.cs index 47458acd689..9d46bb21431 100644 --- a/src/BizHawk.Client.EmuHawk/config/Messages/MessageEdit.cs +++ b/src/BizHawk.Client.EmuHawk/config/Messages/MessageEdit.cs @@ -156,7 +156,7 @@ private void PositionPanel_Paint(object sender, PaintEventArgs e) break; } - using Pen p = new Pen(Color.Black); + using Pen p = new(Color.Black); e.Graphics.DrawLine(p, new Point(x, y), new Point(x + 8, y + 8)); e.Graphics.DrawLine(p, new Point(x + 8, y), new Point(x, y + 8)); e.Graphics.DrawRectangle(p, new Rectangle(x, y, 8, 8)); diff --git a/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs b/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs index 5600892a849..68b69a0d391 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs @@ -73,7 +73,7 @@ private void SetPaletteImage() int w = pictureBoxPalette.Size.Width; int h = pictureBoxPalette.Size.Height; - Bitmap bmp = new Bitmap(w, h); + Bitmap bmp = new(w, h); for (int j = 0; j < h; j++) { int cy = j * 4 / h; @@ -95,7 +95,7 @@ private void SetPaletteImage() { if (PalettePath.Text.Length > 0) { - HawkFile palette = new HawkFile(PalettePath.Text); + HawkFile palette = new(PalettePath.Text); if (palette.Exists) { diff --git a/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs b/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs index 2a12ad090a6..6307715f1d5 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs @@ -21,7 +21,7 @@ public NESSoundConfig() InitializeComponent(); // get baseline maxes from a default config object - NES.NESSettings d = new NES.NESSettings(); + NES.NESSettings d = new(); trackBar1.Minimum = d.APU_vol; } diff --git a/src/BizHawk.Client.EmuHawk/config/NES/NESSyncSettingsForm.cs b/src/BizHawk.Client.EmuHawk/config/NES/NESSyncSettingsForm.cs index 757f551dccb..568492a2ee7 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/NESSyncSettingsForm.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/NESSyncSettingsForm.cs @@ -50,7 +50,7 @@ public NESSyncSettingsForm( if (_syncSettings.InitialWRamStatePattern != null && _syncSettings.InitialWRamStatePattern.Any()) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (byte b in _syncSettings.InitialWRamStatePattern) { sb.Append($"{b:X2}"); diff --git a/src/BizHawk.Client.EmuHawk/config/NES/NesControllerSettings.cs b/src/BizHawk.Client.EmuHawk/config/NES/NesControllerSettings.cs index 2a3fa3fe15f..d70ff15252c 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/NesControllerSettings.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/NesControllerSettings.cs @@ -40,7 +40,7 @@ private void CheckBoxFamicom_CheckedChanged(object sender, EventArgs e) private void OkBtn_Click(object sender, EventArgs e) { - NESControlSettings controls = new NESControlSettings + NESControlSettings controls = new() { Famicom = checkBoxFamicom.Checked, FamicomExpPort = (string)comboBoxFamicom.SelectedItem, diff --git a/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs b/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs index 666dda9a997..24996c28117 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs @@ -39,7 +39,7 @@ private void SetPaletteImage() { int w = pictureBox1.Size.Width; int h = pictureBox1.Size.Height; - Bitmap bmp = new Bitmap(w, h); + Bitmap bmp = new(w, h); byte[] pal = _settings.Palette; for (int j = 0; j < h; j++) diff --git a/src/BizHawk.Client.EmuHawk/config/PSX/PSXControllerConfig.cs b/src/BizHawk.Client.EmuHawk/config/PSX/PSXControllerConfig.cs index a2d920fbe3c..da98eccb7cf 100644 --- a/src/BizHawk.Client.EmuHawk/config/PSX/PSXControllerConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/PSX/PSXControllerConfig.cs @@ -58,7 +58,7 @@ private void GuiFromUserConfig(OctoshockFIOConfigUser user) private OctoshockFIOConfigUser UserConfigFromGui() { - OctoshockFIOConfigUser uc = new OctoshockFIOConfigUser + OctoshockFIOConfigUser uc = new() { Memcards = { [0] = cbMemcard_1.Checked, [1] = cbMemcard_2.Checked }, Multitaps = { [0] = cbMultitap_1.Checked, [1] = cbMultitap_2.Checked } diff --git a/src/BizHawk.Client.EmuHawk/config/PathConfig.cs b/src/BizHawk.Client.EmuHawk/config/PathConfig.cs index 51d130ed969..2f2af311d54 100644 --- a/src/BizHawk.Client.EmuHawk/config/PathConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/PathConfig.cs @@ -69,7 +69,7 @@ void PopulateTabPage(Control t, string system) int y = UIHelper.ScaleY(14); foreach (var path in paths) { - TextBox box = new TextBox + TextBox box = new() { Text = path.Path, Location = new Point(x, y), @@ -82,7 +82,7 @@ void PopulateTabPage(Control t, string system) AutoCompleteSource = AutoCompleteSource.CustomSource }; - Button btn = new Button + Button btn = new() { Text = "", Image = Properties.Resources.OpenFile, @@ -97,7 +97,7 @@ void PopulateTabPage(Control t, string system) string tempSystem = path.System; btn.Click += (sender, args) => BrowseFolder(tempBox, tempPath, tempSystem); - Label label = new Label + Label label = new() { Text = path.Type, Location = new Point(widgetOffset + buttonWidth + padding, y + UIHelper.ScaleY(4)), @@ -115,7 +115,7 @@ void PopulateTabPage(Control t, string system) } void AddTabPageForSystem(string system, string systemDisplayName) { - TabPage t = new TabPage + TabPage t = new() { Name = system, Text = systemDisplayName, @@ -188,7 +188,7 @@ private void BrowseFolder(TextBox box, string name, string system) if (OSTailoredCode.IsUnixHost) { // FolderBrowserEx doesn't work in Mono for obvious reasons - using FolderBrowserDialog f = new FolderBrowserDialog + using FolderBrowserDialog f = new() { Description = $"Set the directory for {name}", SelectedPath = _pathEntries.AbsolutePathFor(box.Text, system) @@ -198,7 +198,7 @@ private void BrowseFolder(TextBox box, string name, string system) } else { - using FolderBrowserEx f = new FolderBrowserEx + using FolderBrowserEx f = new() { Description = $"Set the directory for {name}", SelectedPath = _pathEntries.AbsolutePathFor(box.Text, system) diff --git a/src/BizHawk.Client.EmuHawk/config/SNES/BSNESOptions.cs b/src/BizHawk.Client.EmuHawk/config/SNES/BSNESOptions.cs index a55ba4de041..0362de9e473 100644 --- a/src/BizHawk.Client.EmuHawk/config/SNES/BSNESOptions.cs +++ b/src/BizHawk.Client.EmuHawk/config/SNES/BSNESOptions.cs @@ -31,7 +31,7 @@ public static DialogResult DoSettingsDialog(IDialogParent dialogParent, ISetting { BsnesCore.SnesSettings s = (BsnesCore.SnesSettings) settable.GetSettings(); BsnesCore.SnesSyncSettings ss = (BsnesCore.SnesSyncSettings) settable.GetSyncSettings(); - using BSNESOptions dlg = new BSNESOptions(s, ss) + using BSNESOptions dlg = new(s, ss) { AlwaysDoubleSize = s.AlwaysDoubleSize, CropSGBFrame = s.CropSGBFrame, diff --git a/src/BizHawk.Client.EmuHawk/config/SNES/SNESOptions.cs b/src/BizHawk.Client.EmuHawk/config/SNES/SNESOptions.cs index 7f01613f7ff..40b0a8da675 100644 --- a/src/BizHawk.Client.EmuHawk/config/SNES/SNESOptions.cs +++ b/src/BizHawk.Client.EmuHawk/config/SNES/SNESOptions.cs @@ -21,7 +21,7 @@ public static DialogResult DoSettingsDialog(IDialogParent dialogParent, ISetting { LibsnesCore.SnesSettings s = (LibsnesCore.SnesSettings) settable.GetSettings(); LibsnesCore.SnesSyncSettings ss = (LibsnesCore.SnesSyncSettings) settable.GetSyncSettings(); - using SNESOptions dlg = new SNESOptions + using SNESOptions dlg = new() { RandomizedInitialState = ss.RandomizedInitialState, AlwaysDoubleSize = s.AlwaysDoubleSize, diff --git a/src/BizHawk.Client.EmuHawk/config/TI83/TI83PaletteConfig.cs b/src/BizHawk.Client.EmuHawk/config/TI83/TI83PaletteConfig.cs index a1c38aa623d..77b53dc79ba 100644 --- a/src/BizHawk.Client.EmuHawk/config/TI83/TI83PaletteConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/TI83/TI83PaletteConfig.cs @@ -52,7 +52,7 @@ private void BackgroundPanel_Click(object sender, EventArgs e) // and the rgb order is switched int customColor = BackgroundPanel.BackColor.R | BackgroundPanel.BackColor.G << 8 | BackgroundPanel.BackColor.B << 16; - using ColorDialog dlg = new ColorDialog + using ColorDialog dlg = new() { AllowFullOpen = true, AnyColor = true, @@ -73,7 +73,7 @@ private void ForeGroundPanel_Click(object sender, EventArgs e) // and the rgb order is switched int customColor = ForeGroundPanel.BackColor.R | ForeGroundPanel.BackColor.G << 8 | ForeGroundPanel.BackColor.B << 16; - using ColorDialog dlg = new ColorDialog + using ColorDialog dlg = new() { AllowFullOpen = true, AnyColor = true, @@ -89,7 +89,7 @@ private void ForeGroundPanel_Click(object sender, EventArgs e) private void DefaultsBtn_Click(object sender, EventArgs e) { - TI83Common.TI83CommonSettings s = new TI83Common.TI83CommonSettings(); + TI83Common.TI83CommonSettings s = new(); BackgroundPanel.BackColor = Color.FromArgb((int)s.BGColor); ForeGroundPanel.BackColor = Color.FromArgb((int)s.ForeColor); } diff --git a/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumNonSyncSettings.cs b/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumNonSyncSettings.cs index 6e12f1e1be2..46197bd69e4 100644 --- a/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumNonSyncSettings.cs +++ b/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumNonSyncSettings.cs @@ -103,7 +103,7 @@ private void buttonChooseBGColor_Click(object sender, EventArgs e) { int currColor = _settings.BackgroundColor; System.Drawing.Color c = System.Drawing.Color.FromArgb(currColor); - using ColorDialog cd = new ColorDialog(); + using ColorDialog cd = new(); System.Drawing.Color[] colors = { diff --git a/src/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs b/src/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs index 61804ceff0a..edb1b897e45 100644 --- a/src/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs +++ b/src/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs @@ -32,7 +32,7 @@ public EditSubtitlesForm(IDialogController dialogController, IMovie movie, PathE private void EditSubtitlesForm_Load(object sender, EventArgs e) { - SubtitleList subs = new SubtitleList(); + SubtitleList subs = new(); subs.AddRange(_selectedMovie.Subtitles); for (int x = 0; x < subs.Count; x++) @@ -89,7 +89,7 @@ private void Ok_Click(object sender, EventArgs e) _selectedMovie.Subtitles.Clear(); for (int i = 0; i < SubGrid.Rows.Count - 1; i++) { - Subtitle sub = new Subtitle(); + Subtitle sub = new(); var c = SubGrid.Rows[i].Cells[0]; try { sub.Frame = int.Parse(c.Value.ToString()); } @@ -146,7 +146,7 @@ private Subtitle GetRow(int index) return new Subtitle(); } - Subtitle sub = new Subtitle(); + Subtitle sub = new(); if (int.TryParse(SubGrid.Rows[index].Cells[0].Value.ToString(), out int frame)) { @@ -192,7 +192,7 @@ private void SubGrid_MouseDoubleClick(object sender, MouseEventArgs e) return; } - using SubtitleMaker s = new SubtitleMaker { Sub = GetRow(c[0].Index) }; + using SubtitleMaker s = new() { Sub = GetRow(c[0].Index) }; if (s.ShowDialog().IsOk()) { ChangeRow(s.Sub, SubGrid.SelectedRows[0].Index); @@ -253,7 +253,7 @@ private void SubGrid_CellContentClick(object sender, DataGridViewCellEventArgs e color = Color.FromArgb(hex); } - using ColorDialog picker = new ColorDialog { AllowFullOpen = true, AnyColor = true, Color = color }; + using ColorDialog picker = new() { AllowFullOpen = true, AnyColor = true, Color = color }; if (picker.ShowDialog().IsOk()) { SubGrid[e.ColumnIndex, e.RowIndex].Value = picker.Color.ToArgb().ToHexString(8); diff --git a/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs b/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs index 566e6461374..209d540b0d9 100644 --- a/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs +++ b/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs @@ -107,7 +107,7 @@ private void Run() private int? AddMovieToList(string filename, bool force) { - using HawkFile file = new HawkFile(filename); + using HawkFile file = new(filename); if (!file.Exists) { return null; @@ -189,7 +189,7 @@ private void PreHighlightMovie() return; } - List indices = new List(); + List indices = new(); // Pull out matching names for (int i = 0; i < _movieList.Count; i++) @@ -213,7 +213,7 @@ private void PreHighlightMovie() // Prefer tas files // but `_movieList` should only contain `.bk2` and `.tasproj` so... isn't that all of them? or, it is now I've fixed the case-sensitivity bug --yoshi - List tas = new List(); + List tas = new(); for (int i = 0; i < indices.Count; i++) { foreach (string ext in MovieService.MovieExtensions) @@ -257,10 +257,10 @@ private void ScanFiles() string directory = _config.PathEntries.MovieAbsolutePath(); Directory.CreateDirectory(directory); - Queue dpTodo = new Queue(); - List fpTodo = new List(); + Queue dpTodo = new(); + List fpTodo = new(); dpTodo.Enqueue(directory); - Dictionary ordinals = new Dictionary(); + Dictionary ordinals = new(); while (dpTodo.Count > 0) { @@ -327,7 +327,7 @@ private void MovieView_KeyDown(object sender, KeyEventArgs e) var indexes = MovieView.SelectedIndices; if (indexes.Count > 0) { - StringBuilder copyStr = new StringBuilder(); + StringBuilder copyStr = new(); foreach (int index in indexes) { copyStr @@ -391,7 +391,7 @@ private void MovieView_SelectedIndexChanged(object sender, EventArgs e) foreach (var (k, v) in _movieList[firstIndex].HeaderEntries) { - ListViewItem item = new ListViewItem(k); + ListViewItem item = new(k); item.SubItems.Add(v); item.ToolTipText = v; switch (k) @@ -441,11 +441,11 @@ private void MovieView_SelectedIndexChanged(object sender, EventArgs e) DetailsView.Items.Add(item); } - ListViewItem fpsItem = new ListViewItem("Fps"); + ListViewItem fpsItem = new("Fps"); fpsItem.SubItems.Add($"{_movieList[firstIndex].FrameRate:0.#######}"); DetailsView.Items.Add(fpsItem); - ListViewItem framesItem = new ListViewItem("Frames"); + ListViewItem framesItem = new("Frames"); framesItem.SubItems.Add(_movieList[firstIndex].FrameCount.ToString()); DetailsView.Items.Add(framesItem); CommentsBtn.Enabled = _movieList[firstIndex].Comments.Any(); @@ -463,7 +463,7 @@ private void EditMenuItem_Click(object sender, EventArgs e) private void DetailsView_ColumnClick(object sender, ColumnClickEventArgs e) { - List detailsList = new List(); + List detailsList = new(); for (int i = 0; i < DetailsView.Items.Count; i++) { detailsList.Add(new MovieDetails @@ -496,7 +496,7 @@ private void DetailsView_ColumnClick(object sender, ColumnClickEventArgs e) DetailsView.Items.Clear(); foreach (var detail in detailsList) { - ListViewItem item = new ListViewItem { Text = detail.Keys, BackColor = detail.BackgroundColor }; + ListViewItem item = new() { Text = detail.Keys, BackColor = detail.BackgroundColor }; item.SubItems.Add(detail.Values); DetailsView.Items.Add(item); } @@ -514,7 +514,7 @@ private void CommentsBtn_Click(object sender, EventArgs e) var movie = _movieSession.Get(_movieList[MovieView.SelectedIndices[0]].Filename); movie.Load(); // TODO movie should be disposed if movie is ITasMovie - EditCommentsForm form = new EditCommentsForm(movie, _movieSession.ReadOnly); + EditCommentsForm form = new(movie, _movieSession.ReadOnly); form.Show(); } } diff --git a/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs b/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs index 75b2271e137..8c236394815 100644 --- a/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs +++ b/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs @@ -212,7 +212,7 @@ private void Ok_Click(object sender, EventArgs e) string path = MakePath(); if (!string.IsNullOrWhiteSpace(path)) { - FileInfo test = new FileInfo(path); + FileInfo test = new(path); if (test.Exists) { bool result = DialogController.ShowMessageBox2($"{path} already exists, overwrite?", "Confirm overwrite", EMsgBoxIcon.Warning, useOKCancel: true); @@ -224,7 +224,7 @@ private void Ok_Click(object sender, EventArgs e) var movieToRecord = _movieSession.Get(path); - FileInfo fileInfo = new FileInfo(path); + FileInfo fileInfo = new(path); if (!fileInfo.Exists) { Directory.CreateDirectory(fileInfo.DirectoryName); @@ -242,7 +242,7 @@ private void Ok_Click(object sender, EventArgs e) } else { - using StringWriter sw = new StringWriter(); + using StringWriter sw = new(); core.SaveStateText(sw); movieToRecord.TextSavestate = sw.ToString(); } diff --git a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs index 4e173ac1e2a..ec75551c5ff 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs @@ -704,7 +704,7 @@ private void LoadBotFileInner(BotData botData, string path) private void SaveBotFile(string path) { - BotData data = new BotData + BotData data = new() { Best = _bestBotAttempt, ControlProbabilities = ControlProbabilities, @@ -768,7 +768,7 @@ private void SetupControlsAndProperties() ControlProbabilityPanel.Controls.Clear(); foreach (string button in Emulator.ControllerDefinition.BoolButtons) { - BotControlsRow control = new BotControlsRow + BotControlsRow control = new() { ButtonName = button, Probability = 0.0, @@ -940,7 +940,7 @@ private void UpdateBestAttempt() BestTieBreak2Box.Text = _bestBotAttempt.TieBreak2.ToString(); BestTieBreak3Box.Text = _bestBotAttempt.TieBreak3.ToString(); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (string logEntry in _bestBotAttempt.Log) { sb.AppendLine(logEntry); @@ -965,7 +965,7 @@ private void UpdateBestAttempt() private void PressButtons(bool clear_log) { - Random rand = new Random((int)DateTime.Now.Ticks); + Random rand = new((int)DateTime.Now.Ticks); foreach (string button in Emulator.ControllerDefinition.BoolButtons) { diff --git a/src/BizHawk.Client.EmuHawk/tools/BatchRun.cs b/src/BizHawk.Client.EmuHawk/tools/BatchRun.cs index 7d98ef4e34a..db39361797e 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BatchRun.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BatchRun.cs @@ -66,7 +66,7 @@ private void ButtonGo_Click(object sender, EventArgs e) { label3.Text = "Status: Running..."; int numFrames = (int)numericUpDownFrames.Value; - List files = new List(listBox1.Items.Count); + List files = new(listBox1.Items.Count); foreach (string s in listBox1.Items) { files.Add(s); diff --git a/src/BizHawk.Client.EmuHawk/tools/BatchRunner.cs b/src/BizHawk.Client.EmuHawk/tools/BatchRunner.cs index dad501e3359..ec569176fb8 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BatchRunner.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BatchRunner.cs @@ -107,7 +107,7 @@ private void RunInternal() } while (_multiHasNext); if (OnProgress != null) { - ProgressEventArgs e = new ProgressEventArgs(i + 1, _files.Count); + ProgressEventArgs e = new(i + 1, _files.Count); OnProgress(this, e); if (e.ShouldCancel) { @@ -154,7 +154,7 @@ private void LoadOne(string f) { _current.Game = _ldr.Game; _current.CoreType = emu.GetType(); - Controller controller = new Controller(emu.ControllerDefinition); + Controller controller = new(emu.ControllerDefinition); _current.BoardName = emu.HasBoardInfo() ? emu.AsBoardInfo().BoardName : null; _current.Frames = 0; diff --git a/src/BizHawk.Client.EmuHawk/tools/CDL.cs b/src/BizHawk.Client.EmuHawk/tools/CDL.cs index dc093eaa923..7182b37dcbd 100644 --- a/src/BizHawk.Client.EmuHawk/tools/CDL.cs +++ b/src/BizHawk.Client.EmuHawk/tools/CDL.cs @@ -241,13 +241,13 @@ public override bool AskSaveChanges() private bool _autoloading; public void LoadFile(string path) { - using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) + using (FileStream fs = new(path, FileMode.Open, FileAccess.Read)) { - CodeDataLog newCDL = new CodeDataLog(); + CodeDataLog newCDL = new(); newCDL.Load(fs); //have the core create a CodeDataLog to check mapping information against - CodeDataLog testCDL = new CodeDataLog(); + CodeDataLog testCDL = new(); CodeDataLogger.NewCDL(testCDL); if (!newCDL.Check(testCDL)) { @@ -337,7 +337,7 @@ private void OpenMenuItem_Click(object sender, EventArgs e) private void RunSave() { _recent.Add(_currentFilename); - using FileStream fs = new FileStream(_currentFilename, FileMode.Create, FileAccess.Write); + using FileStream fs = new(_currentFilename, FileMode.Create, FileAccess.Write); _cdl.Save(fs); } @@ -400,8 +400,8 @@ private void AppendMenuItem_Click(object sender, EventArgs e) if (file != null) { - using FileStream fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read); - CodeDataLog newCDL = new CodeDataLog(); + using FileStream fs = new(file.FullName, FileMode.Open, FileAccess.Read); + CodeDataLog newCDL = new(); newCDL.Load(fs); if (!_cdl.Check(newCDL)) { @@ -441,7 +441,7 @@ private void DisassembleMenuItem_Click(object sender, EventArgs e) string result = this.ShowFileSaveDialog(initDir: Config!.PathEntries.ToolsAbsolutePath()); if (result is not null) { - using FileStream fs = new FileStream(result, FileMode.Create, FileAccess.Write); + using FileStream fs = new(result, FileMode.Create, FileAccess.Write); CodeDataLogger.DisassembleCDL(fs, _cdl); } } @@ -547,7 +547,7 @@ private void LvCDL_QueryItemText(int index, RollColumn column, out string text, private void TsbExportText_Click(object sender, EventArgs e) { - using StringWriter sw = new StringWriter(); + using StringWriter sw = new(); foreach(string[] line in _listContents) { foreach (string entry in line) diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs index 328ff74863e..7f74874cd6e 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs @@ -292,7 +292,7 @@ private AddBreakpointDialog CreateAddBreakpointDialog(BreakpointOperation op, Me { AddBreakpointDialog.BreakpointOperation operation = (AddBreakpointDialog.BreakpointOperation)op; - AddBreakpointDialog b = new AddBreakpointDialog(operation) + AddBreakpointDialog b = new(operation) { MaxAddressSize = MemoryDomains.SystemBus.Size - 1 }; diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs index 859d5ab12a3..5a974995d64 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs @@ -144,7 +144,7 @@ public void GenerateUI() if (_canSetCpuRegisters) { - TextBox t = new TextBox + TextBox t = new() { Name = name, Text = rv.Value.ToHexString(rv.BitSize / 4), @@ -195,7 +195,7 @@ public void GenerateUI() if (flags.Any()) { - Panel p = new Panel + Panel p = new() { Name = "FlagPanel", Location = new Point(UIHelper.ScaleX(5), y), @@ -206,7 +206,7 @@ public void GenerateUI() foreach (var (name, rv) in registers.Where(r => r.Value.BitSize == 1).OrderByDescending(x => x.Key)) { - CheckBox c = new CheckBox + CheckBox c = new() { Appearance = Appearance.Button, Name = name, diff --git a/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs b/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs index 2c451018f86..35ce845e647 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs @@ -111,7 +111,7 @@ internal void BuildToolStrip() private ToolStripMenuItem GenerateToolTipFromFileName(string fileName) { if (fileName == null) throw new Exception(); - ToolStripMenuItem item = new ToolStripMenuItem(Path.GetFileName(fileName)) + ToolStripMenuItem item = new(Path.GetFileName(fileName)) { Enabled = false, Image = Properties.Resources.ExclamationRed, diff --git a/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs b/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs index 8fd612e348c..4110c14bf4f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs @@ -558,7 +558,7 @@ private void ScanlineCallback(byte lcdc) } // try to run the current mouseover, to refresh if the mouse is being held over a pane while the emulator runs // this doesn't really work well; the update rate seems to be throttled - MouseEventArgs e = new MouseEventArgs(MouseButtons.None, 0, Cursor.Position.X, Cursor.Position.Y, 0); + MouseEventArgs e = new(MouseButtons.None, 0, Cursor.Position.X, Cursor.Position.Y, 0); OnMouseMove(e); } @@ -676,7 +676,7 @@ private unsafe void PaletteMouseover(int x, int y, bool sprite) bmpViewDetails.ChangeBitmapSize(8, 10); if (bmpViewDetails.Height != 80) bmpViewDetails.Height = 80; - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); x /= 16; y /= 16; int* pal = (int*)(sprite ? spPal : bgPal) + x * 4; @@ -721,7 +721,7 @@ private unsafe void TileMouseover(int x, int y, bool secondBank) bmpViewDetails.ChangeBitmapSize(8, 8); if (bmpViewDetails.Height != 64) bmpViewDetails.Height = 64; - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); x /= 8; y /= 8; int tileIndex = y * 16 + x; @@ -746,7 +746,7 @@ private unsafe void TileMapMouseover(int x, int y, bool win) bmpViewDetails.ChangeBitmapSize(8, 8); if (bmpViewDetails.Height != 64) bmpViewDetails.Height = 64; - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); bool secondMap = win ? _lcdc.Bit(6) : _lcdc.Bit(3); int mapOffset = secondMap ? 0x1c00 : 0x1800; x /= 8; @@ -793,7 +793,7 @@ private unsafe void SpriteMouseover(int x, int y) bmpViewDetails.ChangeBitmapSize(8, tall ? 16 : 8); if (bmpViewDetails.Height != bmpViewDetails.Bmp.Height * 8) bmpViewDetails.Height = bmpViewDetails.Bmp.Height * 8; - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); byte* oament = (byte*)oam + 4 * x; int sy = oament[0]; @@ -983,7 +983,7 @@ private void MessageTimer_Tick(object sender, EventArgs e) private void ButtonChangeColor_Click(object sender, EventArgs e) { - using ColorDialog dlg = new ColorDialog + using ColorDialog dlg = new() { AllowFullOpen = true, AnyColor = true, diff --git a/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.cs b/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.cs index 2d2cb29d16b..1dd72bd2f40 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.cs @@ -89,7 +89,7 @@ private void OnPrint(IntPtr image, byte height, byte topMargin, byte bottomMargi // exposure is ignored // The page received image - Bitmap page = new Bitmap(PaperWidth, height); + Bitmap page = new(PaperWidth, height); var bmp = page.LockBits(new Rectangle(0, 0, PaperWidth, height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); @@ -116,7 +116,7 @@ private void OnPrint(IntPtr image, byte height, byte topMargin, byte bottomMargi using (Graphics g = Graphics.FromImage(_printerHistory)) { // Make it brown - ImageAttributes a = new ImageAttributes(); + ImageAttributes a = new(); a.SetColorMatrix(_paperAdjustment); g.DrawImage(page, new Rectangle(0, oldHeight + topMargin, page.Width, page.Height), 0F, 0F, page.Width, page.Height, GraphicsUnit.Pixel, a); @@ -148,7 +148,7 @@ private void ClearPaper() private void ResizeHistory(int height) { // copy to a new image of height - Bitmap newHistory = new Bitmap(PaperWidth, height); + Bitmap newHistory = new(PaperWidth, height); using (Graphics g = Graphics.FromImage(newHistory)) { g.Clear(Color.FromArgb((int)PaperColor)); diff --git a/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs b/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs index 6b059f8e567..1c8702fca95 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs @@ -635,7 +635,7 @@ private unsafe void DrawEverything() private MobileBmpView MakeMBVWidget(string text, int w, int h) { - MobileBmpView mbv = new MobileBmpView { Text = text }; + MobileBmpView mbv = new() { Text = text }; mbv.BmpView.Text = text; mbv.TopLevel = false; mbv.ChangeViewSize(w, h); @@ -647,7 +647,7 @@ private MobileBmpView MakeMBVWidget(string text, int w, int h) private MobileDetailView MakeMDVWidget(string text, int w, int h) { - MobileDetailView mdv = new MobileDetailView { Text = text }; + MobileDetailView mdv = new() { Text = text }; mdv.BmpView.Text = text; mdv.TopLevel = false; mdv.ClientSize = new Size(w, h); diff --git a/src/BizHawk.Client.EmuHawk/tools/GameShark.cs b/src/BizHawk.Client.EmuHawk/tools/GameShark.cs index 4359fb619c4..8c6aee9a119 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GameShark.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GameShark.cs @@ -45,7 +45,7 @@ private void Go_Click(object sender, EventArgs e) try { string code = l.ToUpperInvariant().Trim(); - GameSharkDecoder decoder = new GameSharkDecoder(MemoryDomains, Emulator.SystemId); + GameSharkDecoder decoder = new(MemoryDomains, Emulator.SystemId); var result = decoder.Decode(code); var domain = decoder.CheatDomain(); diff --git a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index c859c9710aa..7201f6e9a44 100644 --- a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -421,7 +421,7 @@ private bool CurrentRomIsArchive() return false; } - using HawkFile file = new HawkFile(path); + using HawkFile file = new(path); return file.Exists && file.IsArchive; } @@ -434,7 +434,7 @@ private byte[] GetRomBytes() return new byte[] { 0xFF }; } - using HawkFile file = new HawkFile(path); + using HawkFile file = new(path); if (!file.Exists) { @@ -504,7 +504,7 @@ private void CloseHexFind() private string GenerateAddressString() { - StringBuilder addrStr = new StringBuilder(); + StringBuilder addrStr = new(); for (int i = 0; i < _rowsVisible; i++) { @@ -532,7 +532,7 @@ private string GenerateAddressString() private string GenerateMemoryViewString(bool forWindow) { - StringBuilder rowStr = new StringBuilder(); + StringBuilder rowStr = new(); var hexValues = MakeValues(DataSize); var charValues = MakeValues(1); for (int i = 0; i < _rowsVisible; i++) @@ -591,7 +591,7 @@ private Dictionary MakeValues(int dataSize) end = Math.Min(end, _domain.Size); end &= -(long)dataSize; - Dictionary dict = new Dictionary(); + Dictionary dict = new(); if (end <= start) return dict; @@ -603,7 +603,7 @@ private Dictionary MakeValues(int dataSize) default: case 1: { - byte[] vals = new byte[end - start]; + byte[] vals = new byte[end - start]; _domain.BulkPeekByte(range, vals); int i = 0; for (long addr = start; addr < end; addr += dataSize) @@ -612,7 +612,7 @@ private Dictionary MakeValues(int dataSize) } case 2: { - ushort[] vals = new ushort[(end - start) >> 1]; + ushort[] vals = new ushort[(end - start) >> 1]; _domain.BulkPeekUshort(range, BigEndian, vals); int i = 0; for (long addr = start; addr < end; addr += dataSize) @@ -621,7 +621,7 @@ private Dictionary MakeValues(int dataSize) } case 4: { - uint[] vals = new uint[(end - start) >> 2]; + uint[] vals = new uint[(end - start) >> 2]; _domain.BulkPeekUint(range, BigEndian, vals); int i = 0; for (long addr = start; addr < end; addr += dataSize) @@ -832,7 +832,7 @@ private void FreezeHighlighted() if (_secondaryHighlightedAddresses.Any()) { - List cheats = new List(); + List cheats = new(); foreach (long address in _secondaryHighlightedAddresses) { Watch watch = Watch.GenerateWatch( @@ -878,8 +878,8 @@ private void UnfreezeHighlighted() private void SaveFileBinary(string path) { - FileInfo file = new FileInfo(path); - using BinaryWriter binWriter = new BinaryWriter(File.Open(file.FullName, FileMode.Create)); + FileInfo file = new(path); + using BinaryWriter binWriter = new(File.Open(file.FullName, FileMode.Create)); for (int i = 0; i < _domain.Size; i++) { binWriter.Write(_domain.PeekByte(i)); @@ -1186,7 +1186,7 @@ private bool LoadTable(string path) } _textTable.Clear(); - FileInfo file = new FileInfo(path); + FileInfo file = new(path); if (!file.Exists) { return false; @@ -1268,9 +1268,9 @@ private void SaveAsTextMenuItem_Click(object sender, EventArgs e) string path = GetSaveFileFromUser(); if (!string.IsNullOrWhiteSpace(path)) { - FileInfo file = new FileInfo(path); - using StreamWriter sw = new StreamWriter(file.FullName); - StringBuilder sb = new StringBuilder(); + FileInfo file = new(path); + using StreamWriter sw = new(file.FullName); + StringBuilder sb = new(); for (int i = 0; i < _domain.Size / 16; i++) { @@ -1359,7 +1359,7 @@ private string MakeCopyExportString(bool export) // find the maximum length of the exported string int maximumLength = addresses.Length * (export ? 3 : 2) + 8; - StringBuilder sb = new StringBuilder(maximumLength); + StringBuilder sb = new(maximumLength); // generate it differently for export (as you see it) or copy (raw bytes) if (export) @@ -1495,7 +1495,7 @@ private void MemoryDomainsMenuItem_DropDownOpened(object sender, EventArgs e) if (_romDomain != null) { - ToolStripMenuItem romMenuItem = new ToolStripMenuItem + ToolStripMenuItem romMenuItem = new() { Text = _romDomain.Name, Checked = _domain.Name == _romDomain.Name @@ -1522,7 +1522,7 @@ private void BigEndianMenuItem_Click(object sender, EventArgs e) private void GoToAddressMenuItem_Click(object sender, EventArgs e) { - using InputPrompt inputPrompt = new InputPrompt + using InputPrompt inputPrompt = new() { Text = "Go to Address", StartLocation = this.ChildPointToScreen(MemoryViewerBox), @@ -1586,7 +1586,7 @@ private void PokeAddressMenuItem_Click(object sender, EventArgs e) return; } - List addresses = new List(); + List addresses = new(); if (_highlightedAddress.HasValue) { addresses.Add(_highlightedAddress.Value); @@ -1607,7 +1607,7 @@ private void PokeAddressMenuItem_Click(object sender, EventArgs e) Common.WatchDisplayType.Hex, BigEndian)); - using RamPoke poke = new RamPoke(DialogController, watches, MainForm.CheatList) + using RamPoke poke = new(DialogController, watches, MainForm.CheatList) { InitialLocation = this.ChildPointToScreen(AddressLabel), ParentTool = this @@ -1620,7 +1620,7 @@ private void PokeAddressMenuItem_Click(object sender, EventArgs e) private void SetColorsMenuItem_Click(object sender, EventArgs e) { - using HexColorsForm form = new HexColorsForm(this); + using HexColorsForm form = new(this); this.ShowDialogWithTempMute(form); } @@ -2014,7 +2014,7 @@ private void MemoryViewerBox_Paint(object sender, PaintEventArgs e) int width = (_fontWidth * 2 * (int)cheat.Size) + (gaps * _fontWidth); - Rectangle rect = new Rectangle(GetAddressCoordinates(cheat.Address ?? 0), new Size(width, _fontHeight)); + Rectangle rect = new(GetAddressCoordinates(cheat.Address ?? 0), new Size(width, _fontHeight)); e.Graphics.DrawRectangle(_blackPen, rect); _freezeBrush.Color = Colors.Freeze; e.Graphics.FillRectangle(_freezeBrush, rect); @@ -2029,12 +2029,12 @@ private void MemoryViewerBox_Paint(object sender, PaintEventArgs e) // Create a slight offset to increase rectangle sizes var point = GetAddressCoordinates(addressHighlighted); int textX = (int)GetTextX(addressHighlighted); - Point textPoint = new Point(textX, point.Y); + Point textPoint = new(textX, point.Y); - Rectangle rect = new Rectangle(point, new Size(_fontWidth * 2 * DataSize + (NeedsExtra(addressHighlighted) ? _fontWidth : 0) + 2, _fontHeight)); + Rectangle rect = new(point, new Size(_fontWidth * 2 * DataSize + (NeedsExtra(addressHighlighted) ? _fontWidth : 0) + 2, _fontHeight)); e.Graphics.DrawRectangle(_blackPen, rect); - Rectangle textRect = new Rectangle(textPoint, new Size(_fontWidth * DataSize, _fontHeight)); + Rectangle textRect = new(textPoint, new Size(_fontWidth * DataSize, _fontHeight)); if (MainForm.CheatList.IsActive(_domain, addressHighlighted)) { @@ -2056,12 +2056,12 @@ private void MemoryViewerBox_Paint(object sender, PaintEventArgs e) { var point = GetAddressCoordinates(address); int textX = (int)GetTextX(address); - Point textPoint = new Point(textX, point.Y); + Point textPoint = new(textX, point.Y); - Rectangle rect = new Rectangle(point, new Size(_fontWidth * 2 * DataSize + 2, _fontHeight)); + Rectangle rect = new(point, new Size(_fontWidth * 2 * DataSize + 2, _fontHeight)); e.Graphics.DrawRectangle(_blackPen, rect); - Rectangle textRect = new Rectangle(textPoint, new Size(_fontWidth * DataSize, _fontHeight)); + Rectangle textRect = new(textPoint, new Size(_fontWidth * DataSize, _fontHeight)); if (MainForm.CheatList.IsActive(_domain, address)) { @@ -2187,7 +2187,7 @@ private void viewN64MatrixToolStripMenuItem_Click(object sender, EventArgs e) }.ToString()); #endif - using StringWriter sw = new StringWriter(); + using StringWriter sw = new(); for (int i = 0; i < 4; i++) { sw.WriteLine("{0,18:0.00000} {1,18:0.00000} {2,18:0.00000} {3,18:0.00000}", matVals[i, 0], matVals[i, 1], matVals[i, 2], matVals[i, 3]); diff --git a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs index c899a279218..eb51b803bde 100644 --- a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs +++ b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs @@ -59,7 +59,7 @@ private string GetFindBoxChars() byte[] bytes = _hexEditor.ConvertTextToBytes(FindBox.Text); - StringBuilder byteString = new StringBuilder(); + StringBuilder byteString = new(); foreach (byte b in bytes) { byteString.Append($"{b:X2}"); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ConsoleLuaLibrary.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ConsoleLuaLibrary.cs index 8980b9582b8..5cc3a622270 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ConsoleLuaLibrary.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ConsoleLuaLibrary.cs @@ -32,7 +32,7 @@ public void Clear() [LuaMethod("getluafunctionslist", "returns a list of implemented functions")] public string GetLuaFunctionsList() { - StringBuilder list = new StringBuilder(); + StringBuilder list = new(); foreach (var function in _luaLibsImpl.Docs) { list.AppendLine(function.Name); @@ -82,7 +82,7 @@ static string SerializeTable(LuaTable lti) return; } - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); void SerializeAndWrite(object output) => sb.Append(output switch diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/FormsLuaLibrary.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/FormsLuaLibrary.cs index b9d1548c3bb..e589c4f1b1c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/FormsLuaLibrary.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/FormsLuaLibrary.cs @@ -34,7 +34,7 @@ public void WindowClosed(IntPtr handle) private LuaWinform GetForm(long formHandle) { - IntPtr ptr = new IntPtr(formHandle); + IntPtr ptr = new(formHandle); return _luaForms.Find(form => form.Handle == ptr); } @@ -55,7 +55,7 @@ private static void SetText(Control control, string caption) [LuaMethod("addclick", "adds the given lua function as a click event to the given control")] public void AddClick(long handle, LuaFunction clickEvent) { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { foreach (Control control in form.Controls) @@ -86,7 +86,7 @@ public long Button( return 0; } - LuaButton button = new LuaButton(); + LuaButton button = new(); SetText(button, caption); form.Controls.Add(button); form.ControlEvents.Add(new LuaWinform.LuaEvent(button.Handle, clickEvent)); @@ -115,7 +115,7 @@ public long Checkbox(long formHandle, string caption, int? x = null, int? y = nu return 0; } - LuaCheckbox checkbox = new LuaCheckbox(); + LuaCheckbox checkbox = new(); form.Controls.Add(checkbox); SetText(checkbox, caption); @@ -131,7 +131,7 @@ public long Checkbox(long formHandle, string caption, int? x = null, int? y = nu [LuaMethod("clearclicks", "Removes all click events from the given widget at the specified handle")] public void ClearClicks(long handle) { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { foreach (Control control in form.Controls) @@ -148,7 +148,7 @@ public void ClearClicks(long handle) [LuaMethod("destroy", "Closes and removes a Lua created form with the specified handle. If a dialog was found and removed true is returned, else false")] public bool Destroy(long handle) { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -192,7 +192,7 @@ public long Dropdown( List dropdownItems = _th.EnumerateValues(items).ToList(); dropdownItems.Sort(); - LuaDropDown dropdown = new LuaDropDown(dropdownItems); + LuaDropDown dropdown = new(dropdownItems); form.Controls.Add(dropdown); if (x.HasValue && y.HasValue) @@ -214,7 +214,7 @@ public string GetProperty(long handle, string property) { try { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -245,7 +245,7 @@ public string GetText(long handle) { try { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -274,7 +274,7 @@ public string GetText(long handle) [LuaMethod("ischecked", "Returns the given checkbox's checked property")] public bool IsChecked(long handle) { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -317,7 +317,7 @@ public long Label( return 0; } - Label label = new Label(); + Label label = new(); if (fixedWidth) { label.Font = new Font("Courier New", 8); @@ -348,7 +348,7 @@ public long NewForm( string title = null, LuaFunction onClose = null) { - LuaWinform form = new LuaWinform(CurrentFile, WindowClosed); + LuaWinform form = new(CurrentFile, WindowClosed); _luaForms.Add(form); if (width.HasValue && height.HasValue) { @@ -408,7 +408,7 @@ public long PictureBox(long formHandle, int? x = null, int? y = null, int? width return 0; } - LuaPictureBox pictureBox = new LuaPictureBox { TableHelper = _th }; + LuaPictureBox pictureBox = new() { TableHelper = _th }; form.Controls.Add(pictureBox); if (x.HasValue && y.HasValue) @@ -434,7 +434,7 @@ public void Clear(long componentHandle, [LuaColorParam] object color) try { var color1 = _th.ParseColor(color); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -465,7 +465,7 @@ public void Refresh(long componentHandle) { try { - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -497,7 +497,7 @@ public void SetDefaultForegroundColor(long componentHandle, [LuaColorParam] obje try { var color1 = _th.ParseColor(color); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -529,7 +529,7 @@ public void SetDefaultBackgroundColor(long componentHandle, [LuaColorParam] obje try { var color1 = _th.ParseColor(color); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -561,7 +561,7 @@ public void SetDefaultTextBackground(long componentHandle, [LuaColorParam] objec try { var color1 = _th.ParseColor(color); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -593,7 +593,7 @@ public void DrawBezier(long componentHandle, LuaTable points, [LuaColorParam] ob try { var color1 = _th.ParseColor(color); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -633,7 +633,7 @@ public void DrawBox( { var strokeColor = _th.SafeParseColor(line); var fillColor = _th.SafeParseColor(background); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -673,7 +673,7 @@ public void DrawEllipse( { var strokeColor = _th.SafeParseColor(line); var fillColor = _th.SafeParseColor(background); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -715,7 +715,7 @@ public void DrawIcon( } try { - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -758,7 +758,7 @@ public void DrawImage( } try { - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -789,7 +789,7 @@ public void ClearImageCache(long componentHandle) { try { - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -835,7 +835,7 @@ public void DrawImageRegion( } try { - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -867,7 +867,7 @@ public void DrawLine(long componentHandle, int x1, int y1, int x2, int y2, [LuaC try { var color1 = _th.SafeParseColor(color); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -899,7 +899,7 @@ public void DrawAxis(long componentHandle, int x, int y, int size, [LuaColorPara try { var color1 = _th.SafeParseColor(color); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -940,7 +940,7 @@ public void DrawArc( try { var strokeColor = _th.SafeParseColor(line); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -982,7 +982,7 @@ public void DrawPie( { var strokeColor = _th.SafeParseColor(line); var fillColor = _th.SafeParseColor(background); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1014,7 +1014,7 @@ public void DrawPixel(long componentHandle, int x, int y, [LuaColorParam] object try { var color1 = _th.SafeParseColor(color); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1053,7 +1053,7 @@ public void DrawPolygon( { var strokeColor = _th.SafeParseColor(line); var fillColor = _th.SafeParseColor(background); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1094,7 +1094,7 @@ public void DrawRectangle( { var strokeColor = _th.SafeParseColor(line); var fillColor = _th.SafeParseColor(background); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1138,7 +1138,7 @@ public void DrawString( { var fgColor = _th.SafeParseColor(forecolor); var bgColor = _th.SafeParseColor(backcolor); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1182,7 +1182,7 @@ public void DrawText( { var fgColor = _th.SafeParseColor(forecolor); var bgColor = _th.SafeParseColor(backcolor); - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1214,7 +1214,7 @@ public int GetMouseX(long componentHandle) { try { - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1247,7 +1247,7 @@ public int GetMouseY(long componentHandle) { try { - IntPtr ptr = new IntPtr(componentHandle); + IntPtr ptr = new(componentHandle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1278,7 +1278,7 @@ public void SetDropdownItems(long handle, LuaTable items, bool alphabetize = tru { try { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1311,7 +1311,7 @@ public void SetDropdownItems(long handle, LuaTable items, bool alphabetize = tru [LuaMethod("setlocation", "Sets the location of a control or form by passing in the handle of the created object")] public void SetLocation(long handle, int x, int y) { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1352,7 +1352,7 @@ void ParseAndSet(Control c) pi.SetValue(c, o, null); } - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1379,7 +1379,7 @@ void ParseAndSet(Control c) [LuaMethod("setsize", "TODO")] public void SetSize(long handle, int width, int height) { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1403,7 +1403,7 @@ public void SetSize(long handle, int width, int height) [LuaMethod("settext", "Sets the text property of a control or form by passing in the handle of the created object")] public void Settext(long handle, string caption) { - IntPtr ptr = new IntPtr(handle); + IntPtr ptr = new(handle); foreach (var form in _luaForms) { if (form.Handle == ptr) @@ -1444,7 +1444,7 @@ public long Textbox( return 0; } - LuaTextBox textbox = new LuaTextBox(); + LuaTextBox textbox = new(); if (fixedWidth) { textbox.Font = new Font("Courier New", 8); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 9afed289e22..95a8dd0846a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -280,7 +280,7 @@ private void CreateFileWatcher(LuaFile item) if (!Directory.Exists(dir)) return; - FileSystemWatcher watcher = new FileSystemWatcher + FileSystemWatcher watcher = new() { Path = dir, Filter = file, @@ -326,7 +326,7 @@ public void LoadLuaFile(string path) } else { - LuaFile luaFile = new LuaFile("", absolutePath); + LuaFile luaFile = new("", absolutePath); LuaImp.ScriptList.Add(luaFile); LuaListView.RowCount = LuaImp.ScriptList.Count; @@ -1277,7 +1277,7 @@ private void OutputBox_KeyDown(object sender, KeyEventArgs e) private void LuaListView_ColumnClick(object sender, InputRoll.ColumnClickEventArgs e) { string columnToSort = e.Column.Name; - List luaListTemp = new List(); + List luaListTemp = new(); if (columnToSort != _lastColumnSorted) { _sortReverse = false; diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs index 153d5f0374c..0c5b10f7dc4 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs @@ -121,7 +121,7 @@ private void FunctionView_Copy(object sender, EventArgs e) return; } - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (int index in FunctionView.SelectedIndices) { var itm = _filteredList[index]; diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaLibraries.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaLibraries.cs index a4011f9c318..b9fb78ab592 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaLibraries.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaLibraries.cs @@ -87,7 +87,7 @@ void EnumerateLuaFunctions(string name, Type type, LuaLibraryBase instance) // emu lib may be null now, depending on order of ReflectionCache.Types, but definitely won't be null when this is called guiLib.CreateLuaCanvasCallback = (width, height, x, y) => { - LuaCanvas canvas = new LuaCanvas(EmulationLuaLibrary, width, height, x, y, _th, LogToLuaConsole); + LuaCanvas canvas = new(EmulationLuaLibrary, width, height, x, y, _th, LogToLuaConsole); canvas.Show(); return _th.ObjectToTable(canvas); }; @@ -298,7 +298,7 @@ public INamedLuaFunction CreateAndRegisterNamedFunction( LuaFile luaFile, string name = null) { - NamedLuaFunction nlf = new NamedLuaFunction(function, theEvent, logCallback, luaFile, + NamedLuaFunction nlf = new(function, theEvent, logCallback, luaFile, () => { _lua.NewThread(out var thread); return thread; }, name); RegisteredFunctions.Add(nlf); return nlf; diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs index e9b79c57bee..22cf3177514 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs @@ -165,7 +165,7 @@ public void ClearImageCache() public void DrawImageRegion(string path, int sourceX, int sourceY, int sourceWidth, int sourceHeight, int destX, int destY, int? destWidth = null, int? destHeight = null) { var img = _imageCache.GetValueOrPut(path, Image.FromFile); - Rectangle destRect = new Rectangle(destX, destY, destWidth ?? sourceWidth, destHeight ?? sourceHeight); + Rectangle destRect = new(destX, destY, destWidth ?? sourceWidth, destHeight ?? sourceHeight); Graphics boxBackground = Graphics.FromImage(Image); boxBackground.DrawImage(img, destRect, sourceX, sourceY, sourceWidth, sourceHeight, GraphicsUnit.Pixel); @@ -294,8 +294,8 @@ public void DrawText( } } - StringFormat f = new StringFormat(StringFormat.GenericDefault); - Font font = new Font(family, fontSize ?? 12, fStyle, GraphicsUnit.Pixel); + StringFormat f = new(StringFormat.GenericDefault); + Font font = new(family, fontSize ?? 12, fStyle, GraphicsUnit.Pixel); Graphics boxBackground = Graphics.FromImage(Image); Size sizeOfText = boxBackground.MeasureString(message, font, 0, f).ToSize(); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs index 1666400be88..e7d448e95ec 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs @@ -49,7 +49,7 @@ private void PopulateListView() .ThenBy(f => f.Name); foreach (var nlf in functions) { - ListViewItem item = new ListViewItem { Text = nlf.Event }; + ListViewItem item = new() { Text = nlf.Event }; item.SubItems.Add(nlf.Name); item.SubItems.Add(nlf.Guid.ToString()); FunctionView.Items.Add(item); diff --git a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.ButtonSelect.cs b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.ButtonSelect.cs index 892756f0fa8..44a6fe1f0ca 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.ButtonSelect.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.ButtonSelect.cs @@ -15,12 +15,12 @@ private void SetUpButtonBoxes() for (int i = 0; i < def.Axes.Count; i++) { - CheckBox box = new CheckBox { Text = def.Axes[i] }; + CheckBox box = new() { Text = def.Axes[i] }; _buttonBoxes[i] = box; } for (int i = 0; i < def.BoolButtons.Count; i++) { - CheckBox box = new CheckBox { Text = def.BoolButtons[i] }; + CheckBox box = new() { Text = def.BoolButtons[i] }; _buttonBoxes[i + def.Axes.Count] = box; } diff --git a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs index d8e52d41c4c..27ed16f12f9 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs @@ -55,7 +55,7 @@ private void MacroInputTool_Load(object sender, EventArgs e) ReplaceBox.Enabled = OverlayBox.Enabled = PlaceNum.Enabled = CurrentMovie is ITasMovie; - MovieZone main = new MovieZone(Emulator, Tools, MovieSession, 0, CurrentMovie.InputLogLength) + MovieZone main = new(Emulator, Tools, MovieSession, 0, CurrentMovie.InputLogLength) { Name = "Entire Movie" }; @@ -129,7 +129,7 @@ private void SetZoneButton_Click(object sender, EventArgs e) return; } - MovieZone newZone = new MovieZone(Emulator, Tools, MovieSession, (int) StartNum.Value, (int) (EndNum.Value - StartNum.Value + 1)) + MovieZone newZone = new(Emulator, Tools, MovieSession, (int) StartNum.Value, (int) (EndNum.Value - StartNum.Value + 1)) { Name = $"Zone {_zones.Count}" }; diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs index 76765a91cd4..35234fda0a9 100644 --- a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs +++ b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs @@ -128,7 +128,7 @@ private void SaveRunButton_Click(object sender, EventArgs e) DialogResult = DialogResult.OK; Close(); - LoadRomArgs lra = new LoadRomArgs { OpenAdvanced = new OpenAdvanced_OpenRom { Path = fileInfo.FullName } }; + LoadRomArgs lra = new() { OpenAdvanced = new OpenAdvanced_OpenRom { Path = fileInfo.FullName } }; _ = MainForm.LoadRom(fileInfo.FullName, lra); } @@ -136,7 +136,7 @@ private void AddButton_Click(object sender, EventArgs e) { int start = 3 + (FileSelectorPanel.Controls.Count * 43); - GroupBox groupBox = new GroupBox + GroupBox groupBox = new() { Text = "", Location = UIHelper.Scale(new Point(6, start)), @@ -144,7 +144,7 @@ private void AddButton_Click(object sender, EventArgs e) Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top }; - MultiDiskFileSelector mdf = new MultiDiskFileSelector(MainForm, Config.PathEntries, + MultiDiskFileSelector mdf = new(MainForm, Config.PathEntries, () => MainForm.CurrentlyOpenRom, () => SystemDropDown.SelectedItem?.ToString()) { Location = UIHelper.Scale(new Point(7, 12)), @@ -213,7 +213,7 @@ private bool Recalculate() string basePath = Path.GetDirectoryName(name.SubstringBefore('|')); if (string.IsNullOrEmpty(basePath)) { - FileInfo fileInfo = new FileInfo(name); + FileInfo fileInfo = new(name); basePath = Path.GetDirectoryName(fileInfo.FullName); } diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs index e6cacbc8d1a..b0e9e63f326 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs @@ -118,7 +118,7 @@ private void Export_Click(object sender, EventArgs e) // load template XElement templateRoot; - using (ZipArchive zfTemplate = new ZipArchive(new FileStream(templatePath, FileMode.Open, FileAccess.Read), ZipArchiveMode.Read)) + using (ZipArchive zfTemplate = new(new FileStream(templatePath, FileMode.Open, FileAccess.Read), ZipArchiveMode.Read)) { var entry = zfTemplate.Entries.Single(entry => entry.FullName == "Song.xml"); using var stream = entry.Open(); @@ -130,7 +130,7 @@ private void Export_Click(object sender, EventArgs e) var xPatternPool = xPatterns.Parent; xPatterns.Remove(); - StringWriter writer = new StringWriter(); + StringWriter writer = new(); writer.WriteLine(""); @@ -411,7 +411,7 @@ private void Export_Click(object sender, EventArgs e) File.Delete(outPath); File.Copy(templatePath, outPath); - using ZipArchive zfOutput = new ZipArchive(new FileStream(outPath, FileMode.Create, FileAccess.Write), ZipArchiveMode.Create); + using ZipArchive zfOutput = new(new FileStream(outPath, FileMode.Create, FileAccess.Write), ZipArchiveMode.Create); using (var stream = zfOutput.CreateEntry("Song.xml").Open()) { templateRoot.Save(stream); @@ -446,7 +446,7 @@ private void DebugCallback() int noiseNote = FindNearestNote(noiseFreq); // create the record - ApuState rec = new ApuState + ApuState rec = new() { Pulse0 = { diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs index 3b27b089753..45b62d6fcfc 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs @@ -295,7 +295,7 @@ private void UpdatePaletteSelection() private static Bitmap Section(Image srcBitmap, Rectangle section, bool is8x16) { // Create the new bitmap and associated graphics object - Bitmap bmp = new Bitmap(64, 64); + Bitmap bmp = new(64, 64); Graphics g = Graphics.FromImage(bmp); // Draw the specified section of the source bitmap to the new one @@ -615,7 +615,7 @@ private void HandlePaletteViewMouseMove(Point e) AddressLabel.Text = $"Address: 0x{addr:X4}"; int val; - Bitmap bmp = new Bitmap(64, 64); + Bitmap bmp = new(64, 64); Graphics g = Graphics.FromImage(bmp); byte[] palRam = _ppu.GetPalRam(); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs index dbe21b18afc..a09da46b3fe 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs @@ -9,7 +9,7 @@ public sealed class NameTableViewer : Control public NameTableViewer() { - Size pSize = new Size(512, 480); + Size pSize = new(512, 480); Nametables = new Bitmap(pSize.Width, pSize.Height); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); @@ -64,8 +64,8 @@ private void NameTableViewer_Paint(object sender, PaintEventArgs e) public void ScreenshotToClipboard() { - using Bitmap b = new Bitmap(Width, Height); - Rectangle rect = new Rectangle(new Point(0, 0), Size); + using Bitmap b = new(Width, Height); + Rectangle rect = new(new Point(0, 0), Size); DrawToBitmap(b, rect); Clipboard.SetImage(b); } diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/PaletteViewer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/PaletteViewer.cs index 94735d51122..002b180d3aa 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/PaletteViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/PaletteViewer.cs @@ -73,8 +73,8 @@ public bool HasChanged() public void ScreenshotToClipboard() { - Bitmap b = new Bitmap(Width, Height); - Rectangle rect = new Rectangle(new Point(0, 0), Size); + Bitmap b = new(Width, Height); + Rectangle rect = new(new Point(0, 0), Size); DrawToBitmap(b, rect); using var img = b; diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/PatternViewer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/PatternViewer.cs index 4a35338f9b4..9d294ddf278 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/PatternViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/PatternViewer.cs @@ -11,7 +11,7 @@ public sealed class PatternViewer : Control public PatternViewer() { - Size pSize = new Size(256, 128); + Size pSize = new(256, 128); Pattern = new Bitmap(pSize.Width, pSize.Height); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); @@ -32,8 +32,8 @@ private void PatternViewer_Paint(object sender, PaintEventArgs e) public void ScreenshotToClipboard() { - Bitmap b = new Bitmap(Width, Height); - Rectangle rect = new Rectangle(new Point(0, 0), Size); + Bitmap b = new(Width, Height); + Rectangle rect = new(new Point(0, 0), Size); DrawToBitmap(b, rect); using var img = b; diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/SpriteViewer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/SpriteViewer.cs index 3962389af40..59b3247388b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/SpriteViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/SpriteViewer.cs @@ -10,7 +10,7 @@ public sealed class SpriteViewer : Control public SpriteViewer() { SetStyle(ControlStyles.SupportsTransparentBackColor, true); - Size pSize = new Size(256, 96); + Size pSize = new(256, 96); Sprites = new Bitmap(pSize.Width, pSize.Height); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); @@ -31,8 +31,8 @@ private void Display(Graphics g) public void ScreenshotToClipboard() { - Bitmap b = new Bitmap(Width, Height); - Rectangle rect = new Rectangle(new Point(0, 0), Size); + Bitmap b = new(Width, Height); + Rectangle rect = new(new Point(0, 0), Size); DrawToBitmap(b, rect); using var img = b; diff --git a/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.cs b/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.cs index 0fe379758e7..203d3da7df4 100644 --- a/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.cs +++ b/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.cs @@ -99,8 +99,8 @@ protected override void UpdateAfter() short[] waveform = (short[])ch.Wave.Clone(); // hash it - MemoryStream ms = new MemoryStream(_waveformTemp); - BinaryWriter bw = new BinaryWriter(ms); + MemoryStream ms = new(_waveformTemp); + BinaryWriter bw = new(ms); foreach (short s in waveform) { bw.Write(s); @@ -178,14 +178,14 @@ private class PsgEntry private void BtnExport_Click(object sender, EventArgs e) { string tmpFilename = $"{Path.GetTempFileName()}.zip"; - using (FileStream stream = new FileStream(tmpFilename, FileMode.Create, FileAccess.Write, FileShare.Read)) + using (FileStream stream = new(tmpFilename, FileMode.Create, FileAccess.Write, FileShare.Read)) { - using ZipArchive zip = new ZipArchive(stream, ZipArchiveMode.Create); + using ZipArchive zip = new(stream, ZipArchiveMode.Create); foreach (var entry in _psgEntries) { - MemoryStream ms = new MemoryStream(); - BinaryWriter bw = new BinaryWriter(ms); + MemoryStream ms = new(); + BinaryWriter bw = new(ms); bw.Write(EmptyWav, 0, EmptyWav.Length); ms.Position = 0x18; // samplerate and avgbytespersecond bw.Write(20000); @@ -224,7 +224,7 @@ private void SyncLists() lvPsgWaveforms.Items.Clear(); foreach (var entry in _psgEntries) { - ListViewItem lvi = new ListViewItem(entry.Name); + ListViewItem lvi = new(entry.Name); lvi.SubItems.Add(entry.HitCount.ToString()); lvPsgWaveforms.Items.Add(lvi); } diff --git a/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.cs b/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.cs index 19a76fd322e..98c622927db 100644 --- a/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.cs +++ b/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.cs @@ -83,7 +83,7 @@ public SNESGraphicsDebugger() comboDisplayType.DataSource = displayTypeItems; comboDisplayType.SelectedIndex = 2; - List paletteTypeItems = new List + List paletteTypeItems = new() { // must be in same order as enum new PaletteTypeItem("BizHawk", SnesColors.ColorType.BizHawk), @@ -589,7 +589,7 @@ private void comboBGProps_SelectedIndexChanged(object sender, EventArgs e) private Rectangle GetPaletteRegion(int start, int num) { - Rectangle ret = new Rectangle + Rectangle ret = new() { X = start % 16, Y = start / 16, @@ -617,8 +617,8 @@ private void DrawPaletteRegion(Graphics g, Color color, Rectangle region) int width = cellTotalSize * region.Width; int height = cellTotalSize * region.Height; - Rectangle rect = new Rectangle(x, y, width, height); - using Pen pen = new Pen(color); + Rectangle rect = new(x, y, width, height); + using Pen pen = new(color); g.DrawRectangle(pen, rect); } @@ -635,7 +635,7 @@ private SNESGraphicsDecoder.PaletteSelection GetPaletteSelectionForTileDisplay(i if (selection == eDisplayType.OBJTiles0) bpp = 4; if (selection == eDisplayType.OBJTiles1) bpp = 4; - SNESGraphicsDecoder.PaletteSelection ret = new SNESGraphicsDecoder.PaletteSelection(); + SNESGraphicsDecoder.PaletteSelection ret = new(); if(bpp == 0) return ret; //mode7 ext is fixed to use the top 128 colors @@ -661,7 +661,7 @@ private void RenderPalette() int pixsize = paletteCellSize * 16 + paletteCellSpacing * 17; int cellTotalSize = (paletteCellSize + paletteCellSpacing); - Bitmap bmp = new Bitmap(pixsize, pixsize, PixelFormat.Format32bppArgb); + Bitmap bmp = new(pixsize, pixsize, PixelFormat.Format32bppArgb); using (Graphics g = Graphics.FromImage(bmp)) { for (int y = 0; y < 16; y++) @@ -670,7 +670,7 @@ private void RenderPalette() { int rgb555 = lastPalette[y * 16 + x]; int color = gd.Colorize(rgb555); - using SolidBrush brush = new SolidBrush(Color.FromArgb(color)); + using SolidBrush brush = new(Color.FromArgb(color)); g.FillRectangle(brush, new Rectangle(paletteCellSpacing + x * cellTotalSize, paletteCellSpacing + y * cellTotalSize, paletteCellSize, paletteCellSize)); } } @@ -688,7 +688,7 @@ private void RenderPalette() } if (IsDisplayTypeOBJ(CurrDisplaySelection)) { - SNESGraphicsDecoder.PaletteSelection ps = new SNESGraphicsDecoder.PaletteSelection(128, 128); + SNESGraphicsDecoder.PaletteSelection ps = new(128, 128); region = GetPaletteRegion(ps); DrawPaletteRegion(g, Color.FromArgb(192, 128, 255, 255), region); } @@ -858,7 +858,7 @@ private void Freeze() var tp = tabctrlDetails.SelectedTab; //clone the currently selected tab page into the destination - ArrayList oldControls = new ArrayList(pnGroupFreeze.Controls); + ArrayList oldControls = new(pnGroupFreeze.Controls); pnGroupFreeze.Controls.Clear(); foreach (Control control in tp.Controls) pnGroupFreeze.Controls.Add(control.Clone()); foreach (Control control in oldControls) control.Dispose(); @@ -939,7 +939,7 @@ private void RenderTileView() int tileSize = si.BG[bgs.bgnum].TileSize; int pixels = tileSize * tileSize; - Bitmap bmp = new Bitmap(tileSize, tileSize, PixelFormat.Format32bppArgb); + Bitmap bmp = new(tileSize, tileSize, PixelFormat.Format32bppArgb); var bmpData = bmp.LockBits(new Rectangle(0, 0, tileSize, tileSize), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); if (viewBgMode == SNESGraphicsDecoder.BGMode.Mode7) @@ -963,7 +963,7 @@ private void RenderTileView() //view a tileset tile int bpp = currTileDataState.Bpp; - Bitmap bmp = new Bitmap(8, 8, PixelFormat.Format32bppArgb); + Bitmap bmp = new(8, 8, PixelFormat.Format32bppArgb); var bmpdata = bmp.LockBits(new Rectangle(0, 0, 8, 8), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); if (currTileDataState.Type == eDisplayType.TilesMode7) gd.RenderMode7TilesToScreen((int*)bmpdata.Scan0, bmpdata.Stride / 4, false, false, 1, currTileDataState.Tile, 1); @@ -987,7 +987,7 @@ private void RenderTileView() var bounds = si.ObjSizeBoundsSquare; int width = bounds.Width; int height = bounds.Height; - Bitmap bmp = new Bitmap(width, height, PixelFormat.Format32bppArgb); + Bitmap bmp = new(width, height, PixelFormat.Format32bppArgb); var bmpData = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); gd.RenderSpriteToScreen((int*)bmpData.Scan0, bmpData.Stride / 4, 0, 0, si, currObjDataState.Number); bmp.UnlockBits(bmpData); @@ -995,7 +995,7 @@ private void RenderTileView() } else { - Bitmap bmp = new Bitmap(8, 8, PixelFormat.Format32bppArgb); + Bitmap bmp = new(8, 8, PixelFormat.Format32bppArgb); viewerTile.SetBitmap(bmp); } } @@ -1198,7 +1198,7 @@ private void checkBackdropColor_CheckedChanged(object sender, EventArgs e) private void pnBackdropColor_MouseDoubleClick(object sender, MouseEventArgs e) { - ColorDialog cd = new ColorDialog + ColorDialog cd = new() { Color = pnBackdropColor.BackColor }; diff --git a/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsViewer.cs b/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsViewer.cs index fb18c24477f..9939b90c086 100644 --- a/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsViewer.cs @@ -13,7 +13,7 @@ protected override void ScaleControl(SizeF factor, BoundsSpecified specified) x = (int)(x * factor.Width); if (specified.HasFlag(BoundsSpecified.Y)) y = (int)(y * factor.Height); - Point pt = new Point(x, y); + Point pt = new(x, y); if (pt != Location) Location = pt; } diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs index 0b09b12a5b8..60225042fa8 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs @@ -579,7 +579,7 @@ public bool EditBranchTextPopUp(int index) return false; } - InputPrompt i = new InputPrompt + InputPrompt i = new() { Text = $"Text for branch {index + 1}", TextInputType = InputPrompt.InputType.Text, diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs index d050a792837..8598f3fcc11 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs @@ -177,7 +177,7 @@ public void AddMarker(int frame, bool editText = false) TasMovieMarker marker; if (editText) { - InputPrompt i = new InputPrompt + InputPrompt i = new() { Text = $"Marker for frame {frame}", TextInputType = InputPrompt.InputType.Text, @@ -226,7 +226,7 @@ public void UpdateTextColumnWidth() public void EditMarkerPopUp(TasMovieMarker marker, bool followCursor = false) { int markerFrame = marker.Frame; - InputPrompt i = new InputPrompt + InputPrompt i = new() { Text = $"Marker for frame {markerFrame}", TextInputType = InputPrompt.InputType.Text, @@ -255,7 +255,7 @@ public void EditMarkerPopUp(TasMovieMarker marker, bool followCursor = false) public void EditMarkerFramePopUp(TasMovieMarker marker) { int markerFrame = marker.Frame; - InputPrompt i = new InputPrompt + InputPrompt i = new() { Text = $"Marker for frame {markerFrame}", TextInputType = InputPrompt.InputType.Unsigned, diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs index dfe9d36456d..1c15cb36a8d 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs @@ -235,7 +235,7 @@ private void UpdatePattern() if (index != -1) { - List p = new List(); + List p = new(); for (int i = 0; i < _counts.Count; i++) { for (int c = 0; c < _counts[i]; c++) @@ -257,7 +257,7 @@ private void UpdatePattern() index = _tastudio.MovieSession.MovieController.Definition.Axes.IndexOf(SelectedButton); } - List p = new List(); + List p = new(); for (int i = 0; i < _counts.Count; i++) { for (int c = 0; c < _counts[i]; c++) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 5da4bb91c34..18c78f386bf 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -270,7 +270,7 @@ or Emulation.Cores.Nintendo.Gameboy.Gameboy Cursor = Cursors.WaitCursor; Update(); string exportResult = " not exported."; - FileInfo file = new FileInfo(bk2.Filename); + FileInfo file = new(bk2.Filename); if (file.Exists) { var result = MainForm.DoWithTempMute(() => MessageBox.Show( @@ -430,7 +430,7 @@ private void CopyMenuItem_Click(object sender, EventArgs e) { _tasClipboard.Clear(); int[] list = TasView.SelectedRows.ToArray(); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (int index in list) { @@ -549,7 +549,7 @@ private void CutMenuItem_Click(object sender, EventArgs e) _tasClipboard.Clear(); int[] list = TasView.SelectedRows.ToArray(); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (int index in list) // copy of CopyMenuItem_Click() { @@ -635,7 +635,7 @@ private void DeleteFramesMenuItem_Click(object sender, EventArgs e) private void CloneFramesXTimesMenuItem_Click(object sender, EventArgs e) { - using FramesPrompt framesPrompt = new FramesPrompt("Clone # Times", "Insert times to clone:"); + using FramesPrompt framesPrompt = new("Clone # Times", "Insert times to clone:"); if (framesPrompt.ShowDialog().IsOk()) { CloneFramesXTimes(framesPrompt.Frames); @@ -694,7 +694,7 @@ private void InsertNumFramesMenuItem_Click(object sender, EventArgs e) if (TasView.Focused && TasView.AnyRowsSelected) { int insertionFrame = TasView.SelectionStartIndex ?? 0; - using FramesPrompt framesPrompt = new FramesPrompt(); + using FramesPrompt framesPrompt = new(); if (framesPrompt.ShowDialog().IsOk()) { InsertNumFrames(insertionFrame, framesPrompt.Frames); @@ -816,7 +816,7 @@ private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e) private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e) { - using InputPrompt prompt = new InputPrompt + using InputPrompt prompt = new() { TextInputType = InputPrompt.InputType.Unsigned, Message = "Number of Undo Levels to keep", @@ -845,7 +845,7 @@ private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e) private void SetBranchCellHoverIntervalMenuItem_Click(object sender, EventArgs e) { - using InputPrompt prompt = new InputPrompt + using InputPrompt prompt = new() { TextInputType = InputPrompt.InputType.Unsigned, Message = "ScreenshotPopUp Delay", @@ -866,7 +866,7 @@ private void SetBranchCellHoverIntervalMenuItem_Click(object sender, EventArgs e private void SetSeekingCutoffIntervalMenuItem_Click(object sender, EventArgs e) { - using InputPrompt prompt = new InputPrompt + using InputPrompt prompt = new() { TextInputType = InputPrompt.InputType.Unsigned, Message = "Seeking Cutoff Interval", @@ -889,7 +889,7 @@ private void SetSeekingCutoffIntervalMenuItem_Click(object sender, EventArgs e) private void SetAutosaveIntervalMenuItem_Click(object sender, EventArgs e) { - using InputPrompt prompt = new InputPrompt + using InputPrompt prompt = new() { TextInputType = InputPrompt.InputType.Unsigned, Message = "Autosave Interval in seconds\nSet to 0 to disable", @@ -971,7 +971,7 @@ private void SetCustomsMenuItem_Click(object sender, EventArgs e) { // Exceptions in PatternsForm are not caught by the debugger, I have no idea why. // Exceptions in UndoForm are caught, which makes it weirder. - PatternsForm pForm = new PatternsForm(this) { Owner = this }; + PatternsForm pForm = new(this) { Owner = this }; pForm.Show(); } @@ -1003,7 +1003,7 @@ private void StateHistorySettingsMenuItem_Click(object sender, EventArgs e) private void CommentsMenuItem_Click(object sender, EventArgs e) { - EditCommentsForm form = new EditCommentsForm(CurrentTasMovie, false); + EditCommentsForm form = new(CurrentTasMovie, false); form.Show(); } @@ -1121,13 +1121,13 @@ private void DenoteMarkersWithBGColorToolStripMenuItem_Click(object sender, Even private void ColorSettingsMenuItem_Click(object sender, EventArgs e) { - using TAStudioColorSettingsForm colorSettings = new TAStudioColorSettingsForm(Palette, p => Settings.Palette = p); + using TAStudioColorSettingsForm colorSettings = new(Palette, p => Settings.Palette = p); this.ShowDialogAsChild(colorSettings); } private void WheelScrollSpeedMenuItem_Click(object sender, EventArgs e) { - InputPrompt inputPrompt = new InputPrompt + InputPrompt inputPrompt = new() { TextInputType = InputPrompt.InputType.Unsigned, Message = "Frames per tick:", @@ -1169,7 +1169,7 @@ private void SetUpToolStripColumns() foreach (var column in columns) { - ToolStripMenuItem menuItem = new ToolStripMenuItem + ToolStripMenuItem menuItem = new() { Text = $"{column.Text} ({column.Name})", Checked = column.Visible, @@ -1238,7 +1238,7 @@ private void SetUpToolStripColumns() if (keysMenus.Length > 0) { - ToolStripMenuItem item = new ToolStripMenuItem("Show Keys") + ToolStripMenuItem item = new("Show Keys") { CheckOnClick = true, Checked = false @@ -1267,7 +1267,7 @@ private void SetUpToolStripColumns() { if (playerMenus[i].HasDropDownItems) { - ToolStripMenuItem item = new ToolStripMenuItem($"Show Player {i}") + ToolStripMenuItem item = new($"Show Player {i}") { CheckOnClick = true, Checked = playerMenus[i].DropDownItems.OfType().Any(mi => mi.Checked) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 0af55732c57..5cdbfd6e7c1 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -700,7 +700,7 @@ private void DummyLoadMacro(string path) return; } - MovieZone loadZone = new MovieZone(path, MainForm, Emulator, MovieSession, Tools) + MovieZone loadZone = new(path, MainForm, Emulator, MovieSession, Tools) { Start = TasView.SelectionStartIndex!.Value, }; @@ -1184,7 +1184,7 @@ private void TasView_CellDropped(object sender, InputRoll.CellEventArgs e) { var currentMarker = CurrentTasMovie.Markers.Single(m => m.Frame == e.OldCell.RowIndex.Value); int newFrame = e.NewCell.RowIndex.Value; - TasMovieMarker newMarker = new TasMovieMarker(newFrame, currentMarker.Message); + TasMovieMarker newMarker = new(newFrame, currentMarker.Message); CurrentTasMovie.Markers.Remove(currentMarker); CurrentTasMovie.Markers.Add(newMarker); RefreshDialog(); @@ -1200,7 +1200,7 @@ private void TasView_CellDropped(object sender, InputRoll.CellEventArgs e) private void SetFontMenuItem_Click(object sender, EventArgs e) { - using FontDialog fontDialog = new FontDialog + using FontDialog fontDialog = new() { ShowColor = false, Font = TasView.Font diff --git a/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs index e9038273c51..a9e34a97a96 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -242,7 +242,7 @@ private void AddCloseButton(ToolStripMenuItem subMenu, Form form) subMenu.DropDownItems.Add(new ToolStripSeparatorEx()); } - ToolStripMenuItem closeMenuItem = new ToolStripMenuItem + ToolStripMenuItem closeMenuItem = new() { Name = "CloseBtn", Text = "&Close", @@ -277,7 +277,7 @@ private void AttachSettingHooks(IToolFormAutoConfig tool, ToolDialogSettings set if (dest == null) { - ToolStripMenuItem submenu = new ToolStripMenuItem("&Settings"); + ToolStripMenuItem submenu = new("&Settings"); ms.Items.Add(submenu); dest = submenu.DropDownItems; } @@ -558,7 +558,7 @@ public void Restart(Config config, IEmulator emulator, IGameInfo game) _owner.CheatList.NewList(GenerateDefaultCheatFilename(), autosave: true); } - List unavailable = new List(); + List unavailable = new(); foreach (var tool in _tools) { @@ -825,7 +825,7 @@ public string GenerateDefaultCheatFilename() { string path = _config.PathEntries.CheatsAbsolutePath(_game.System); - FileInfo f = new FileInfo(path); + FileInfo f = new(path); if (f.Directory != null && f.Directory.Exists == false) { f.Directory.Create(); diff --git a/src/BizHawk.Client.EmuHawk/tools/TraceLogger.cs b/src/BizHawk.Client.EmuHawk/tools/TraceLogger.cs index b95970ee5cf..b2e3f75f3f6 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TraceLogger.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TraceLogger.cs @@ -347,7 +347,7 @@ private void SelectAllMenuItem_Click(object sender, EventArgs e) private void MaxLinesMenuItem_Click(object sender, EventArgs e) { - using InputPrompt prompt = new InputPrompt + using InputPrompt prompt = new() { StartLocation = this.ChildPointToScreen(TraceView), TextInputType = InputPrompt.InputType.Unsigned, @@ -361,7 +361,7 @@ private void MaxLinesMenuItem_Click(object sender, EventArgs e) private void SegmentSizeMenuItem_Click(object sender, EventArgs e) { - using InputPrompt prompt = new InputPrompt + using InputPrompt prompt = new() { StartLocation = this.ChildPointToScreen(TraceView), TextInputType = InputPrompt.InputType.Unsigned, diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualPad.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualPad.cs index 3b9332e2f2d..ae2a6c710a6 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualPad.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualPad.cs @@ -85,7 +85,7 @@ private void VirtualPadControl_Load(object sender, EventArgs e) static VirtualPadButton GenVirtualPadButton(InputManager inputManager, ButtonSchema button) { var icon = button.Icon == null ? null : _buttonImages[button.Icon.Value]; - VirtualPadButton buttonControl = new VirtualPadButton + VirtualPadButton buttonControl = new() { InputManager = inputManager, Name = button.Name, diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadDiscManager.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadDiscManager.cs index 886bea2ba48..e8c912dadbf 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadDiscManager.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadDiscManager.cs @@ -42,7 +42,7 @@ private void UpdateCoreAssociation() return; } - List buttons = new List { "- NONE -" }; + List buttons = new() { "- NONE -" }; buttons.AddRange(psx.HackyDiscButtons); lvDiscs.Items.Clear(); @@ -50,7 +50,7 @@ private void UpdateCoreAssociation() int idx = 0; foreach (string button in buttons) { - ListViewItem lvi = new ListViewItem { Text = idx.ToString() }; + ListViewItem lvi = new() { Text = idx.ToString() }; lvi.SubItems.Add(button); lvDiscs.Items.Add(lvi); idx++; diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs index 1d816420e61..455a677cbb2 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs @@ -547,7 +547,7 @@ private bool MayPokeAllSelected private void LoadFileFromRecent(string path) { - FileInfo file = new FileInfo(path); + FileInfo file = new(path); if (!file.Exists) { @@ -814,7 +814,7 @@ private void LoadWatchFile(FileInfo file, bool append, bool truncate = false) _currentFileName = file.FullName; } - WatchList watches = new WatchList(MemoryDomains, Emu.SystemId); + WatchList watches = new(MemoryDomains, Emu.SystemId); watches.Load(file.FullName, append); Settings.RecentSearches.Add(watches.CurrentFileName); @@ -884,7 +884,7 @@ private void UpdateUndoToolBarButtons() private void GoToSpecifiedAddress() { WatchListView.DeselectAll(); - InputPrompt prompt = new InputPrompt + InputPrompt prompt = new() { Text = "Go to Address", StartLocation = this.ChildPointToScreen(WatchListView), @@ -973,7 +973,7 @@ private void SaveMenuItem_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(_currentFileName)) { - WatchList watches = new WatchList(MemoryDomains, Emu.SystemId) { CurrentFileName = _currentFileName }; + WatchList watches = new(MemoryDomains, Emu.SystemId) { CurrentFileName = _currentFileName }; for (int i = 0; i < _searches.Count; i++) { watches.Add(_searches[i]); @@ -1002,7 +1002,7 @@ private void SaveMenuItem_Click(object sender, EventArgs e) private void SaveAsMenuItem_Click(object sender, EventArgs e) { - WatchList watches = new WatchList(MemoryDomains, Emu.SystemId) { CurrentFileName = _currentFileName }; + WatchList watches = new(MemoryDomains, Emu.SystemId) { CurrentFileName = _currentFileName }; for (int i = 0; i < _searches.Count; i++) { watches.Add(_searches[i]); @@ -1052,12 +1052,12 @@ private void DisplayTypeSubMenu_DropDownOpened(object sender, EventArgs e) foreach (var type in types) { - ToolStripMenuItem item = new ToolStripMenuItem - { - Name = $"{type}ToolStripMenuItem", - Text = Watch.DisplayTypeToString(type), - Checked = _settings.Type == type - }; + ToolStripMenuItem item = new() + { + Name = $"{type}ToolStripMenuItem", + Text = Watch.DisplayTypeToString(type), + Checked = _settings.Type == type + }; var type1 = type; item.Click += (o, ev) => DoDisplayTypeClick(type1); @@ -1365,7 +1365,7 @@ private void CopyWatchesToClipBoard() { if (SelectedItems.Any()) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (var watch in SelectedItems) { sb.AppendLine(watch.ToString()); @@ -1589,7 +1589,7 @@ private void NewRamSearch_DragDrop(object sender, DragEventArgs e) string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); if (Path.GetExtension(filePaths[0]) == ".wch") { - FileInfo file = new FileInfo(filePaths[0]); + FileInfo file = new(filePaths[0]); if (file.Exists) { LoadWatchFile(file, false); diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index db84e69ca3d..9e7e77193fd 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -391,7 +391,7 @@ private void CopyWatchesToClipBoard() { if (SelectedItems.Any()) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (var watch in SelectedItems) { sb.AppendLine(watch.ToString()); @@ -439,7 +439,7 @@ private void EditWatch(bool duplicate = false) if (SelectedWatches.Any()) { - WatchEditor we = new WatchEditor + WatchEditor we = new() { InitialLocation = this.ChildPointToScreen(WatchListView), MemoryDomains = MemoryDomains @@ -469,7 +469,7 @@ private void EditWatch(bool duplicate = false) } else if (SelectedSeparators.Any() && !duplicate) { - InputPrompt inputPrompt = new InputPrompt + InputPrompt inputPrompt = new() { Text = "Edit Separator", StartLocation = this.ChildPointToScreen(WatchListView), @@ -754,7 +754,7 @@ private void MemoryDomainsSubMenu_DropDownOpened(object sender, EventArgs e) private void NewWatchMenuItem_Click(object sender, EventArgs e) { - WatchEditor we = new WatchEditor + WatchEditor we = new() { InitialLocation = this.ChildPointToScreen(WatchListView), MemoryDomains = MemoryDomains @@ -817,7 +817,7 @@ private void PokeAddressMenuItem_Click(object sender, EventArgs e) { if (SelectedWatches.Any()) { - RamPoke poke = new RamPoke(DialogController, SelectedWatches, MainForm.CheatList) + RamPoke poke = new(DialogController, SelectedWatches, MainForm.CheatList) { InitialLocation = this.ChildPointToScreen(WatchListView) }; @@ -955,7 +955,7 @@ private void MoveBottomMenuItem_Click(object sender, EventArgs e) _watches.Insert(_watches.Count, watch); } - List newInd = new List(); + List newInd = new(); for (int i = 0, x = _watches.Count - indices.Count; i < indices.Count; i++, x++) { newInd.Add(x); diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs index 0e4febe3811..6de11bf076a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs @@ -233,7 +233,7 @@ private void Ok_Click(object sender, EventArgs e) DoEdit(); break; case Mode.Duplicate: - List tempWatchList = new List(); + List tempWatchList = new(); tempWatchList.AddRange(Watches); Watches.Clear(); foreach (var watch in tempWatchList) diff --git a/src/BizHawk.Common/BinaryQuickSerializer.cs b/src/BizHawk.Common/BinaryQuickSerializer.cs index 72025140a77..f37a5653094 100644 --- a/src/BizHawk.Common/BinaryQuickSerializer.cs +++ b/src/BizHawk.Common/BinaryQuickSerializer.cs @@ -102,8 +102,8 @@ private static SerializationFactory CreateFactory(Type t) .OrderBy(fi => (int)Marshal.OffsetOf(t, fi.Name)) .ToList(); - DynamicMethod rmeth = new DynamicMethod($"{t.Name}_r", null, new[] { typeof(object), typeof(BinaryReader) }, true); - DynamicMethod wmeth = new DynamicMethod($"{t.Name}_w", null, new[] { typeof(object), typeof(BinaryWriter) }, true); + DynamicMethod rmeth = new($"{t.Name}_r", null, new[] { typeof(object), typeof(BinaryReader) }, true); + DynamicMethod wmeth = new($"{t.Name}_w", null, new[] { typeof(object), typeof(BinaryWriter) }, true); { var il = rmeth.GetILGenerator(); diff --git a/src/BizHawk.Common/Extensions/BufferExtensions.cs b/src/BizHawk.Common/Extensions/BufferExtensions.cs index cdccaba2e16..83b7d7bca52 100644 --- a/src/BizHawk.Common/Extensions/BufferExtensions.cs +++ b/src/BizHawk.Common/Extensions/BufferExtensions.cs @@ -55,7 +55,7 @@ public static unsafe void ReadFromHexFast(this byte[] buffer, string hex) /// public static string BytesToHexString(this byte[] bytes) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (byte b in bytes) { sb.AppendFormat("{0:X2}", b); diff --git a/src/BizHawk.Common/Extensions/IOExtensions.cs b/src/BizHawk.Common/Extensions/IOExtensions.cs index 580e7ab939e..c3a0486e592 100644 --- a/src/BizHawk.Common/Extensions/IOExtensions.cs +++ b/src/BizHawk.Common/Extensions/IOExtensions.cs @@ -18,7 +18,7 @@ public static unsafe string GetString(this Encoding encoding, ReadOnlySpan public static byte[] ReadAllBytes(this Stream stream) { - MemoryStream outStream = new MemoryStream(); + MemoryStream outStream = new(); stream.CopyTo(outStream); return outStream.ToArray(); @@ -30,7 +30,7 @@ public static byte[] ReadAllBytes(this BinaryReader br) byte[] buffer = new byte[BUFF_SIZE]; int bytesRead; - MemoryStream outStream = new MemoryStream(); + MemoryStream outStream = new(); while ((bytesRead = br.Read(buffer, 0, BUFF_SIZE)) > 0) { @@ -60,7 +60,7 @@ public static string ReadStringFixedUtf8(this BinaryReader r, int bytes) /// public static string ReadStringUtf8NullTerminated(this BinaryReader br) { - using MemoryStream ms = new MemoryStream(); + using MemoryStream ms = new(); for (;;) { byte b = br.ReadByte(); diff --git a/src/BizHawk.Common/Extensions/PathExtensions.cs b/src/BizHawk.Common/Extensions/PathExtensions.cs index 0e409da425c..9f9c27c9ea8 100644 --- a/src/BizHawk.Common/Extensions/PathExtensions.cs +++ b/src/BizHawk.Common/Extensions/PathExtensions.cs @@ -39,8 +39,8 @@ public static bool IsSubfolderOf(this string? childPath, string? parentPath) #endif } - Uri parentUri = new Uri(parentPath.RemoveSuffix(Path.DirectorySeparatorChar)); - for (DirectoryInfo childUri = new DirectoryInfo(childPath); childUri != null; childUri = childUri.Parent) + Uri parentUri = new(parentPath.RemoveSuffix(Path.DirectorySeparatorChar)); + for (DirectoryInfo childUri = new(childPath); childUri != null; childUri = childUri.Parent) { if (new Uri(childUri.FullName) == parentUri) return true; } @@ -79,7 +79,7 @@ static FileAttributes GetPathAttribute(string path1) if (File.Exists(path1.SubstringBefore('|'))) return FileAttributes.Normal; throw new FileNotFoundException(); } - StringBuilder path = new StringBuilder(260 /* = MAX_PATH */); + StringBuilder path = new(260 /* = MAX_PATH */); return Win32Imports.PathRelativePathTo(path, fromPath, GetPathAttribute(fromPath), toPath, GetPathAttribute(toPath)) ? path.ToString() : throw new ArgumentException(message: "Paths must have a common prefix", paramName: nameof(toPath)); @@ -99,7 +99,7 @@ public static string MakeAbsolute(this string path, string? cwd = null) // FileInfo for normalisation ("C:\a\b\..\c" => "C:\a\c") string mycwd = cwd ?? (OSTailoredCode.IsUnixHost ? Environment.CurrentDirectory : CWDHacks.Get()); string finalpath = $"{mycwd}/{path}"; - FileInfo fi = new FileInfo(finalpath); + FileInfo fi = new(finalpath); return fi.FullName; } } diff --git a/src/BizHawk.Common/FFmpegService.cs b/src/BizHawk.Common/FFmpegService.cs index e6e69061984..37abdaadc5e 100644 --- a/src/BizHawk.Common/FFmpegService.cs +++ b/src/BizHawk.Common/FFmpegService.cs @@ -35,7 +35,7 @@ public class AudioQueryResult private static readonly Regex rxHasAudio = new(@"Stream \#(\d*(\.|\:)\d*)\: Audio", RegexOptions.Compiled); public static AudioQueryResult QueryAudio(string path) { - AudioQueryResult ret = new AudioQueryResult(); + AudioQueryResult ret = new(); string stdout = Run("-i", path).Text; ret.IsAudio = rxHasAudio.Matches(stdout).Count > 0; return ret; @@ -86,9 +86,9 @@ public static RunResults Run(params string[] args) }; Mutex m = new(); - StringBuilder outputBuilder = new StringBuilder(); - TaskCompletionSource outputCloseEvent = new TaskCompletionSource(); - TaskCompletionSource errorCloseEvent = new TaskCompletionSource(); + StringBuilder outputBuilder = new(); + TaskCompletionSource outputCloseEvent = new(); + TaskCompletionSource errorCloseEvent = new(); proc.OutputDataReceived += (s, e) => { diff --git a/src/BizHawk.Common/HawkFile/HawkFile.cs b/src/BizHawk.Common/HawkFile/HawkFile.cs index f8d073b063f..cb44a4e21b7 100644 --- a/src/BizHawk.Common/HawkFile/HawkFile.cs +++ b/src/BizHawk.Common/HawkFile/HawkFile.cs @@ -270,7 +270,7 @@ public void Dispose() public byte[] ReadAllBytes() { using var stream = GetStream(); - using MemoryStream ms = new MemoryStream((int) stream.Length); + using MemoryStream ms = new((int) stream.Length); stream.CopyTo(ms); return ms.GetBuffer(); } diff --git a/src/BizHawk.Common/IImportResolver.cs b/src/BizHawk.Common/IImportResolver.cs index 289ee98e164..19f0dd73bac 100644 --- a/src/BizHawk.Common/IImportResolver.cs +++ b/src/BizHawk.Common/IImportResolver.cs @@ -39,7 +39,7 @@ private static string UnixResolveFilePath(string orig) => orig.IsAbsolute() : UnixSearchPaths.Select(dir => dir + orig) .FirstOrDefault(s => { - FileInfo fi = new FileInfo(s); + FileInfo fi = new(s); return fi.Exists && (fi.Attributes & FileAttributes.Directory) != FileAttributes.Directory; }) ?? orig; // don't MakeAbsolute, just pass through and hope something lower-level magically makes it work diff --git a/src/BizHawk.Common/Serializer.cs b/src/BizHawk.Common/Serializer.cs index 87d97b5e7c6..b83060967bf 100644 --- a/src/BizHawk.Common/Serializer.cs +++ b/src/BizHawk.Common/Serializer.cs @@ -22,11 +22,11 @@ public Serializer() { } public BinaryReader BinaryReader { get; private set; } - public BinaryWriter BinaryWriter => _bw; + public BinaryWriter BinaryWriter { get; private set; } public TextReader TextReader { get; private set; } - public TextWriter TextWriter => _tw; + public TextWriter TextWriter { get; private set; } public Serializer(BinaryWriter bw) { @@ -48,17 +48,17 @@ public Serializer(TextReader tr) StartRead(tr); } - public static Serializer CreateBinaryWriter(BinaryWriter bw) => new Serializer(bw); + public static Serializer CreateBinaryWriter(BinaryWriter bw) => new(bw); - public static Serializer CreateBinaryReader(BinaryReader br) => new Serializer(br); + public static Serializer CreateBinaryReader(BinaryReader br) => new(br); - public static Serializer CreateTextWriter(TextWriter tw) => new Serializer(tw); + public static Serializer CreateTextWriter(TextWriter tw) => new(tw); - public static Serializer CreateTextReader(TextReader tr) => new Serializer(tr); + public static Serializer CreateTextReader(TextReader tr) => new(tr); public void StartWrite(BinaryWriter bw) { - _bw = bw; + BinaryWriter = bw; IsReader = false; } @@ -70,7 +70,7 @@ public void StartRead(BinaryReader br) public void StartWrite(TextWriter tw) { - _tw = tw; + TextWriter = tw; IsReader = false; IsText = true; } @@ -90,7 +90,7 @@ public void BeginSection(string name) { if (IsWriter) { - _tw.WriteLine("[{0}]", name); + TextWriter.WriteLine("[{0}]", name); } else { @@ -107,7 +107,7 @@ public void EndSection() { if (IsWriter) { - _tw.WriteLine("[/{0}]", name); + TextWriter.WriteLine("[/{0}]", name); } else { @@ -134,7 +134,7 @@ public void SyncEnum(string name, ref T val) where T : struct } else { - _bw.Write(Convert.ToInt32(val)); + BinaryWriter.Write(Convert.ToInt32(val)); } } @@ -149,7 +149,7 @@ public void SyncEnumText(string name, ref T val) where T : struct } else { - _tw.WriteLine("{0} {1}", name, val); + TextWriter.WriteLine("{0} {1}", name, val); } } @@ -165,7 +165,7 @@ public void Sync(string name, ref byte[] val, bool useNull) } else { - _bw.WriteByteBuffer(val); + BinaryWriter.WriteByteBuffer(val); } } @@ -186,7 +186,7 @@ public void SyncText(string name, ref byte[] val, bool useNull) else { byte[] temp = val ?? Array.Empty(); - _tw.WriteLine("{0} {1}", name, temp.BytesToHexString()); + TextWriter.WriteLine("{0} {1}", name, temp.BytesToHexString()); } } @@ -206,7 +206,7 @@ public void Sync(string name, ref bool[] val, bool useNull) } else { - _bw.WriteByteBuffer(val.ToUByteBuffer()); + BinaryWriter.WriteByteBuffer(val.ToUByteBuffer()); } } @@ -228,7 +228,7 @@ public void SyncText(string name, ref bool[] val, bool useNull) else { bool[] temp = val ?? Array.Empty(); - _tw.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); + TextWriter.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); } } public void Sync(string name, ref short[] val, bool useNull) @@ -247,7 +247,7 @@ public void Sync(string name, ref short[] val, bool useNull) } else { - _bw.WriteByteBuffer(val.ToUByteBuffer()); + BinaryWriter.WriteByteBuffer(val.ToUByteBuffer()); } } @@ -267,7 +267,7 @@ public void Sync(string name, ref ushort[] val, bool useNull) } else { - _bw.WriteByteBuffer(val.ToUByteBuffer()); + BinaryWriter.WriteByteBuffer(val.ToUByteBuffer()); } } @@ -289,7 +289,7 @@ public void SyncText(string name, ref short[] val, bool useNull) else { short[] temp = val ?? Array.Empty(); - _tw.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); + TextWriter.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); } } @@ -311,7 +311,7 @@ public void SyncText(string name, ref ushort[] val, bool useNull) else { ushort[] temp = val ?? Array.Empty(); - _tw.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); + TextWriter.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); } } @@ -331,7 +331,7 @@ public void Sync(string name, ref int[] val, bool useNull) } else { - _bw.WriteByteBuffer(val.ToUByteBuffer()); + BinaryWriter.WriteByteBuffer(val.ToUByteBuffer()); } } @@ -353,7 +353,7 @@ public void SyncText(string name, ref int[] val, bool useNull) else { int[] temp = val ?? Array.Empty(); - _tw.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); + TextWriter.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); } } @@ -373,7 +373,7 @@ public void Sync(string name, ref uint[] val, bool useNull) } else { - _bw.WriteByteBuffer(val.ToUByteBuffer()); + BinaryWriter.WriteByteBuffer(val.ToUByteBuffer()); } } @@ -395,7 +395,7 @@ public void SyncText(string name, ref uint[] val, bool useNull) else { uint[] temp = val ?? Array.Empty(); - _tw.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); + TextWriter.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); } } @@ -415,7 +415,7 @@ public void Sync(string name, ref float[] val, bool useNull) } else { - _bw.WriteByteBuffer(val.ToUByteBuffer()); + BinaryWriter.WriteByteBuffer(val.ToUByteBuffer()); } } @@ -437,7 +437,7 @@ public void SyncText(string name, ref float[] val, bool useNull) else { float[] temp = val ?? Array.Empty(); - _tw.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); + TextWriter.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); } } @@ -457,7 +457,7 @@ public void Sync(string name, ref double[] val, bool useNull) } else { - _bw.WriteByteBuffer(val.ToUByteBuffer()); + BinaryWriter.WriteByteBuffer(val.ToUByteBuffer()); } } @@ -479,7 +479,7 @@ public void SyncText(string name, ref double[] val, bool useNull) else { double[] temp = val ?? Array.Empty(); - _tw.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); + TextWriter.WriteLine("{0} {1}", name, temp.ToUByteBuffer().BytesToHexString()); } } @@ -725,13 +725,13 @@ public void SyncFixedString(string name, ref string val, int length) char[] remainder = new char[length - buf.Length]; if (IsText) { - _tw.Write(buf); - _tw.Write(remainder); + TextWriter.Write(buf); + TextWriter.Write(remainder); } else { - _bw.Write(buf); - _bw.Write(remainder); + BinaryWriter.Write(buf); + BinaryWriter.Write(remainder); } } } @@ -752,8 +752,6 @@ public void SyncDelta(string name, T[] original, T[] current) } } - private BinaryWriter _bw; - private TextWriter _tw; private readonly Stack _sections = new(); private Section _readerSection, _currSection; private readonly Stack
_sectionStack = new(); @@ -766,12 +764,12 @@ private void BeginTextBlock() } _readerSection = new Section(); - Stack
ss = new Stack
(); + Stack
ss = new(); ss.Push(_readerSection); var curs = _readerSection; - System.Text.RegularExpressions.Regex rxEnd = new System.Text.RegularExpressions.Regex(@"\[/(.*?)\]", System.Text.RegularExpressions.RegexOptions.Compiled); - System.Text.RegularExpressions.Regex rxBegin = new System.Text.RegularExpressions.Regex(@"\[(.*?)\]", System.Text.RegularExpressions.RegexOptions.Compiled); + System.Text.RegularExpressions.Regex rxEnd = new(@"\[/(.*?)\]", System.Text.RegularExpressions.RegexOptions.Compiled); + System.Text.RegularExpressions.Regex rxBegin = new(@"\[(.*?)\]", System.Text.RegularExpressions.RegexOptions.Compiled); // read the entire file into a data structure for flexi-parsing string str; @@ -800,7 +798,7 @@ private void BeginTextBlock() { string name = begin.Groups[1].Value; ss.Push(curs); - Section news = new Section { Name = name }; + Section news = new() { Name = name }; curs.Add(name, news); curs = news; } @@ -979,7 +977,7 @@ private void SyncText(string name, ref bool val) private void Read(ref Bit val) => val = BinaryReader.ReadBit(); - private void Write(ref Bit val) => _bw.WriteBit(val); + private void Write(ref Bit val) => BinaryWriter.WriteBit(val); private void ReadText(string name, ref Bit val) { @@ -989,11 +987,11 @@ private void ReadText(string name, ref Bit val) } } - private void WriteText(string name, ref Bit val) => _tw.WriteLine("{0} {1}", name, (int)val); + private void WriteText(string name, ref Bit val) => TextWriter.WriteLine("{0} {1}", name, (int)val); private void Read(ref byte val) => val = BinaryReader.ReadByte(); - private void Write(ref byte val) => _bw.Write(val); + private void Write(ref byte val) => BinaryWriter.Write(val); private void ReadText(string name, ref byte val) { @@ -1002,11 +1000,11 @@ private void ReadText(string name, ref byte val) val = byte.Parse(Item(name).Replace("0x", ""), NumberStyles.HexNumber); } } - private void WriteText(string name, ref byte val) => _tw.WriteLine("{0} 0x{1:X2}", name, val); + private void WriteText(string name, ref byte val) => TextWriter.WriteLine("{0} 0x{1:X2}", name, val); private void Read(ref ushort val) => val = BinaryReader.ReadUInt16(); - private void Write(ref ushort val) => _bw.Write(val); + private void Write(ref ushort val) => BinaryWriter.Write(val); private void ReadText(string name, ref ushort val) { @@ -1016,14 +1014,14 @@ private void ReadText(string name, ref ushort val) } } - private void WriteText(string name, ref ushort val) => _tw.WriteLine("{0} 0x{1:X4}", name, val); + private void WriteText(string name, ref ushort val) => TextWriter.WriteLine("{0} 0x{1:X4}", name, val); private void Read(ref uint val) { { val = BinaryReader.ReadUInt32(); } } - private void Write(ref uint val) => _bw.Write(val); + private void Write(ref uint val) => BinaryWriter.Write(val); private void ReadText(string name, ref uint val) { @@ -1033,11 +1031,11 @@ private void ReadText(string name, ref uint val) } } - private void WriteText(string name, ref uint val) => _tw.WriteLine("{0} 0x{1:X8}", name, val); + private void WriteText(string name, ref uint val) => TextWriter.WriteLine("{0} 0x{1:X8}", name, val); private void Read(ref sbyte val) => val = BinaryReader.ReadSByte(); - private void Write(ref sbyte val) => _bw.Write(val); + private void Write(ref sbyte val) => BinaryWriter.Write(val); private void ReadText(string name, ref sbyte val) { @@ -1047,11 +1045,11 @@ private void ReadText(string name, ref sbyte val) } } - private void WriteText(string name, ref sbyte val) => _tw.WriteLine("{0} 0x{1:X2}", name, val); + private void WriteText(string name, ref sbyte val) => TextWriter.WriteLine("{0} 0x{1:X2}", name, val); private void Read(ref short val) => val = BinaryReader.ReadInt16(); - private void Write(ref short val) => _bw.Write(val); + private void Write(ref short val) => BinaryWriter.Write(val); private void ReadText(string name, ref short val) { @@ -1061,11 +1059,11 @@ private void ReadText(string name, ref short val) } } - private void WriteText(string name, ref short val) => _tw.WriteLine("{0} 0x{1:X4}", name, val); + private void WriteText(string name, ref short val) => TextWriter.WriteLine("{0} 0x{1:X4}", name, val); private void Read(ref int val) => val = BinaryReader.ReadInt32(); - private void Write(ref int val) => _bw.Write(val); + private void Write(ref int val) => BinaryWriter.Write(val); private void ReadText(string name, ref int val) { @@ -1075,15 +1073,15 @@ private void ReadText(string name, ref int val) } } - private void WriteText(string name, ref int val) => _tw.WriteLine("{0} 0x{1:X8}", name, val); + private void WriteText(string name, ref int val) => TextWriter.WriteLine("{0} 0x{1:X8}", name, val); private void Read(ref long val) => val = BinaryReader.ReadInt64(); - private void Write(ref long val) => _bw.Write(val); + private void Write(ref long val) => BinaryWriter.Write(val); private void Read(ref ulong val) => val = BinaryReader.ReadUInt64(); - private void Write(ref ulong val) => _bw.Write(val); + private void Write(ref ulong val) => BinaryWriter.Write(val); private void ReadText(string name, ref long val) { @@ -1093,7 +1091,7 @@ private void ReadText(string name, ref long val) } } - private void WriteText(string name, ref long val) => _tw.WriteLine("{0} 0x{1:X16}", name, val); + private void WriteText(string name, ref long val) => TextWriter.WriteLine("{0} 0x{1:X16}", name, val); private void ReadText(string name, ref ulong val) { @@ -1103,15 +1101,15 @@ private void ReadText(string name, ref ulong val) } } - private void WriteText(string name, ref ulong val) => _tw.WriteLine("{0} 0x{1:X16}", name, val); + private void WriteText(string name, ref ulong val) => TextWriter.WriteLine("{0} 0x{1:X16}", name, val); private void Read(ref float val) => val = BinaryReader.ReadSingle(); - private void Write(ref float val) => _bw.Write(val); + private void Write(ref float val) => BinaryWriter.Write(val); private void Read(ref double val) => val = BinaryReader.ReadDouble(); - private void Write(ref double val) => _bw.Write(val); + private void Write(ref double val) => BinaryWriter.Write(val); private void ReadText(string name, ref float val) { @@ -1121,7 +1119,7 @@ private void ReadText(string name, ref float val) } } - private void WriteText(string name, ref float val) => _tw.WriteLine("{0} {1}", name, val); + private void WriteText(string name, ref float val) => TextWriter.WriteLine("{0} {1}", name, val); private void ReadText(string name, ref double val) { @@ -1131,11 +1129,11 @@ private void ReadText(string name, ref double val) } } - private void WriteText(string name, ref double val) => _tw.WriteLine("{0} {1}", name, val); + private void WriteText(string name, ref double val) => TextWriter.WriteLine("{0} {1}", name, val); private void Read(ref bool val) => val = BinaryReader.ReadBoolean(); - private void Write(ref bool val) => _bw.Write(val); + private void Write(ref bool val) => BinaryWriter.Write(val); private void ReadText(string name, ref bool val) { @@ -1144,7 +1142,7 @@ private void ReadText(string name, ref bool val) val = bool.Parse(Item(name)); } } - private void WriteText(string name, ref bool val) => _tw.WriteLine("{0} {1}", name, val); + private void WriteText(string name, ref bool val) => TextWriter.WriteLine("{0} {1}", name, val); private sealed class Section : Dictionary { diff --git a/src/BizHawk.Common/SettingsUtil.cs b/src/BizHawk.Common/SettingsUtil.cs index 4b895ea7d83..3a47c806ba2 100644 --- a/src/BizHawk.Common/SettingsUtil.cs +++ b/src/BizHawk.Common/SettingsUtil.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Reflection; using System.Reflection.Emit; using System.Collections.Concurrent; using System.ComponentModel; @@ -54,7 +53,7 @@ public static void SetDefaultValues(T obj) private static DefaultValueSetter CreateSetter(Type t) { - DynamicMethod dyn = new DynamicMethod($"SetDefaultValues_{t.Name}", null, new[] { typeof(object), typeof(object[]) }, false); + DynamicMethod dyn = new($"SetDefaultValues_{t.Name}", null, new[] { typeof(object), typeof(object[]) }, false); var il = dyn.GetILGenerator(); List DefaultValues = new(); diff --git a/src/BizHawk.Common/TempFileManager.cs b/src/BizHawk.Common/TempFileManager.cs index 64e58743019..782386b65df 100644 --- a/src/BizHawk.Common/TempFileManager.cs +++ b/src/BizHawk.Common/TempFileManager.cs @@ -64,8 +64,8 @@ public static void Start() private static void ThreadProc() { // squirrely logic, trying not to create garbage - HashSet knownTempDirs = new HashSet(); - List dis = new List(); + HashSet knownTempDirs = new(); + List dis = new(); for (;;) { lock (typeof(TempFileManager)) diff --git a/src/BizHawk.Common/Util.cs b/src/BizHawk.Common/Util.cs index de978d4936c..08456eaa3f6 100644 --- a/src/BizHawk.Common/Util.cs +++ b/src/BizHawk.Common/Util.cs @@ -55,9 +55,9 @@ public static byte[] DecompressGzipFile(Stream src) src.Seek(-4, SeekOrigin.End); src.Read(tmp, 0, 4); src.Seek(0, SeekOrigin.Begin); - using GZipStream gs = new GZipStream(src, CompressionMode.Decompress, true); + using GZipStream gs = new(src, CompressionMode.Decompress, true); byte[] data = new byte[BitConverter.ToInt32(tmp, 0)]; - using MemoryStream ms = new MemoryStream(data); + using MemoryStream ms = new(data); gs.CopyTo(ms); return data; } @@ -134,7 +134,7 @@ static int CharToNybble(char c) if (c is >= 'a' and <= 'f') return c - 0x57; throw new ArgumentException(message: "not a hex digit", paramName: nameof(c)); } - using MemoryStream ms = new MemoryStream(); + using MemoryStream ms = new(); for (int i = 0, l = str.Length / 2; i != l; i++) ms.WriteByte((byte) ((CharToNybble(str[2 * i]) << 4) + CharToNybble(str[2 * i + 1]))); return ms.ToArray(); } diff --git a/src/BizHawk.Common/Win32/Win32ShellContextMenu.cs b/src/BizHawk.Common/Win32/Win32ShellContextMenu.cs index 26d2655a13c..c4d4a1c7fd7 100644 --- a/src/BizHawk.Common/Win32/Win32ShellContextMenu.cs +++ b/src/BizHawk.Common/Win32/Win32ShellContextMenu.cs @@ -241,7 +241,7 @@ public static extern IShellItem SHCreateItemFromParsingName( private Win32ShellContextMenu(string path) { - Uri uri = new Uri(path); + Uri uri = new(path); // this should be the only scheme used in practice if (uri.Scheme != "file") @@ -295,8 +295,8 @@ public void Dispose() public static void ShowContextMenu(string path, IntPtr parentWindow, int x, int y) { - Win32ShellContextMenu ctxMenu = new Win32ShellContextMenu(path); - using TempMenu menu = new TempMenu(); + Win32ShellContextMenu ctxMenu = new(path); + using TempMenu menu = new(); const int CmdFirst = 0x8000; ctxMenu.ComInterface.QueryContextMenu(menu.Handle, 0, CmdFirst, int.MaxValue, CMF.EXPLORE); int command = TrackPopupMenuEx(menu.Handle, TPM.TPM_RETURNCMD, x, y, parentWindow, IntPtr.Zero); diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Axes/CircularAxisConstraint.cs b/src/BizHawk.Emulation.Common/Base Implementations/Axes/CircularAxisConstraint.cs index 72b75ba89e3..7f8f96aabfb 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Axes/CircularAxisConstraint.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Axes/CircularAxisConstraint.cs @@ -19,8 +19,8 @@ public CircularAxisConstraint(string @class, string pairedAxis, float magnitude) public (int X, int Y) ApplyTo(int rawX, int rawY) { - double xVal = (double) rawX; - double yVal = (double) rawY; + double xVal = rawX; + double yVal = rawY; double length = Math.Sqrt(xVal * xVal + yVal * yVal); double ratio = Magnitude / length; return ratio < 1.0 diff --git a/src/BizHawk.Emulation.Common/Base Implementations/CodeDataLog.cs b/src/BizHawk.Emulation.Common/Base Implementations/CodeDataLog.cs index f98c5f95b92..35da300ffd5 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/CodeDataLog.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/CodeDataLog.cs @@ -135,8 +135,8 @@ public void ClearData() private Dictionary SaveInternal(Stream s, bool forReal) { - Dictionary ret = new Dictionary(); - BinaryWriter w = new BinaryWriter(s); + Dictionary ret = new(); + BinaryWriter w = new(s); w.Write("BIZHAWK-CDL-2"); w.Write(SubType!.PadRight(15)); w.Write(Count); @@ -171,7 +171,7 @@ private Dictionary SaveInternal(Stream s, bool forReal) /// contents of do not begin with valid file header public void Load(Stream s) { - BinaryReader br = new BinaryReader(s); + BinaryReader br = new(s); string id = br.ReadString(); SubType = id switch { diff --git a/src/BizHawk.Emulation.Common/Base Implementations/LinkedDebuggable.cs b/src/BizHawk.Emulation.Common/Base Implementations/LinkedDebuggable.cs index d06737646b3..dd1f90ff491 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/LinkedDebuggable.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/LinkedDebuggable.cs @@ -23,7 +23,7 @@ public LinkedDebuggable(IEmulator[] linkedCores, int numCores, MemoryCallbackSys public IDictionary GetCpuFlagsAndRegisters() { - List> ret = new List>(); + List> ret = new(); for (int i = 0; i < _numCores; i++) { diff --git a/src/BizHawk.Emulation.Common/Base Implementations/LinkedMemoryDomains.cs b/src/BizHawk.Emulation.Common/Base Implementations/LinkedMemoryDomains.cs index f296ecf1711..96ef75e63ef 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/LinkedMemoryDomains.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/LinkedMemoryDomains.cs @@ -22,7 +22,7 @@ public LinkedMemoryDomains(IEmulator[] linkedCores, int numCores, LinkedDisassem private static List LinkMemoryDomains(IEmulator[] linkedCores, int numCores) { - List mm = new List(); + List mm = new(); for (int i = 0; i < numCores; i++) { diff --git a/src/BizHawk.Emulation.Common/Base Implementations/LinkedSaveRam.cs b/src/BizHawk.Emulation.Common/Base Implementations/LinkedSaveRam.cs index a3693450c45..1e88b8f0a5e 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/LinkedSaveRam.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/LinkedSaveRam.cs @@ -34,7 +34,7 @@ private bool LinkedSaveRamModified() public byte[] CloneSaveRam() { - List linkedBuffers = new List(); + List linkedBuffers = new(); int len = 0; for (int i = 0; i < _numCores; i++) { diff --git a/src/BizHawk.Emulation.Common/Base Implementations/MemoryBasedInputCallbackSystem.cs b/src/BizHawk.Emulation.Common/Base Implementations/MemoryBasedInputCallbackSystem.cs index 96415030ef7..26bc49cde31 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/MemoryBasedInputCallbackSystem.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/MemoryBasedInputCallbackSystem.cs @@ -23,7 +23,7 @@ public MemoryBasedInputCallbackSystem(IDebuggable debuggableCore, string scope, foreach (uint address in addresses) { - MemoryCallback callback = new MemoryCallback( + MemoryCallback callback = new( scope, MemoryCallbackType.Read, "InputCallback" + address, diff --git a/src/BizHawk.Emulation.Common/Database/Database.cs b/src/BizHawk.Emulation.Common/Database/Database.cs index 157df3d2432..86320958bfb 100644 --- a/src/BizHawk.Emulation.Common/Database/Database.cs +++ b/src/BizHawk.Emulation.Common/Database/Database.cs @@ -61,7 +61,7 @@ private static void LoadDatabase_Escape(string line, bool inUser, bool silent) public static void SaveDatabaseEntry(CompactGameInfo gameInfo, string filename = "gamedb_user.txt") { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); sb .Append("sha1:") // TODO: how do we know it is sha1? .Append(gameInfo.Hash) @@ -99,7 +99,7 @@ private static void InitializeWork(string path, bool inUser, bool silent) { if (!inUser) _expected.Remove(Path.GetFileName(path)); //reminder: this COULD be done on several threads, if it takes even longer - using StreamReader reader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)); + using StreamReader reader = new(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)); while (reader.EndOfStream == false) { string line = reader.ReadLine() ?? ""; @@ -120,7 +120,7 @@ private static void InitializeWork(string path, bool inUser, bool silent) string[] items = line.Split('\t'); - CompactGameInfo game = new CompactGameInfo + CompactGameInfo game = new() { Hash = FormatHash(items[0]), Status = items[1].Trim() @@ -225,7 +225,7 @@ public static GameInfo GetGameInfo(byte[] romData, string fileName) } // rom is not in database. make some best-guesses - GameInfo game = new GameInfo + GameInfo game = new() { Hash = hashSHA1, Status = RomStatus.NotInDatabase, @@ -371,7 +371,7 @@ public static GameInfo GetGameInfo(byte[] romData, string fileName) break; case ".DSK": - DskIdentifier dId = new DskIdentifier(romData); + DskIdentifier dId = new(romData); game.System = dId.IdentifiedSystem; break; diff --git a/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs b/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs index 096e33082cf..09e391197c0 100644 --- a/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs +++ b/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs @@ -49,7 +49,7 @@ FirmwareFile File( void Option(string systemId, string id, in FirmwareFile ff, FirmwareOptionStatus status = FirmwareOptionStatus.Acceptable) { - FirmwareOption option = new FirmwareOption(new(systemId, id), ff.Hash, ff.Size, ff.IsBad ? FirmwareOptionStatus.Bad : status); + FirmwareOption option = new(new(systemId, id), ff.Hash, ff.Size, ff.IsBad ? FirmwareOptionStatus.Bad : status); options.Add(option); filesByOption[option] = ff; } diff --git a/src/BizHawk.Emulation.Common/Extensions.cs b/src/BizHawk.Emulation.Common/Extensions.cs index 8b0ec180efb..92598d9b2a5 100644 --- a/src/BizHawk.Emulation.Common/Extensions.cs +++ b/src/BizHawk.Emulation.Common/Extensions.cs @@ -275,7 +275,7 @@ public static int VsyncDenominator(this IEmulator core) private static List ToControlNameList(IEnumerable buttonList, int? controllerNum = null) { - List buttons = new List(); + List buttons = new(); foreach (string button in buttonList) { if (controllerNum != null && button.Length > 2 && button.Substring(0, 2) == $"P{controllerNum}") @@ -293,7 +293,7 @@ private static List ToControlNameList(IEnumerable buttonList, in public static IReadOnlyDictionary ToDictionary(this IController controller, int? controllerNum = null) { - Dictionary dict = new Dictionary(); + Dictionary dict = new(); if (controllerNum == null) { foreach (string buttonName in controller.Definition.BoolButtons) dict[buttonName] = controller.IsPressed(buttonName); diff --git a/src/BizHawk.Emulation.Common/Interfaces/Services/IStatable.cs b/src/BizHawk.Emulation.Common/Interfaces/Services/IStatable.cs index a558714fdf6..34520226714 100644 --- a/src/BizHawk.Emulation.Common/Interfaces/Services/IStatable.cs +++ b/src/BizHawk.Emulation.Common/Interfaces/Services/IStatable.cs @@ -55,8 +55,8 @@ public static void LoadStateText(this IStatable core, TextReader reader) { byte[] state = new byte[hex.Length / 2]; state.ReadFromHexFast(hex); - using MemoryStream ms = new MemoryStream(state); - using BinaryReader br = new BinaryReader(ms); + using MemoryStream ms = new(state); + using BinaryReader br = new(ms); core.LoadStateBinary(br); } } @@ -68,8 +68,8 @@ public static void LoadStateText(this IStatable core, TextReader reader) /// public static void LoadStateBinary(this IStatable core, byte[] state) { - using MemoryStream ms = new MemoryStream(state, false); - using BinaryReader br = new BinaryReader(ms); + using MemoryStream ms = new(state, false); + using BinaryReader br = new(ms); core.LoadStateBinary(br); } @@ -79,8 +79,8 @@ public static void LoadStateBinary(this IStatable core, byte[] state) /// public static byte[] CloneSavestate(this IStatable core) { - using MemoryStream ms = new MemoryStream(); - using BinaryWriter bw = new BinaryWriter(ms); + using MemoryStream ms = new(); + using BinaryWriter bw = new(ms); core.SaveStateBinary(bw); bw.Flush(); byte[] stateBuffer = ms.ToArray(); diff --git a/src/BizHawk.Emulation.Common/Sound/SpeexResampler.cs b/src/BizHawk.Emulation.Common/Sound/SpeexResampler.cs index a79049a3de4..2c8d7ad113e 100644 --- a/src/BizHawk.Emulation.Common/Sound/SpeexResampler.cs +++ b/src/BizHawk.Emulation.Common/Sound/SpeexResampler.cs @@ -19,7 +19,7 @@ public class SpeexResampler : IDisposable, ISoundProvider private static readonly LibSpeexDSP NativeDSP; static SpeexResampler() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( OSTailoredCode.IsUnixHost ? "libspeexdsp.so.1" : "libspeexdsp.dll", hasLimitedLifetime: false); NativeDSP = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); } diff --git a/src/BizHawk.Emulation.Common/Sound/Waves.cs b/src/BizHawk.Emulation.Common/Sound/Waves.cs index 3c38e71ebba..24e94787386 100644 --- a/src/BizHawk.Emulation.Common/Sound/Waves.cs +++ b/src/BizHawk.Emulation.Common/Sound/Waves.cs @@ -26,7 +26,7 @@ public static void InitWaves() PeriodicWave16 = new short[] { 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; NoiseWave = new short[0x1000]; - System.Random rnd = new System.Random(unchecked((int)0xDEADBEEF)); + System.Random rnd = new(unchecked((int)0xDEADBEEF)); for (int i = 0; i < NoiseWave.Length; i++) { int r = rnd.Next(); diff --git a/src/BizHawk.Emulation.Common/zstd/Zstd.cs b/src/BizHawk.Emulation.Common/zstd/Zstd.cs index 6f274f4b7d2..798b96c59d8 100644 --- a/src/BizHawk.Emulation.Common/zstd/Zstd.cs +++ b/src/BizHawk.Emulation.Common/zstd/Zstd.cs @@ -376,7 +376,7 @@ public override void Write(byte[] buffer, int offset, int count) static Zstd() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( OSTailoredCode.IsUnixHost ? "libzstd.so.1" : "libzstd.dll", hasLimitedLifetime: false); _lib = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); @@ -473,10 +473,10 @@ public static MemoryStream DecompressZstdStream(Stream src) } src.Seek(0, SeekOrigin.Begin); - using ZstdDecompressionStreamContext dctx = new ZstdDecompressionStreamContext(); + using ZstdDecompressionStreamContext dctx = new(); dctx.InitContext(); - using ZstdDecompressionStream dstream = new ZstdDecompressionStream(src, dctx); - MemoryStream ret = new MemoryStream(); + using ZstdDecompressionStream dstream = new(src, dctx); + MemoryStream ret = new(); dstream.CopyTo(ret); return ret; } diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs index 3bf2ceb4b58..09023dc1a6a 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs @@ -24,9 +24,9 @@ private void GetInputFields() string[] buttonFields = MameGetString(MAMELuaCommand.GetButtonFields).Split(';'); string[] analogFields = MameGetString(MAMELuaCommand.GetAnalogFields).Split(';'); - List buttonFieldList = new List(); - List analogFieldList = new List(); - List fieldPtrList = new List(); + List buttonFieldList = new(); + List analogFieldList = new(); + List fieldPtrList = new(); void AddFieldPtr(string tag, string field) { diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISaveRam.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISaveRam.cs index 60163d4dc23..7e0927318d4 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISaveRam.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISaveRam.cs @@ -30,8 +30,8 @@ public byte[] CloneSaveRam() _core.mame_nvram_save(); - using MemoryStream ms = new MemoryStream(); - using BinaryWriter writer = new BinaryWriter(ms); + using MemoryStream ms = new(); + using BinaryWriter writer = new(ms); writer.Write(NVRAM_MAGIC); writer.Write(_nvramFilenames.Count); @@ -54,8 +54,8 @@ public void StoreSaveRam(byte[] data) return; } - using MemoryStream ms = new MemoryStream(data, false); - using BinaryReader reader = new BinaryReader(ms); + using MemoryStream ms = new(data, false); + using BinaryReader reader = new(ms); if (reader.ReadString() != NVRAM_MAGIC) { @@ -68,7 +68,7 @@ public void StoreSaveRam(byte[] data) throw new InvalidOperationException($"Wrong NVRAM file count! (got {cnt}, expected {_nvramFilenames.Count})"); } - List nvramFilesToClose = new List(); + List nvramFilesToClose = new(); void RemoveFiles() { foreach (string nvramFileToClose in nvramFilesToClose) diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs index bd40b60fca5..01511a42121 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs @@ -79,7 +79,7 @@ public void FetchDefaultGameSettings() foreach (string fieldName in fieldNames) { - DriverSetting setting = new DriverSetting + DriverSetting setting = new() { Name = fieldName, GameName = _gameShortName, @@ -125,7 +125,7 @@ private void GetROMsInfo() string[] ROMs = ROMsInfo.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); string tempDefault = string.Empty; - DriverSetting setting = new DriverSetting + DriverSetting setting = new() { Name = "BIOS", GameName = _gameShortName, diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.MemoryDomains.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.MemoryDomains.cs index 4a0b610b9c4..a4dbd64db2d 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.MemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.MemoryDomains.cs @@ -59,7 +59,7 @@ public override void Exit() private void InitMemoryDomains() { - List domains = new List(); + List domains = new(); int systemBusAddressShift = _core.mame_lua_get_int(MAMELuaCommand.GetSpaceAddressShift); int dataWidth = _core.mame_lua_get_int(MAMELuaCommand.GetSpaceDataWidth) >> 3; // mame returns in bits diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs index d0004a8f286..c246792717d 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs @@ -149,9 +149,9 @@ static byte[] MakeRomData(IRomAsset rom) { // if this is deflate, unzip the zip, and rezip it without compression // this is to get around some zlib bug? - using MemoryStream ret = new MemoryStream(); + using MemoryStream ret = new(); ret.Write(rom.FileData, 0, rom.FileData.Length); - using (ZipArchive zip = new ZipArchive(ret, ZipArchiveMode.Update, leaveOpen: true)) + using (ZipArchive zip = new(ret, ZipArchiveMode.Update, leaveOpen: true)) { foreach (string entryName in zip.Entries.Select(e => e.FullName).ToList()) { @@ -192,7 +192,7 @@ string MakeFileName(IRomAsset rom) } // https://docs.mamedev.org/commandline/commandline-index.html - List args = new List + List args = new() { "mame" // dummy, internally discarded by index, so has to go first , _gameFileName // no dash for rom names diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAMEMachineDB.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAMEMachineDB.cs index f244b14363c..07dc4407c00 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAMEMachineDB.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAMEMachineDB.cs @@ -36,8 +36,8 @@ public static void Initialize(string basePath) private MAMEMachineDB(string basePath) { - using HawkFile mameMachineFile = new HawkFile(Path.Combine(basePath, "mame_machines.txt")); - using StreamReader sr = new StreamReader(mameMachineFile.GetStream()); + using HawkFile mameMachineFile = new(Path.Combine(basePath, "mame_machines.txt")); + using StreamReader sr = new(mameMachineFile.GetStream()); while (true) { string line = sr.ReadLine(); diff --git a/src/BizHawk.Emulation.Cores/CPUs/68000/Diassembler.cs b/src/BizHawk.Emulation.Cores/CPUs/68000/Diassembler.cs index 3c1848f21f3..ffea3fa583b 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/68000/Diassembler.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/68000/Diassembler.cs @@ -17,7 +17,7 @@ partial class MC68000 { public DisassemblyInfo Disassemble(int pc) { - DisassemblyInfo info = new DisassemblyInfo { Mnemonic = "UNKNOWN", PC = pc, Length = 2 }; + DisassemblyInfo info = new() { Mnemonic = "UNKNOWN", PC = pc, Length = 2 }; op = (ushort)ReadWord(pc); if (Opcodes[op] == MOVE) MOVE_Disasm(info); @@ -102,7 +102,7 @@ public DisassemblyInfo Disassemble(int pc) else if (Opcodes[op] == MOVECCR) MOVECCR_Disasm(info); else if (Opcodes[op] == TRAP) TRAP_Disasm(info); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); for (int p = info.PC; p < info.PC + info.Length; p++) sb.AppendFormat("{0:X2}", ReadByte(p)); info.RawBytes = sb.ToString(); diff --git a/src/BizHawk.Emulation.Cores/CPUs/68000/Instructions/DataMovement.cs b/src/BizHawk.Emulation.Cores/CPUs/68000/Instructions/DataMovement.cs index fbdca619733..3c57595c05c 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/68000/Instructions/DataMovement.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/68000/Instructions/DataMovement.cs @@ -389,7 +389,7 @@ private void MOVEM1() private static string DisassembleRegisterList0(uint registers) { - StringBuilder str = new StringBuilder(); + StringBuilder str = new(); int count = 0; bool snip = false; for (int i = 0; i < 8; i++) @@ -444,7 +444,7 @@ private static string DisassembleRegisterList0(uint registers) private static string DisassembleRegisterList1(uint registers) { - StringBuilder str = new StringBuilder(); + StringBuilder str = new(); int count = 0; bool snip = false; for (int i = 0; i < 8; i++) diff --git a/src/BizHawk.Emulation.Cores/CPUs/ARM/Darm.cs b/src/BizHawk.Emulation.Cores/CPUs/ARM/Darm.cs index 794dc48bd27..de763e6e38a 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/ARM/Darm.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/ARM/Darm.cs @@ -92,8 +92,8 @@ public class Darm_Str_T public string DisassembleStuff(uint addr, uint opcode) { - Darm_T d = new Darm_T(); - Darm_Str_T s = new Darm_Str_T(); + Darm_T d = new(); + Darm_Str_T s = new(); if (!Disassemble(d, (ushort)opcode, (ushort)(opcode >> 16), addr)) return null; if (Str(d, s, false)) diff --git a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Registers.cs b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Registers.cs index 766c029f766..7b4759f58b7 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Registers.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Registers.cs @@ -244,7 +244,7 @@ public ushort RegIRQV public IDictionary GetCpuFlagsAndRegisters() { - Dictionary res = new Dictionary + Dictionary res = new() { ["A"] = Regs[A], ["W"] = Regs[W], diff --git a/src/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280_CDL.cs b/src/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280_CDL.cs index d94af8751e4..55599f97211 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280_CDL.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280_CDL.cs @@ -8,7 +8,7 @@ public partial class HuC6280 { public void DisassembleCDL(Stream s, ICodeDataLog cdl, IMemoryDomains mem) { - StreamWriter w = new StreamWriter(s); + StreamWriter w = new(s); w.WriteLine("; Bizhawk CDL Disassembly"); w.WriteLine(); foreach (var kvp in cdl) diff --git a/src/BizHawk.Emulation.Cores/CPUs/LR35902/NewDisassembler.cs b/src/BizHawk.Emulation.Cores/CPUs/LR35902/NewDisassembler.cs index f2b8180b5ea..fcb62ae92b9 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/LR35902/NewDisassembler.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/LR35902/NewDisassembler.cs @@ -1043,7 +1043,7 @@ public sealed partial class LR35902 public static string Disassemble(ushort addr, Func reader, bool rgbds, out ushort size) { ushort origaddr = addr; - List bytes = new List + List bytes = new() { reader(addr++) }; @@ -1101,7 +1101,7 @@ public static string Disassemble(ushort addr, Func reader, bool rg string sign = (d >= 128) ? "-" : ""; result = result.Replace("e8", rgbds ? sign + $"${offs:X2}" : sign + $"{offs:X2}h"); } - StringBuilder ret = new StringBuilder(); + StringBuilder ret = new(); ret.Append($"{origaddr:X4}: "); foreach (byte b in bytes) ret.Append($"{b:X2} "); diff --git a/src/BizHawk.Emulation.Cores/CPUs/x86/Disassembler.cs b/src/BizHawk.Emulation.Cores/CPUs/x86/Disassembler.cs index 3b93bbd0249..098d419679c 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/x86/Disassembler.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/x86/Disassembler.cs @@ -101,7 +101,7 @@ private string DisassembleMod(ref int addr, int mod, int m, int size) public DisassemblyInfo Disassemble(int addr) { - DisassemblyInfo info = new DisassemblyInfo { Addr = addr }; + DisassemblyInfo info = new() { Addr = addr }; byte op1 = ReadMemory(addr++); switch (op1) { @@ -180,7 +180,7 @@ public DisassemblyInfo Disassemble(int addr) } info.Length = addr - info.Addr; - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); for (int p = info.Addr; p < info.Addr + info.Length; p++) sb.AppendFormat("{0:X2}", ReadMemory(p)); info.RawBytes = sb.ToString(); diff --git a/src/BizHawk.Emulation.Cores/Calculators/Emu83/Emu83.cs b/src/BizHawk.Emulation.Cores/Calculators/Emu83/Emu83.cs index 4fb22e651c7..0bb77ad0cc4 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/Emu83/Emu83.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/Emu83/Emu83.cs @@ -16,7 +16,7 @@ public partial class Emu83 : TI83Common static Emu83() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( OSTailoredCode.IsUnixHost ? "libemu83.so" : "libemu83.dll", hasLimitedLifetime: false); LibEmu83 = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); } diff --git a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IMemoryDomains.cs index 26f4413e80c..c6b2e2ceb40 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IMemoryDomains.cs @@ -14,9 +14,9 @@ public partial class TI83 private void SetupMemoryDomains() { - List domains = new List(); + List domains = new(); - MemoryDomainDelegate systemBusDomain = new MemoryDomainDelegate("System Bus", 0x10000, MemoryDomain.Endian.Little, + MemoryDomainDelegate systemBusDomain = new("System Bus", 0x10000, MemoryDomain.Endian.Little, (addr) => { if (addr is < 0 or > 0xFFFF) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); @@ -49,7 +49,7 @@ private void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Little, data, true, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Little, data, true, 1); _byteArrayDomains.Add(name, m); } } diff --git a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IStatable.cs b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IStatable.cs index 942e77bf3a5..c05f2b4edb0 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IStatable.cs @@ -10,7 +10,7 @@ private void SyncState(Serializer ser) { if (ser.IsWriter) { - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); ms.Close(); ms.ToArray(); } diff --git a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs index b303bf551b7..27681ad33e7 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs @@ -13,7 +13,7 @@ public partial class TI83 : TI83Common, IEmulator, IVideoProvider, IDebuggable, [CoreConstructor(VSystemID.Raw.TI83)] public TI83(CoreLoadParameters lp) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; PutSettings(lp.Settings ?? new TI83CommonSettings()); diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.Controllers.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.Controllers.cs index 7e0f1f670d2..c2088ee6b58 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.Controllers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.Controllers.cs @@ -19,7 +19,7 @@ public ControllerDefinition AmstradCPCControllerDefinition ControllerDefinition definition = new("AmstradCPC Controller"); // joysticks - List joys1 = new List + List joys1 = new() { // P1 Joystick "P1 Up", "P1 Down", "P1 Left", "P1 Right", "P1 Fire1", "P1 Fire2", "P1 Fire3" @@ -31,7 +31,7 @@ public ControllerDefinition AmstradCPCControllerDefinition definition.CategoryLabels[s] = "J1"; } - List joys2 = new List + List joys2 = new() { // P2 Joystick "P2 Up", "P2 Down", "P2 Left", "P2 Right", "P2 Fire", @@ -44,7 +44,7 @@ public ControllerDefinition AmstradCPCControllerDefinition } // keyboard - List keys = new List + List keys = new() { // http://www.cpcwiki.eu/index.php/Programming:Keyboard_scanning // http://www.cpcwiki.eu/index.php/File:Grimware_cpc464_version3_case_top.jpg @@ -72,7 +72,7 @@ public ControllerDefinition AmstradCPCControllerDefinition } // Power functions - List power = new List + List power = new() { // Power functions "Reset", "Power" @@ -85,7 +85,7 @@ public ControllerDefinition AmstradCPCControllerDefinition } // Datacorder (tape device) - List tape = new List + List tape = new() { // Tape functions "Play Tape", "Stop Tape", "RTZ Tape", "Record Tape", "Insert Next Tape", @@ -99,7 +99,7 @@ public ControllerDefinition AmstradCPCControllerDefinition } // Datacorder (tape device) - List disk = new List + List disk = new() { // Tape functions "Insert Next Disk", "Insert Previous Disk", /*"Eject Current Disk",*/ "Get Disk Status" diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IMemoryDomains.cs index 3b12659ce80..176ca45165d 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IMemoryDomains.cs @@ -17,7 +17,7 @@ public partial class AmstradCPC private void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate("System Bus", 0x10000, MemoryDomain.Endian.Little, (addr) => @@ -65,7 +65,7 @@ private void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Little, data, true, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Little, data, true, 1); _byteArrayDomains.Add(name, m); } #pragma warning restore MEN014 diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.ISettable.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.ISettable.cs index 71e7e1a8a46..0c577ad8b34 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.ISettable.cs @@ -147,7 +147,7 @@ public class CPCMachineMetaData public static CPCMachineMetaData GetMetaObject(MachineType type) { - CPCMachineMetaData m = new CPCMachineMetaData { MachineType = type }; + CPCMachineMetaData m = new() { MachineType = type }; switch (type) { @@ -190,7 +190,7 @@ public static CPCMachineMetaData GetMetaObject(MachineType type) public static string GetMetaString(MachineType type) { var m = GetMetaObject(type); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); // get longest title int titleLen = 0; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IStatable.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IStatable.cs index d03232ca46d..6349fa4513f 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IStatable.cs @@ -14,7 +14,7 @@ private void SyncState(Serializer ser) byte[] core = null; if (ser.IsWriter) { - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); ms.Close(); core = ms.ToArray(); } diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs index 6e895418e14..5a147bdeb17 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs @@ -18,7 +18,7 @@ public partial class AmstradCPC : IRegionable, IDriveLight [CoreConstructor(VSystemID.Raw.AmstradCPC)] public AmstradCPC(CoreLoadParameters lp) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; CoreComm = lp.Comm; _gameInfo = lp.Roms.Select(r => r.Game).ToList(); @@ -158,7 +158,7 @@ private void Init(MachineType machineType, List files, bool autoTape, Bo { case MachineType.CPC464: _machine = new CPC464(this, _cpu, files, autoTape, bType); - List roms64 = new List + List roms64 = new() { RomData.InitROM(MachineType.CPC464, GetFirmware(0x4000, "OS464ROM"), RomData.ROMChipType.Lower), RomData.InitROM(MachineType.CPC464, GetFirmware(0x4000, "BASIC1-0ROM"), RomData.ROMChipType.Upper, 0) @@ -168,7 +168,7 @@ private void Init(MachineType machineType, List files, bool autoTape, Bo case MachineType.CPC6128: _machine = new CPC6128(this, _cpu, files, autoTape, bType); - List roms128 = new List + List roms128 = new() { RomData.InitROM(MachineType.CPC6128, GetFirmware(0x4000, "OS6128ROM"), RomData.ROMChipType.Lower), RomData.InitROM(MachineType.CPC6128, GetFirmware(0x4000, "BASIC1-1ROM"), RomData.ROMChipType.Upper, 0), diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Display/AmstradGateArray.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Display/AmstradGateArray.cs index cc8c9f3efa8..8440c93d6ba 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Display/AmstradGateArray.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Display/AmstradGateArray.cs @@ -944,7 +944,6 @@ public void OnVSYNC() } public int[] ScreenBuffer; - private int _bufferHeight; public int BackgroundColor => CPCHardwarePalette[0]; @@ -954,11 +953,7 @@ public void OnVSYNC() public int BufferWidth { get; set; } - public int BufferHeight - { - get => _bufferHeight; - set => _bufferHeight = value; - } + public int BufferHeight { get; set; } public int SysBufferWidth; public int SysBufferHeight; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Input/StandardKeyboard.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Input/StandardKeyboard.cs index 5c64ed58eb8..e4714fb2c2f 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Input/StandardKeyboard.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Input/StandardKeyboard.cs @@ -76,7 +76,7 @@ public StandardKeyboard(CPCBase machine) KeyStatus = new bool[8 * 10]; // nonmatrix keys (anything that hasnt already been taken) - List nonMatrix = new List(); + List nonMatrix = new(); foreach (string key in _machine.CPC.AmstradCPCControllerDefinition.BoolButtons) { diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/GateArrayBase.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/GateArrayBase.cs index 0eba245682f..c6789668547 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/GateArrayBase.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/GateArrayBase.cs @@ -395,7 +395,6 @@ public bool WritePort(ushort port, int result) /// Video output buffer /// public int[] ScreenBuffer; - private int _bufferHeight; public int BackgroundColor => CPCHardwarePalette[16]; @@ -405,11 +404,7 @@ public bool WritePort(ushort port, int result) public int BufferWidth { get; set; } - public int BufferHeight - { - get => _bufferHeight; - set => _bufferHeight = value; - } + public int BufferHeight { get; set; } public int VsyncNumerator { diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/CDT/CdtConverter.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/CDT/CdtConverter.cs index 74ba62e90e2..ac956a6ae97 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/CDT/CdtConverter.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/CDT/CdtConverter.cs @@ -58,7 +58,7 @@ public CdtConverter(DatacorderDevice _tapeDevice) /// private TapeDataBlock ConvertClock(TapeDataBlock db) { - TapeDataBlock tb = new TapeDataBlock + TapeDataBlock tb = new() { BlockDescription = db.BlockDescription, BlockID = db.BlockID, @@ -335,7 +335,7 @@ This block must be replayed with the standard Spectrum ROM timing values - see t for custom loading routines that use the same timings as ROM ones do. */ private void ProcessBlockID10(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x10, BlockDescription = BlockType.Standard_Speed_Data_Block, @@ -387,7 +387,7 @@ This block is very similar to the normal TAP block but with some additional info sync or pilot tones (i.e. all sorts of protection schemes) then use the next three blocks to describe it.*/ private void ProcessBlockID11(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x11, BlockDescription = BlockType.Turbo_Speed_Data_Block, @@ -438,7 +438,7 @@ private void ProcessBlockID12(byte[] data) { int blockLen = 4; - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x12, BlockDescription = BlockType.Pure_Tone, @@ -569,7 +569,7 @@ The preferred sampling frequencies are 22050 or 44100 Hz (158 or 79 T-states/sam Please use this block only if you cannot use any other block. */ private void ProcessBlockID15(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x15, BlockDescription = BlockType.Direct_Recording, @@ -790,7 +790,7 @@ the symbol and the number of times it must be repeated. private void ProcessBlockID19(byte[] data) { // not currently implemented properly - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x19, BlockDescription = BlockType.Generalized_Data_Block, @@ -892,7 +892,7 @@ You can also give the group a name (example 'Bleepload Block 1'). For each group start block, there must be a group end block. Nesting of groups is not allowed. */ private void ProcessBlockID21(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x21, DataPeriods = new List(), @@ -947,7 +947,7 @@ All blocks are included in the block count!. */ private void ProcessBlockID23(byte[] data) { // not implemented properly - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x23, DataPeriods = new List(), @@ -993,7 +993,7 @@ be repeated. This block is the same as the FOR statement in BASIC. For simplicity reasons don't nest loop blocks! */ private void ProcessBlockID24(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x24, DataPeriods = new List(), @@ -1030,7 +1030,7 @@ private void ProcessBlockID24(byte[] data) This block has no body. */ private void ProcessBlockID25(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x25, DataPeriods = new List(), @@ -1085,7 +1085,7 @@ then goes back to the next block. Because more than one call can be normally use private void ProcessBlockID26(byte[] data) { // block processing not implemented for this - just gets added for informational purposes only - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x26, DataPeriods = new List(), @@ -1111,7 +1111,7 @@ This block indicates the end of the Called Sequence. The next block played will private void ProcessBlockID27(byte[] data) { // block processing not implemented for this - just gets added for informational purposes only - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x27, DataPeriods = new List(), @@ -1144,7 +1144,7 @@ selections when it encounters such a block. All offsets are relative signed word private void ProcessBlockID28(byte[] data) { // block processing not implemented for this - just gets added for informational purposes only - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x28, DataPeriods = new List(), @@ -1171,7 +1171,7 @@ 0x00 0 DWORD Length of the block without these four bytes (0) This block has no body of its own, but follows the extension rule. */ private void ProcessBlockID2A(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x2A, DataPeriods = new List(), @@ -1199,7 +1199,7 @@ This block sets the current signal level to the specified value (high or low). I ambiguities, e.g. with custom loaders which are level-sensitive. */ private void ProcessBlockID2B(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x2B, DataPeriods = new List(), @@ -1227,7 +1227,7 @@ The description can be up to 255 characters long but please keep it down to abou Please use 'Archive Info' block for title, authors, publisher, etc. */ private void ProcessBlockID30(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x30, DataPeriods = new List(), @@ -1266,7 +1266,7 @@ stick to a maximum of 8 lines. private void ProcessBlockID31(byte[] data) { // currently not implemented properly in CPCHawk - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x31, DataPeriods = new List(), @@ -1326,7 +1326,7 @@ If all texts on the tape are in English language then you don't have to supply t The information about what hardware the tape uses is in the 'Hardware Type' block, so no need for it here. */ private void ProcessBlockID32(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x32, DataPeriods = new List(), @@ -1464,7 +1464,7 @@ 0x10 L DWORD Length of the custom info extra settings required by a particular emulator, or even poke data. */ private void ProcessBlockID35(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x35, DataPeriods = new List(), @@ -1498,7 +1498,7 @@ This block is generated when you merge two ZX Tape files together. It is here so ensure that they are both of the higher version number. */ private void ProcessBlockID5A(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x5A, DataPeriods = new List(), @@ -1515,7 +1515,7 @@ private void ProcessBlockID5A(byte[] data) private void ProcessUnidentifiedBlock(byte[] data) { - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = -2, DataPeriods = new List(), @@ -1556,7 +1556,7 @@ private void ProcessBlockID16(byte[] data) private void ProcessBlockID17(byte[] data) { // CPCHawk will not implement this block. it will however handle it so subsequent blocks can be parsed - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x17, DataPeriods = new List(), @@ -1575,7 +1575,7 @@ private void ProcessBlockID17(byte[] data) private void ProcessBlockID34(byte[] data) { // currently not implemented properly in CPCHawk - TapeDataBlock t = new TapeDataBlock + TapeDataBlock t = new() { BlockID = 0x34, DataPeriods = new List(), @@ -1904,7 +1904,7 @@ private void CreatePauseBlock(TapeDataBlock original) { if (original.PauseInMS > 0) { - TapeDataBlock pBlock = new TapeDataBlock + TapeDataBlock pBlock = new() { DataPeriods = new List(), BlockDescription = BlockType.PAUSE_BLOCK, diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs index 91ea0126ea4..cdb29b197a8 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs @@ -9,7 +9,7 @@ public partial class AppleII : IDebuggable { public IDictionary GetCpuFlagsAndRegisters() { - Dictionary regs = new Dictionary + Dictionary regs = new() { ["A"] = _machine.Cpu.RA, ["X"] = _machine.Cpu.RX, @@ -26,7 +26,7 @@ public IDictionary GetCpuFlagsAndRegisters() ["Flag T"] = _machine.Cpu.FlagT ? 1 : 0 }; - Dictionary dic = new Dictionary(); + Dictionary dic = new(); foreach (var reg in regs) { diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IMemoryDomains.cs index ede91dbe4b9..6602197b009 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IMemoryDomains.cs @@ -9,9 +9,9 @@ public partial class AppleII { private void SetupMemoryDomains() { - List domains = new List(); + List domains = new(); - MemoryDomainDelegate mainRamDomain = new MemoryDomainDelegate("Main RAM", 0x10000, MemoryDomain.Endian.Little, + MemoryDomainDelegate mainRamDomain = new("Main RAM", 0x10000, MemoryDomain.Endian.Little, addr => { if (addr is < 0 or > 0x10000) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); @@ -25,7 +25,7 @@ private void SetupMemoryDomains() domains.Add(mainRamDomain); - MemoryDomainDelegate auxRamDomain = new MemoryDomainDelegate("Auxiliary RAM", 0x10000, MemoryDomain.Endian.Little, + MemoryDomainDelegate auxRamDomain = new("Auxiliary RAM", 0x10000, MemoryDomain.Endian.Little, addr => { if (addr is < 0 or > 0x10000) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); @@ -39,7 +39,7 @@ private void SetupMemoryDomains() domains.Add(auxRamDomain); - MemoryDomainDelegate systemBusDomain = new MemoryDomainDelegate("System Bus", 0x10000, MemoryDomain.Endian.Little, + MemoryDomainDelegate systemBusDomain = new("System Bus", 0x10000, MemoryDomain.Endian.Little, addr => { if (addr is < 0 or > 0xFFFF) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.ISaveRam.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.ISaveRam.cs index 0aadb46a5f6..7bf973863d7 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.ISaveRam.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.ISaveRam.cs @@ -16,8 +16,8 @@ public partial class AppleII : ISaveRam public byte[] CloneSaveRam() { - using MemoryStream ms = new MemoryStream(); - using BinaryWriter bw = new BinaryWriter(ms); + using MemoryStream ms = new(); + using BinaryWriter bw = new(ms); SaveDelta(); bw.Write(DiskCount); @@ -31,8 +31,8 @@ public byte[] CloneSaveRam() public void StoreSaveRam(byte[] data) { - using MemoryStream ms = new MemoryStream(data, false); - using BinaryReader br = new BinaryReader(ms); + using MemoryStream ms = new(data, false); + using BinaryReader br = new(ms); int ndisks = br.ReadInt32(); diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs index 8049b643106..998f1a15aca 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs @@ -35,7 +35,7 @@ public AppleII(CoreLoadParameters lp) } _romSet = lp.Roms.Select(GetRomAndExt).ToList(); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; const string TRACE_HEADER = "6502: PC, opcode, register (A, X, Y, P, SP, Cy), flags (NVTBDIZC)"; diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/Components.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/Components.cs index 1ca4e5941dc..aa001173222 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/Components.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/Components.cs @@ -17,7 +17,7 @@ public Components(byte[] appleIIe, byte[] diskIIRom) NoSlotClock = new NoSlotClock(Video); DiskIIController = new DiskIIController(Video, diskIIRom); - EmptyPeripheralCard emptySlot = new EmptyPeripheralCard(Video); + EmptyPeripheralCard emptySlot = new(Video); // Necessary because of tangling dependencies between memory and video classes Memory.Initialize( diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IMemoryDomains.cs index dc157e92ed0..38ac232d8e1 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IMemoryDomains.cs @@ -13,7 +13,7 @@ private void SetupMemoryDomains() bool diskDriveEnabled = _board.DiskDrive != null; bool tapeDriveEnabled = _board.TapeDrive != null; - List domains = new List + List domains = new() { C64MemoryDomainFactory.Create("System Bus", 0x10000, a => _board.Cpu.Peek(a), (a, v) => _board.Cpu.Poke(a, v)), C64MemoryDomainFactory.Create("RAM", 0x10000, a => _board.Ram.Peek(a), (a, v) => _board.Ram.Poke(a, v)), diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs index fe0c6b5c0cc..a4d9fd81a73 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs @@ -18,7 +18,7 @@ public C64(CoreLoadParameters lp) PutSyncSettings(lp.SyncSettings ?? new C64SyncSettings()); PutSettings(lp.Settings ?? new C64Settings()); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; CoreComm = lp.Comm; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64FormatFinder.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64FormatFinder.cs index 00a2a64e4b6..6a19b023634 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64FormatFinder.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64FormatFinder.cs @@ -13,7 +13,7 @@ public static C64Format GetFormat(byte[] data) return C64Format.Unknown; } - using BinaryReader reader = new BinaryReader(new MemoryStream(data)); + using BinaryReader reader = new(new MemoryStream(data)); string header = Encoding.GetEncoding(437).GetString(reader.ReadBytes(0x10)); if (header.StartsWithOrdinal("C64 CARTRIDGE ")) diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs index 43ea07d07a2..12817a715ef 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs @@ -13,18 +13,18 @@ public abstract class CartridgeDevice : IDriveLight public static CartridgeDevice Load(byte[] crtFile) { - using MemoryStream mem = new MemoryStream(crtFile); - BinaryReader reader = new BinaryReader(mem); + using MemoryStream mem = new(crtFile); + BinaryReader reader = new(mem); if (new string(reader.ReadChars(16)) != "C64 CARTRIDGE ") { return null; } - List chipAddress = new List(); - List chipBank = new List(); - List chipData = new List(); - List chipType = new List(); + List chipAddress = new(); + List chipBank = new(); + List chipData = new(); + List chipType = new(); int headerLength = ReadCRTInt(reader); int version = ReadCRTShort(reader); diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6522.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6522.cs index ebe516f8476..074a387306c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6522.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6522.cs @@ -4,8 +4,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { public static class Chip6522 { - public static Via Create(Func readPrA, Func readPrB) => new Via(readPrA, readPrB); + public static Via Create(Func readPrA, Func readPrB) => new(readPrA, readPrB); - public static Via Create(Func readClock, Func readData, Func readAtn, int driveNumber) => new Via(readClock, readData, readAtn, driveNumber); + public static Via Create(Func readClock, Func readData, Func readAtn, int driveNumber) => new(readClock, readData, readAtn, driveNumber); } } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R2.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R2.cs index 1c946c4d348..287c4787647 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R2.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R2.cs @@ -15,6 +15,6 @@ public static class Chip6581R2 new[] { 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x014, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x001, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x025, 0x015, 0x028, 0x074, 0x196, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x014, 0x05c, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x014, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x089, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x080, 0x0c4, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x02a, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x02a, 0x000, 0x095, 0x095, 0x135, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x095, 0x000, 0x000, 0x000, 0x095, 0x095, 0x095, 0x0e0, 0x1c5, 0x02a, 0x095, 0x095, 0x0e0, 0x0a0, 0x0e0, 0x13a, 0x28d, 0x0e5, 0x145, 0x148, 0x2d9, 0x239, 0x3cc, 0x632, 0x89a, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x014, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x001, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x025, 0x015, 0x028, 0x074, 0x196, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x014, 0x05c, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x014, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x089, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x080, 0x0c4, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x02a, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x02a, 0x000, 0x095, 0x095, 0x135, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x095, 0x000, 0x000, 0x000, 0x095, 0x095, 0x095, 0x0e0, 0x1c5, 0x02a, 0x095, 0x095, 0x0e0, 0x0a0, 0x0e0, 0x13a, 0x28d, 0x0e5, 0x145, 0x148, 0x2d9, 0x239, 0x3cc, 0x632, 0x89a } }; - public static Sid Create(int newSampleRate, int clockFrqNum, int clockFrqDen) => new Sid(WaveTable, newSampleRate, clockFrqNum, clockFrqDen); + public static Sid Create(int newSampleRate, int clockFrqNum, int clockFrqDen) => new(WaveTable, newSampleRate, clockFrqNum, clockFrqDen); } } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R3.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R3.cs index afbfedea5e0..e697025ae64 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R3.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R3.cs @@ -15,6 +15,6 @@ public static class Chip6581R3 new[] { 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x345, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x050, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x100, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x100, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x280, 0x000, 0x000, 0x000, 0x4ea, 0x22a, 0x7ca, 0x7f0, 0x7f0, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x345, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x050, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x100, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x100, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x32a, 0x000, 0x000, 0x000, 0x4ea, 0x22a, 0x7d0, 0x7f0, 0x7f0 } }; - public static Sid Create(int newSampleRate, int clockFrqNum, int clockFrqDen) => new Sid(WaveTable, newSampleRate, clockFrqNum, clockFrqDen); + public static Sid Create(int newSampleRate, int clockFrqNum, int clockFrqDen) => new(WaveTable, newSampleRate, clockFrqNum, clockFrqDen); } } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R4AR.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R4AR.cs index 8f7ac1de751..cabd99c20e6 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R4AR.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6581R4AR.cs @@ -15,6 +15,6 @@ public static class Chip6581R4AR new[] { 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x070, 0x274, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x03c, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x01c, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x080, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x240, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x080, 0x2a0, 0x000, 0x000, 0x000, 0x080, 0x000, 0x080, 0x0c0, 0x3d0, 0x080, 0x1e0, 0x260, 0x4a8, 0x458, 0x6a4, 0x7ec, 0x7f0, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x070, 0x274, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x03c, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x01c, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x080, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x240, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x080, 0x2a0, 0x000, 0x000, 0x000, 0x080, 0x000, 0x080, 0x0c0, 0x3d0, 0x080, 0x1e0, 0x260, 0x4a8, 0x458, 0x6a4, 0x7ec, 0x7f0 } }; - public static Sid Create(int newSampleRate, int clockFrqNum, int clockFrqDen) => new Sid(WaveTable, newSampleRate, clockFrqNum, clockFrqDen); + public static Sid Create(int newSampleRate, int clockFrqNum, int clockFrqDen) => new(WaveTable, newSampleRate, clockFrqNum, clockFrqDen); } } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip8580R5.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip8580R5.cs index 1ae07efe7ff..4ae5d655424 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip8580R5.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip8580R5.cs @@ -15,6 +15,6 @@ public static class Chip8580R5 new[] { 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x078, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x100, 0x000, 0x000, 0x000, 0x100, 0x100, 0x100, 0x380, 0x3c0, 0x3c0, 0x3c0, 0x4c0, 0x760, 0x760, 0x7d0, 0x7e8, 0x7f0, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x0f0, 0x2f0, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x800, 0x918, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x400, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x400, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x800, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x400, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x000, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x800, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x800, 0x800, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x400, 0x800, 0x400, 0x400, 0x400, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xc00, 0xc38, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0xa00, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0x800, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0x800, 0x800, 0x800, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xc00, 0xc00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xc00, 0xa00, 0xa00, 0xc00, 0xc00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xa00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xe00, 0xe00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xe00, 0xe00, 0xe00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xd00, 0xe00, 0xd00, 0xe00, 0xd00, 0xd00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe00, 0xe80, 0xe80, 0xe80, 0xe80, 0xf00, 0xf00, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xe80, 0xf00, 0xf00, 0xf00, 0xe80, 0xe80, 0xf00, 0xf00, 0xf00, 0xf00, 0xf00, 0xf00, 0xf00, 0xf00, 0xf00, 0xf40, 0xf40, 0xf40, 0xf40, 0xf80, 0xf40, 0xf40, 0xf40, 0xf40, 0xf40, 0xf40, 0xf80, 0xf80, 0xf80, 0xf80, 0xf80, 0xf80, 0xf80, 0xfa0, 0xfa0, 0xfc0, 0xfa0, 0xfc0, 0xfc0, 0xfc0, 0xfc0, 0xfc0, 0xfd0, 0xfe0, 0xfe0, 0xfe0, 0xfe0, 0xff0, 0xff0, 0xff0, 0xff0, 0xff0 } }; - public static Sid Create(int newSampleRate, int clockFrqNum, int clockFrqDen) => new Sid(WaveTable, newSampleRate, clockFrqNum, clockFrqDen); + public static Sid Create(int newSampleRate, int clockFrqNum, int clockFrqDen) => new(WaveTable, newSampleRate, clockFrqNum, clockFrqDen); } } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.TimingBuilder.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.TimingBuilder.cs index cccd0f01c7d..4168ef6fa84 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.TimingBuilder.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.TimingBuilder.cs @@ -28,7 +28,7 @@ public sealed partial class Vic // pre-display operations happen, and Cycle55 is the X-raster position where post-display operations happen. public static int[] TimingBuilder_Act(int[] timing, int cycle14, int sprite0Ba, int sprDisp) { - List result = new List(); + List result = new(); int length = timing.Length; for (int i = 0; i < length; i++) @@ -254,7 +254,7 @@ private static int TimingBuilder_ScreenWidth(IList timing, int hblankStart, // (specifically on an NTSC 6567R8) and DelayAmount is the number of positions to lag. public static int[] TimingBuilder_XRaster(int start, int width, int count, int delayOffset, int delayAmount) { - List result = new List(); + List result = new(); int rasterX = start; bool delayed = false; count >>= 2; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/D64.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/D64.cs index c5c6c68c15b..0b81b543f43 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/D64.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/D64.cs @@ -102,8 +102,8 @@ private static byte Checksum(byte[] source) private static byte[] ConvertSectorToGcr(byte[] source, byte sectorNo, byte trackNo, byte formatA, byte formatB, int gapLength, ErrorType errorType, out int bitsWritten) { - using MemoryStream mem = new MemoryStream(); - using BinaryWriter writer = new BinaryWriter(mem); + using MemoryStream mem = new(); + using BinaryWriter writer = new(mem); if (errorType == ErrorType.IdMismatch) { @@ -142,8 +142,8 @@ private static byte[] EncodeGcr(byte[] source) int[] gcr = new int[8]; byte[] data = new byte[4]; int count = source.Length; - using MemoryStream mem = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(mem); + using MemoryStream mem = new(); + BinaryWriter writer = new(mem); for (int i = 0; i < count; i += 4) { @@ -180,12 +180,12 @@ public static Disk Read(byte[] source) byte formatB = source[D64_DISK_ID_OFFSET + 0x00]; byte formatA = source[D64_DISK_ID_OFFSET + 0x01]; - using MemoryStream mem = new MemoryStream(source); - BinaryReader reader = new BinaryReader(mem); - List trackDatas = new List(); - List trackLengths = new List(); - List trackNumbers = new List(); - List trackDensities = new List(); + using MemoryStream mem = new(source); + BinaryReader reader = new(mem); + List trackDatas = new(); + List trackLengths = new(); + List trackNumbers = new(); + List trackDensities = new(); var errorType = ErrorType.NoError; int trackCount; int errorOffset = -1; @@ -219,7 +219,7 @@ public static Disk Read(byte[] source) } int sectors = SectorsPerTrack[i]; int trackLengthBits = 0; - using MemoryStream trackMem = new MemoryStream(); + using MemoryStream trackMem = new(); for (int j = 0; j < sectors; j++) { byte[] sectorData = reader.ReadBytes(256); diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Disk.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Disk.cs index da02e68830c..98e4a6c9d04 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Disk.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Disk.cs @@ -77,7 +77,7 @@ private int[] ConvertToFluxTransitions(int density, byte[] bytes, int fluxBitOff } int[] result = new int[FluxEntriesPerTrack]; int lengthBits = (paddedLength * 8) - 7; - List offsets = new List(); + List offsets = new(); int remainingBits = lengthBits; const long bitsNum = FluxEntriesPerTrack * FluxBitsPerEntry; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/DiskBuilder.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/DiskBuilder.cs index 83213f41965..fb603031008 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/DiskBuilder.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/DiskBuilder.cs @@ -170,7 +170,7 @@ public Disk Build() int currentSector = 0; int interleaveStart = 0; int sectorInterleave = 3; - List directory = new List(); + List directory = new(); int GetOutputOffset(int t, int s) => trackByteOffsets[t] + (s * 256); @@ -180,7 +180,7 @@ public Disk Build() int dataLength = entry.Data == null ? 0 : entry.Data.Length; int lengthInSectors = dataLength / 254; int dataRemaining = dataLength; - LocatedEntry directoryEntry = new LocatedEntry + LocatedEntry directoryEntry = new() { Entry = entry, LengthInSectors = lengthInSectors + 1, diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/G64.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/G64.cs index 8cca77f6e8e..70937fd7b21 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/G64.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/G64.cs @@ -9,13 +9,13 @@ public static class G64 { public static Disk Read(byte[] source) { - using MemoryStream mem = new MemoryStream(source); - using BinaryReader reader = new BinaryReader(mem); - string id = new string(reader.ReadChars(8)); - List trackDatas = new List(); - List trackLengths = new List(); - List trackNumbers = new List(); - List trackDensities = new List(); + using MemoryStream mem = new(source); + using BinaryReader reader = new(mem); + string id = new(reader.ReadChars(8)); + List trackDatas = new(); + List trackLengths = new(); + List trackNumbers = new(); + List trackDensities = new(); if (id == @"GCR-1541") { @@ -71,8 +71,8 @@ public static byte[] Write(IList trackData, IList trackNumbers, ILi ushort trackMaxLength = (ushort)Math.Max(7928, trackData.Max(d => d.Length)); - using MemoryStream mem = new MemoryStream(); - using BinaryWriter writer = new BinaryWriter(mem); + using MemoryStream mem = new(); + using BinaryWriter writer = new(mem); // header ID writer.Write("GCR-1541".ToCharArray()); @@ -87,11 +87,11 @@ public static byte[] Write(IList trackData, IList trackNumbers, ILi writer.Write(trackMaxLength); // combine track data - List offsets = new List(); - List densities = new List(); - using (MemoryStream trackMem = new MemoryStream()) + List offsets = new(); + List densities = new(); + using (MemoryStream trackMem = new()) { - BinaryWriter trackMemWriter = new BinaryWriter(trackMem); + BinaryWriter trackMemWriter = new(trackMem); for (int i = 0; i < trackCount; i++) { if (trackNumbers.Contains(i)) diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs index 91b428df3db..8baad7f160f 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs @@ -284,8 +284,8 @@ public byte[] CloneSaveRam() { SaveDeltas(); // update the current deltas - using MemoryStream ms = new MemoryStream(); - using BinaryWriter bw = new BinaryWriter(ms); + using MemoryStream ms = new(); + using BinaryWriter bw = new(ms); bw.Write(_usedDiskTracks.Length); for (int i = 0; i < _usedDiskTracks.Length; i++) { @@ -301,8 +301,8 @@ public byte[] CloneSaveRam() public void StoreSaveRam(byte[] data) { - using MemoryStream ms = new MemoryStream(data, false); - using BinaryReader br = new BinaryReader(ms); + using MemoryStream ms = new(data, false); + using BinaryReader br = new(ms); int ndisks = br.ReadInt32(); if (ndisks != _usedDiskTracks.Length) diff --git a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IMemoryDomains.cs index f1a967650b2..6ac8f87093a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IMemoryDomains.cs @@ -13,7 +13,7 @@ public partial class MSX private void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "System Bus", @@ -40,7 +40,7 @@ private void SetupMemoryDomains() if (SaveRAM != null) { - MemoryDomainDelegate saveRamDomain = new MemoryDomainDelegate("Save RAM", SaveRAM.Length, MemoryDomain.Endian.Little, + MemoryDomainDelegate saveRamDomain = new("Save RAM", SaveRAM.Length, MemoryDomain.Endian.Little, addr => SaveRAM[addr], (addr, value) => { SaveRAM[addr] = value; SaveRamModified = true; }, 1); domains.Add(saveRamDomain); @@ -65,7 +65,7 @@ private void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Little, data, true, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Little, data, true, 1); _byteArrayDomains.Add(name, m); } } diff --git a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs index 47b93289b7d..e8da8a80dcc 100644 --- a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs +++ b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs @@ -149,7 +149,7 @@ public MSX(CoreLoadParameters lp) Disasm_Length = LibMSX.MSX_getdisasmlength(MSX_Pntr); Reg_String_Length = LibMSX.MSX_getregstringlength(MSX_Pntr); - StringBuilder newHeader = new StringBuilder(Header_Length); + StringBuilder newHeader = new(Header_Length); LibMSX.MSX_getheader(MSX_Pntr, newHeader, Header_Length); Console.WriteLine(Header_Length + " " + Disasm_Length + " " + Reg_String_Length); diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs index eedcae9eadd..ba2b2411f05 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs @@ -622,7 +622,7 @@ private bool FlashLoad() ushort d = (ushort)(_cpu.Regs[_cpu.Ixl] + (_cpu.Regs[_cpu.Ixh] << 8) + 1); _machine.WriteBus(d, v); } - ushort pc = (ushort)0x05DF; + ushort pc = 0x05DF; if (_cpu.Regs[_cpu.E] + (_cpu.Regs[_cpu.D] << 8) == toRead && toRead + 1 < tData.Length) diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs index 5d41af033b6..6055272dc1e 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs @@ -13,7 +13,6 @@ public class StandardKeyboard : IKeyboard public SpectrumBase _machine { get; set; } private byte[] LineStatus; private int[] _keyLine; - private string[] _nonMatrixKeys; public bool IsIssue2Keyboard { get; set; } @@ -25,11 +24,7 @@ public int[] KeyLine public string[] KeyboardMatrix { get; set; } - public string[] NonMatrixKeys - { - get => _nonMatrixKeys; - set => _nonMatrixKeys = value; - } + public string[] NonMatrixKeys { get; set; } public StandardKeyboard(SpectrumBase machine) { @@ -55,7 +50,7 @@ public StandardKeyboard(SpectrumBase machine) "Key Space", "Key Symbol Shift", "Key M", "Key N", "Key B" }; - List nonMatrix = new List(); + List nonMatrix = new(); foreach (string key in _machine.Spectrum.ZXSpectrumControllerDefinition.BoolButtons) { diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Rom/RomData.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Rom/RomData.cs index a3c3d262766..771ca46b349 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Rom/RomData.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Rom/RomData.cs @@ -18,13 +18,7 @@ public class RomData public ushort LoadBytesRoutineAddress { get; set; } public ushort SaveBytesResumeAddress { get; set; } public ushort LoadBytesResumeAddress { get; set; } - public ushort LoadBytesInvalidHeaderAddress - { - get => _loadBytesInvalidHeaderAddress; - set => _loadBytesInvalidHeaderAddress = value; - } - - private ushort _loadBytesInvalidHeaderAddress; + public ushort LoadBytesInvalidHeaderAddress { get; set; } public static RomData InitROM(MachineType machineType, byte[] rom) { diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Memory.cs index 27ed6574e77..323a300c3e1 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Memory.cs @@ -188,7 +188,7 @@ public override byte ReadMemory(ushort addr) /// public override ZXSpectrum.CDLResult ReadCDL(ushort addr) { - ZXSpectrum.CDLResult result = new ZXSpectrum.CDLResult(); + ZXSpectrum.CDLResult result = new(); int divisor = addr / 0x4000; result.Address = addr % 0x4000; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Input.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Input.cs index d1bf952a52a..17b5974aa59 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Input.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Input.cs @@ -281,7 +281,7 @@ public void PollInput() /// protected void InitJoysticks(List joys) { - List jCollection = new List(); + List jCollection = new(); for (int i = 0; i < joys.Count; i++) { diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs index 367a54e247c..798351c3b17 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs @@ -747,7 +747,6 @@ public int GetPortContentionValue(int tstate) /// Video output buffer /// public int[] ScreenBuffer; - private int _bufferHeight; public int BackgroundColor { @@ -768,11 +767,7 @@ public int BackgroundColor public int BufferWidth { get; set; } - public int BufferHeight - { - get => _bufferHeight; - set => _bufferHeight = value; - } + public int BufferHeight { get; set; } public int VsyncNumerator { diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs index 71252263e1f..98e339431f4 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs @@ -188,7 +188,7 @@ public override byte ReadMemory(ushort addr) /// public override ZXSpectrum.CDLResult ReadCDL(ushort addr) { - ZXSpectrum.CDLResult result = new ZXSpectrum.CDLResult(); + ZXSpectrum.CDLResult result = new(); int divisor = addr / 0x4000; result.Address = addr % 0x4000; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs index cb937fe65f7..0767bd7c75d 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs @@ -364,7 +364,7 @@ public override byte ReadMemory(ushort addr) /// public override ZXSpectrum.CDLResult ReadCDL(ushort addr) { - ZXSpectrum.CDLResult result = new ZXSpectrum.CDLResult(); + ZXSpectrum.CDLResult result = new(); int divisor = addr / 0x4000; result.Address = addr % 0x4000; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs index 9db1b018030..6f716403958 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs @@ -364,7 +364,7 @@ public override byte ReadMemory(ushort addr) /// public override ZXSpectrum.CDLResult ReadCDL(ushort addr) { - ZXSpectrum.CDLResult result = new ZXSpectrum.CDLResult(); + ZXSpectrum.CDLResult result = new(); int divisor = addr / 0x4000; result.Address = addr % 0x4000; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs index 41dc3120945..c142e61c68e 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs @@ -93,7 +93,7 @@ public override byte ReadMemory(ushort addr) /// public override ZXSpectrum.CDLResult ReadCDL(ushort addr) { - ZXSpectrum.CDLResult res = new ZXSpectrum.CDLResult(); + ZXSpectrum.CDLResult res = new(); int divisor = addr / 0x4000; res.Address = addr % 0x4000; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs index 4ba5232a59c..59aaebd6d15 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs @@ -97,7 +97,7 @@ public override byte ReadMemory(ushort addr) /// public override ZXSpectrum.CDLResult ReadCDL(ushort addr) { - ZXSpectrum.CDLResult res = new ZXSpectrum.CDLResult(); + ZXSpectrum.CDLResult res = new(); int divisor = addr / 0x4000; res.Address = addr % 0x4000; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/UDIFormat/UDI1_0FloppyDisk.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/UDIFormat/UDI1_0FloppyDisk.cs index 6f6f217e1e9..cab1d223e05 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/UDIFormat/UDI1_0FloppyDisk.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/UDIFormat/UDI1_0FloppyDisk.cs @@ -173,7 +173,7 @@ public override Sector[] Sectors { List secs = new(); byte[] datas = TrackData.Skip(3).Take(TLEN).ToArray(); - BitArray clocks = new BitArray(TrackData.Skip(3 + TLEN).Take(CLEN).ToArray()); + BitArray clocks = new(TrackData.Skip(3 + TLEN).Take(CLEN).ToArray()); return secs.ToArray(); } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Methods.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Methods.cs index 8249ced6f3d..c8e5ead6b0b 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Methods.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Methods.cs @@ -28,13 +28,13 @@ private SZX(SpectrumBase machine) /// public static byte[] ExportSZX(SpectrumBase machine) { - SZX s = new SZX(machine); + SZX s = new(machine); byte[] result = null; - using (MemoryStream ms = new MemoryStream()) + using (MemoryStream ms = new()) { - using (BinaryWriter r = new BinaryWriter(ms)) + using (BinaryWriter r = new(ms)) { // temp buffer byte[] buff; @@ -233,7 +233,7 @@ public static byte[] ExportSZX(SpectrumBase machine) private ZXSTRAMPAGE GetZXSTRAMPAGE(byte page, byte[] RAM) { - ZXSTRAMPAGE s = new ZXSTRAMPAGE + ZXSTRAMPAGE s = new() { wFlags = 0, // uncompressed only at the moment chPageNo = page, @@ -244,7 +244,7 @@ private ZXSTRAMPAGE GetZXSTRAMPAGE(byte page, byte[] RAM) private ZXSTCREATOR GetZXSTCREATOR() { - ZXSTCREATOR s = new ZXSTCREATOR(); + ZXSTCREATOR s = new(); char[] str = "BIZHAWK EMULATOR".ToCharArray(); s.szCreator = new char[32]; for (int i = 0; i < str.Length; i++) @@ -257,7 +257,7 @@ private ZXSTCREATOR GetZXSTCREATOR() private ZXSTZ80REGS GetZXSTZ80REGS() { - ZXSTZ80REGS s = new ZXSTZ80REGS + ZXSTZ80REGS s = new() { AF = (ushort) _machine.Spectrum.GetCpuFlagsAndRegisters()["AF"].Value, BC = (ushort) _machine.Spectrum.GetCpuFlagsAndRegisters()["BC"].Value, @@ -295,7 +295,7 @@ private ZXSTZ80REGS GetZXSTZ80REGS() private ZXSTSPECREGS GetZXSTSPECREGS() { - ZXSTSPECREGS s = new ZXSTSPECREGS + ZXSTSPECREGS s = new() { chBorder = _machine.ULADevice.BorderColor > 7 ? (byte)0 : (byte)_machine.ULADevice.BorderColor, chFe = _machine.LastFe @@ -363,7 +363,7 @@ private ZXSTSPECREGS GetZXSTSPECREGS() private ZXSTKEYBOARD GetZXSTKEYBOARD() { - ZXSTKEYBOARD s = new ZXSTKEYBOARD + ZXSTKEYBOARD s = new() { dwFlags = 0 //no issue 2 emulation }; @@ -373,7 +373,7 @@ private ZXSTKEYBOARD GetZXSTKEYBOARD() private ZXSTJOYSTICK GetZXSTJOYSTICK() { - ZXSTJOYSTICK s = new ZXSTJOYSTICK + ZXSTJOYSTICK s = new() { dwFlags = 0 //depreciated }; @@ -384,7 +384,7 @@ private ZXSTJOYSTICK GetZXSTJOYSTICK() private ZXSTAYBLOCK GetZXSTAYBLOCK() { - ZXSTAYBLOCK s = new ZXSTAYBLOCK + ZXSTAYBLOCK s = new() { cFlags = 0, // no external units chCurrentRegister = (byte)_machine.AYDevice.SelectedRegister @@ -401,7 +401,7 @@ private ZXSTAYBLOCK GetZXSTAYBLOCK() #pragma warning disable IDE0051 private ZXSTTAPE GetZXSTTAPE() { - ZXSTTAPE s = new ZXSTTAPE(); + ZXSTTAPE s = new(); s.wFlags |= (int)CassetteRecorderState.ZXSTTP_EMBEDDED; s.wCurrentBlockNo = (ushort)_machine.TapeDevice.CurrentDataBlockIndex; s.dwCompressedSize = _machine.tapeImages[_machine.TapeDevice.CurrentDataBlockIndex].Length; @@ -417,7 +417,7 @@ private ZXSTTAPE GetZXSTTAPE() private ZXSTPLUS3 GetZXSTPLUS3() { - ZXSTPLUS3 s = new ZXSTPLUS3 + ZXSTPLUS3 s = new() { chNumDrives = 1, fMotorOn = _machine.UPDDiskDevice.FDD_FLAG_MOTOR ? (byte)1 : (byte)0 @@ -427,7 +427,7 @@ private ZXSTPLUS3 GetZXSTPLUS3() private ZXSTDSKFILE GetZXSTDSKFILE() { - ZXSTDSKFILE s = new ZXSTDSKFILE + ZXSTDSKFILE s = new() { wFlags = 0, chDriveNum = 0, diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs index 0bc0b30a1fa..815cb05349c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs @@ -19,7 +19,7 @@ public ControllerDefinition ZXSpectrumControllerDefinition ControllerDefinition definition = new("ZXSpectrum Controller"); // joysticks - List joys1 = new List + List joys1 = new() { // P1 Joystick "P1 Up", "P1 Down", "P1 Left", "P1 Right", "P1 Button", @@ -31,7 +31,7 @@ public ControllerDefinition ZXSpectrumControllerDefinition definition.CategoryLabels[s] = "J1 (" + SyncSettings.JoystickType1 + ")"; } - List joys2 = new List + List joys2 = new() { // P2 Joystick "P2 Up", "P2 Down", "P2 Left", "P2 Right", "P2 Button", @@ -43,7 +43,7 @@ public ControllerDefinition ZXSpectrumControllerDefinition definition.CategoryLabels[s] = "J2 (" + SyncSettings.JoystickType2 + ")"; } - List joys3 = new List + List joys3 = new() { // P3 Joystick "P3 Up", "P3 Down", "P3 Left", "P3 Right", "P3 Button", @@ -56,7 +56,7 @@ public ControllerDefinition ZXSpectrumControllerDefinition } // keyboard - List keys = new List + List keys = new() { // Controller mapping includes all keyboard keys from the following models: // https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/ZXSpectrum48k.jpg/1200px-ZXSpectrum48k.jpg @@ -81,7 +81,7 @@ public ControllerDefinition ZXSpectrumControllerDefinition } // Power functions - List power = new List + List power = new() { // Power functions "Reset", "Power" @@ -94,7 +94,7 @@ public ControllerDefinition ZXSpectrumControllerDefinition } // Datacorder (tape device) - List tape = new List + List tape = new() { // Tape functions "Play Tape", "Stop Tape", "RTZ Tape", "Record Tape", "Insert Next Tape", @@ -108,7 +108,7 @@ public ControllerDefinition ZXSpectrumControllerDefinition } // Datacorder (tape device) - List disk = new List + List disk = new() { // Tape functions "Insert Next Disk", "Insert Previous Disk", /*"Eject Current Disk",*/ "Get Disk Status" diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IMemoryDomains.cs index 19c41518db2..91ffa343c3c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IMemoryDomains.cs @@ -17,7 +17,7 @@ public partial class ZXSpectrum private void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate("System Bus", 0x10000, MemoryDomain.Endian.Little, (addr) => @@ -97,7 +97,7 @@ private void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Little, data, true, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Little, data, true, 1); _byteArrayDomains.Add(name, m); } #pragma warning restore MEN014 diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs index b9e67ce1728..90cafea6ce7 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs @@ -339,7 +339,7 @@ public static string GetMetaString(MachineType type) { var m = GetMetaObject(type); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); // get longest title int titleLen = 0; @@ -372,7 +372,7 @@ public static string GetMetaString(MachineType type) string[] arr = d.Value.Split(' '); //int cnt = 0; - List builder = new List(); + List builder = new(); string working = ""; foreach (string s in arr) { diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IStatable.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IStatable.cs index 47367e7fac0..3689ffb4a23 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IStatable.cs @@ -14,7 +14,7 @@ private void SyncState(Serializer ser) byte[] core = null; if (ser.IsWriter) { - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); ms.Close(); core = ms.ToArray(); } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs index cecfa4c90b1..754a0fc5ce0 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs @@ -20,7 +20,7 @@ public partial class ZXSpectrum : IRegionable, IDriveLight public ZXSpectrum( CoreLoadParameters lp) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; CoreComm = lp.Comm; @@ -38,7 +38,7 @@ public ZXSpectrum( PutSyncSettings(syncSettings); PutSettings(settings); - List joysticks = new List + List joysticks = new() { syncSettings.JoystickType1, syncSettings.JoystickType2, diff --git a/src/BizHawk.Emulation.Cores/Computers/TIC80/TIC80.cs b/src/BizHawk.Emulation.Cores/Computers/TIC80/TIC80.cs index 8547f0e16f3..d1458080e1a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/TIC80/TIC80.cs +++ b/src/BizHawk.Emulation.Cores/Computers/TIC80/TIC80.cs @@ -96,7 +96,7 @@ public TIC80(CoreLoadParameters lp) private static ControllerDefinition CreateControllerDefinition(bool[] inputsActive) { - ControllerDefinition ret = new ControllerDefinition("TIC-80 Controller"); + ControllerDefinition ret = new("TIC-80 Controller"); for (int i = 0; i < 4; i++) { @@ -222,7 +222,7 @@ private static void GetKeys(IController controller, ref LibTIC80.TIC80Inputs inp protected override LibWaterboxCore.FrameInfo FrameAdvancePrep(IController controller, bool render, bool rendersound) { - LibTIC80.TIC80Inputs inputs = new LibTIC80.TIC80Inputs + LibTIC80.TIC80Inputs inputs = new() { MouseX = (sbyte)controller.AxisValue("Mouse Position X"), MouseY = (sbyte)controller.AxisValue("Mouse Position Y"), diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IMemoryDomains.cs index 0bdfe3d11ab..648e40ec4d9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IMemoryDomains.cs @@ -13,7 +13,7 @@ public partial class Atari2600 private void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "TIA", @@ -72,7 +72,7 @@ private void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Little, data, true, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Little, data, true, 1); _byteArrayDomains.Add(name, m); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs index 9562d74878e..b41b107b2e2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs @@ -23,7 +23,7 @@ internal static class RomChecksums [CoreConstructor(VSystemID.Raw.A26)] public Atari2600(GameInfo game, byte[] rom, Atari2600.A2600Settings settings, Atari2600.A2600SyncSettings syncSettings) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; _ram = new byte[128]; @@ -110,7 +110,7 @@ private static bool DetectPal(GameInfo game, byte[] rom) // here we advance past start up irregularities to see how long a frame is based on calls to Vsync // we run 72 frames, then run 270 scanlines worth of cycles. // if we don't hit a new frame, we can be pretty confident we are in PAL - using Atari2600 emu = new Atari2600(newGame, rom, null, null); + using Atari2600 emu = new(newGame, rom, null, null); for (int i = 0; i < 72; i++) { emu.FrameAdvance(NullController.Instance, false, false); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IMemoryDomains.cs index 2ace7d5b6ce..dc0388fd230 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IMemoryDomains.cs @@ -9,7 +9,7 @@ public partial class A7800Hawk public void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "Main RAM", diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs index c38416ad632..d4118baaa30 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs @@ -78,7 +78,7 @@ public CpuLink(A7800Hawk a7800) [CoreConstructor(VSystemID.Raw.A78)] public A7800Hawk(CoreComm comm, byte[] rom, A7800Hawk.A7800Settings settings, A7800Hawk.A7800SyncSettings syncSettings) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); maria = new Maria(); tia = new TIA(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.IDebuggable.cs index 4d0a320c46b..215f1686a5b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.IDebuggable.cs @@ -14,7 +14,7 @@ public unsafe IDictionary GetCpuFlagsAndRegisters() uint* regs = stackalloc uint[18 + 32 + 32 + 32 + 32 + 2]; _core.GetRegisters((IntPtr)regs); - Dictionary ret = new Dictionary(); + Dictionary ret = new(); // M68K data regs for (int i = 0; i < 8; i++) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.ITraceable.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.ITraceable.cs index 23d19b42b7d..131069d2c22 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.ITraceable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.ITraceable.cs @@ -16,7 +16,7 @@ private unsafe void MakeCPUTrace(IntPtr r) uint* regs = (uint*)r; uint pc = regs![16] & 0xFFFFFF; string disasm = _disassembler.DisassembleM68K(this.AsMemoryDomains().SystemBus, pc, out _); - StringBuilder regInfo = new StringBuilder(216); + StringBuilder regInfo = new(216); for (int i = 0; i < 8; i++) { regInfo.Append($"D{i}:{regs[i]:X8} "); @@ -43,7 +43,7 @@ private unsafe void MakeGPUTrace(uint pc, IntPtr r) uint* regs = (uint*)r; pc &= 0xFFFFFF; string disasm = _disassembler.DisassembleRISC(true, this.AsMemoryDomains().SystemBus, pc, out _); - StringBuilder regInfo = new StringBuilder(411); + StringBuilder regInfo = new(411); for (int i = 0; i < 32; i++) { regInfo.Append($"r{i}:{regs![i]:X8} "); @@ -58,7 +58,7 @@ private unsafe void MakeDSPTrace(uint pc, IntPtr r) uint* regs = (uint*)r; pc &= 0xFFFFFF; string disasm = _disassembler.DisassembleRISC(false, this.AsMemoryDomains().SystemBus, pc, out _); - StringBuilder regInfo = new StringBuilder(411); + StringBuilder regInfo = new(411); for (int i = 0; i < 32; i++) { regInfo.Append($"r{i}:{regs![i]:X8} "); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.cs index 024f5ef700c..724b4b77239 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.cs @@ -69,7 +69,7 @@ public VirtualJaguar(CoreLoadParameters mms = new List + List mms = new() { new MemoryDomainIntPtr("RAM", MemoryDomain.Endian.Little, LibLynx.GetRamPointer(Core), 65536, true, 2) }; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.IStatable.cs index 149ad0a844f..4a43a63ca2c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.IStatable.cs @@ -12,7 +12,7 @@ public partial class Lynx : ITextStatable public void SaveStateText(TextWriter writer) { - TextState s = new TextState(); + TextState s = new(); s.Prepare(); var ff = s.GetFunctionPointersSave(); LibLynx.TxtStateSave(Core, ref ff); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs index 68975192755..18995721891 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs @@ -17,7 +17,7 @@ public partial class Lynx : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, static Lynx() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( OSTailoredCode.IsUnixHost ? "libbizlynx.dll.so" : "bizlynx.dll", hasLimitedLifetime: false); LibLynx = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); } @@ -38,8 +38,8 @@ public Lynx(byte[] file, GameInfo game, CoreComm comm) byte[] realfile = null; { - using MemoryStream ms = new MemoryStream(file, false); - using BinaryReader br = new BinaryReader(ms); + using MemoryStream ms = new(file, false); + using BinaryReader br = new(ms); string header = Encoding.ASCII.GetString(br.ReadBytes(4)); int p0 = br.ReadUInt16(); int p1 = br.ReadUInt16(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Belogic/Uzem.cs b/src/BizHawk.Emulation.Cores/Consoles/Belogic/Uzem.cs index 8342621b46d..2ea174450c0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Belogic/Uzem.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Belogic/Uzem.cs @@ -113,7 +113,7 @@ private static int EncodeDelta(float value) protected override LibWaterboxCore.FrameInfo FrameAdvancePrep(IController controller, bool render, bool rendersound) { - LibUzem.FrameInfo ret = new LibUzem.FrameInfo(); + LibUzem.FrameInfo ret = new(); if (_mouseEnabled) { ret.ButtonsP1 = EncodeDelta(controller.AxisValue("P1 Mouse X")) << 24 diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IMemoryDomains.cs index 992bfdfb37b..71e0f0327d2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IMemoryDomains.cs @@ -14,7 +14,7 @@ public partial class ColecoVision private void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate("System Bus", 0x10000, MemoryDomain.Endian.Little, addr => @@ -31,10 +31,10 @@ private void SetupMemoryDomains() if (use_SGM) { - MemoryDomainByteArray SGMLRam = new MemoryDomainByteArray("SGM Low RAM", MemoryDomain.Endian.Little, SGM_low_RAM, true, 1); + MemoryDomainByteArray SGMLRam = new("SGM Low RAM", MemoryDomain.Endian.Little, SGM_low_RAM, true, 1); domains.Add(SGMLRam); - MemoryDomainByteArray SGMHRam = new MemoryDomainByteArray("SGM High RAM", MemoryDomain.Endian.Little, SGM_high_RAM, true, 1); + MemoryDomainByteArray SGMHRam = new("SGM High RAM", MemoryDomain.Endian.Little, SGM_high_RAM, true, 1); domains.Add(SGMHRam); } @@ -61,7 +61,7 @@ private void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Little, data, true, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Little, data, true, 1); _byteArrayDomains.Add(name, m); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IStatable.cs index be4eeb2da4c..62cce269b16 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IStatable.cs @@ -11,7 +11,7 @@ private void SyncState(Serializer ser) byte[] core = null; if (ser.IsWriter) { - using MemoryStream ms = new MemoryStream(); + using MemoryStream ms = new(); ms.Close(); core = ms.ToArray(); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index bacc035296a..3c1de0039ba 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -13,7 +13,7 @@ public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, ColecoSettings settings, ColecoSyncSettings syncSettings) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; _syncSettings = syncSettings ?? new ColecoSyncSettings(); bool skipBios = _syncSettings.SkipBiosIntro; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.Controllers.cs b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.Controllers.cs index b75250a617c..7b4d8931559 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.Controllers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.Controllers.cs @@ -14,7 +14,7 @@ public ControllerDefinition ChannelFControllerDefinition string pre = "P1 "; // sticks - List stickR = new List + List stickR = new() { // P1 (right) stick pre + "Forward", pre + "Back", pre + "Left", pre + "Right", pre + "CCW", pre + "CW", pre + "Pull", pre + "Push" @@ -28,7 +28,7 @@ public ControllerDefinition ChannelFControllerDefinition pre = "P2 "; - List stickL = new List + List stickL = new() { // P2 (left) stick pre + "Forward", pre + "Back", pre + "Left", pre + "Right", pre + "CCW", pre + "CW", pre + "Pull", pre + "Push" @@ -41,7 +41,7 @@ public ControllerDefinition ChannelFControllerDefinition } // console - List consoleButtons = new List + List consoleButtons = new() { "TIME", "MODE", "HOLD", "START", "RESET" }; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.InputPollable.cs b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.InputPollable.cs index 3003a7c3bb3..9368adf3c65 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.InputPollable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.InputPollable.cs @@ -6,16 +6,10 @@ public partial class ChannelF : IInputPollable { public int LagCount { get; set; } = 0; - public bool IsLagFrame - { - get => _isLag; - set => _isLag = value; - } + public bool IsLagFrame { get; set; } = false; public IInputCallbackSystem InputCallbacks { get; } = new InputCallbackSystem(); - private bool _isLag = false; - /// /// Cycles through all the input callbacks /// This should be done once per frame diff --git a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.MemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.MemoryDomains.cs index ed75b8fd559..b7a6043c1cd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.MemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.MemoryDomains.cs @@ -13,7 +13,7 @@ public partial class ChannelF private void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate("System Bus", 0x10000, MemoryDomain.Endian.Big, (addr) => @@ -55,7 +55,7 @@ public void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Big, data, false, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Big, data, false, 1); _byteArrayDomains.Add(name, m); } #pragma warning restore MEN014 diff --git a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs index 6f5bb880d73..b5ecbaa4aaa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs @@ -11,7 +11,7 @@ public partial class ChannelF : IDriveLight [CoreConstructor(VSystemID.Raw.ChannelF)] public ChannelF(CoreLoadParameters lp) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; CoreComm = lp.Comm; _gameInfo = lp.Roms.Select(r => r.Game).ToList(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IMemoryDomains.cs index 081f19c07c8..bceedcff745 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IMemoryDomains.cs @@ -10,7 +10,7 @@ public partial class VectrexHawk public void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "Main RAM", diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs index 9121bec8813..5fe6cba5fcd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs @@ -35,7 +35,7 @@ internal static class RomChecksums [CoreConstructor(VSystemID.Raw.VEC)] public VectrexHawk(CoreComm comm, byte[] rom, VectrexHawk.VectrexSyncSettings syncSettings) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); cpu = new MC6809 { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IMemoryDomains.cs index c7a5d039419..da0c3dfcdbc 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IMemoryDomains.cs @@ -11,7 +11,7 @@ private void SetupMemoryDomains() { // TODO: is 8bit for byte arrays and 16bit for ushort correct here? // If ushort is correct, how about little endian? - List domains = new List + List domains = new() { new MemoryDomainDelegate( "Main RAM", diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs index b53225e61b0..945c668d065 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs @@ -13,7 +13,7 @@ public sealed partial class Intellivision : IEmulator, IInputPollable, IDisassem [CoreConstructor(VSystemID.Raw.INTV)] public Intellivision(CoreComm comm, byte[] rom, Intellivision.IntvSettings settings, Intellivision.IntvSyncSettings syncSettings) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; _rom = rom; _settings = settings ?? new IntvSettings(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IMemoryDomains.cs index d22322471cd..0025a975442 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IMemoryDomains.cs @@ -9,7 +9,7 @@ public partial class O2Hawk public void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "Main RAM", @@ -50,7 +50,7 @@ public void SetupMemoryDomains() if (cart_RAM != null) { - MemoryDomainByteArray CartRam = new MemoryDomainByteArray("Cart RAM", MemoryDomain.Endian.Little, cart_RAM, true, 1); + MemoryDomainByteArray CartRam = new("Cart RAM", MemoryDomain.Endian.Little, cart_RAM, true, 1); domains.Add(CartRam); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs index d928fb499b3..ca772b9a114 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs @@ -43,7 +43,7 @@ public partial class O2Hawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, [CoreConstructor(VSystemID.Raw.O2)] public O2Hawk(CoreComm comm, GameInfo game, byte[] rom, O2Settings settings, O2SyncSettings syncSettings) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); cpu = new I8048 { diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs index bcf2b898fb3..23a73f93eac 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs @@ -24,7 +24,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) { if (_cachedSettingsInfo is null) { - using HyperNyma n = new HyperNyma(comm); + using HyperNyma n = new(comm); n.InitForSettingsInfo("hyper.wbx"); _cachedSettingsInfo = n.SettingsInfo.Clone(); } @@ -42,7 +42,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) public HyperNyma(CoreLoadParameters lp) : base(lp.Comm, VSystemID.Raw.PCE, "PC Engine Controller", lp.Settings, lp.SyncSettings) { - Dictionary firmwares = new Dictionary(); + Dictionary firmwares = new(); if (lp.Discs.Count > 0) { _hasCds = true; @@ -80,7 +80,7 @@ public unsafe void GetGpuData(int vdc, Action callback) using(_exe.EnterExit()) { int[] palScratch = new int[512]; - PceGpuData v = new PceGpuData(); + PceGpuData v = new(); _hyperNyma.GetVramInfo(v, vdc); fixed(int* p = palScratch) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs index 85cffd53eba..b079c8806f6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs @@ -26,7 +26,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) { if (_cachedSettingsInfo is null) { - using TurboNyma n = new TurboNyma(comm); + using TurboNyma n = new(comm); n.InitForSettingsInfo("turbo.wbx"); _cachedSettingsInfo = n.SettingsInfo.Clone(); } @@ -44,7 +44,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) public TurboNyma(CoreLoadParameters lp) : base(lp.Comm, VSystemID.Raw.PCE, "PC Engine Controller", lp.Settings, lp.SyncSettings) { - Dictionary firmwares = new Dictionary(); + Dictionary firmwares = new(); if (lp.Discs.Count > 0) { _hasCds = true; @@ -118,7 +118,7 @@ public unsafe void GetGpuData(int vdc, Action callback) using(_exe.EnterExit()) { int[] palScratch = new int[512]; - PceGpuData v = new PceGpuData(); + PceGpuData v = new(); _turboNyma.GetVramInfo(v, vdc); fixed(int* p = palScratch) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/Tst.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/Tst.cs index 716357dbba4..238e52fef4c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/Tst.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/Tst.cs @@ -20,7 +20,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) { if (_cachedSettingsInfo is null) { - using Tst n = new Tst(comm); + using Tst n = new(comm); n.InitForSettingsInfo("pcfx.wbx"); _cachedSettingsInfo = n.SettingsInfo.Clone(); } @@ -34,7 +34,7 @@ public Tst(CoreLoadParameters lp) { if (lp.Roms.Count > 0) throw new InvalidOperationException("To load a PC-FX game, please load the CUE file and not the BIN file."); - Dictionary firmwares = new Dictionary + Dictionary firmwares = new() { { "FIRMWARE:pcfx.rom", new("PCFX", "BIOS") }, }; @@ -76,7 +76,7 @@ protected override HashSet ComputeHiddenPorts() devCount -= 3; if (SettingsQuery("pcfx.input.port2.multitap") != "1") devCount -= 3; - HashSet ret = new HashSet(); + HashSet ret = new(); for (int i = 1; i <= 8; i++) { if (i > devCount) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Citra.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Citra.IMemoryDomains.cs index ca89b31a4c4..edb49895669 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Citra.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Citra.IMemoryDomains.cs @@ -16,7 +16,7 @@ public partial class Citra private void InitMemoryDomains() { - List domains = new List() + List domains = new() { (_fcram = new("FCRAM", MemoryDomain.Endian.Little, IntPtr.Zero, 0, true, 4)), (_vram = new("VRAM", MemoryDomain.Endian.Little, IntPtr.Zero, 0, true, 4)), diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Citra.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Citra.cs index 699aadeaa62..c18310f0caf 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Citra.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Citra.cs @@ -19,7 +19,7 @@ public partial class Citra static Citra() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( OSTailoredCode.IsUnixHost ? "libcitra-headless.so" : "citra-headless.dll", hasLimitedLifetime: false); _core = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.IDebuggable.cs index f75789baa08..731881da141 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.IDebuggable.cs @@ -9,7 +9,7 @@ public partial class Ares64 : IDebuggable { public IDictionary GetCpuFlagsAndRegisters() { - Dictionary ret = new Dictionary(); + Dictionary ret = new(); ulong[] data = new ulong[32 + 3]; // GPRs, lo, hi, pc (todo: other regs) _core.GetRegisters(data); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs index 5038182ea99..39e3fa99c9c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs @@ -133,7 +133,7 @@ byte[] GetGBRomOrNull(int n) gb3RomPtr = GetGBRomOrNull(2), gb4RomPtr = GetGBRomOrNull(3)) { - LibAres64.LoadData loadData = new LibAres64.LoadData + LibAres64.LoadData loadData = new() { PifData = (IntPtr)pifPtr, PifLen = pif.Length, @@ -179,7 +179,7 @@ byte[] GetGBRomOrNull(int n) private static ControllerDefinition CreateControllerDefinition(LibAres64.ControllerType[] controllerSettings) { - ControllerDefinition ret = new ControllerDefinition("Nintendo 64 Controller"); + ControllerDefinition ret = new("Nintendo 64 Controller"); for (int i = 0; i < 4; i++) { if (controllerSettings[i] == LibAres64.ControllerType.Mouse) @@ -441,7 +441,7 @@ private static (byte[] Disk, byte[] Error) TransformDisk(byte[] disk) if (!systemCheck) return default; - ReadOnlySpan dataFormat = new ReadOnlySpan(disk, systemOffset, 0xE8); + ReadOnlySpan dataFormat = new(disk, systemOffset, 0xE8); int diskIndex = 0; byte[] ret = new byte[0x435B0C0]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.ISettable.cs index 40c11676430..719d1c20934 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.ISettable.cs @@ -31,7 +31,7 @@ public PutSettingsDirtyBits PutSettings(SnesSettings o) { if (o != _settings) { - BsnesApi.LayerEnables enables = new BsnesApi.LayerEnables + BsnesApi.LayerEnables enables = new() { BG1_Prio0 = o.ShowBG1_0, BG1_Prio1 = o.ShowBG1_1, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs index 8ae85b7aecf..3b2b8315125 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs @@ -21,7 +21,7 @@ public partial class BsnesCore : IEmulator, IDebuggable, IVideoProvider, ISaveRa public BsnesCore(CoreLoadParameters loadParameters) : this(loadParameters, false) { } public BsnesCore(CoreLoadParameters loadParameters, bool subframe = false) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; this._romPath = Path.ChangeExtension(loadParameters.Roms[0].RomPath, null); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Faust/Faust.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Faust/Faust.cs index e63c1c6dd35..9a1c0515c41 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Faust/Faust.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Faust/Faust.cs @@ -18,7 +18,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) { if (_cachedSettingsInfo is null) { - using Faust n = new Faust(comm); + using Faust n = new(comm); n.InitForSettingsInfo("faust.wbx"); _cachedSettingsInfo = n.SettingsInfo.Clone(); } @@ -47,7 +47,7 @@ protected override HashSet ComputeHiddenPorts() devCount -= 3; if (SettingsQuery("snes_faust.input.sport2.multitap") != "1") devCount -= 3; - HashSet ret = new HashSet(); + HashSet ret = new(); for (int i = 1; i <= 8; i++) { if (i > devCount) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IDebuggable.cs index 7c47c4c742f..8413c145065 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IDebuggable.cs @@ -11,7 +11,7 @@ public IDictionary GetCpuFlagsAndRegisters() { int[] values = new int[RegisterNames.Length]; LibmGBA.BizGetRegisters(Core, values); - Dictionary ret = new Dictionary(); + Dictionary ret = new(); for (int i = 0; i < RegisterNames.Length; i++) { ret[RegisterNames[i]] = new(values[i]); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IMemoryDomains.cs index 6a089a2a3e4..db9c314ef78 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IMemoryDomains.cs @@ -23,7 +23,7 @@ private void CreateMemoryDomains(int romsize) { const MemoryDomain.Endian le = MemoryDomain.Endian.Little; - List mm = new List + List mm = new() { (_iwram = new MemoryDomainIntPtr("IWRAM", le, IntPtr.Zero, 32 * 1024, true, 4)), (_ewram = new MemoryDomainIntPtr("EWRAM", le, IntPtr.Zero, 256 * 1024, true, 4)), diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.ISaveRam.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.ISaveRam.cs index ba67f74ab66..1142522c14e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.ISaveRam.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.ISaveRam.cs @@ -47,7 +47,7 @@ public void StoreSaveRam(byte[] data) private static byte[] LegacyFix(byte[] saveram) { // at one point vbanext-hawk had a special saveram format which we want to load. - BinaryReader br = new BinaryReader(new MemoryStream(saveram, false)); + BinaryReader br = new(new MemoryStream(saveram, false)); br.ReadBytes(8); // header; int flashSize = br.ReadInt32(); int eepromsize = br.ReadInt32(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.ITraceable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.ITraceable.cs index 6e1fc579b6f..ae947548450 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.ITraceable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.ITraceable.cs @@ -19,7 +19,7 @@ private void MakeTrace(string msg) var regs = GetCpuFlagsAndRegisters(); ulong wordSize = (regs["CPSR"].Value & 32) == 0 ? 4UL : 2UL; ulong pc = regs["R15"].Value - wordSize * 2; - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); for (int i = 0; i < RegisterNames.Length; i++) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs index db102c84503..cb57095ccbe 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs @@ -14,7 +14,7 @@ public partial class MGBAHawk static MGBAHawk() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( OSTailoredCode.IsUnixHost ? "libmgba.dll.so" : "mgba.dll", hasLimitedLifetime: false); LibmGBA = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); } @@ -52,7 +52,7 @@ public MGBAHawk(CoreLoadParameters lp) try { CreateMemoryDomains(rom.Length); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ser.Register(new ArmV4Disassembler()); ser.Register(_memoryDomains); @@ -78,7 +78,7 @@ public MGBAHawk(CoreLoadParameters lp) private static LibmGBA.OverrideInfo GetOverrideInfo(SyncSettings syncSettings) { - LibmGBA.OverrideInfo ret = new LibmGBA.OverrideInfo + LibmGBA.OverrideInfo ret = new() { Savetype = syncSettings.OverrideSaveType, Hardware = LibmGBA.Hardware.None, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAMemoryCallbackSystem.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAMemoryCallbackSystem.cs index bd4ae2d06f0..05b08928181 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAMemoryCallbackSystem.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAMemoryCallbackSystem.cs @@ -64,7 +64,7 @@ public void Add(IMemoryCallback callback) throw new NotImplementedException("Non 0xFFFFFFFF address masks are not currently implemented."); } - CallbackContainer container = new CallbackContainer(callback); + CallbackContainer container = new(callback); if (container.Callback.Type == MemoryCallbackType.Execute) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IMemoryDomains.cs index 3dbb29be042..0a5434908e4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IMemoryDomains.cs @@ -9,7 +9,7 @@ public partial class GBHawk public void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "WRAM", @@ -57,7 +57,7 @@ public void SetupMemoryDomains() if (cart_RAM != null) { - MemoryDomainDelegate CartRam = new MemoryDomainDelegate( + MemoryDomainDelegate CartRam = new( "CartRAM", cart_RAM.Length, MemoryDomain.Endian.Little, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs index cb888e65cfe..f4c0ccd7d03 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs @@ -132,7 +132,7 @@ internal static class RomChecksums [CoreConstructor(VSystemID.Raw.GBC)] public GBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBSettings settings, GBSyncSettings syncSettings, bool subframe = false) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); cpu = new LR35902 { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IMemoryDomains.cs index aa15c9e5b1f..1ab4527d245 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IMemoryDomains.cs @@ -10,7 +10,7 @@ public partial class GBHawkLink public void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "Main RAM L", @@ -86,13 +86,13 @@ public void SetupMemoryDomains() if (L.cart_RAM != null) { - MemoryDomainByteArray cartRamL = new MemoryDomainByteArray("Cart RAM L", MemoryDomain.Endian.Little, L.cart_RAM, true, 1); + MemoryDomainByteArray cartRamL = new("Cart RAM L", MemoryDomain.Endian.Little, L.cart_RAM, true, 1); domains.Add(cartRamL); } if (R.cart_RAM != null) { - MemoryDomainByteArray cartRamR = new MemoryDomainByteArray("Cart RAM R", MemoryDomain.Endian.Little, R.cart_RAM, true, 1); + MemoryDomainByteArray cartRamR = new("Cart RAM R", MemoryDomain.Endian.Little, R.cart_RAM, true, 1); domains.Add(cartRamR); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs index e440c781d87..c0936b3e3fe 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs @@ -37,7 +37,7 @@ public GBHawkLink(CoreLoadParameters domains = new List + List domains = new() { new MemoryDomainDelegate( "Main RAM L", @@ -121,19 +121,19 @@ public void SetupMemoryDomains() if (L.cart_RAM != null) { - MemoryDomainByteArray cartRamL = new MemoryDomainByteArray("Cart RAM L", MemoryDomain.Endian.Little, L.cart_RAM, true, 1); + MemoryDomainByteArray cartRamL = new("Cart RAM L", MemoryDomain.Endian.Little, L.cart_RAM, true, 1); domains.Add(cartRamL); } if (C.cart_RAM != null) { - MemoryDomainByteArray cartRamC = new MemoryDomainByteArray("Cart RAM C", MemoryDomain.Endian.Little, C.cart_RAM, true, 1); + MemoryDomainByteArray cartRamC = new("Cart RAM C", MemoryDomain.Endian.Little, C.cart_RAM, true, 1); domains.Add(cartRamC); } if (R.cart_RAM != null) { - MemoryDomainByteArray cartRamR = new MemoryDomainByteArray("Cart RAM R", MemoryDomain.Endian.Little, R.cart_RAM, true, 1); + MemoryDomainByteArray cartRamR = new("Cart RAM R", MemoryDomain.Endian.Little, R.cart_RAM, true, 1); domains.Add(cartRamR); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs index 740b31f049b..87d4b8a50b9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs @@ -37,7 +37,7 @@ public GBHawkLink3x(CoreLoadParameters l if (lp.Roms.Count != 3) throw new InvalidOperationException("Wrong number of roms"); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; Link3xSettings = lp.Settings ?? new GBLink3xSettings(); @@ -47,13 +47,13 @@ public GBHawkLink3x(CoreLoadParameters l GBHawkControllerDeck.DefaultControllerName, GBHawkControllerDeck.DefaultControllerName); - GBHawk.GBHawk.GBSettings tempSetL = new GBHawk.GBHawk.GBSettings(); - GBHawk.GBHawk.GBSettings tempSetC = new GBHawk.GBHawk.GBSettings(); - GBHawk.GBHawk.GBSettings tempSetR = new GBHawk.GBHawk.GBSettings(); + GBHawk.GBHawk.GBSettings tempSetL = new(); + GBHawk.GBHawk.GBSettings tempSetC = new(); + GBHawk.GBHawk.GBSettings tempSetR = new(); - GBHawk.GBHawk.GBSyncSettings tempSyncL = new GBHawk.GBHawk.GBSyncSettings(); - GBHawk.GBHawk.GBSyncSettings tempSyncC = new GBHawk.GBHawk.GBSyncSettings(); - GBHawk.GBHawk.GBSyncSettings tempSyncR = new GBHawk.GBHawk.GBSyncSettings(); + GBHawk.GBHawk.GBSyncSettings tempSyncL = new(); + GBHawk.GBHawk.GBSyncSettings tempSyncC = new(); + GBHawk.GBHawk.GBSyncSettings tempSyncR = new(); tempSyncL.ConsoleMode = Link3xSyncSettings.ConsoleMode_L; tempSyncC.ConsoleMode = Link3xSyncSettings.ConsoleMode_C; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IMemoryDomains.cs index 6acb658eee4..19b2c3ad6ca 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IMemoryDomains.cs @@ -10,7 +10,7 @@ public partial class GBHawkLink4x public void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "Main RAM A", @@ -156,25 +156,25 @@ public void SetupMemoryDomains() if (A.cart_RAM != null) { - MemoryDomainByteArray cartRamA = new MemoryDomainByteArray("Cart RAM L", MemoryDomain.Endian.Little, A.cart_RAM, true, 1); + MemoryDomainByteArray cartRamA = new("Cart RAM L", MemoryDomain.Endian.Little, A.cart_RAM, true, 1); domains.Add(cartRamA); } if (B.cart_RAM != null) { - MemoryDomainByteArray cartRamB = new MemoryDomainByteArray("Cart RAM B", MemoryDomain.Endian.Little, B.cart_RAM, true, 1); + MemoryDomainByteArray cartRamB = new("Cart RAM B", MemoryDomain.Endian.Little, B.cart_RAM, true, 1); domains.Add(cartRamB); } if (C.cart_RAM != null) { - MemoryDomainByteArray cartRamC = new MemoryDomainByteArray("Cart RAM C", MemoryDomain.Endian.Little, C.cart_RAM, true, 1); + MemoryDomainByteArray cartRamC = new("Cart RAM C", MemoryDomain.Endian.Little, C.cart_RAM, true, 1); domains.Add(cartRamC); } if (D.cart_RAM != null) { - MemoryDomainByteArray cartRamD = new MemoryDomainByteArray("Cart RAM D", MemoryDomain.Endian.Little, D.cart_RAM, true, 1); + MemoryDomainByteArray cartRamD = new("Cart RAM D", MemoryDomain.Endian.Little, D.cart_RAM, true, 1); domains.Add(cartRamD); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs index b527ae50870..c8e629fada0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs @@ -58,7 +58,7 @@ public GBHawkLink4x(CoreLoadParameters l if (lp.Roms.Count != 4) throw new InvalidOperationException("Wrong number of roms"); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); Link4xSettings = lp.Settings ?? new GBLink4xSettings(); Link4xSyncSettings = lp.SyncSettings ?? new GBLink4xSyncSettings(); @@ -68,15 +68,15 @@ public GBHawkLink4x(CoreLoadParameters l GBHawkControllerDeck.DefaultControllerName, GBHawkControllerDeck.DefaultControllerName); - GBHawk.GBHawk.GBSettings tempSetA = new GBHawk.GBHawk.GBSettings(); - GBHawk.GBHawk.GBSettings tempSetB = new GBHawk.GBHawk.GBSettings(); - GBHawk.GBHawk.GBSettings tempSetC = new GBHawk.GBHawk.GBSettings(); - GBHawk.GBHawk.GBSettings tempSetD = new GBHawk.GBHawk.GBSettings(); + GBHawk.GBHawk.GBSettings tempSetA = new(); + GBHawk.GBHawk.GBSettings tempSetB = new(); + GBHawk.GBHawk.GBSettings tempSetC = new(); + GBHawk.GBHawk.GBSettings tempSetD = new(); - GBHawk.GBHawk.GBSyncSettings tempSyncA = new GBHawk.GBHawk.GBSyncSettings(); - GBHawk.GBHawk.GBSyncSettings tempSyncB = new GBHawk.GBHawk.GBSyncSettings(); - GBHawk.GBHawk.GBSyncSettings tempSyncC = new GBHawk.GBHawk.GBSyncSettings(); - GBHawk.GBHawk.GBSyncSettings tempSyncD = new GBHawk.GBHawk.GBSyncSettings(); + GBHawk.GBHawk.GBSyncSettings tempSyncA = new(); + GBHawk.GBHawk.GBSyncSettings tempSyncB = new(); + GBHawk.GBHawk.GBSyncSettings tempSyncC = new(); + GBHawk.GBHawk.GBSyncSettings tempSyncD = new(); tempSyncA.ConsoleMode = Link4xSyncSettings.ConsoleMode_A; tempSyncB.ConsoleMode = Link4xSyncSettings.ConsoleMode_B; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IStatable.cs index 0a47bc9bbe4..6726234463f 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IStatable.cs @@ -112,7 +112,7 @@ internal class TextStateData internal TextState SaveState() { - TextState s = new TextState(); + TextState s = new(); s.Prepare(); var ff = s.GetFunctionPointersSave(); LibGambatte.gambatte_newstatesave_ex(GambatteState, ref ff); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index d3f26ee3589..67ff915e63c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -22,7 +22,7 @@ public partial class Gameboy : IInputPollable, IRomInfo, IGameboyCommon, ICycleT [CoreConstructor(VSystemID.Raw.SGB)] public Gameboy(CoreComm comm, GameInfo game, byte[] file, GambatteSettings settings, GambatteSyncSettings syncSettings, bool deterministic) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ser.Register(_disassembler); ServiceProvider = ser; const string TRACE_HEADER = "LR35902: PC, opcode, registers (A, F, B, C, D, E, H, L, LY, SP, CY)"; @@ -271,7 +271,7 @@ public Gameboy(CoreComm comm, GameInfo game, byte[] file, GambatteSettings setti public static ControllerDefinition CreateControllerDefinition(bool sgb, bool sub, bool tilt, bool rumble, bool remote) { - ControllerDefinition ret = new ControllerDefinition((sub ? "Subframe " : "") + "Gameboy Controller" + (tilt ? " + Tilt" : "")); + ControllerDefinition ret = new((sub ? "Subframe " : "") + "Gameboy Controller" + (tilt ? " + Tilt" : "")); if (sub) { ret.AddAxis("Input Length", 0.RangeTo(35112), 35112); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.ISettable.cs index 5be3d83d102..a35d58b0ffe 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.ISettable.cs @@ -50,7 +50,7 @@ public GambatteLinkSettings(Gameboy.GambatteSettings one, Gameboy.GambatteSettin _linkedSettings = new Gameboy.GambatteSettings[MAX_PLAYERS] { one, two, three, four }; } - public GambatteLinkSettings Clone() => new GambatteLinkSettings(_linkedSettings[P1].Clone(), _linkedSettings[P2].Clone(), _linkedSettings[P3].Clone(), _linkedSettings[P4].Clone()); + public GambatteLinkSettings Clone() => new(_linkedSettings[P1].Clone(), _linkedSettings[P2].Clone(), _linkedSettings[P3].Clone(), _linkedSettings[P4].Clone()); } public class GambatteLinkSyncSettings @@ -67,7 +67,7 @@ public GambatteLinkSyncSettings(Gameboy.GambatteSyncSettings one, Gameboy.Gambat _linkedSyncSettings = new Gameboy.GambatteSyncSettings[MAX_PLAYERS] { one, two, three, four }; } - public GambatteLinkSyncSettings Clone() => new GambatteLinkSyncSettings(_linkedSyncSettings[P1].Clone(), _linkedSyncSettings[P2].Clone(), _linkedSyncSettings[P3].Clone(), _linkedSyncSettings[P4].Clone()); + public GambatteLinkSyncSettings Clone() => new(_linkedSyncSettings[P1].Clone(), _linkedSyncSettings[P2].Clone(), _linkedSyncSettings[P3].Clone(), _linkedSyncSettings[P4].Clone()); } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IDebuggable.cs index 73a3ca4fbdd..f634b098b0c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IDebuggable.cs @@ -12,7 +12,7 @@ public IDictionary GetCpuFlagsAndRegisters() { // note: the approach this code takes is highly bug-prone // warning: tracer magically relies on these register names! - Dictionary ret = new Dictionary(); + Dictionary ret = new(); byte[] data = new byte[32 * 8 + 4 + 4 + 8 + 8 + 4 + 4 + 32 * 4 + 32 * 8]; api.getRegisters(data); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IMemoryDomains.cs index fa594ca255d..bcf55d8db40 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IMemoryDomains.cs @@ -55,7 +55,7 @@ private void MakeMemoryDomain(string name, mupen64plusApi.N64_MEMORY id, MemoryD }; } - MemoryDomainDelegate md = new MemoryDomainDelegate(name, size, endian, peekByte, pokeByte, 4); + MemoryDomainDelegate md = new(name, size, endian, peekByte, pokeByte, 4); _memoryDomains.Add(md); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ITraceable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ITraceable.cs index c14b3d5c3b6..e0955326762 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ITraceable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ITraceable.cs @@ -16,7 +16,7 @@ public void MakeTrace() uint pc = (uint)regs["PC"].Value; string disasm = Disassemble(MemoryDomains.SystemBus, pc, out int length); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); for (int i = 1; i < 32; i++) // r0 is always zero { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs index a579040fe02..841a83837dc 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs @@ -42,7 +42,7 @@ public N64(GameInfo game, byte[] file, byte[] rom, N64Settings settings, N64Sync _disableExpansionSlot = _syncSettings.DisableExpansionSlot; // Override the user's expansion slot setting if it is mentioned in the gamedb (it is mentioned but the game MUST have this setting or else not work - if (game.OptionValue("expansionpak") != null && game.OptionValue("expansionpak") == "1") + if (game.OptionValue("expansionpak") is not null and "1") { _disableExpansionSlot = false; IsOverridingUserExpansionSlotSetting = true; @@ -188,7 +188,7 @@ private void RunThreadAction(Action action) private void StartThreadLoop() { - Thread thread = new Thread(ThreadLoop) { IsBackground = true }; + Thread thread = new(ThreadLoop) { IsBackground = true }; thread.Start(); // will this solve the hanging process problem? } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.cs index 745ed1e7e83..295e918a856 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.cs @@ -64,7 +64,7 @@ public N64SyncSettings Clone() // get mupenapi internal object public VideoPluginSettings GetVPS(GameInfo game, int videoSizeX, int videoSizeY) { - VideoPluginSettings ret = new VideoPluginSettings(VideoPlugin, videoSizeX, videoSizeY); + VideoPluginSettings ret = new(VideoPlugin, videoSizeX, videoSizeY); IPluginSettings ips = null; switch (VideoPlugin) { @@ -136,7 +136,7 @@ public static class PluginExtensions public static Dictionary GetPluginSettings(this IPluginSettings plugin) { // TODO: deal witn the game depedent settings - Dictionary dictionary = new Dictionary(); + Dictionary dictionary = new(); var members = plugin.GetType().GetMembers(); foreach (var member in members) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs index e4d3ff92fe1..4eaa4c7bb90 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs @@ -598,7 +598,7 @@ public void AsyncExecuteEmulator() private void ExecuteEmulatorThread() { emulator_running = true; - StartupCallback cb = new StartupCallback(() => m64pStartupComplete.Set()); + StartupCallback cb = new(() => m64pStartupComplete.Set()); m64pCoreDoCommandPtr(m64p_command.M64CMD_EXECUTE, 0, Marshal.GetFunctionPointerForDelegate(cb)); emulator_running = false; @@ -1001,7 +1001,7 @@ public IntPtr AttachPlugin(m64p_plugin_type type, string PluginName) { static IntPtr GetDLIRPtrByRefl(DynamicLibraryImportResolver dlir) => (IntPtr) fiDLIRInternalPtr.GetValue(dlir); if (plugins.ContainsKey(type)) DetachPlugin(type); - DynamicLibraryImportResolver lib = new DynamicLibraryImportResolver(PluginName); + DynamicLibraryImportResolver lib = new(PluginName); var libPtr = GetDLIRPtrByRefl(lib); GetTypedDelegate(libPtr, "PluginStartup")(GetDLIRPtrByRefl(Library), null, null); if (m64pCoreAttachPlugin(type, libPtr) != m64p_error.M64ERR_SUCCESS) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IDebuggable.cs index 3c6cec6b2e0..2419293c387 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IDebuggable.cs @@ -12,7 +12,7 @@ public IDictionary GetCpuFlagsAndRegisters() uint[] regs = new uint[2 * 16]; _core.GetRegs(regs); - Dictionary ret = new Dictionary(); + Dictionary ret = new(); for (int i = 0; i < 2; i++) { int ncpu = i == 0 ? 9 : 7; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs index c96e9b42c4a..d7b1854063a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs @@ -120,7 +120,7 @@ public NDS(CoreLoadParameters lp) if (_syncSettings.ThreadedRendering) loadFlags |= LibMelonDS.LoadFlags.THREADED_RENDERING; - LibMelonDS.FirmwareSettings fwSettings = new LibMelonDS.FirmwareSettings(); + LibMelonDS.FirmwareSettings fwSettings = new(); byte[] name = Encoding.UTF8.GetBytes(_syncSettings.FirmwareUsername); fwSettings.FirmwareUsernameLength = name.Length; fwSettings.FirmwareLanguage = _syncSettings.FirmwareLanguage; @@ -131,7 +131,7 @@ public NDS(CoreLoadParameters lp) byte[] message = _syncSettings.FirmwareMessage.Length != 0 ? Encoding.UTF8.GetBytes(_syncSettings.FirmwareMessage) : new byte[1]; fwSettings.FirmwareMessageLength = message.Length; - LibMelonDS.LoadData loadData = new LibMelonDS.LoadData + LibMelonDS.LoadData loadData = new() { DsRomLength = roms[0].Length, GbaRomLength = gbacartpresent ? roms[1].Length : 0, @@ -239,7 +239,7 @@ private static (ulong Full, uint Upper, uint Lower) GetDSiTitleId(IReadOnlyList< private static byte[] DecideNAND(ICoreFileProvider cfp, bool isDSiEnhanced, byte regionFlags) { // TODO: priority settings? - List nandOptions = new List { "NAND (JPN)", "NAND (USA)", "NAND (EUR)", "NAND (AUS)", "NAND (CHN)", "NAND (KOR)" }; + List nandOptions = new() { "NAND (JPN)", "NAND (USA)", "NAND (EUR)", "NAND (AUS)", "NAND (CHN)", "NAND (KOR)" }; if (isDSiEnhanced) // NB: Core makes cartridges region free regardless, DSiWare must follow DSi region locking however (we'll enforce it regardless) { nandOptions.Clear(); @@ -262,7 +262,7 @@ private static byte[] DecideNAND(ICoreFileProvider cfp, bool isDSiEnhanced, byte private static byte[] GetTMDData(ulong titleId) { - using ZipArchive zip = new ZipArchive(Zstd.DecompressZstdStream(new MemoryStream(Resources.TMDS.Value)), ZipArchiveMode.Read, false); + using ZipArchive zip = new(Zstd.DecompressZstdStream(new MemoryStream(Resources.TMDS.Value)), ZipArchiveMode.Read, false); using var tmd = zip.GetEntry($"{titleId:x16}.tmd")?.Open() ?? throw new($"Cannot find TMD for title ID {titleId:x16}, please report"); return tmd.ReadAllBytes(); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/DatachBarcode.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/DatachBarcode.cs index f3528da0ae5..590a17ea66f 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/DatachBarcode.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/DatachBarcode.cs @@ -116,7 +116,7 @@ public void Transfer(string s) throw new InvalidOperationException("s must be numeric only"); } - System.IO.MemoryStream result = new System.IO.MemoryStream(); + System.IO.MemoryStream result = new(); for (int i = 0; i < 33; i++) result.WriteByte(8); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDSInspector.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDSInspector.cs index 2fe3685cc43..47a4bfe104b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDSInspector.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDSInspector.cs @@ -100,7 +100,7 @@ public FDSDisk(BinaryReader r) { try { - FDSChunk chunk = new FDSChunk(r) { Hidden = true }; + FDSChunk chunk = new(r) { Hidden = true }; if (r.BaseStream.Position <= endpos) { Chunks.Add(chunk); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs index 673030cde96..27ce509a353 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs @@ -32,7 +32,7 @@ private void BoardSystemHardReset() // FDS and NSF have a unique activation setup if (Board is FDS) { - FDS newfds = new FDS(); + FDS newfds = new(); FDS oldfds = Board as FDS; newfds.biosrom = oldfds.biosrom; newfds.SetDiskImage(oldfds.GetDiskImage()); @@ -40,7 +40,7 @@ private void BoardSystemHardReset() } else if (Board is NSFBoard) { - NSFBoard newnsf = new NSFBoard(); + NSFBoard newnsf = new(); NSFBoard oldnsf = Board as NSFBoard; newnsf.InitNSF(oldnsf.nsf); newboard = newnsf; @@ -81,8 +81,8 @@ private void BoardSystemHardReset() static NES() { - List highPriority = new List(); - List normalPriority = new List(); + List highPriority = new(); + List normalPriority = new(); //scan types in this assembly to find ones that implement boards to add them to the list foreach (var type in Emulation.Cores.ReflectionCache.Types) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index f474403e1e5..ddcc53e3fa9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -835,7 +835,7 @@ private void write_joyport(byte value) { //Console.WriteLine("cont " + value + " frame " + Frame); - StrobeInfo si = new StrobeInfo(latched4016, value); + StrobeInfo si = new(latched4016, value); ControllerDeck.Strobe(si, _controller); latched4016 = value; new_strobe = (value & 1) > 0; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs index 6b0a6329117..397196e555b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs @@ -10,18 +10,18 @@ public partial class NES private void SetupMemoryDomains() { - List domains = new List(); - MemoryDomainByteArray RAM = new MemoryDomainByteArray("RAM", MemoryDomain.Endian.Little, ram, true, 1); + List domains = new(); + MemoryDomainByteArray RAM = new("RAM", MemoryDomain.Endian.Little, ram, true, 1); // System bus gets it's own class in order to send compare values to cheats - MemoryDomainDelegateSysBusNES SystemBus = new MemoryDomainDelegateSysBusNES("System Bus", 0x10000, MemoryDomain.Endian.Little, + MemoryDomainDelegateSysBusNES SystemBus = new("System Bus", 0x10000, MemoryDomain.Endian.Little, addr => PeekMemory((ushort)addr), (addr, value) => ApplySystemBusPoke((int)addr, value), 1, (addr, value, compare, comparetype) => ApplyCompareCheat(addr, value, compare, comparetype)); - MemoryDomainDelegate PPUBus = new MemoryDomainDelegate("PPU Bus", 0x4000, MemoryDomain.Endian.Little, + MemoryDomainDelegate PPUBus = new("PPU Bus", 0x4000, MemoryDomain.Endian.Little, addr => ppu.ppubus_peek((int)addr), (addr, value) => ppu.ppubus_write((int)addr, value), 1); - MemoryDomainByteArray CIRAMdomain = new MemoryDomainByteArray("CIRAM (nametables)", MemoryDomain.Endian.Little, CIRAM, true, 1); - MemoryDomainByteArray OAMdoman = new MemoryDomainByteArray("OAM", MemoryDomain.Endian.Unknown, ppu.OAM, true, 1); + MemoryDomainByteArray CIRAMdomain = new("CIRAM (nametables)", MemoryDomain.Endian.Little, CIRAM, true, 1); + MemoryDomainByteArray OAMdoman = new("OAM", MemoryDomain.Endian.Unknown, ppu.OAM, true, 1); domains.Add(RAM); domains.Add(SystemBus); @@ -31,31 +31,31 @@ private void SetupMemoryDomains() if (Board is not FDS && Board.SaveRam != null) { - MemoryDomainByteArray BatteryRam = new MemoryDomainByteArray("Battery RAM", MemoryDomain.Endian.Little, Board.SaveRam, true, 1); + MemoryDomainByteArray BatteryRam = new("Battery RAM", MemoryDomain.Endian.Little, Board.SaveRam, true, 1); domains.Add(BatteryRam); } if (Board.Rom != null) { - MemoryDomainByteArray PRGROM = new MemoryDomainByteArray("PRG ROM", MemoryDomain.Endian.Little, Board.Rom, true, 1); + MemoryDomainByteArray PRGROM = new("PRG ROM", MemoryDomain.Endian.Little, Board.Rom, true, 1); domains.Add(PRGROM); } if (Board.Vrom != null) { - MemoryDomainByteArray CHRROM = new MemoryDomainByteArray("CHR VROM", MemoryDomain.Endian.Little, Board.Vrom, true, 1); + MemoryDomainByteArray CHRROM = new("CHR VROM", MemoryDomain.Endian.Little, Board.Vrom, true, 1); domains.Add(CHRROM); } if (Board.Vram != null) { - MemoryDomainByteArray VRAM = new MemoryDomainByteArray("VRAM", MemoryDomain.Endian.Little, Board.Vram, true, 1); + MemoryDomainByteArray VRAM = new("VRAM", MemoryDomain.Endian.Little, Board.Vram, true, 1); domains.Add(VRAM); } if (Board.Wram != null) { - MemoryDomainByteArray WRAM = new MemoryDomainByteArray("WRAM", MemoryDomain.Endian.Little, Board.Wram, true, 1); + MemoryDomainByteArray WRAM = new("WRAM", MemoryDomain.Endian.Little, Board.Wram, true, 1); domains.Add(WRAM); } @@ -77,7 +77,7 @@ private void SetupMemoryDomains() } else { - MemoryDomainList src = new MemoryDomainList(domains); + MemoryDomainList src = new(domains); _memoryDomains.MergeList(src); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs index 5850809a481..eddf8199847 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs @@ -16,7 +16,7 @@ public partial class NES : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRe [CoreConstructor(VSystemID.Raw.NES)] public NES(CoreComm comm, GameInfo game, byte[] rom, NESSettings settings, NESSyncSettings syncSettings, bool subframe = false) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; byte[] fdsBios = comm.CoreFileProvider.GetFirmware(new("NES", "Bios_FDS")); @@ -345,11 +345,11 @@ public void Init(GameInfo gameInfo, byte[] rom, byte[] fdsbios = null) { origin = EDetectionOrigin.NSF; LoadWriteLine("Loading as NSF"); - NSFFormat nsf = new NSFFormat(); + NSFFormat nsf = new(); nsf.WrapByteArray(file); cart = new CartInfo(); - NSFBoard nsfboard = new NSFBoard(); + NSFBoard nsfboard = new(); nsfboard.Create(this); nsfboard.Rom = rom; nsfboard.InitNSF( nsf); @@ -379,7 +379,7 @@ public void Init(GameInfo gameInfo, byte[] rom, byte[] fdsbios = null) if (fdsbios == null) throw new MissingFirmwareException("Missing FDS Bios"); cart = new CartInfo(); - FDS fdsboard = new FDS + FDS fdsboard = new() { biosrom = fdsbios }; @@ -465,7 +465,7 @@ public void Init(GameInfo gameInfo, byte[] rom, byte[] fdsbios = null) //8KB prg can't be stored in iNES format, which counts 16KB prg banks. //so a correct hash will include only 8KB. LoadWriteLine("Since this rom has a 16 KB PRG, we'll hash it as 8KB too for bootgod's DB:"); - MemoryStream msTemp = new MemoryStream(); + MemoryStream msTemp = new(); msTemp.Write(file, 16, 8 * 1024); //add prg if (file.Length >= (16 * 1024 + iNesHeaderInfo.ChrSize * 1024 + 16)) { @@ -655,7 +655,7 @@ public void Init(GameInfo gameInfo, byte[] rom, byte[] fdsbios = null) //create the board's rom and vrom if (iNesHeaderInfo != null) { - using MemoryStream ms = new MemoryStream(file, false); + using MemoryStream ms = new(file, false); ms.Seek(16, SeekOrigin.Begin); // ines header //pluck the necessary bytes out of the file if (iNesHeaderInfo.TrainerSize != 0) @@ -686,7 +686,7 @@ public void Init(GameInfo gameInfo, byte[] rom, byte[] fdsbios = null) else { // we should only get here for boards with no header - MemoryStream ms = new MemoryStream(file, false); + MemoryStream ms = new(file, false); ms.Seek(0, SeekOrigin.Begin); Board.Rom = new byte[choice.PrgSize * 1024]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NSFFormat.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NSFFormat.cs index e62cbd3facd..5f0043804a4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NSFFormat.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NSFFormat.cs @@ -52,8 +52,8 @@ public void WrapByteArray(byte[] data) { NSFData = data; - MemoryStream ms = new MemoryStream(data); - BinaryReader br = new BinaryReader(ms); + MemoryStream ms = new(data); + BinaryReader br = new(ms); br.BaseStream.Position += 5; Version = br.ReadByte(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs index 213d17e408a..1196dfda3ba 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs @@ -30,7 +30,7 @@ private void TryAdd(Stream s, string key) public Unif(Stream s) { - BinaryReader br = new BinaryReader(s, Encoding.ASCII); + BinaryReader br = new(s, Encoding.ASCII); if (!Encoding.ASCII.GetBytes("UNIF") .SequenceEqual(br.ReadBytes(4))) @@ -51,8 +51,8 @@ public Unif(Stream s) Chunks.Add(chunkId, chunkData); } - MemoryStream prgs = new MemoryStream(); - MemoryStream chrs = new MemoryStream(); + MemoryStream prgs = new(); + MemoryStream chrs = new(); for (int i = 0; i < 16; i++) { TryAdd(prgs, $"PRG{i:X1}"); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.IDebuggable.cs index 40681637e27..2724f3cac7d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.IDebuggable.cs @@ -10,7 +10,7 @@ public partial class QuickNES : IDebuggable public IDictionary GetCpuFlagsAndRegisters() { int[] regs = new int[6]; - Dictionary ret = new Dictionary(); + Dictionary ret = new(); QN.qn_get_cpuregs(Context, regs); ret["A"] = (byte)regs[0]; ret["X"] = (byte)regs[1]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs index 7cdb4137e2d..d859bf5bdd7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs @@ -20,7 +20,7 @@ public sealed partial class QuickNES : IEmulator, IVideoProvider, ISoundProvider { static QuickNES() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( $"libquicknes{(OSTailoredCode.IsUnixHost ? ".dll.so.0.7.0" : ".dll")}", hasLimitedLifetime: false); QN = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); QN.qn_setup_mappers(); @@ -194,7 +194,7 @@ private void ComputeBootGod() var chrrom = _memoryDomains["CHR VROM"]; var prgrom = _memoryDomains["PRG ROM"]!; - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); for (int i = 0; i < prgrom.Size; i++) ms.WriteByte(prgrom.PeekByte(i)); if (chrrom != null) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesControllerDeck.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesControllerDeck.cs index 205706e4783..9449f649eaa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesControllerDeck.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesControllerDeck.cs @@ -131,7 +131,7 @@ public class SnesController : ILibsnesController private static int ButtonOrder(string btn) { - Dictionary order = new Dictionary + Dictionary order = new() { ["0Up"] = 0, ["0Down"] = 1, @@ -193,7 +193,7 @@ public class SnesMultitapController : ILibsnesController private static int ButtonOrder(string btn) { - Dictionary order = new Dictionary + Dictionary order = new() { ["Up"] = 0, ["Down"] = 1, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs index 9277ffc6ef1..35e9a228aaa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs @@ -49,7 +49,7 @@ public bool FrameAdvance(IController controller, bool render, bool renderSound) Api.CMD_power(); } - LibsnesApi.LayerEnables enables = new LibsnesApi.LayerEnables + LibsnesApi.LayerEnables enables = new() { BG1_Prio0 = _settings.ShowBG1_0, BG1_Prio1 = _settings.ShowBG1_1, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs index 3344b2c434f..03188514d83 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs @@ -65,7 +65,7 @@ private void SetupMemoryDomains(byte[] romData, byte[] sgbRomData) MakeMemoryDomain("SGB WRAM", LibsnesApi.SNES_MEMORY.SGB_WRAM, MemoryDomain.Endian.Little); //uhhh why can't this be done with MakeMemoryDomain? improve that. - MemoryDomainByteArray romDomain = new MemoryDomainByteArray("SGB CARTROM", MemoryDomain.Endian.Little, romData, true, 1); + MemoryDomainByteArray romDomain = new("SGB CARTROM", MemoryDomain.Endian.Little, romData, true, 1); _memoryDomainList.Add(romDomain); // the last 1 byte of this is special.. its an interrupt enable register, instead of ram. weird. maybe its actually ram and just getting specially used? @@ -92,7 +92,7 @@ private unsafe void MakeMemoryDomain(string name, LibsnesApi.SNES_MEMORY id, Mem byte* blockPtr = Api.QUERY_get_memory_data(id); - MemoryDomainIntPtrMonitor md = new MemoryDomainIntPtrMonitor(name, MemoryDomain.Endian.Little, (IntPtr)blockPtr, size, + MemoryDomainIntPtrMonitor md = new(name, MemoryDomain.Endian.Little, (IntPtr)blockPtr, size, true, byteSize, Api); @@ -109,7 +109,7 @@ private unsafe void MakeFakeBus() byte* blockPtr = Api.QUERY_get_memory_data(LibsnesApi.SNES_MEMORY.WRAM); - MemoryDomainDelegate md = new MemoryDomainDelegate("System Bus", 0x1000000, MemoryDomain.Endian.Little, + MemoryDomainDelegate md = new("System Bus", 0x1000000, MemoryDomain.Endian.Little, addr => { using (Api.EnterExit()) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index c58a6c06ad2..deff2cc48d4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -33,7 +33,7 @@ public LibsnesCore(GameInfo game, byte[] romData, byte[] xmlData, string baseRom LibsnesCore.SnesSettings settings, LibsnesCore.SnesSyncSettings syncSettings) { _baseRomPath = baseRomPath; - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; const string TRACE_HEADER = "65816: PC, mnemonic, operands, registers (A, X, Y, S, D, DB, flags (NVMXDIZC), V, H)"; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/SNESGraphicsDecoder.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/SNESGraphicsDecoder.cs index a1c6f975f08..ea3d6cf1edc 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/SNESGraphicsDecoder.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/SNESGraphicsDecoder.cs @@ -408,7 +408,7 @@ public ScreenInfo ScanScreenInfo() int OBSEL_NameSel = api.QUERY_peek_logical_register(LibsnesApi.SNES_REG.OBSEL_NAMESEL); int OBSEL_NameBase = api.QUERY_peek_logical_register(LibsnesApi.SNES_REG.OBSEL_NAMEBASE); - ScreenInfo si = new ScreenInfo + ScreenInfo si = new() { Mode = api.QUERY_peek_logical_register(LibsnesApi.SNES_REG.BG_MODE), Mode1_BG3_Priority = api.QUERY_peek_logical_register(LibsnesApi.SNES_REG.BG3_PRIORITY) == 1, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9xControllers.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9xControllers.cs index d71b1b4eab4..2d8078b5283 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9xControllers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9xControllers.cs @@ -91,7 +91,7 @@ private class Joypad : IControlDevice private static int ButtonOrder(string btn) { - Dictionary order = new Dictionary + Dictionary order = new() { ["0Up"] = 0, ["0Down"] = 1, ["0Left"] = 2, ["0Right"] = 3, ["0Select"] = 4, ["0Start"] = 5, ["0Y"] = 6, ["0B"] = 7, ["0X"] = 8, ["0A"] = 9 , ["0L"] = 10, ["0R"] = 11 diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.ISettable.cs index 1fb5d374473..03ea4d7afd2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.ISettable.cs @@ -18,7 +18,7 @@ public partial class Sameboy : ISettable(resolver, CallingConventionAdapters.Native); } @@ -49,7 +49,7 @@ public bool IsCGBDMGMode public Sameboy(CoreComm comm, GameInfo game, byte[] gbs, SameboySettings settings, SameboySyncSettings syncSettings) : this(comm, game, null, settings, syncSettings, false) { - LibSameboy.GBSInfo gbsInfo = new LibSameboy.GBSInfo + LibSameboy.GBSInfo gbsInfo = new() { TrackCount = 0, FirstTrack = 0, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs index f6c785f2e7e..ff5f5e10155 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs @@ -26,7 +26,7 @@ public SubGBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ _GBStatable = _GBCore.ServiceProvider.GetService(); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; ser.Register(_GBCore.ServiceProvider.GetService()); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs index 3275da07f0c..83e924fad86 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs @@ -22,7 +22,7 @@ public SubNESHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ _nesStatable = _nesCore.ServiceProvider.GetService(); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; ser.Register(_nesCore.ServiceProvider.GetService()); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs index c2982361d0a..42d100756ff 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs @@ -19,7 +19,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) { if (_cachedSettingsInfo is null) { - using VirtualBoyee n = new VirtualBoyee(comm); + using VirtualBoyee n = new(comm); n.InitForSettingsInfo("vb.wbx"); _cachedSettingsInfo = n.SettingsInfo.Clone(); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.ICodeDataLogger.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.ICodeDataLogger.cs index a05af2aa485..2692a8108e4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.ICodeDataLogger.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.ICodeDataLogger.cs @@ -96,7 +96,7 @@ private void InitCDLMappings() CDLMappingApplyRange(mm, "Battery RAM", 0xf7, BRAM.Length); } - HuC6280.MemMapping ramMirrors = new HuC6280.MemMapping { Name = "Main Memory", Offs = 0 }; + HuC6280.MemMapping ramMirrors = new() { Name = "Main Memory", Offs = 0 }; mm[0xf9] = mm[0xfa] = mm[0xfb] = ramMirrors; CDLMappingApplyRange(mm, "Main Memory", 0xf8, Ram.Length); diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.IMemoryDomains.cs index 7d6628fa020..e63e0777adf 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.IMemoryDomains.cs @@ -14,9 +14,9 @@ public sealed partial class PCEngine private void SetupMemoryDomains() { - List domains = new List(); + List domains = new(); - MemoryDomainDelegate systemBusDomain = new MemoryDomainDelegate("System Bus (21 bit)", 0x200000, MemoryDomain.Endian.Little, + MemoryDomainDelegate systemBusDomain = new("System Bus (21 bit)", 0x200000, MemoryDomain.Endian.Little, (addr) => { if (addr is < 0 or > 0x1FFFFF) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); @@ -30,7 +30,7 @@ private void SetupMemoryDomains() wordSize: 2); domains.Add(systemBusDomain); - MemoryDomainDelegate cpuBusDomain = new MemoryDomainDelegate("System Bus", 0x10000, MemoryDomain.Endian.Little, + MemoryDomainDelegate cpuBusDomain = new("System Bus", 0x10000, MemoryDomain.Endian.Little, (addr) => { if (addr is < 0 or > 0xFFFF) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); @@ -101,7 +101,7 @@ private void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Little, data, true, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Little, data, true, 1); _byteArrayDomains.Add(name, m); } } @@ -115,7 +115,7 @@ private void SyncUshortArrayDomain(string name, ushort[] data) } else { - MemoryDomainUshortArray m = new MemoryDomainUshortArray(name, MemoryDomain.Endian.Big, data, true); + MemoryDomainUshortArray m = new(name, MemoryDomain.Endian.Big, data, true); _ushortArrayDomains.Add(name, m); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index f19858c5e41..a04699763ee 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -311,7 +311,7 @@ private void Init(GameInfo game, byte[] rom) Cpu.ResetPC(); Tracer = new TraceBuffer(Cpu.TraceHeader); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; ser.Register(Tracer); ser.Register(Cpu); @@ -331,7 +331,7 @@ private static Dictionary SizesFromHuMap(IEnumerable keys = new List(sizes.Keys); + List keys = new(sizes.Keys); foreach (string key in keys) { // becase we were looking at offsets, and each bank is 8192 big, we need to add that size diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs index e14ab1ce96c..2b9bc8cd139 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs @@ -183,7 +183,7 @@ public void Think() if (DataIn.Count == 0) { // read in a sector and shove it in the queue - DiscSectorReader dsr = new DiscSectorReader(disc); // TODO - cache reader + DiscSectorReader dsr = new(disc); // TODO - cache reader dsr.ReadLBA_2048(CurrentReadingSector, DataIn.GetBuffer(), 0); DataIn.SignalBufferFilled(2048); CurrentReadingSector++; diff --git a/src/BizHawk.Emulation.Cores/Consoles/SNK/NeoGeoPort.cs b/src/BizHawk.Emulation.Cores/Consoles/SNK/NeoGeoPort.cs index fed3611a911..ea17afac65e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/SNK/NeoGeoPort.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/SNK/NeoGeoPort.cs @@ -21,7 +21,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) { if (_cachedSettingsInfo is null) { - using NeoGeoPort n = new NeoGeoPort(comm); + using NeoGeoPort n = new(comm); n.InitForSettingsInfo("ngp.wbx"); _cachedSettingsInfo = n.SettingsInfo.Clone(); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IMemoryDomains.cs index e2ae1562bd2..3302ab493bd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IMemoryDomains.cs @@ -9,7 +9,7 @@ public partial class GGHawkLink public void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate( "Main RAM L", @@ -71,13 +71,13 @@ public void SetupMemoryDomains() if (L.SaveRAM != null) { - MemoryDomainByteArray cartRamL = new MemoryDomainByteArray("Cart RAM L", MemoryDomain.Endian.Little, L.SaveRAM, true, 1); + MemoryDomainByteArray cartRamL = new("Cart RAM L", MemoryDomain.Endian.Little, L.SaveRAM, true, 1); domains.Add(cartRamL); } if (R.SaveRAM != null) { - MemoryDomainByteArray cartRamR = new MemoryDomainByteArray("Cart RAM R", MemoryDomain.Endian.Little, R.SaveRAM, true, 1); + MemoryDomainByteArray cartRamR = new("Cart RAM R", MemoryDomain.Endian.Little, R.SaveRAM, true, 1); domains.Add(cartRamR); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs index c42d6d58a6d..22093e8ba4e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs @@ -27,17 +27,17 @@ public GGHawkLink(CoreLoadParameters lp) if (lp.Roms.Count != 2) throw new InvalidOperationException("Wrong number of roms"); - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); linkSettings = lp.Settings ?? new GGLinkSettings(); linkSyncSettings = lp.SyncSettings ?? new GGLinkSyncSettings(); _controllerDeck = new GGHawkLinkControllerDeck(GGHawkLinkControllerDeck.DefaultControllerName, GGHawkLinkControllerDeck.DefaultControllerName); - SMS.SmsSettings temp_set_L = new SMS.SmsSettings(); - SMS.SmsSettings temp_set_R = new SMS.SmsSettings(); + SMS.SmsSettings temp_set_L = new(); + SMS.SmsSettings temp_set_R = new(); - SMS.SmsSyncSettings temp_sync_L = new SMS.SmsSyncSettings(); - SMS.SmsSyncSettings temp_sync_R = new SMS.SmsSyncSettings(); + SMS.SmsSyncSettings temp_sync_L = new(); + SMS.SmsSyncSettings temp_sync_R = new(); L = new SMS(lp.Comm, lp.Roms[0].Game, lp.Roms[0].RomData, temp_set_L, temp_sync_L); R = new SMS(lp.Comm, lp.Roms[1].Game, lp.Roms[1].RomData, temp_set_R, temp_sync_R); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs index 2dc1be04387..95450ffbec0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs @@ -206,7 +206,7 @@ public SyncSettings() private SyncSettings _syncSettings; - public object GetSettings() => new object(); + public object GetSettings() => new(); public SyncSettings GetSyncSettings() => _syncSettings.Clone(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IMemoryDomains.cs index 6718c40f1b8..99789c77002 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IMemoryDomains.cs @@ -14,7 +14,7 @@ public partial class SMS private void SetupMemoryDomains() { - List domains = new List + List domains = new() { new MemoryDomainDelegate("System Bus", 0x10000, MemoryDomain.Endian.Little, (addr) => @@ -31,7 +31,7 @@ private void SetupMemoryDomains() if (SaveRAM != null) { - MemoryDomainDelegate saveRamDomain = new MemoryDomainDelegate("Save RAM", SaveRAM.Length, MemoryDomain.Endian.Little, + MemoryDomainDelegate saveRamDomain = new("Save RAM", SaveRAM.Length, MemoryDomain.Endian.Little, addr => SaveRAM[addr], (addr, value) => { SaveRAM[addr] = value; SaveRamModified = true; }, 1); domains.Add(saveRamDomain); @@ -66,7 +66,7 @@ private void SyncByteArrayDomain(string name, byte[] data) } else { - MemoryDomainByteArray m = new MemoryDomainByteArray(name, MemoryDomain.Endian.Little, data, true, 1); + MemoryDomainByteArray m = new(name, MemoryDomain.Endian.Little, data, true, 1); _byteArrayDomains.Add(name, m); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IStatable.cs index b8158603a03..df2818574f0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IStatable.cs @@ -10,7 +10,7 @@ private void SyncState(Serializer ser) byte[] core = null; if (ser.IsWriter) { - using MemoryStream ms = new MemoryStream(); + using MemoryStream ms = new(); ms.Close(); core = ms.ToArray(); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs index d8474c22ece..1bd13556520 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs @@ -24,7 +24,7 @@ public partial class SMS : IEmulator, ISoundProvider, ISaveRam, IInputPollable, [CoreConstructor(VSystemID.Raw.GG)] public SMS(CoreComm comm, GameInfo game, byte[] rom, SmsSettings settings, SmsSyncSettings syncSettings) { - BasicServiceProvider ser = new BasicServiceProvider(this); + BasicServiceProvider ser = new(this); ServiceProvider = ser; Settings = settings ?? new SmsSettings(); SyncSettings = syncSettings ?? new SmsSyncSettings(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs index 06bbcd168a5..96fc3fb35e0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs @@ -20,7 +20,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) { if (_cachedSettingsInfo is null) { - using Saturnus n = new Saturnus(comm); + using Saturnus n = new(comm); n.InitForSettingsInfo("ss.wbx"); _cachedSettingsInfo = n.SettingsInfo.Clone(); } @@ -34,7 +34,7 @@ public Saturnus(CoreLoadParameters lp) { if (lp.Roms.Count > 0) throw new InvalidOperationException("To load a Saturn game, please load the CUE file and not the BIN file."); - Dictionary firmwares = new Dictionary + Dictionary firmwares = new() { { "FIRMWARE:$J", new("SAT", "J") }, { "FIRMWARE:$U", new("SAT", "U") }, @@ -91,7 +91,7 @@ protected override HashSet ComputeHiddenPorts() devCount -= 5; if (SettingsQuery("ss.input.sport2.multitap") != "1") devCount -= 5; - HashSet ret = new HashSet(); + HashSet ret = new(); for (int i = 1; i <= 12; i++) { if (i > devCount) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs index f03dd8e59d2..2e6f5abf9bb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs @@ -16,7 +16,7 @@ public IDictionary GetCpuFlagsAndRegisters() int n = Core.gpgx_getregs(regs); if (n > regs.Length) throw new InvalidOperationException("A buffer overrun has occured!"); - Dictionary ret = new Dictionary(); + Dictionary ret = new(); using (_elf.EnterExit()) { for (int i = 0; i < n; i++) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IMemoryDomains.cs index ba0dc123a07..30308aaeab1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IMemoryDomains.cs @@ -15,7 +15,7 @@ private unsafe void SetMemoryDomains() { using (_elf.EnterExit()) { - List mm = new List(); + List mm = new(); for (int i = LibGPGX.MIN_MEM_DOMAIN; i <= LibGPGX.MAX_MEM_DOMAIN; i++) { var area = IntPtr.Zero; @@ -79,7 +79,7 @@ private unsafe void SetMemoryDomains() mm.Add(new MemoryDomainIntPtrSwap16Monitor(name, endian, area, size, true, _elf)); } } - MemoryDomainDelegate m68Bus = new MemoryDomainDelegate("M68K BUS", 0x1000000, MemoryDomain.Endian.Big, + MemoryDomainDelegate m68Bus = new("M68K BUS", 0x1000000, MemoryDomain.Endian.Big, addr => { uint a = (uint)addr; @@ -97,7 +97,7 @@ private unsafe void SetMemoryDomains() if (IsMegaCD) { - MemoryDomainDelegate s68Bus = new MemoryDomainDelegate("S68K BUS", 0x1000000, MemoryDomain.Endian.Big, + MemoryDomainDelegate s68Bus = new("S68K BUS", 0x1000000, MemoryDomain.Endian.Big, addr => { uint a = (uint)addr; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.ITraceable.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.ITraceable.cs index 75ac7fa12b9..00217c361ec 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.ITraceable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.ITraceable.cs @@ -22,7 +22,7 @@ protected override void TraceFromCallback(uint addr, uint value, uint flags) uint pc = (uint)regs["M68K PC"].Value; string disasm = Disassembler.Disassemble(MemoryDomains.SystemBus, pc & 0xFFFFFF, out _); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (var r in regs) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs index d9b60a7e2b0..c9cf280accd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs @@ -14,7 +14,7 @@ public partial class GPGX : IVideoProvider public int BufferWidth { get; private set; } - public int BufferHeight => _vheight; + public int BufferHeight { get; private set; } public int BackgroundColor => unchecked((int)0xff000000); @@ -23,7 +23,6 @@ public partial class GPGX : IVideoProvider public int VsyncDenominator { get; } private int[] _vidBuff = new int[0]; - private int _vheight; private void UpdateVideoInitial() { @@ -33,8 +32,8 @@ private void UpdateVideoInitial() // so instead, just assume a 320x224 size now; if that happens to be wrong, it'll be fixed soon enough. BufferWidth = 320; - _vheight = 224; - _vidBuff = new int[BufferWidth * _vheight]; + BufferHeight = 224; + _vidBuff = new int[BufferWidth * BufferHeight]; for (int i = 0; i < _vidBuff.Length; i++) { _vidBuff[i] = unchecked((int)0xff000000); @@ -56,7 +55,7 @@ private unsafe void UpdateVideo() Core.gpgx_get_video(out int gpwidth, out int gpheight, out int gppitch, ref src); BufferWidth = gpwidth; - _vheight = gpheight; + BufferHeight = gpheight; if (_settings.PadScreen320 && BufferWidth == 256) BufferWidth = 320; @@ -64,8 +63,8 @@ private unsafe void UpdateVideo() int xpad = (BufferWidth - gpwidth) / 2; int xpad2 = BufferWidth - gpwidth - xpad; - if (_vidBuff.Length < BufferWidth * _vheight) - _vidBuff = new int[BufferWidth * _vheight]; + if (_vidBuff.Length < BufferWidth * BufferHeight) + _vidBuff = new int[BufferWidth * BufferHeight]; int rinc = (gppitch / 4) - gpwidth; fixed (int* pdst_ = _vidBuff) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs index 75f1dd979c9..9eef37d9041 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs @@ -296,7 +296,7 @@ private void CDRead(int lba, IntPtr dest, bool audio) public static LibGPGX.CDData GetCDDataStruct(Disc cd) { - LibGPGX.CDData ret = new LibGPGX.CDData(); + LibGPGX.CDData ret = new(); var ses = cd.Session1; int ntrack = ses.InformationTrackCount; @@ -389,7 +389,7 @@ public VDPView(LibGPGX.VDPView v, IMonitor m) public VDPView UpdateVDPViewContext() { - LibGPGX.VDPView v = new LibGPGX.VDPView(); + LibGPGX.VDPView v = new(); Core.gpgx_get_vdp_view(v); Core.gpgx_flush_vram(); // fully regenerate internal caches as needed return new VDPView(v, _elf); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Nymashock.cs b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Nymashock.cs index 4cb58ef80d7..d4362fea75d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Nymashock.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Nymashock.cs @@ -45,7 +45,7 @@ public static NymaSettingsInfo CachedSettingsInfo(CoreComm comm) { if (_cachedSettingsInfo is null) { - using Nymashock n = new Nymashock(comm); + using Nymashock n = new(comm); n.InitForSettingsInfo("shock.wbx"); _cachedSettingsInfo = n.SettingsInfo.Clone(); } @@ -59,7 +59,7 @@ public Nymashock(CoreLoadParameters lp) { if (lp.Roms.Count > 0) throw new InvalidOperationException("To load a PSX game, please load the CUE file and not the BIN file."); - Dictionary firmwares = new Dictionary + Dictionary firmwares = new() { { "FIRMWARE:$J", new("PSX", "J") }, { "FIRMWARE:$U", new("PSX", "U") }, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.IDebuggable.cs index 50bcf6e26ee..4da665db704 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.IDebuggable.cs @@ -10,7 +10,7 @@ public unsafe partial class Octoshock : IDebuggable public IDictionary GetCpuFlagsAndRegisters() { Dictionary ret = new(); - OctoshockDll.ShockRegisters_CPU regs = new OctoshockDll.ShockRegisters_CPU(); + OctoshockDll.ShockRegisters_CPU regs = new(); OctoshockDll.shock_GetRegisters_CPU(psx, ref regs); @@ -126,7 +126,7 @@ private void RefreshMemCallbacks() private void SetMemoryDomains() { - List mmd = new List(); + List mmd = new(); OctoshockDll.shock_GetMemData(psx, out var ptr, out int size, OctoshockDll.eMemType.MainRAM); mmd.Add(new MemoryDomainIntPtr("MainRAM", MemoryDomain.Endian.Little, ptr, size, true, 4)); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.IDisassemblable.cs b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.IDisassemblable.cs index 43401853d97..96e9d88b942 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.IDisassemblable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.IDisassemblable.cs @@ -25,7 +25,7 @@ public IEnumerable AvailableCpus public string Disassemble(MemoryDomain m, uint addr, out int length) { length = 4; - StringBuilder buf = new StringBuilder(32); + StringBuilder buf = new(32); int result = OctoshockDll.shock_Util_DisassembleMIPS(addr, m.PeekUint(addr, false), buf, buf.Capacity); return result==0?buf.ToString():""; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs index 23b39cd1ffd..6f95d6edb3e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs @@ -63,7 +63,7 @@ static string DiscHashWarningText(GameInfo game, string discHash) } } - StringWriter sw = new StringWriter(); + StringWriter sw = new(); foreach (var d in lp.Discs) { string discHash = new DiscHasher(d.DiscData).Calculate_PSX_BizIDHash(); @@ -111,7 +111,7 @@ private void Load( foreach (var disc in discs) { - DiscInterface discInterface = new DiscInterface(disc, + DiscInterface discInterface = new(disc, di => { //if current disc this delegate disc, activity is happening @@ -268,7 +268,7 @@ private void Load( else OctoshockDll.shock_Peripheral_Connect(psx, 0x02, fioCfg.Devices8[4]); - OctoshockDll.ShockMemcardTransaction memcardTransaction = new OctoshockDll.ShockMemcardTransaction() + OctoshockDll.ShockMemcardTransaction memcardTransaction = new() { transaction = OctoshockDll.eShockMemcardTransaction.Connect }; @@ -449,7 +449,7 @@ private int ShockDisc_ReadLBA2448(IntPtr opaque, int lba, void* dst) cbActivity(this); //todo - cache reader - DiscSectorReader dsr = new DiscSectorReader(Disc); + DiscSectorReader dsr = new(Disc); int readed = dsr.ReadLBA_2448(lba, SectorBuffer, 0); if (readed == 2448) { @@ -496,7 +496,7 @@ static Octoshock() public string CalculateDiscHashes() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); try { foreach (var disc in Discs) @@ -809,7 +809,7 @@ public bool FrameAdvance(IController controller, bool render, bool rendersound) OctoshockDll.shock_SetLEC(psx, _SyncSettings.EnableLEC); - OctoshockDll.ShockRenderOptions ropts = new OctoshockDll.ShockRenderOptions() + OctoshockDll.ShockRenderOptions ropts = new() { scanline_start = SystemVidStandard == OctoshockDll.eVidStandard.NTSC ? _Settings.ScanlineStart_NTSC : _Settings.ScanlineStart_PAL, scanline_end = SystemVidStandard == OctoshockDll.eVidStandard.NTSC ? _Settings.ScanlineEnd_NTSC : _Settings.ScanlineEnd_PAL, @@ -965,7 +965,7 @@ public byte[] CloneSaveRam() { fixed (byte* pbuf = buf) { - OctoshockDll.ShockMemcardTransaction transaction = new OctoshockDll.ShockMemcardTransaction + OctoshockDll.ShockMemcardTransaction transaction = new() { buffer128k = pbuf + idx * 128 * 1024, transaction = OctoshockDll.eShockMemcardTransaction.Read @@ -987,7 +987,7 @@ public void StoreSaveRam(byte[] data) { fixed (byte* pbuf = data) { - OctoshockDll.ShockMemcardTransaction transaction = new OctoshockDll.ShockMemcardTransaction + OctoshockDll.ShockMemcardTransaction transaction = new() { buffer128k = pbuf + idx * 128 * 1024, transaction = OctoshockDll.eShockMemcardTransaction.Write @@ -1008,7 +1008,7 @@ public bool SaveRamModified { if (cfg.Memcards[i]) { - OctoshockDll.ShockMemcardTransaction transaction = new OctoshockDll.ShockMemcardTransaction + OctoshockDll.ShockMemcardTransaction transaction = new() { transaction = OctoshockDll.eShockMemcardTransaction.CheckDirty }; @@ -1029,7 +1029,7 @@ public bool SaveRamModified private void StudySaveBufferSize() { - OctoshockDll.ShockStateTransaction transaction = new OctoshockDll.ShockStateTransaction + OctoshockDll.ShockStateTransaction transaction = new() { transaction = OctoshockDll.eShockStateTransaction.BinarySize }; @@ -1043,7 +1043,7 @@ public void SaveStateBinary(BinaryWriter writer) { fixed (byte* psavebuff = savebuff) { - OctoshockDll.ShockStateTransaction transaction = new OctoshockDll.ShockStateTransaction() + OctoshockDll.ShockStateTransaction transaction = new() { transaction = OctoshockDll.eShockStateTransaction.BinarySave, buffer = psavebuff, @@ -1069,7 +1069,7 @@ public void LoadStateBinary(BinaryReader reader) { fixed (byte* psavebuff = savebuff) { - OctoshockDll.ShockStateTransaction transaction = new OctoshockDll.ShockStateTransaction() + OctoshockDll.ShockStateTransaction transaction = new() { transaction = OctoshockDll.eShockStateTransaction.BinaryLoad, buffer = psavebuff, @@ -1112,7 +1112,7 @@ public class SyncSettings public SyncSettings() { //initialize with single controller and memcard - OctoshockFIOConfigUser user = new OctoshockFIOConfigUser(); + OctoshockFIOConfigUser user = new(); user.Memcards[0] = true; user.Memcards[1] = false; user.Multitaps[0] = user.Multitaps[0] = false; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/OctoshockFIOConfig.cs b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/OctoshockFIOConfig.cs index 423bd10494c..4ad3f029184 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/OctoshockFIOConfig.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/OctoshockFIOConfig.cs @@ -11,7 +11,7 @@ public class OctoshockFIOConfigUser public OctoshockFIOConfigLogical ToLogical() { - OctoshockFIOConfigLogical lc = new OctoshockFIOConfigLogical(); + OctoshockFIOConfigLogical lc = new(); lc.PopulateFrom(this); return lc; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/PSF.cs b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/PSF.cs index 1938dabe2a7..b1a397b844a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/PSF.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/PSF.cs @@ -18,7 +18,7 @@ public bool Load(string fpPSF, Func cbDeflater) { using var fs = File.OpenRead(fpPSF); //not endian safe - BinaryReader br = new BinaryReader(fs); + BinaryReader br = new(fs); string sig = br.ReadStringFixedUtf8(4); if (sig != "PSF\x1") return false; diff --git a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.IMemoryDomains.cs index db60151614a..e69d198f016 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.IMemoryDomains.cs @@ -9,7 +9,7 @@ public partial class WonderSwan { private void InitIMemoryDomains() { - List mmd = new List(); + List mmd = new(); for (int i = 0;; i++) { if (!BizSwan.bizswan_getmemoryarea(Core, i, out var name, out int size, out var data)) diff --git a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.ISettable.cs index c1772947a8b..c11763876ae 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.ISettable.cs @@ -34,7 +34,7 @@ public class Settings public BizSwan.Settings GetNativeSettings() { - BizSwan.Settings ret = new BizSwan.Settings(); + BizSwan.Settings ret = new(); if (EnableBG) ret.LayerMask |= BizSwan.LayerFlags.BG; if (EnableFG) ret.LayerMask |= BizSwan.LayerFlags.FG; if (EnableSprites) ret.LayerMask |= BizSwan.LayerFlags.Sprite; @@ -124,7 +124,7 @@ public class SyncSettings public BizSwan.SyncSettings GetNativeSettings() { - BizSwan.SyncSettings ret = new BizSwan.SyncSettings + BizSwan.SyncSettings ret = new() { color = Color, userealtime = UseRealTime, diff --git a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.IStatable.cs index 32805447507..dd6710602eb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.IStatable.cs @@ -37,7 +37,7 @@ private void SaveTextStateData(TextStateData d) public void SaveStateText(TextWriter writer) { - TextState s = new TextState(); + TextState s = new(); s.Prepare(); var ff = s.GetFunctionPointersSave(); BizSwan.bizswan_txtstatesave(Core, ref ff); @@ -65,7 +65,7 @@ public void SaveStateBinary(BinaryWriter writer) writer.Write(savebuff.Length); writer.Write(savebuff); - TextStateData d = new TextStateData(); + TextStateData d = new(); SaveTextStateData(d); BinaryQuickSerializer.Write(d, writer); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs index 21d64685c49..aee43a249a6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs @@ -107,7 +107,7 @@ public void ResetCounters() public IDictionary GetCpuFlagsAndRegisters() { - Dictionary ret = new Dictionary(); + Dictionary ret = new(); for (int i = (int)BizSwan.NecRegsMin; i <= (int)BizSwan.NecRegsMax; i++) { BizSwan.NecRegs en = (BizSwan.NecRegs)i; diff --git a/src/BizHawk.Emulation.Cores/CoreInventory.cs b/src/BizHawk.Emulation.Cores/CoreInventory.cs index 123473c3580..a824aa0a22d 100644 --- a/src/BizHawk.Emulation.Cores/CoreInventory.cs +++ b/src/BizHawk.Emulation.Cores/CoreInventory.cs @@ -160,10 +160,10 @@ public IEnumerable GetCores(string system) /// public CoreInventory(IEnumerable> assys) { - Dictionary systemsFlat = new Dictionary(); + Dictionary systemsFlat = new(); void ProcessConstructor(Type type, CoreConstructorAttribute consAttr, CoreAttribute coreAttr, ConstructorInfo cons) { - Core core = new Core(type, consAttr, coreAttr, cons); + Core core = new(type, consAttr, coreAttr, cons); _systems.GetValueOrPutNew(consAttr.System).Add(core); systemsFlat[type] = core; } diff --git a/src/BizHawk.Emulation.Cores/FileID.cs b/src/BizHawk.Emulation.Cores/FileID.cs index f2241e7fac8..1e6b299bfc8 100644 --- a/src/BizHawk.Emulation.Cores/FileID.cs +++ b/src/BizHawk.Emulation.Cores/FileID.cs @@ -179,7 +179,7 @@ public FileIDResults Identify(IdentifyParams p) //add a low confidence result just based on extension, if it doesnt exist if(ret.Find( (x) => x.FileIDType == handler.DefaultForExtension) == null) { - FileIDResult fidr = new FileIDResult(handler.DefaultForExtension, 5); + FileIDResult fidr = new(handler.DefaultForExtension, 5); ret.Add(fidr); } } @@ -211,7 +211,7 @@ public FileIDType IdentifySimple(IdentifyParams p) private FileIDResults IdentifyDisc(IdentifyJob job) { - DiscSystem.DiscIdentifier discIdentifier = new DiscSystem.DiscIdentifier(job.Disc); + DiscSystem.DiscIdentifier discIdentifier = new(job.Disc); //DiscSystem could use some newer approaches from this file (instead of parsing ISO filesystem... maybe?) return discIdentifier.DetectDiscType() switch { @@ -430,7 +430,7 @@ private static FileIDResult Test_INES(IdentifyJob job) if (!CheckMagic(job.Stream, SimpleMagics.INES)) return new FileIDResult(); - FileIDResult ret = new FileIDResult(FileIDType.INES, 100); + FileIDResult ret = new(FileIDType.INES, 100); //an INES file should be a multiple of 8k, with the 16 byte header. //if it isnt.. this is fishy. @@ -455,7 +455,7 @@ private static FileIDResult Test_FDS(IdentifyJob job) /// private static FileIDResult Test_Simple(IdentifyJob job, FileIDType type, SimpleMagicRecord[] magics) { - FileIDResult ret = new FileIDResult(type); + FileIDResult ret = new(type); if (CheckMagic(job.Stream, magics)) return new FileIDResult(type, 100); @@ -465,7 +465,7 @@ private static FileIDResult Test_Simple(IdentifyJob job, FileIDType type, Simple private static FileIDResult Test_Simple(IdentifyJob job, FileIDType type, SimpleMagicRecord magic) { - FileIDResult ret = new FileIDResult(type); + FileIDResult ret = new(type); if (CheckMagic(job.Stream, magic)) return new FileIDResult(type, 100); @@ -480,7 +480,7 @@ private static FileIDResult Test_UNIF(IdentifyJob job) //TODO - simple parser (for starters, check for a known chunk being next, see http://wiki.nesdev.com/w/index.php/UNIF) - FileIDResult ret = new FileIDResult(FileIDType.UNIF, 100); + FileIDResult ret = new(FileIDType.UNIF, 100); return ret; } @@ -490,7 +490,7 @@ private static FileIDResult Test_GB_GBC(IdentifyJob job) if (!CheckMagic(job.Stream, SimpleMagics.GB)) return new FileIDResult(); - FileIDResult ret = new FileIDResult(FileIDType.GB, 100); + FileIDResult ret = new(FileIDType.GB, 100); int type = ReadByte(job.Stream, 0x143); if ((type & 0x80) != 0) ret.FileIDType = FileIDType.GBC; @@ -504,7 +504,7 @@ private static FileIDResult Test_SMS(IdentifyJob job) => //http://www.smspower.org/Development/ROMHeader //actually, not sure how to handle this yet - new FileIDResult(); + new(); private static FileIDResult Test_N64(IdentifyJob job) { @@ -513,7 +513,7 @@ private static FileIDResult Test_N64(IdentifyJob job) // .V64 = Byte Swapped //not sure how to check for these yet... - FileIDResult ret = new FileIDResult(FileIDType.N64, 5); + FileIDResult ret = new(FileIDType.N64, 5); if (job.Extension == "V64") ret.ExtraInfo["byteswap"] = true; if (job.Extension == "N64") ret.ExtraInfo["wordswap"] = true; return ret; @@ -568,7 +568,7 @@ private static FileIDResult Test_BIN_ISO(IdentifyJob job) //so, I think it's possible that every valid PSX disc is mode2 in the track 1 if (CheckMagic(job.Stream, SimpleMagics.PSX)) { - FileIDResult ret = new FileIDResult(FileIDType.PSX, 95); + FileIDResult ret = new(FileIDType.PSX, 95); //this is an unreliable way to get a PSX game! ret.ExtraInfo["unreliable"] = true; return ret; diff --git a/src/BizHawk.Emulation.Cores/Libretro/Libretro.cs b/src/BizHawk.Emulation.Cores/Libretro/Libretro.cs index d25476fe140..68ab047f052 100644 --- a/src/BizHawk.Emulation.Cores/Libretro/Libretro.cs +++ b/src/BizHawk.Emulation.Cores/Libretro/Libretro.cs @@ -20,7 +20,7 @@ public partial class LibretroHost static LibretroHost() { - DynamicLibraryImportResolver resolver = new DynamicLibraryImportResolver( + DynamicLibraryImportResolver resolver = new( OSTailoredCode.IsUnixHost ? "libLibretroBridge.so" : "libLibretroBridge.dll", hasLimitedLifetime: false); bridge = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); @@ -264,7 +264,7 @@ private bool LoadHandler(RETRO_LOAD which, RetroData path = null, RetroData data public RetroDescription CalculateDescription() { - RetroDescription descr = new RetroDescription(); + RetroDescription descr = new(); api.retro_get_system_info(out var sys_info); descr.LibraryName = Mershul.PtrToStringUtf8(sys_info.library_name); descr.LibraryVersion = Mershul.PtrToStringUtf8(sys_info.library_version); diff --git a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Cd.cs b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Cd.cs index 094420fa5bf..ccbf08a05d8 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Cd.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Cd.cs @@ -34,7 +34,7 @@ private static void SetupTOC(LibNymaCore.TOC t, DiscTOC tin) private void CDTOCCallback(int disk, IntPtr dest) { - LibNymaCore.TOC toc = new LibNymaCore.TOC { Tracks = new LibNymaCore.TOC.Track[101] }; + LibNymaCore.TOC toc = new() { Tracks = new LibNymaCore.TOC.Track[101] }; SetupTOC(toc, _disks[disk].TOC); Marshal.StructureToPtr(toc, dest, false); } diff --git a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs index 1952974e344..f673eeeb98d 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs @@ -82,9 +82,9 @@ public ControllerAdapter( } }; - List finalDevices = new List(); + List finalDevices = new(); - List switchPreviousFrame = new List(); + List switchPreviousFrame = new(); for (int port = 0, devByteStart = 0; port < allPorts.Count; port++) { var portInfo = allPorts[port]; @@ -121,8 +121,8 @@ public ControllerAdapter( if (input.Type == InputType.Padding) continue; - int bitSize = (int)input.BitSize; - int bitOffset = (int)input.BitOffset; + int bitSize = input.BitSize; + int bitOffset = input.BitOffset; int byteStart = devByteStart + bitOffset / 8; bitOffset %= 8; string baseName = input.Name; @@ -350,7 +350,7 @@ public void LoadStateBinary(BinaryReader reader) /// On some cores, some controller ports are not relevant when certain settings are off (like multitap). /// Override this if your core has such an issue /// - protected virtual HashSet ComputeHiddenPorts() => new HashSet(); + protected virtual HashSet ComputeHiddenPorts() => new(); public class PortResult { diff --git a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Settings.cs b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Settings.cs index 674b1559184..360e4b0d66d 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Settings.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Settings.cs @@ -87,7 +87,7 @@ public NymaSettings Clone() /// public void Normalize(NymaSettingsInfo info) { - List toRemove = new List(); + List toRemove = new(); foreach (var kvp in MednafenValues) { if (!info.AllSettingsByKey.ContainsKey(kvp.Key)) @@ -151,7 +151,7 @@ public NymaSyncSettings Clone() /// public void Normalize(NymaSettingsInfo info) { - List toRemove = new List(); + List toRemove = new(); foreach (var kvp in MednafenValues) { if (!info.AllSettingsByKey.ContainsKey(kvp.Key)) @@ -169,7 +169,7 @@ public void Normalize(NymaSettingsInfo info) { MednafenValues.Remove(key); } - List toRemovePort = new List(); + List toRemovePort = new(); foreach (var kvp in PortDevices) { if (info.Ports.Count <= kvp.Key || info.Ports[kvp.Key].DefaultSettingsValue == kvp.Value) @@ -275,7 +275,7 @@ public NymaSettingsInfo Clone() } private void InitAllSettingsInfo(List allPorts) { - NymaSettingsInfo s = new NymaSettingsInfo(); + NymaSettingsInfo s = new(); foreach (var kvp in ExtraOverrides.Concat(SettingOverrides)) { diff --git a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.cs index e23a907c779..3fc2088740a 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.cs @@ -71,9 +71,9 @@ protected T DoInit(GameInfo game, byte[] rom, Disc[] discs, string wbxFilenam _cdTocCallback = CDTOCCallback; _cdSectorCallback = CDSectorCallback; - List filesToRemove = new List(); + List filesToRemove = new(); - LibNymaCore.FrontendFirmwareNotify firmwareDelegate = new LibNymaCore.FrontendFirmwareNotify((name) => + LibNymaCore.FrontendFirmwareNotify firmwareDelegate = new((name) => { if (firmwares != null && firmwares.TryGetValue(name, out var id)) { @@ -237,7 +237,7 @@ protected override LibWaterboxCore.FrameInfo FrameAdvancePrep(IController contro if (controller.IsPressed("Close Tray")) flags |= LibNymaCore.BizhawkFlags.CloseTray; - LibNymaCore.FrameInfo ret = new LibNymaCore.FrameInfo + LibNymaCore.FrameInfo ret = new() { Flags = flags, Command = controller.IsPressed("Power") @@ -286,7 +286,7 @@ protected override void FrameAdvancePost() /// private List GetLayerData() { - List ret = new List(); + List ret = new(); byte* p = _nyma.GetLayerData(); if (p == null) return ret; diff --git a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs index 8ed232bc5f8..0718b40ad6d 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs @@ -71,7 +71,7 @@ protected void PostInit() List memoryDomains = _memoryAreas.Select(a => WaterboxMemoryDomain.Create(a, _exe)).ToList(); var primaryDomain = memoryDomains.Single(static md => md.Definition.Flags.HasFlag(LibWaterboxCore.MemoryDomainFlags.Primary)); - MemoryDomainList mdl = new MemoryDomainList( + MemoryDomainList mdl = new( memoryDomains.Cast() .Concat(new[] { _exe.GetPagesDomain() }) .ToList() @@ -129,7 +129,7 @@ public unsafe bool SaveRamModified { foreach (var area in _saveramAreas) { - MemoryDomainStream stream = new MemoryDomainStream(area); + MemoryDomainStream stream = new(area); int cmp = (area.Definition.Flags & LibWaterboxCore.MemoryDomainFlags.OneFilled) != 0 ? -1 : 0; while (true) { @@ -159,7 +159,7 @@ public byte[] CloneSaveRam() using (_exe.EnterExit()) { byte[] ret = new byte[_saveramSize]; - MemoryStream dest = new MemoryStream(ret, true); + MemoryStream dest = new(ret, true); foreach (var area in _saveramAreas) { new MemoryDomainStream(area).CopyTo(dest); @@ -176,7 +176,7 @@ public void StoreSaveRam(byte[] data) throw new InvalidOperationException("Saveram size mismatch"); using (_exe.EnterExit()) { - MemoryStream source = new MemoryStream(data, false); + MemoryStream source = new(data, false); foreach (var area in _saveramAreas) { WaterboxUtils.CopySome(source, new MemoryDomainStream(area), area.Size); diff --git a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxHost.cs b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxHost.cs index 53fa5df66e0..edac484ad80 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxHost.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxHost.cs @@ -154,7 +154,7 @@ private static int WriteCallback(IntPtr userdata, IntPtr data, UIntPtr size) public WaterboxHost(WaterboxOptions opt) { - MemoryLayoutTemplate nativeOpts = new MemoryLayoutTemplate + MemoryLayoutTemplate nativeOpts = new() { sbrk_size = Z.UU(opt.SbrkHeapSizeKB * 1024), sealed_size = Z.UU(opt.SealedHeapSizeKB * 1024), @@ -169,15 +169,15 @@ public WaterboxHost(WaterboxOptions opt) string zstpath = path + ".zst"; if (File.Exists(zstpath)) { - using Zstd zstd = new Zstd(); - using FileStream fs = new FileStream(zstpath, FileMode.Open, FileAccess.Read); - using ReadWriteWrapper reader = new ReadWriteWrapper(zstd.CreateZstdDecompressionStream(fs)); + using Zstd zstd = new(); + using FileStream fs = new(zstpath, FileMode.Open, FileAccess.Read); + using ReadWriteWrapper reader = new(zstd.CreateZstdDecompressionStream(fs)); NativeImpl.wbx_create_host(nativeOpts, opt.Filename, _readCallback, reader.WaterboxHandle, out var retobj); _nativeHost = retobj.GetDataOrThrow(); } else { - using ReadWriteWrapper reader = new ReadWriteWrapper(new FileStream(path, FileMode.Open, FileAccess.Read)); + using ReadWriteWrapper reader = new(new FileStream(path, FileMode.Open, FileAccess.Read)); NativeImpl.wbx_create_host(nativeOpts, opt.Filename, _readCallback, reader.WaterboxHandle, out var retobj); _nativeHost = retobj.GetDataOrThrow(); } @@ -228,7 +228,7 @@ public void Seal() /// the filename that the unmanaged core will access the file by public void AddReadonlyFile(byte[] data, string name) { - using ReadWriteWrapper reader = new ReadWriteWrapper(new MemoryStream(data, false)); + using ReadWriteWrapper reader = new(new MemoryStream(data, false)); NativeImpl.wbx_mount_file(_nativeHost, name, _readCallback, reader.WaterboxHandle, false, out var retobj); retobj.GetDataOrThrow(); } @@ -249,7 +249,7 @@ public void RemoveReadonlyFile(string name) /// public void AddTransientFile(byte[] data, string name) { - using ReadWriteWrapper reader = new ReadWriteWrapper(new MemoryStream(data, false)); + using ReadWriteWrapper reader = new(new MemoryStream(data, false)); NativeImpl.wbx_mount_file(_nativeHost, name, _readCallback, reader.WaterboxHandle, true, out var retobj); retobj.GetDataOrThrow(); } @@ -260,8 +260,8 @@ public void AddTransientFile(byte[] data, string name) /// The state of the file when it was removed public byte[] RemoveTransientFile(string name) { - MemoryStream ms = new MemoryStream(); - using ReadWriteWrapper writer = new ReadWriteWrapper(ms); + MemoryStream ms = new(); + using ReadWriteWrapper writer = new(ms); NativeImpl.wbx_unmount_file(_nativeHost, name, _writeCallback, writer.WaterboxHandle, out var retobj); retobj.GetDataOrThrow(); return ms.ToArray(); @@ -340,14 +340,14 @@ public override byte PeekByte(long addr) public void SaveStateBinary(BinaryWriter bw) { - using ReadWriteWrapper writer = new ReadWriteWrapper(bw.BaseStream, false); + using ReadWriteWrapper writer = new(bw.BaseStream, false); NativeImpl.wbx_save_state(_nativeHost, _writeCallback, writer.WaterboxHandle, out var retobj); retobj.GetDataOrThrow(); } public void LoadStateBinary(BinaryReader br) { - using ReadWriteWrapper reader = new ReadWriteWrapper(br.BaseStream, false); + using ReadWriteWrapper reader = new(br.BaseStream, false); NativeImpl.wbx_load_state(_nativeHost, _readCallback, reader.WaterboxHandle, out var retobj); retobj.GetDataOrThrow(); } diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/NesSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/NesSchema.cs index 72a90495481..69242c4d81b 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/NesSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/NesSchema.cs @@ -174,7 +174,7 @@ private static PadSchema NesConsoleButtons() private static PadSchema FdsConsoleButtons(int diskSize) { - List buttons = new List + List buttons = new() { new ButtonSchema(10, 15, "Reset"), new ButtonSchema(58, 15, "Power"), diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/PceSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/PceSchema.cs index 62f32436b54..da762e9410c 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/PceSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/PceSchema.cs @@ -134,7 +134,7 @@ private static PadSchema StandardController(int controller) private static PadSchema Mouse(int controller) { - AxisSpec range = new AxisSpec((-127).RangeTo(127), 0); + AxisSpec range = new((-127).RangeTo(127), 0); return new PadSchema { Size = new Size(345, 225), diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/PcfxSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/PcfxSchema.cs index 05e0d344a6b..c3287b64a76 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/PcfxSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/PcfxSchema.cs @@ -70,7 +70,7 @@ private static PadSchema StandardController(int controller) private static PadSchema Mouse(int controller) { - AxisSpec range = new AxisSpec((-127).RangeTo(127), 0); + AxisSpec range = new((-127).RangeTo(127), 0); return new PadSchema { Size = new Size(345, 225), diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/TIC80Schema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/TIC80Schema.cs index 850ec4e7a01..ffc73643e09 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/TIC80Schema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/TIC80Schema.cs @@ -44,8 +44,8 @@ private static PadSchema StandardController(int controller) private static PadSchema Mouse() { - AxisSpec posRange = new AxisSpec((-128).RangeTo(127), 0); - AxisSpec scrollRange = new AxisSpec((-32).RangeTo(31), 0); + AxisSpec posRange = new((-128).RangeTo(127), 0); + AxisSpec scrollRange = new((-32).RangeTo(31), 0); return new PadSchema { Size = new Size(375, 395), diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/VECSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/VECSchema.cs index 42700c6bb8c..e1142e4269b 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/VECSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/VECSchema.cs @@ -79,7 +79,7 @@ private static PadSchema AnalogController(int controller) }; } - private static ButtonSchema Button(int x, int y, int controller, int button) => new ButtonSchema(x, y, controller, $"Button {button}", button.ToString()); + private static ButtonSchema Button(int x, int y, int controller, int button) => new(x, y, controller, $"Button {button}", button.ToString()); private static PadSchema ConsoleButtons() { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs index 399e5443b23..1f384e5adaf 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs @@ -46,7 +46,7 @@ private class ButtonLayout private static PadSchema Keyboard() { - List bls = new List + List bls = new() { new ButtonLayout { Name = "Key True Video", DisName = "TV", Row = 0, WidthFactor = 1 }, new ButtonLayout { Name = "Key Inv Video", DisName = "IV", Row = 0, WidthFactor = 1 }, @@ -112,13 +112,13 @@ private static PadSchema Keyboard() new ButtonLayout { Name = "Key Symbol Shift", DisName = "SS", Row = 4, WidthFactor = 1 } }; - PadSchema ps = new PadSchema + PadSchema ps = new() { DisplayName = "Keyboard", Size = new Size(500, 170) }; - List btns = new List(); + List btns = new(); int rowHeight = 29; //24 int stdButtonWidth = 29; //24 @@ -153,7 +153,7 @@ private static PadSchema Keyboard() if (b.IsActive) { - ButtonSchema btn = new ButtonSchema(xPos, yPos, b.Name) + ButtonSchema btn = new(xPos, yPos, b.Name) { DisplayName = disp }; diff --git a/src/BizHawk.Emulation.DiscSystem/Disc.cs b/src/BizHawk.Emulation.DiscSystem/Disc.cs index d518f5c17e1..124356d56f9 100644 --- a/src/BizHawk.Emulation.DiscSystem/Disc.cs +++ b/src/BizHawk.Emulation.DiscSystem/Disc.cs @@ -23,7 +23,7 @@ public sealed class Disc : IDisposable /// public static Disc LoadAutomagic(string path) { - DiscMountJob job = new DiscMountJob(fromPath: path/*, discInterface: DiscInterface.MednaDisc <-- TEST*/); + DiscMountJob job = new(fromPath: path/*, discInterface: DiscInterface.MednaDisc <-- TEST*/); job.Run(); return job.OUT_Disc; } @@ -70,7 +70,7 @@ public byte[] Easy_Extract_Mode1(int lba_start, int lba_count, int byteLength = { int totsize = lba_count * 2048; byte[] ret = new byte[totsize]; - DiscSectorReader dsr = new DiscSectorReader(this) { Policy = { DeterministicClearBuffer = false } }; + DiscSectorReader dsr = new(this) { Policy = { DeterministicClearBuffer = false } }; for (int i = 0; i < lba_count; i++) { dsr.ReadLBA_2048(lba_start + i, ret, i*2048); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscExtensions.cs b/src/BizHawk.Emulation.DiscSystem/DiscExtensions.cs index 95470bef1ca..6ce422584e1 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscExtensions.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscExtensions.cs @@ -10,7 +10,7 @@ public static class DiscExtensions private static Disc CreateImpl(DiscType? type, string path, Action errorCallback) { //--- load the disc in a context which will let us abort if it's going to take too long - DiscMountJob discMountJob = new DiscMountJob(fromPath: path, slowLoadAbortThreshold: 8); + DiscMountJob discMountJob = new(fromPath: path, slowLoadAbortThreshold: 8); discMountJob.Run(); if (discMountJob.OUT_SlowLoadAborted) diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_ECM.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_ECM.cs index a4d61eec376..6c61c89b27b 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_ECM.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_ECM.cs @@ -119,7 +119,7 @@ public void Load(string path) //TODO - endian bug. need an endian-independent binary reader with good license (miscutils is apache license) //extension methods on binary reader wont suffice, we need something that lets you control the endianness used for reading. a complete replacement. - BinaryReader br = new BinaryReader(stream); + BinaryReader br = new(stream); EDC = br.ReadInt32(); Length = logOffset; @@ -129,7 +129,7 @@ public void Load(string path) public static bool IsECM(string path) { - using FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fs = new(path, FileMode.Open, FileAccess.Read, FileShare.Read); int e = fs.ReadByte(); int c = fs.ReadByte(); int m = fs.ReadByte(); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_WaveFile.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_WaveFile.cs index b9950166228..82443f1bbdd 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_WaveFile.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_WaveFile.cs @@ -29,7 +29,7 @@ public void Load(byte[] waveData) public void Load(string wavePath) { - FileStream stream = new FileStream(wavePath, FileMode.Open, FileAccess.Read, FileShare.Read); + FileStream stream = new(wavePath, FileMode.Open, FileAccess.Read, FileShare.Read); Load(stream); } @@ -39,7 +39,7 @@ public void Load(Stream stream) try { RiffSource = null; - RiffMaster rm = new RiffMaster(); + RiffMaster rm = new(); rm.LoadStream(stream); RiffSource = rm; diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs index 5b94a8df360..96d9c446017 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs @@ -251,7 +251,7 @@ private void Flush() subchunks.Clear(); foreach (var (subchunkTag, s) in dictionary) { - RiffSubchunk rs = new RiffSubchunk + RiffSubchunk rs = new() { tag = subchunkTag, Source = new MemoryStream(System.Text.Encoding.ASCII.GetBytes(s)), @@ -287,7 +287,7 @@ private RiffChunk ReadChunk(BinaryReader br) throw new FormatException("chunk too big"); if (tag is "RIFF" or "LIST") { - RiffContainer rc = new RiffContainer + RiffContainer rc = new() { tag = tag, type = ReadTag(br) @@ -301,7 +301,7 @@ private RiffChunk ReadChunk(BinaryReader br) } else { - RiffSubchunk rsc = new RiffSubchunk + RiffSubchunk rsc = new() { tag = tag, Source = br.BaseStream, diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs index ec4b38ec378..5707f107a4e 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs @@ -178,12 +178,12 @@ public int FetchOrFail(string key) private static List ParseSections(Stream stream) { - List sections = new List(); + List sections = new(); //TODO - do we need to attempt to parse out the version tag in a first pass? //im doing this from a version 3 example - StreamReader sr = new StreamReader(stream); + StreamReader sr = new(stream); CCDSection currSection = null; while (true) { @@ -251,7 +251,7 @@ private static int PreParseIntegrityCheck(IReadOnlyList sections) /// parsed is 1, parsed session number is not 1, or malformed entry public static CCDFile ParseFrom(Stream stream) { - CCDFile ccdf = new CCDFile(); + CCDFile ccdf = new(); var sections = ParseSections(stream); ccdf.Version = PreParseIntegrityCheck(sections); @@ -271,7 +271,7 @@ public static CCDFile ParseFrom(Stream stream) if (section.Name.StartsWithOrdinal("SESSION")) { int sesnum = int.Parse(section.Name.Split(' ')[1]); - CCDSession session = new CCDSession(sesnum); + CCDSession session = new(sesnum); ccdf.Sessions.Add(session); if (sesnum != ccdf.Sessions.Count) throw new CCDParseException("Malformed CCD format: wrong session number in sequence"); @@ -281,7 +281,7 @@ public static CCDFile ParseFrom(Stream stream) else if (section.Name.StartsWithOrdinal("ENTRY")) { int entryNum = int.Parse(section.Name.Split(' ')[1]); - CCDTocEntry entry = new CCDTocEntry(entryNum); + CCDTocEntry entry = new(entryNum); ccdf.TOCEntries.Add(entry); entry.Session = section.FetchOrFail("SESSION"); @@ -308,7 +308,7 @@ public static CCDFile ParseFrom(Stream stream) else if (section.Name.StartsWithOrdinal("TRACK")) { int entryNum = int.Parse(section.Name.Split(' ')[1]); - CCDTrack track = new CCDTrack(entryNum); + CCDTrack track = new(entryNum); ccdf.Tracks.Add(track); ccdf.TracksByNumber[entryNum] = track; foreach (var (k, v) in section) @@ -335,7 +335,7 @@ public class LoadResults public static LoadResults LoadCCDPath(string path) { - LoadResults ret = new LoadResults + LoadResults ret = new() { CcdPath = path, ImgPath = Path.ChangeExtension(path, ".img"), @@ -346,7 +346,7 @@ public static LoadResults LoadCCDPath(string path) if (!File.Exists(path)) throw new CCDParseException("Malformed CCD format: nonexistent CCD file!"); CCDFile ccdf; - using (FileStream infCCD = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) + using (FileStream infCCD = new(path, FileMode.Open, FileAccess.Read, FileShare.Read)) ccdf = ParseFrom(infCCD); ret.ParsedCCDFile = ccdf; @@ -363,7 +363,7 @@ public static LoadResults LoadCCDPath(string path) public static void Dump(Disc disc, string path) { - using (StreamWriter sw = new StreamWriter(path)) + using (StreamWriter sw = new(path)) { //NOTE: IsoBuster requires the A0,A1,A2 RawTocEntries to be first or else it can't do anything with the tracks //if we ever get them in a different order, we'll have to re-order them here @@ -436,7 +436,7 @@ public static void Dump(Disc disc, string path) string imgPath = Path.ChangeExtension(path, ".img"); string subPath = Path.ChangeExtension(path, ".sub"); byte[] buf2448 = new byte[2448]; - DiscSectorReader dsr = new DiscSectorReader(disc); + DiscSectorReader dsr = new(disc); using var imgFile = File.OpenWrite(imgPath); using var subFile = File.OpenWrite(subPath); @@ -487,7 +487,7 @@ public static Disc LoadCCDToDisc(string ccdPath, DiscMountPolicy IN_DiscMountPol if (!loadResults.Valid) throw loadResults.FailureException; - Disc disc = new Disc(); + Disc disc = new(); IBlob imgBlob = null; long imgLen = -1; @@ -502,7 +502,7 @@ public static Disc LoadCCDToDisc(string ccdPath, DiscMountPolicy IN_DiscMountPol { if (Blob_ECM.IsECM(ecmPath)) { - Blob_ECM ecm = new Blob_ECM(); + Blob_ECM ecm = new(); ecm.Load(ecmPath); imgBlob = ecm; imgLen = ecm.Length; @@ -512,7 +512,7 @@ public static Disc LoadCCDToDisc(string ccdPath, DiscMountPolicy IN_DiscMountPol if (imgBlob == null) { if (!File.Exists(loadResults.ImgPath)) throw new CCDParseException("Malformed CCD format: nonexistent IMG file!"); - Blob_RawFile imgFile = new Blob_RawFile() { PhysicalPath = loadResults.ImgPath }; + Blob_RawFile imgFile = new() { PhysicalPath = loadResults.ImgPath }; imgLen = imgFile.Length; imgBlob = imgFile; } @@ -520,7 +520,7 @@ public static Disc LoadCCDToDisc(string ccdPath, DiscMountPolicy IN_DiscMountPol //mount the SUB file if (!File.Exists(loadResults.SubPath)) throw new CCDParseException("Malformed CCD format: nonexistent SUB file!"); - Blob_RawFile subFile = new Blob_RawFile { PhysicalPath = loadResults.SubPath }; + Blob_RawFile subFile = new() { PhysicalPath = loadResults.SubPath }; disc.DisposableResources.Add(subFile); long subLen = subFile.Length; @@ -532,7 +532,7 @@ public static Disc LoadCCDToDisc(string ccdPath, DiscMountPolicy IN_DiscMountPol var ccdf = loadResults.ParsedCCDFile; //the only instance of a sector synthesizer we'll need - SS_CCD synth = new SS_CCD(); + SS_CCD synth = new(); // create the initial session int curSession = 1; @@ -564,7 +564,7 @@ public static Disc LoadCCDToDisc(string ccdPath, DiscMountPolicy IN_DiscMountPol _ => ino.BCDValue }; - SubchannelQ q = new SubchannelQ + SubchannelQ q = new() { q_status = SubchannelQ.ComputeStatus(entry.ADR, (EControlQ)(entry.Control & 0xF)), q_tno = tno, @@ -583,7 +583,7 @@ public static Disc LoadCCDToDisc(string ccdPath, DiscMountPolicy IN_DiscMountPol } //analyze the RAWTocEntries to figure out what type of track track 1 is - Synthesize_DiscTOC_From_RawTOCEntries_Job tocSynth = new Synthesize_DiscTOC_From_RawTOCEntries_Job(disc.Session1.RawTOCEntries); + Synthesize_DiscTOC_From_RawTOCEntries_Job tocSynth = new(disc.Session1.RawTOCEntries); tocSynth.Run(); //Add sectors for the mandatory track 1 pregap, which isn't stored in the CCD file @@ -604,7 +604,7 @@ public static Disc LoadCCDToDisc(string ccdPath, DiscMountPolicy IN_DiscMountPol for (int i = 0; i < 150; i++) { - CUE.SS_Gap ss_gap = new CUE.SS_Gap() + CUE.SS_Gap ss_gap = new() { Policy = IN_DiscMountPolicy, TrackType = pregapTrackType diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CDI_format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CDI_format.cs index 818e7789d48..bb5b0b23253 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CDI_format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CDI_format.cs @@ -193,8 +193,8 @@ public CDIParseException(string message) : base(message) { } /// malformed cdi format public static CDIFile ParseFrom(Stream stream) { - CDIFile cdif = new CDIFile(); - using BinaryReader br = new BinaryReader(stream); + CDIFile cdif = new(); + using BinaryReader br = new(stream); try { @@ -230,7 +230,7 @@ void ParseTrackHeader(CDITrackHeader header) for (int i = 0; i <= cdif.NumSessions; i++) { - CDISession session = new CDISession(); + CDISession session = new(); stream.Seek(1, SeekOrigin.Current); // unknown byte session.NumTracks = br.ReadByte(); stream.Seek(13, SeekOrigin.Current); // unknown bytes @@ -249,7 +249,7 @@ void ParseTrackHeader(CDITrackHeader header) for (int j = 0; j < session.NumTracks; j++) { - CDITrack track = new CDITrack(); + CDITrack track = new(); ParseTrackHeader(track); ushort indexes = br.ReadUInt16(); @@ -265,7 +265,7 @@ void ParseTrackHeader(CDITrackHeader header) uint numCdTextBlocks = br.ReadUInt32(); for (int k = 0; k < numCdTextBlocks; k++) { - CDICDText cdTextBlock = new CDICDText(); + CDICDText cdTextBlock = new(); for (int l = 0; l < 18; l++) { byte cdTextLen = br.ReadByte(); @@ -418,7 +418,7 @@ public class LoadResults public static LoadResults LoadCDIPath(string path) { - LoadResults ret = new LoadResults + LoadResults ret = new() { CdiPath = path }; @@ -427,7 +427,7 @@ public static LoadResults LoadCDIPath(string path) if (!File.Exists(path)) throw new CDIParseException("Malformed CDI format: nonexistent CDI file!"); CDIFile cdif; - using (FileStream infCDI = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) + using (FileStream infCDI = new(path, FileMode.Open, FileAccess.Read, FileShare.Read)) cdif = ParseFrom(infCDI); ret.ParsedCDIFile = cdif; @@ -448,7 +448,7 @@ public static Disc LoadCDIToDisc(string cdiPath, DiscMountPolicy IN_DiscMountPol if (!loadResults.Valid) throw loadResults.FailureException; - Disc disc = new Disc(); + Disc disc = new(); var cdif = loadResults.ParsedCDIFile; IBlob cdiBlob = new Blob_RawFile { PhysicalPath = cdiPath }; @@ -458,7 +458,7 @@ public static Disc LoadCDIToDisc(string cdiPath, DiscMountPolicy IN_DiscMountPol int blobOffset = 0; for (int i = 0; i < cdif.NumSessions; i++) { - DiscSession session = new DiscSession { Number = i + 1 }; + DiscSession session = new() { Number = i + 1 }; // leadin track // we create this only for session 2+, not session 1 @@ -492,7 +492,7 @@ public static Disc LoadCDIToDisc(string cdiPath, DiscMountPolicy IN_DiscMountPol RawTOCEntry EmitRawTOCEntry() { - SubchannelQ q = default(SubchannelQ); + SubchannelQ q = default; //absent some kind of policy for how to set it, this is a safe assumption const byte kADR = 1; q.SetStatus(kADR, (EControlQ)track.Control); @@ -575,7 +575,7 @@ RawTOCEntry EmitRawTOCEntry() }); } - Synthesize_A0A1A2_Job TOCMiscInfo = new Synthesize_A0A1A2_Job( + Synthesize_A0A1A2_Job TOCMiscInfo = new( firstRecordedTrackNumber: trackOffset + 1, lastRecordedTrackNumber: trackOffset + cdif.Sessions[i].NumTracks, sessionFormat: (SessionFormat)(cdif.Tracks[trackOffset + cdif.Sessions[i].NumTracks - 1].SessionType * 0x10), diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs index 97edb281ead..0fbc721474c 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs @@ -226,7 +226,7 @@ private void OpenFile(CUE_File.Command.FILE f) if (options.Count > 1) Warn($"Multiple options resolving referenced cue file; choosing: {Path.GetFileName(choice)}"); - CompiledCueFile cfi = new CompiledCueFile(); + CompiledCueFile cfi = new(); curr_file = cfi; OUT_CompiledCueFiles.Add(cfi); @@ -248,7 +248,7 @@ private void OpenFile(CUE_File.Command.FILE f) //TODO - fix exception-throwing inside //TODO - verify stream-disposing semantics var fs = File.OpenRead(choice); - using Blob_WaveFile blob = new Blob_WaveFile(); + using Blob_WaveFile blob = new(); try { blob.Load(fs); @@ -395,7 +395,7 @@ public override void Run() //add a track 0, for addressing convenience. //note: for future work, track 0 may need emulation (accessible by very negative LBA--the TOC is stored there) - CompiledCueTrack track0 = new CompiledCueTrack + CompiledCueTrack track0 = new() { Number = 0, }; diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs index 86bd09f759d..6122e765973 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs @@ -78,7 +78,7 @@ private void MountBlobs() BlobInfos = new(); foreach (var ccf in IN_CompileJob.OUT_CompiledCueFiles) { - BlobInfo bi = new BlobInfo(); + BlobInfo bi = new(); BlobInfos.Add(bi); IBlob file_blob; @@ -88,14 +88,14 @@ private void MountBlobs() case CompiledCueFileType.Unknown: { //raw files: - Blob_RawFile blob = new Blob_RawFile { PhysicalPath = ccf.FullPath }; + Blob_RawFile blob = new() { PhysicalPath = ccf.FullPath }; OUT_Disc.DisposableResources.Add(file_blob = blob); bi.Length = blob.Length; break; } case CompiledCueFileType.ECM: { - Blob_ECM blob = new Blob_ECM(); + Blob_ECM blob = new(); OUT_Disc.DisposableResources.Add(file_blob = blob); blob.Load(ccf.FullPath); bi.Length = blob.Length; @@ -103,7 +103,7 @@ private void MountBlobs() } case CompiledCueFileType.WAVE: { - Blob_WaveFile blob = new Blob_WaveFile(); + Blob_WaveFile blob = new(); OUT_Disc.DisposableResources.Add(file_blob = blob); blob.Load(ccf.FullPath); bi.Length = blob.Length; @@ -117,7 +117,7 @@ private void MountBlobs() } AudioDecoder dec = new(); byte[] buf = dec.AcquireWaveData(ccf.FullPath); - Blob_WaveFile blob = new Blob_WaveFile(); + Blob_WaveFile blob = new(); OUT_Disc.DisposableResources.Add(file_blob = blob); blob.Load(new MemoryStream(buf)); bi.Length = buf.Length; @@ -174,7 +174,7 @@ private void CloseSession() { //add RawTOCEntries A0 A1 A2 to round out the TOC var sessionInfo = IN_CompileJob.OUT_CompiledSessionInfo[CurrentSession.Number]; - Synthesize_A0A1A2_Job TOCMiscInfo = new Synthesize_A0A1A2_Job( + Synthesize_A0A1A2_Job TOCMiscInfo = new( firstRecordedTrackNumber: sessionInfo.FirstRecordedTrackNumber, lastRecordedTrackNumber: sessionInfo.LastRecordedTrackNumber, sessionFormat: sessionInfo.SessionFormat, @@ -393,7 +393,7 @@ public override void Run() int specifiedPostgapLength = cct.PostgapLength.Sector; for (int s = 0; s < specifiedPostgapLength; s++) { - SS_Gap ss = new SS_Gap + SS_Gap ss = new() { TrackType = cct.TrackType // TODO - old track type in some < -150 cases? }; diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs index 116fadd2645..048643a8d1c 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs @@ -142,7 +142,7 @@ private void LoadFromString() string line = tr.ReadLine()?.Trim(); if (line is null) break; if (line == string.Empty) continue; - CueLineParser clp = new CueLineParser(line); + CueLineParser clp = new(line); string key = clp.ReadToken().ToUpperInvariant(); @@ -187,7 +187,7 @@ private void LoadFromString() case "FILE": { - string path = clp.ReadPath(); + string path = clp.ReadPath(); CueFileType ft; if (clp.EOF) { @@ -196,7 +196,7 @@ private void LoadFromString() } else { - string strType = clp.ReadToken().ToUpperInvariant(); + string strType = clp.ReadToken().ToUpperInvariant(); switch (strType) { default: @@ -219,7 +219,7 @@ private void LoadFromString() CueTrackFlags flags = default; while (!clp.EOF) { - string flag = clp.ReadToken().ToUpperInvariant(); + string flag = clp.ReadToken().ToUpperInvariant(); switch (flag) { case "DATA": @@ -245,14 +245,14 @@ private void LoadFromString() Error("Incomplete INDEX command"); break; } - string strindexnum = clp.ReadToken(); + string strindexnum = clp.ReadToken(); if (!int.TryParse(strindexnum, out int indexnum) || indexnum < 0 || indexnum > 99) { Error($"Invalid INDEX number: {strindexnum}"); break; } - string str_timestamp = clp.ReadToken(); - Timestamp ts = new Timestamp(str_timestamp); + string str_timestamp = clp.ReadToken(); + Timestamp ts = new(str_timestamp); if (!ts.Valid && !IN_Strict) { //try cleaning it up @@ -276,7 +276,7 @@ private void LoadFromString() Warn("Ignoring empty ISRC command"); else { - string isrc = clp.ReadToken(); + string isrc = clp.ReadToken(); if (isrc.Length != 12) Warn($"Invalid ISRC code ignored: {isrc}"); else @@ -293,8 +293,8 @@ private void LoadFromString() case "POSTGAP": case "PREGAP": { - string str_msf = clp.ReadToken(); - Timestamp msf = new Timestamp(str_msf); + string str_msf = clp.ReadToken(); + Timestamp msf = new(str_msf); if (!msf.Valid) Error($"Ignoring {{0}} with invalid length MSF: {str_msf}", key); else @@ -309,10 +309,10 @@ private void LoadFromString() case "REM": { - string comment = clp.ReadLine(); - // cues don't support multiple sessions themselves, but it is common for rips to put SESSION # in REM fields - // so, if we have such a REM, we'll check if the comment starts with SESSION, and interpret that as a session "command" - string trimmed = comment.Trim(); + string comment = clp.ReadLine(); + // cues don't support multiple sessions themselves, but it is common for rips to put SESSION # in REM fields + // so, if we have such a REM, we'll check if the comment starts with SESSION, and interpret that as a session "command" + string trimmed = comment.Trim(); if (trimmed.StartsWith("SESSION ", StringComparison.OrdinalIgnoreCase) && int.TryParse(trimmed.Substring(8), out int number) && number > 0) { OUT_CueFile.Commands.Add(new CUE_File.Command.SESSION(number)); @@ -340,7 +340,7 @@ private void LoadFromString() break; } - string str_tracknum = clp.ReadToken(); + string str_tracknum = clp.ReadToken(); if (!int.TryParse(str_tracknum, out int tracknum) || tracknum is < 1 or > 99) { Error($"Invalid TRACK number: {str_tracknum}"); @@ -350,7 +350,7 @@ private void LoadFromString() // TODO - check sequentiality? maybe as a warning CueTrackType tt; - string str_trackType = clp.ReadToken(); + string str_trackType = clp.ReadToken(); switch (str_trackType.ToUpperInvariant()) { default: diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CueFileResolver.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CueFileResolver.cs index eade5d04136..94eebb36dfb 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CueFileResolver.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CueFileResolver.cs @@ -89,7 +89,7 @@ public List Resolve(string path) fileInfos = fisBaseDir; } - List results = new List(); + List results = new(); foreach (var fi in fileInfos) { string ext = Path.GetExtension(fi.FullName).ToLowerInvariant(); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/M3U_file.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/M3U_file.cs index a4c3296d9f0..94602062579 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/M3U_file.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/M3U_file.cs @@ -9,7 +9,7 @@ public class M3U_File { public static M3U_File Read(StreamReader sr) { - M3U_File ret = new M3U_File(); + M3U_File ret = new(); return !ret.Parse(sr) ? null : ret; } @@ -50,7 +50,7 @@ private bool Parse(StreamReader sr) continue; } - Entry e = new Entry + Entry e = new() { Path = line, Runtime = runtime, diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs index b16fdd311a1..4cfd9c4240e 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs @@ -308,7 +308,7 @@ public static AFile Parse(FileStream stream) EndianBitConverter bc = EndianBitConverter.CreateForLittleEndian(); bool isDvd = false; - AFile aFile = new AFile { MDSPath = stream.Name }; + AFile aFile = new() { MDSPath = stream.Name }; stream.Seek(0, SeekOrigin.Begin); @@ -333,7 +333,7 @@ public static AFile Parse(FileStream stream) } // parse sessions - Dictionary aSessions = new Dictionary(); + Dictionary aSessions = new(); stream.Seek(aFile.Header.SessionOffset, SeekOrigin.Begin); for (int se = 0; se < aFile.Header.SessionCount; se++) @@ -342,7 +342,7 @@ public static AFile Parse(FileStream stream) stream.Read(sessionHeader, 0, 24); //sessionHeader.Reverse().ToArray(); - ASession session = new ASession + ASession session = new() { SessionStart = bc.ToInt32(sessionHeader.Take(4).ToArray()), SessionEnd = bc.ToInt32(sessionHeader.Skip(4).Take(4).ToArray()), @@ -361,7 +361,7 @@ public static AFile Parse(FileStream stream) long footerOffset = 0; // parse track blocks - Dictionary aTracks = new Dictionary(); + Dictionary aTracks = new(); // iterate through each session block foreach (var session in aSessions.Values) @@ -373,7 +373,7 @@ public static AFile Parse(FileStream stream) for (int bl = 0; bl < session.AllBlocks; bl++) { byte[] trackHeader = new byte[80]; - ATrack track = new ATrack(); + ATrack track = new(); stream.Read(trackHeader, 0, 80); @@ -428,7 +428,7 @@ public static AFile Parse(FileStream stream) stream.Seek(track.FooterOffset, SeekOrigin.Begin); stream.Read(foot, 0, 16); - AFooter f = new AFooter + AFooter f = new() { FilenameOffset = bc.ToInt32(foot.Take(4).ToArray()), WideChar = bc.ToInt32(foot.Skip(4).Take(4).ToArray()) @@ -518,7 +518,7 @@ public static AFile Parse(FileStream stream) aFile.ParsedSession = new(); foreach (var s in aSessions.Values) { - Session session = new Session(); + Session session = new(); if (!aTracks.TryGetValue(s.FirstTrack, out var startTrack)) { @@ -625,14 +625,14 @@ public class LoadResults public static LoadResults LoadMDSPath(string path) { - LoadResults ret = new LoadResults { MdsPath = path }; + LoadResults ret = new() { MdsPath = path }; //ret.MdfPath = Path.ChangeExtension(path, ".mdf"); try { if (!File.Exists(path)) throw new MDSParseException("Malformed MDS format: nonexistent MDS file!"); AFile mdsf; - using (FileStream infMDS = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) + using (FileStream infMDS = new(path, FileMode.Open, FileAccess.Read, FileShare.Read)) mdsf = Parse(infMDS); ret.ParsedMDSFile = mdsf; @@ -650,7 +650,7 @@ public static LoadResults LoadMDSPath(string path) /// path reference no longer points to file private static Dictionary MountBlobs(AFile mdsf, Disc disc) { - Dictionary BlobIndex = new Dictionary(); + Dictionary BlobIndex = new(); int count = 0; foreach (var track in mdsf.Tracks) @@ -661,7 +661,7 @@ private static Dictionary MountBlobs(AFile mdsf, Disc disc) throw new MDSParseException($"Malformed MDS format: nonexistent image file: {file}"); //mount the file - Blob_RawFile mdfBlob = new Blob_RawFile { PhysicalPath = file }; + Blob_RawFile mdfBlob = new() { PhysicalPath = file }; bool dupe = false; foreach (var re in disc.DisposableResources) @@ -703,7 +703,7 @@ private static RawTOCEntry EmitRawTOCEntry(ATOCEntry entry) int Control = adrc & 0x0F; int ADR = adrc >> 4; - SubchannelQ q = new SubchannelQ + SubchannelQ q = new() { q_status = SubchannelQ.ComputeStatus(ADR, (EControlQ)(Control & 0xF)), q_tno = tno, @@ -728,7 +728,7 @@ public static Disc LoadMDSToDisc(string mdsPath, DiscMountPolicy IN_DiscMountPol if (!loadResults.Valid) throw loadResults.FailureException; - Disc disc = new Disc(); + Disc disc = new(); // load all blobs var BlobIndex = MountBlobs(loadResults.ParsedMDSFile, disc); @@ -752,7 +752,7 @@ public static Disc LoadMDSToDisc(string mdsPath, DiscMountPolicy IN_DiscMountPol } //analyze the RAWTocEntries to figure out what type of track track 1 is - Synthesize_DiscTOC_From_RawTOCEntries_Job tocSynth = new Synthesize_DiscTOC_From_RawTOCEntries_Job(disc.Session1.RawTOCEntries); + Synthesize_DiscTOC_From_RawTOCEntries_Job tocSynth = new(disc.Session1.RawTOCEntries); tocSynth.Run(); // now build the sectors @@ -840,7 +840,7 @@ public static Disc LoadMDSToDisc(string mdsPath, DiscMountPolicy IN_DiscMountPol { relMSF++; - CUE.SS_Gap ss_gap = new CUE.SS_Gap() + CUE.SS_Gap ss_gap = new() { Policy = IN_DiscMountPolicy, TrackType = pregapTrackType @@ -924,7 +924,7 @@ public static Disc LoadMDSToDisc(string mdsPath, DiscMountPolicy IN_DiscMountPol int Control = adrc & 0x0F; int ADR = adrc >> 4; - SubchannelQ q = new SubchannelQ + SubchannelQ q = new() { q_status = SubchannelQ.ComputeStatus(ADR, (EControlQ)(Control & 0xF)), q_tno = BCD2.FromDecimal(track.Point), diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/NRG_format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/NRG_format.cs index 45d182511ba..083be77a598 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/NRG_format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/NRG_format.cs @@ -362,10 +362,10 @@ private static NRGCue ParseCueChunk(string chunkID, int chunkSize, ReadOnlySpan< } bool v2 = chunkID == "CUEX"; - NRGCue ret = new NRGCue { ChunkID = chunkID, ChunkSize = chunkSize }; + NRGCue ret = new() { ChunkID = chunkID, ChunkSize = chunkSize }; for (int i = 0; i < chunkSize; i += 8) { - NRGTrackIndex trackIndex = new NRGTrackIndex + NRGTrackIndex trackIndex = new() { ADRControl = chunkData[i + 0], Track = BCD2.FromBCD(chunkData[i + 1]), @@ -397,7 +397,7 @@ private static NRGDAOTrackInfo ParseDaoChunk(string chunkID, int chunkSize, Read throw new NRGParseException("Malformed NRG format: DAO chunk is less than 22 bytes!"); } - NRGDAOTrackInfo ret = new NRGDAOTrackInfo + NRGDAOTrackInfo ret = new() { ChunkID = chunkID, ChunkSize = chunkSize, @@ -430,7 +430,7 @@ ret.FirstTrack is < 0 or > 99 || for (int i = 22; i < chunkSize; i += v2 ? 42 : 30) { - NRGDAOTrack track = new NRGDAOTrack + NRGDAOTrack track = new() { Isrc = Encoding.ASCII.GetString(chunkData.Slice(i, 12)).TrimEnd('\0'), SectorSize = BinaryPrimitives.ReadUInt16BigEndian(chunkData.Slice(i + 12, sizeof(ushort))), @@ -482,7 +482,7 @@ private static NRGTAOTrackInfo ParseEtnChunk(string chunkID, int chunkSize, Read throw new NRGParseException($"Malformed NRG format: {chunkID} chunk was not a multiple of {trackSize}!"); } - NRGTAOTrackInfo ret = new NRGTAOTrackInfo + NRGTAOTrackInfo ret = new() { ChunkID = chunkID, ChunkSize = chunkSize, @@ -490,7 +490,7 @@ private static NRGTAOTrackInfo ParseEtnChunk(string chunkID, int chunkSize, Read for (int i = 0; i < chunkSize; i += trackSize) { - NRGTAOTrack track = new NRGTAOTrack(); + NRGTAOTrack track = new(); if (chunkID == "ETN2") { @@ -586,7 +586,7 @@ private static NRGCdText ParseCdtxChunk(string chunkID, int chunkSize, ReadOnlyS // might be legal to have a 0 sized CDTX chunk? - NRGCdText ret = new NRGCdText + NRGCdText ret = new() { ChunkID = chunkID, ChunkSize = chunkSize, @@ -626,7 +626,7 @@ private static NRGFilenames ParseAfnmChunk(string chunkID, int chunkSize, ReadOn throw new NRGParseException("Malformed NRG format: Missing null terminator in AFNM chunk!"); } - NRGFilenames ret = new NRGFilenames + NRGFilenames ret = new() { ChunkID = chunkID, ChunkSize = chunkSize, @@ -683,8 +683,8 @@ private static NRGEND ParseEndChunk(string chunkID, int chunkSize, ReadOnlySpan< /// malformed nrg format public static NRGFile ParseFrom(Stream stream) { - NRGFile nrgf = new NRGFile(); - using BinaryReader br = new BinaryReader(stream); + NRGFile nrgf = new(); + using BinaryReader br = new(stream); try { @@ -894,7 +894,7 @@ public class LoadResults public static LoadResults LoadNRGPath(string path) { - LoadResults ret = new LoadResults + LoadResults ret = new() { NrgPath = path }; @@ -903,7 +903,7 @@ public static LoadResults LoadNRGPath(string path) if (!File.Exists(path)) throw new NRGParseException("Malformed NRG format: nonexistent NRG file!"); NRGFile nrgf; - using (FileStream infNRG = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) + using (FileStream infNRG = new(path, FileMode.Open, FileAccess.Read, FileShare.Read)) nrgf = ParseFrom(infNRG); ret.ParsedNRGFile = nrgf; @@ -924,7 +924,7 @@ public static Disc LoadNRGToDisc(string nrgPath, DiscMountPolicy IN_DiscMountPol if (!loadResults.Valid) throw loadResults.FailureException; - Disc disc = new Disc(); + Disc disc = new(); var nrgf = loadResults.ParsedNRGFile; IBlob nrgBlob = new Blob_RawFile { PhysicalPath = nrgPath }; @@ -936,7 +936,7 @@ public static Disc LoadNRGToDisc(string nrgPath, DiscMountPolicy IN_DiscMountPol for (int i = 0; i < nsessions; i++) { - DiscSession session = new DiscSession { Number = i + 1 }; + DiscSession session = new() { Number = i + 1 }; int startTrack, endTrack; SessionFormat sessionFormat; @@ -953,7 +953,7 @@ public static Disc LoadNRGToDisc(string nrgPath, DiscMountPolicy IN_DiscMountPol sessionFormat = (SessionFormat)nrgf.TOCTs[i].DiskType; } - Synthesize_A0A1A2_Job TOCMiscInfo = new Synthesize_A0A1A2_Job( + Synthesize_A0A1A2_Job TOCMiscInfo = new( firstRecordedTrackNumber: startTrack, lastRecordedTrackNumber: endTrack, sessionFormat: sessionFormat, @@ -964,7 +964,7 @@ public static Disc LoadNRGToDisc(string nrgPath, DiscMountPolicy IN_DiscMountPol { if (trackIndex.Track.BCDValue is not (0 or 0xAA) && trackIndex.Index.BCDValue == 1) { - SubchannelQ q = default(SubchannelQ); + SubchannelQ q = default; q.q_status = trackIndex.ADRControl; q.q_tno = BCD2.FromBCD(0); q.q_index = trackIndex.Track; diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/SBI_format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/SBI_format.cs index 569030fbd16..4df9080c90e 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/SBI_format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/SBI_format.cs @@ -35,7 +35,7 @@ public static class SBIFormat public static bool QuickCheckISSBI(string path) { using var fs = File.OpenRead(path); - BinaryReader br = new BinaryReader(fs); + BinaryReader br = new(fs); string sig = br.ReadStringFixedUtf8(4); return sig == "SBI\0"; } diff --git a/src/BizHawk.Emulation.DiscSystem/DiscHasher.cs b/src/BizHawk.Emulation.DiscSystem/DiscHasher.cs index 8e7d2285cf8..2bc2d9f9a12 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscHasher.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscHasher.cs @@ -28,7 +28,7 @@ public string Calculate_PSX_BizIDHash() CRC32 crc = new(); byte[] buffer2352 = new byte[2352]; - DiscSectorReader dsr = new DiscSectorReader(disc) + DiscSectorReader dsr = new(disc) { Policy = { DeterministicClearBuffer = false } // live dangerously }; @@ -66,7 +66,7 @@ public uint Calculate_PSX_RedumpHash() CRC32 crc = new(); byte[] buffer2352 = new byte[2352]; - DiscSectorReader dsr = new DiscSectorReader(disc) + DiscSectorReader dsr = new(disc) { Policy = { DeterministicClearBuffer = false } // live dangerously }; @@ -88,7 +88,7 @@ public uint Calculate_PSX_RedumpHash() public string OldHash() { byte[] buffer = new byte[512 * 2352]; - DiscSectorReader dsr = new DiscSectorReader(disc); + DiscSectorReader dsr = new(disc); foreach (var track in disc.Session1.Tracks) { if (track.IsAudio) diff --git a/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs b/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs index 61b80e219c0..4f510f8ea55 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs @@ -189,7 +189,7 @@ public DiscType DetectDiscType() if (_disc.TOC.SessionFormat == SessionFormat.Type20_CDXA) discView = EDiscStreamView.DiscStreamView_Mode2_Form1_2048; - ISOFile iso = new ISOFile(); + ISOFile iso = new(); bool isIso = iso.Parse(new DiscStream(_disc, discView, 0)); if (!isIso) diff --git a/src/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs b/src/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs index a48bc84a487..2c4bf5d41de 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs @@ -19,11 +19,11 @@ public void Synth(SectorSynthJob job) private void RunMednaDisc() { - Disc disc = new Disc(); + Disc disc = new(); OUT_Disc = disc; //create a MednaDisc and give it to the disc for ownership - MednaDisc md = new MednaDisc(IN_FromPath); + MednaDisc md = new(IN_FromPath); disc.DisposableResources.Add(md); //"length of disc" for BizHawk's purposes (NOT a robust concept!) is determined by beginning of leadout track @@ -34,7 +34,7 @@ private void RunMednaDisc() disc.SynthParams.MednaDisc = md; //this is the sole sector synthesizer we'll need - SS_MednaDisc synth = new SS_MednaDisc(); + SS_MednaDisc synth = new(); OUT_Disc.SynthProvider = new SimpleSectorSynthProvider { SS = synth }; //ADR (q-Mode) is necessarily 0x01 for a RawTOCEntry @@ -58,9 +58,9 @@ private void RunMednaDisc() if (!m_te.Valid) continue; - Timestamp m_ts = new Timestamp((int)m_te.lba + 150); //these are supposed to be absolute timestamps + Timestamp m_ts = new((int)m_te.lba + 150); //these are supposed to be absolute timestamps - SubchannelQ q = new SubchannelQ + SubchannelQ q = new() { q_status = SubchannelQ.ComputeStatus(kADR, (EControlQ) m_te.control), q_tno = BCD2.FromDecimal(0), //unknown with mednadisc @@ -85,7 +85,7 @@ private void RunMednaDisc() } // synth A0 and A1 entries (indicating first and last recorded tracks and also session type) - SubchannelQ qA0 = new SubchannelQ + SubchannelQ qA0 = new() { q_status = SubchannelQ.ComputeStatus(kADR, kUnknownControl), q_tno = BCD2.FromDecimal(0), //unknown with mednadisc @@ -100,7 +100,7 @@ private void RunMednaDisc() q_crc = 0, //meaningless }; disc.Session1.RawTOCEntries.Add(new() { QData = qA0 }); - SubchannelQ qA1 = new SubchannelQ + SubchannelQ qA1 = new() { q_status = SubchannelQ.ComputeStatus(kADR, kUnknownControl), q_tno = BCD2.FromDecimal(0), //unknown with mednadisc diff --git a/src/BizHawk.Emulation.DiscSystem/DiscMountJob.cs b/src/BizHawk.Emulation.DiscSystem/DiscMountJob.cs index a1327b38c1e..9421276891b 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscMountJob.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscMountJob.cs @@ -84,11 +84,11 @@ public override void Run() { var session = OUT_Disc.Sessions[i]; //1. TOC from RawTOCEntries - Synthesize_DiscTOC_From_RawTOCEntries_Job tocSynth = new Synthesize_DiscTOC_From_RawTOCEntries_Job(session.RawTOCEntries); + Synthesize_DiscTOC_From_RawTOCEntries_Job tocSynth = new(session.RawTOCEntries); tocSynth.Run(); session.TOC = tocSynth.Result; //2. DiscTracks from TOC - Synthesize_DiscTracks_From_DiscTOC_Job tracksSynth = new Synthesize_DiscTracks_From_DiscTOC_Job(OUT_Disc, session); + Synthesize_DiscTracks_From_DiscTOC_Job tracksSynth = new(OUT_Disc, session); tracksSynth.Run(); } @@ -98,7 +98,7 @@ public override void Run() //(although note only VirtualJaguar currently deals with multisession discs and it doesn't care about the leadout so far) if (IN_DiscInterface != DiscInterface.MednaDisc) { - SS_Leadout ss_leadout = new SS_Leadout + SS_Leadout ss_leadout = new() { SessionNumber = OUT_Disc.Sessions.Count - 1, Policy = IN_DiscMountPolicy @@ -111,9 +111,9 @@ public override void Run() string sbiPath = Path.ChangeExtension(IN_FromPath, ".sbi"); if (File.Exists(sbiPath) && SBI.SBIFormat.QuickCheckISSBI(sbiPath)) { - SBI.LoadSBIJob loadSbiJob = new SBI.LoadSBIJob(sbiPath); + SBI.LoadSBIJob loadSbiJob = new(sbiPath); loadSbiJob.Run(); - ApplySBIJob applySbiJob = new ApplySBIJob(); + ApplySBIJob applySbiJob = new(); applySbiJob.Run(OUT_Disc, loadSbiJob.OUT_Data, IN_DiscMountPolicy.SBI_As_Mednafen); } } @@ -129,13 +129,13 @@ void LoadCue(string cueDirPath, string cueContent) //TODO make sure code is designed so no matter what happens, a disc is disposed in case of errors. // perhaps the CUE_Format2 (once renamed to something like Context) can handle that - CueFileResolver cfr = new CueFileResolver(); - CUE_Context cueContext = new CUE_Context { DiscMountPolicy = IN_DiscMountPolicy, Resolver = cfr }; + CueFileResolver cfr = new(); + CUE_Context cueContext = new() { DiscMountPolicy = IN_DiscMountPolicy, Resolver = cfr }; if (!cfr.IsHardcodedResolve) cfr.SetBaseDirectory(cueDirPath); // parse the cue file - ParseCueJob parseJob = new ParseCueJob(cueContent); + ParseCueJob parseJob = new(cueContent); bool okParse = true; try { @@ -152,7 +152,7 @@ void LoadCue(string cueDirPath, string cueContent) // compile the cue file // includes resolving required bin files and finding out what would processing would need to happen in order to load the cue - CompileCueJob compileJob = new CompileCueJob(parseJob.OUT_CueFile, cueContext); + CompileCueJob compileJob = new(parseJob.OUT_CueFile, cueContext); bool okCompile = true; try { @@ -176,7 +176,7 @@ void LoadCue(string cueDirPath, string cueContent) } // actually load it all up - LoadCueJob loadJob = new LoadCueJob(compileJob); + LoadCueJob loadJob = new(compileJob); loadJob.Run(); //TODO need better handling of log output if (!string.IsNullOrEmpty(loadJob.OUT_Log)) Console.WriteLine(loadJob.OUT_Log); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs b/src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs index 8c2c9513ddb..d8f6f0a4c00 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs @@ -93,7 +93,7 @@ public struct SubchannelQ public int Timestamp { readonly get => MSF.ToInt(min.DecimalValue, sec.DecimalValue, frame.DecimalValue); set { - Timestamp ts = new Timestamp(value); + Timestamp ts = new(value); min.DecimalValue = ts.MIN; sec.DecimalValue = ts.SEC; frame.DecimalValue = ts.FRAC; } } @@ -105,7 +105,7 @@ public int Timestamp { public int AP_Timestamp { readonly get => MSF.ToInt(ap_min.DecimalValue, ap_sec.DecimalValue, ap_frame.DecimalValue); set { - Timestamp ts = new Timestamp(value); + Timestamp ts = new(value); ap_min.DecimalValue = ts.MIN; ap_sec.DecimalValue = ts.SEC; ap_frame.DecimalValue = ts.FRAC; } } diff --git a/src/BizHawk.Emulation.DiscSystem/DiscTypes.cs b/src/BizHawk.Emulation.DiscSystem/DiscTypes.cs index 3e6f5adb748..4f9fb2dda6b 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscTypes.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscTypes.cs @@ -60,7 +60,7 @@ public static BCD2 FromBCD(byte b) public static int BCDToInt(byte n) { - BCD2 bcd = new BCD2 { BCDValue = n }; + BCD2 bcd = new() { BCDValue = n }; return bcd.DecimalValue; } diff --git a/src/BizHawk.Emulation.DiscSystem/DiscoHawkLogic/AudioExtractor.cs b/src/BizHawk.Emulation.DiscSystem/DiscoHawkLogic/AudioExtractor.cs index 4d60813927b..f6254959ebb 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscoHawkLogic/AudioExtractor.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscoHawkLogic/AudioExtractor.cs @@ -11,7 +11,7 @@ public static class AudioExtractor { public static void Extract(Disc disc, string path, string fileBase, Func getOverwritePolicy) { - DiscSectorReader dsr = new DiscSectorReader(disc); + DiscSectorReader dsr = new(disc); bool shouldHalt = false; bool? overwriteExisting = null; // true = overwrite, false = skip existing, null = unset diff --git a/src/BizHawk.Emulation.DiscSystem/DiscoHawkLogic/DiscoHawkLogic.cs b/src/BizHawk.Emulation.DiscSystem/DiscoHawkLogic/DiscoHawkLogic.cs index fc236531b71..317c004ea81 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscoHawkLogic/DiscoHawkLogic.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscoHawkLogic/DiscoHawkLogic.cs @@ -30,19 +30,19 @@ private static bool CompareFile(string infile, DiscInterface loadDiscInterface, sw.WriteLine("BEGIN COMPARE: {0}\nSRC {1} vs DST {2}", infile, loadDiscInterface, cmpif); //reload the original disc, with new policies as needed - DiscMountJob dmj = new DiscMountJob( + DiscMountJob dmj = new( fromPath: infile, discMountPolicy: new DiscMountPolicy { CUE_PregapContradictionModeA = cmpif != DiscInterface.MednaDisc }, discInterface: loadDiscInterface); dmj.Run(); srcDisc = dmj.OUT_Disc; - DiscMountJob dstDmj = new DiscMountJob(fromPath: infile, discInterface: cmpif); + DiscMountJob dstDmj = new(fromPath: infile, discInterface: cmpif); dstDmj.Run(); dstDisc = dstDmj.OUT_Disc; - DiscSectorReader srcDsr = new DiscSectorReader(srcDisc); - DiscSectorReader dstDsr = new DiscSectorReader(dstDisc); + DiscSectorReader srcDsr = new(srcDisc); + DiscSectorReader dstDsr = new(dstDisc); var srcToc = srcDisc.TOC; var dstToc = dstDisc.TOC; @@ -122,7 +122,7 @@ void SwDumpChunkOne(string comment, int lba, byte[] buf, int addr, int count) void SwDumpChunk(int lba, int dispAddr, int addr, int count, int numOffenders) { - HashSet hashedOffenders = new HashSet(); + HashSet hashedOffenders = new(); for (int i = 0; i < numOffenders; i++) { hashedOffenders.Add(offenders[i]); @@ -224,8 +224,8 @@ void SwDumpChunk(int lba, int dispAddr, int addr, int count, int numOffenders) private static List FindCuesRecurse(string dir) { - List ret = new List(); - Queue dpTodo = new Queue(); + List ret = new(); + Queue dpTodo = new(); dpTodo.Enqueue(dir); for (; ; ) { @@ -268,7 +268,7 @@ public static void RunWithArgs(string[] args, Action showComparisonResul string dirArg = null; string infile = null; var loadDiscInterface = DiscInterface.BizHawk; - List compareDiscInterfaces = new List(); + List compareDiscInterfaces = new(); bool hawk = false; bool music = false; bool overwrite = false; @@ -328,8 +328,8 @@ public static void RunWithArgs(string[] args, Action showComparisonResul { verbose = false; var todo = FindCuesRecurse(dirArg); - ParallelOptions po = new ParallelOptions(); - CancellationTokenSource cts = new CancellationTokenSource(); + ParallelOptions po = new(); + CancellationTokenSource cts = new(); po.CancellationToken = cts.Token; po.MaxDegreeOfParallelism = 1; if(po.MaxDegreeOfParallelism < 0) po.MaxDegreeOfParallelism = 1; @@ -351,7 +351,7 @@ public static void RunWithArgs(string[] args, Action showComparisonResul if(!blocked) foreach (var cmpif in compareDiscInterfaces) { - StringWriter sw = new StringWriter(); + StringWriter sw = new(); bool success = CompareFile(fp, loadDiscInterface, cmpif, verbose, cts, sw); if (!success) { @@ -377,7 +377,7 @@ public static void RunWithArgs(string[] args, Action showComparisonResul if (compareDiscInterfaces.Count != 0) { - StringWriter sw = new StringWriter(); + StringWriter sw = new(); foreach (var cmpif in compareDiscInterfaces) { CompareFile(infile, loadDiscInterface, cmpif, verbose, null, sw); diff --git a/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/ApplySBIJob.cs b/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/ApplySBIJob.cs index f8ac0057fe7..1f763cf4d11 100644 --- a/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/ApplySBIJob.cs +++ b/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/ApplySBIJob.cs @@ -13,7 +13,7 @@ public void Run(Disc disc, SBI.SubQPatchData sbi, bool asMednafen) //save this, it's small, and we'll want it for disc processing a/b checks disc.Memos["sbi"] = sbi; - DiscSectorReader dsr = new DiscSectorReader(disc); + DiscSectorReader dsr = new(disc); int n = sbi.ABAs.Count; int b = 0; @@ -22,7 +22,7 @@ public void Run(Disc disc, SBI.SubQPatchData sbi, bool asMednafen) int lba = sbi.ABAs[i] - 150; //create a synthesizer which can return the patched data - SS_PatchQ ss_patchq = new SS_PatchQ { Original = disc._Sectors[lba + 150] }; + SS_PatchQ ss_patchq = new() { Original = disc._Sectors[lba + 150] }; byte[] subQbuf = ss_patchq.Buffer_SubQ; //read the old subcode diff --git a/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/LoadSBIJob.cs b/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/LoadSBIJob.cs index 56e8d093bfd..564af2239a1 100644 --- a/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/LoadSBIJob.cs +++ b/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/LoadSBIJob.cs @@ -24,13 +24,13 @@ internal class LoadSBIJob : DiscJob public override void Run() { using var fs = File.OpenRead(IN_Path); - BinaryReader br = new BinaryReader(fs); + BinaryReader br = new(fs); string sig = br.ReadStringFixedUtf8(4); if (sig != "SBI\0") throw new SBIParseException("Missing magic number"); - SubQPatchData ret = new SubQPatchData(); - List bytes = new List(); + SubQPatchData ret = new(); + List bytes = new(); //read records until done for (; ; ) @@ -43,7 +43,7 @@ public override void Run() int m = BCD2.BCDToInt(br.ReadByte()); int s = BCD2.BCDToInt(br.ReadByte()); int f = BCD2.BCDToInt(br.ReadByte()); - Timestamp ts = new Timestamp(m, s, f); + Timestamp ts = new(m, s, f); ret.ABAs.Add(ts.Sector); int type = br.ReadByte(); switch (type) diff --git a/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTracks_From_DiscTOC_Job.cs b/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTracks_From_DiscTOC_Job.cs index 22ba2efb459..8bf821daf7d 100644 --- a/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTracks_From_DiscTOC_Job.cs +++ b/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTracks_From_DiscTOC_Job.cs @@ -21,7 +21,7 @@ public Synthesize_DiscTracks_From_DiscTOC_Job(Disc disc, DiscSession session) /// first track of is not 1 public void Run() { - DiscSectorReader dsr = new DiscSectorReader(IN_Disc) { Policy = { DeterministicClearBuffer = false } }; + DiscSectorReader dsr = new(IN_Disc) { Policy = { DeterministicClearBuffer = false } }; //add a lead-in track Tracks.Add(new() @@ -34,7 +34,7 @@ public void Run() for (int i = TOCRaw.FirstRecordedTrackNumber; i <= TOCRaw.LastRecordedTrackNumber; i++) { var item = TOCRaw.TOCItems[i]; - DiscTrack track = new DiscTrack + DiscTrack track = new() { Number = i, Control = item.Control, diff --git a/src/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs b/src/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs index 5d4fe9f52d1..701f450e973 100644 --- a/src/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs +++ b/src/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs @@ -257,7 +257,7 @@ public void Synth(SectorSynthJob job) TrackType = CUE.CueTrackType.Mode1_2352; } - CUE.SS_Gap ss_gap = new CUE.SS_Gap + CUE.SS_Gap ss_gap = new() { Policy = Policy, sq = sq, diff --git a/src/BizHawk.Emulation.DiscSystem/Internal/SynthUtils.cs b/src/BizHawk.Emulation.DiscSystem/Internal/SynthUtils.cs index 46a72df854d..687f6ee9518 100644 --- a/src/BizHawk.Emulation.DiscSystem/Internal/SynthUtils.cs +++ b/src/BizHawk.Emulation.DiscSystem/Internal/SynthUtils.cs @@ -61,7 +61,7 @@ public static void SectorHeader(byte[] buffer16, int offset, int LBA, byte mode) buffer16[offset + 0] = 0x00; for (int i = 1; i < 11; i++) buffer16[offset + i] = 0xFF; buffer16[offset + 11] = 0x00; - Timestamp ts = new Timestamp(LBA + 150); + Timestamp ts = new(LBA + 150); buffer16[offset + 12] = BCD2.IntToBCD(ts.MIN); buffer16[offset + 13] = BCD2.IntToBCD(ts.SEC); buffer16[offset + 14] = BCD2.IntToBCD(ts.FRAC); diff --git a/src/BizHawk.Tests/Client.Common/Display/InputDisplayTests.cs b/src/BizHawk.Tests/Client.Common/Display/InputDisplayTests.cs index 1e7249b4c2d..8dd3c5e40af 100644 --- a/src/BizHawk.Tests/Client.Common/Display/InputDisplayTests.cs +++ b/src/BizHawk.Tests/Client.Common/Display/InputDisplayTests.cs @@ -27,7 +27,7 @@ public void Initializer() public void Generate_BoolPressed_GeneratesMnemonic() { _boolController["A"] = true; - Bk2InputDisplayGenerator displayGenerator = new Bk2InputDisplayGenerator("NES", _boolController); + Bk2InputDisplayGenerator displayGenerator = new("NES", _boolController); string actual = displayGenerator.Generate(); Assert.AreEqual("A", actual); } @@ -36,7 +36,7 @@ public void Generate_BoolPressed_GeneratesMnemonic() public void Generate_BoolUnPressed_GeneratesSpace() { _boolController["A"] = false; - Bk2InputDisplayGenerator displayGenerator = new Bk2InputDisplayGenerator("NES", _boolController); + Bk2InputDisplayGenerator displayGenerator = new("NES", _boolController); string actual = displayGenerator.Generate(); Assert.AreEqual(" ", actual); } @@ -44,7 +44,7 @@ public void Generate_BoolUnPressed_GeneratesSpace() [TestMethod] public void Generate_Floats() { - Bk2InputDisplayGenerator displayGenerator = new Bk2InputDisplayGenerator("NES", _axisController); + Bk2InputDisplayGenerator displayGenerator = new("NES", _axisController); string actual = displayGenerator.Generate(); Assert.AreEqual(" 0, 0,", actual); } @@ -53,7 +53,7 @@ public void Generate_Floats() public void Generate_MidRangeDisplaysEmpty() { _axisController.AcceptNewAxis("StickX", MidValue); - Bk2InputDisplayGenerator displayGenerator = new Bk2InputDisplayGenerator("NES", _axisController); + Bk2InputDisplayGenerator displayGenerator = new("NES", _axisController); string actual = displayGenerator.Generate(); Assert.AreEqual(" 0,", actual); } diff --git a/src/BizHawk.Tests/Client.Common/Movie/LogGeneratorTests.cs b/src/BizHawk.Tests/Client.Common/Movie/LogGeneratorTests.cs index 3cd4070062e..b50046e28cc 100644 --- a/src/BizHawk.Tests/Client.Common/Movie/LogGeneratorTests.cs +++ b/src/BizHawk.Tests/Client.Common/Movie/LogGeneratorTests.cs @@ -26,7 +26,7 @@ public void Initializer() public void GenerateLogEntry_ExclamationForUnknownButtons() { SimpleController controller = new(new ControllerDefinition("Dummy Gamepad") { BoolButtons = { "Unknown Button" } }.MakeImmutable()); - Bk2LogEntryGenerator lg = new Bk2LogEntryGenerator("NES", controller); + Bk2LogEntryGenerator lg = new("NES", controller); controller["Unknown Button"] = true; string actual = lg.GenerateLogEntry(); Assert.AreEqual("|!|", actual); @@ -36,7 +36,7 @@ public void GenerateLogEntry_ExclamationForUnknownButtons() public void GenerateLogEntry_BoolPressed_GeneratesMnemonic() { _boolController["A"] = true; - Bk2LogEntryGenerator lg = new Bk2LogEntryGenerator("NES", _boolController); + Bk2LogEntryGenerator lg = new("NES", _boolController); string actual = lg.GenerateLogEntry(); Assert.AreEqual("|A|", actual); } @@ -45,7 +45,7 @@ public void GenerateLogEntry_BoolPressed_GeneratesMnemonic() public void GenerateLogEntry_BoolUnPressed_GeneratesPeriod() { _boolController["A"] = false; - Bk2LogEntryGenerator lg = new Bk2LogEntryGenerator("NES", _boolController); + Bk2LogEntryGenerator lg = new("NES", _boolController); string actual = lg.GenerateLogEntry(); Assert.AreEqual("|.|", actual); } @@ -53,7 +53,7 @@ public void GenerateLogEntry_BoolUnPressed_GeneratesPeriod() [TestMethod] public void GenerateLogEntry_Floats() { - Bk2LogEntryGenerator lg = new Bk2LogEntryGenerator("NES", _axisController); + Bk2LogEntryGenerator lg = new("NES", _axisController); string actual = lg.GenerateLogEntry(); Assert.AreEqual("| 0, 0,|", actual); } diff --git a/src/BizHawk.Tests/Client.Common/Movie/ZwinderStateManagerTests.cs b/src/BizHawk.Tests/Client.Common/Movie/ZwinderStateManagerTests.cs index 205bb87cfaf..ea86e566c00 100644 --- a/src/BizHawk.Tests/Client.Common/Movie/ZwinderStateManagerTests.cs +++ b/src/BizHawk.Tests/Client.Common/Movie/ZwinderStateManagerTests.cs @@ -13,7 +13,7 @@ public class ZwinderStateManagerTests { private ZwinderStateManager CreateSmallZwinder(IStatable ss) { - ZwinderStateManager zw = new ZwinderStateManager(new ZwinderStateManagerSettings + ZwinderStateManager zw = new(new ZwinderStateManagerSettings { CurrentBufferSize = 1, CurrentTargetFrameLength = 10000, @@ -24,7 +24,7 @@ private ZwinderStateManager CreateSmallZwinder(IStatable ss) AncientStateInterval = 50000 }, f => false); - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); ss.SaveStateBinary(new BinaryWriter(ms)); zw.Engage(ms.ToArray()); return zw; @@ -35,8 +35,8 @@ private ZwinderStateManager CreateSmallZwinder(IStatable ss) [TestMethod] public void SaveCreateRoundTrip() { - MemoryStream ms = new MemoryStream(); - ZwinderStateManager zw = new ZwinderStateManager(new ZwinderStateManagerSettings + MemoryStream ms = new(); + ZwinderStateManager zw = new(new ZwinderStateManagerSettings { CurrentBufferSize = 16, CurrentTargetFrameLength = 10000, @@ -48,7 +48,7 @@ public void SaveCreateRoundTrip() }, f => false); zw.SaveStateHistory(new BinaryWriter(ms)); byte[] buff = ms.ToArray(); - MemoryStream rms = new MemoryStream(buff, false); + MemoryStream rms = new(buff, false); ZwinderStateManager zw2 = ZwinderStateManager.Create(new BinaryReader(rms), zw.Settings, f => false); @@ -61,12 +61,12 @@ public void SaveCreateRoundTrip() [TestMethod] public void CountEvictWorks() { - using ZwinderBuffer zb = new ZwinderBuffer(new RewindConfig + using ZwinderBuffer zb = new(new RewindConfig { BufferSize = 1, TargetFrameLength = 1 }); - StateSource ss = new StateSource + StateSource ss = new() { PaddingData = new byte[10] }; @@ -87,8 +87,8 @@ public void SaveCreateBufferRoundTrip() BufferSize = 1, TargetFrameLength = 10 }; - ZwinderBuffer buff = new ZwinderBuffer(config); - StateSource ss = new StateSource { PaddingData = new byte[500] }; + ZwinderBuffer buff = new(config); + StateSource ss = new() { PaddingData = new byte[500] }; for (int frame = 0; frame < 2090; frame++) { ss.Frame = frame; @@ -101,7 +101,7 @@ public void SaveCreateBufferRoundTrip() Assert.AreEqual(StateSource.GetFrameNumberInState(buff.GetState(0).GetReadStream()), 10); Assert.AreEqual(StateSource.GetFrameNumberInState(buff.GetState(2079).GetReadStream()), 2089); - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); buff.SaveStateBinary(new BinaryWriter(ms)); ms.Position = 0; ZwinderBuffer buff2 = ZwinderBuffer.Create(new BinaryReader(ms), config); @@ -118,8 +118,8 @@ public void SaveCreateBufferRoundTrip() [TestMethod] public void StateBeforeFrame() { - StateSource ss = new StateSource { PaddingData = new byte[1000] }; - ZwinderStateManager zw = new ZwinderStateManager(new ZwinderStateManagerSettings + StateSource ss = new() { PaddingData = new byte[1000] }; + ZwinderStateManager zw = new(new ZwinderStateManagerSettings { CurrentBufferSize = 1, CurrentTargetFrameLength = 10000, @@ -130,7 +130,7 @@ public void StateBeforeFrame() AncientStateInterval = 50000 }, f => false); { - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new(); ss.SaveStateBinary(new BinaryWriter(ms)); zw.Engage(ms.ToArray()); } @@ -362,7 +362,7 @@ public void Count_WithReserved() public void StateCache() { var ss = CreateStateSource(); - ZwinderStateManager zw = new ZwinderStateManager(new ZwinderStateManagerSettings + ZwinderStateManager zw = new(new ZwinderStateManagerSettings { CurrentBufferSize = 2, CurrentTargetFrameLength = 1000, @@ -424,11 +424,11 @@ public void Clear_KeepsZeroState() [TestMethod] public void WhatIfTheHeadStateWrapsAround() { - StateSource ss = new StateSource + StateSource ss = new() { PaddingData = new byte[400 * 1000] }; - using ZwinderBuffer zw = new ZwinderBuffer(new RewindConfig + using ZwinderBuffer zw = new(new RewindConfig { BufferSize = 1, TargetFrameLength = 1 @@ -448,7 +448,7 @@ public void WhatIfTheHeadStateWrapsAround() [TestMethod] public void TestReadByteCorruption() { - using ZwinderBuffer zw = new ZwinderBuffer(new RewindConfig + using ZwinderBuffer zw = new(new RewindConfig { BufferSize = 1, TargetFrameLength = 1 @@ -470,7 +470,7 @@ public void TestReadByteCorruption() [TestMethod] public void TestReadBytesCorruption() { - using ZwinderBuffer zw = new ZwinderBuffer(new RewindConfig + using ZwinderBuffer zw = new(new RewindConfig { BufferSize = 1, TargetFrameLength = 1 @@ -495,7 +495,7 @@ public void TestReadBytesCorruption() [TestMethod] public void TestWriteByteCorruption() { - using ZwinderBuffer zw = new ZwinderBuffer(new RewindConfig + using ZwinderBuffer zw = new(new RewindConfig { BufferSize = 1, TargetFrameLength = 1 @@ -532,8 +532,8 @@ public void TestWriteByteCorruption() [TestMethod] public void BufferStressTest() { - Random r = new Random(8675309); - using ZwinderBuffer zw = new ZwinderBuffer(new RewindConfig + Random r = new(8675309); + using ZwinderBuffer zw = new(new RewindConfig { BufferSize = 1, TargetFrameLength = 1 @@ -547,7 +547,7 @@ public void BufferStressTest() zw.Capture(i, s => { int length = r.Next(40000); - BinaryWriter bw = new BinaryWriter(s); + BinaryWriter bw = new(s); var bytes = buff.AsSpan(0, length); r.NextBytes(bytes); bw.Write(length); @@ -559,7 +559,7 @@ public void BufferStressTest() { var info = zw.GetState(i); var s = info.GetReadStream(); - BinaryReader br = new BinaryReader(s); + BinaryReader br = new(s); int length = info.Size; if (length != br.ReadInt32() + 8) throw new Exception("Length field corrupted"); @@ -592,7 +592,7 @@ public void SaveStateBinary(BinaryWriter writer) public static int GetFrameNumberInState(Stream stream) { - StateSource ss = new StateSource(); + StateSource ss = new(); ss.LoadStateBinary(new BinaryReader(stream)); return ss.Frame; } diff --git a/src/BizHawk.Tests/Common/CustomCollections/CustomCollectionTests.cs b/src/BizHawk.Tests/Common/CustomCollections/CustomCollectionTests.cs index 76a11eb9b1c..3e3ac63576d 100644 --- a/src/BizHawk.Tests/Common/CustomCollections/CustomCollectionTests.cs +++ b/src/BizHawk.Tests/Common/CustomCollections/CustomCollectionTests.cs @@ -12,7 +12,7 @@ public class CustomCollectionTests [TestMethod] public void TestSortedListAddRemove() { - SortedList list = new SortedList(new[] { 1, 3, 4, 7, 8, 9, 11 }) + SortedList list = new(new[] { 1, 3, 4, 7, 8, 9, 11 }) { 5, // `Insert` when `BinarySearch` returns negative 8 // `Insert` when `BinarySearch` returns non-negative @@ -25,7 +25,7 @@ public void TestSortedListAddRemove() [TestMethod] public void TestSortedListContains() { - SortedList list = new SortedList(new[] { 1, 3, 4, 7, 8, 9, 11 }); + SortedList list = new(new[] { 1, 3, 4, 7, 8, 9, 11 }); Assert.IsFalse(list.Contains(6)); // `Contains` when `BinarySearch` returns negative Assert.IsTrue(list.Contains(11)); // `Contains` when `BinarySearch` returns non-negative } @@ -37,7 +37,7 @@ public void TestSortedListContains() [DataRow(new[] { 4, 7 }, new int[] { }, 0)] public void TestSortedListRemoveAfter(int[] before, int[] after, int removeItem) { - SortedList sortlist = new SortedList(before); + SortedList sortlist = new(before); sortlist.RemoveAfter(removeItem); Assert.IsTrue(sortlist.ToArray().SequenceEqual(after)); } diff --git a/src/BizHawk.Tests/Common/MultiPredicateSort/MultiPredicateSortTests.cs b/src/BizHawk.Tests/Common/MultiPredicateSort/MultiPredicateSortTests.cs index 7264e6ff244..18c78ad603e 100644 --- a/src/BizHawk.Tests/Common/MultiPredicateSort/MultiPredicateSortTests.cs +++ b/src/BizHawk.Tests/Common/MultiPredicateSort/MultiPredicateSortTests.cs @@ -37,7 +37,7 @@ public void SanityCheck() [TestMethod] public void TestRigidSort() { - RigidMultiPredicateSort<(int X, string Y)> sorts = new RigidMultiPredicateSort<(int X, string Y)>(new Dictionary> + RigidMultiPredicateSort<(int X, string Y)> sorts = new(new Dictionary> { ["by_x"] = t => t.X, ["by_y"] = t => t.Y