From e0c1fc4a4db2469cbea5fce3c2b7f7a2456100d7 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 4 Dec 2020 15:39:52 -0600 Subject: [PATCH] misc cleanups in Client.Common --- BizHawk.sln.DotSettings | 6 +++++ .../DirectInputAdapter.cs | 2 +- .../Api/Classes/EmulationApi.cs | 10 ++++----- .../Api/Classes/MemoryApi.cs | 2 +- .../DisplayManager/Filters/BaseFilter.cs | 8 +++---- .../DisplayManager/Filters/Gui.cs | 20 ++++++----------- .../DisplayManager/Filters/Retro.cs | 10 ++++----- .../PropertyGridConverters/IntConverter.cs | 4 ++-- src/BizHawk.Client.Common/QuickBmpFile.cs | 1 + src/BizHawk.Client.Common/RomLoader.cs | 8 +------ .../Sound/Utilities/BufferedAsync.cs | 2 +- .../cheats/GameSharkDecoder.cs | 18 +++++++-------- .../input/DistinctKey.cs | 3 +++ .../input/HostInputAdapter.cs | 2 +- .../lua/CommonLibs/CommLuaLibrary.cs | 1 - .../lua/CommonLibs/GuiLuaLibrary.cs | 2 +- .../movie/MovieSession.cs | 13 +++++------ .../movie/PlatformFrameRates.cs | 22 +++++++++---------- .../movie/bk2/Bk2Movie.IO.cs | 2 +- .../tasproj/ZwinderStateManagerSettings.cs | 6 ++--- .../rewind/ZwinderBuffer.cs | 1 - .../tools/Watch/WatchList/WatchList.cs | 1 - src/BizHawk.Client.EmuHawk/Input/Input.cs | 2 +- .../Input/OpenTKInputAdapter.cs | 2 +- 24 files changed, 70 insertions(+), 78 deletions(-) diff --git a/BizHawk.sln.DotSettings b/BizHawk.sln.DotSettings index 5ef64684b8..c865531127 100644 --- a/BizHawk.sln.DotSettings +++ b/BizHawk.sln.DotSettings @@ -95,6 +95,7 @@ IRQ LR MGBA + NDS NES NMI NT @@ -117,6 +118,7 @@ SGX SHA SNES + SQ TA TAS TI @@ -261,6 +263,7 @@ True True True + True True True True @@ -272,6 +275,7 @@ True True True + True True True True @@ -306,6 +310,8 @@ True True True + True + True True True diff --git a/src/BizHawk.Bizware.DirectX/DirectInputAdapter.cs b/src/BizHawk.Bizware.DirectX/DirectInputAdapter.cs index 762c8aa2b2..5cb93994dd 100644 --- a/src/BizHawk.Bizware.DirectX/DirectInputAdapter.cs +++ b/src/BizHawk.Bizware.DirectX/DirectInputAdapter.cs @@ -8,7 +8,7 @@ using BizHawk.Client.Common; namespace BizHawk.Bizware.DirectX { - public sealed class DirectInputAdapter : HostInputAdapter + public sealed class DirectInputAdapter : IHostInputAdapter { private Config? _config; diff --git a/src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs b/src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs index 864864c4b9..058acfce63 100644 --- a/src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/EmulationApi.cs @@ -196,7 +196,7 @@ namespace BizHawk.Client.Common QuickNES quickNes => quickNes.GetSettings(), SMS sms => sms.GetSettings(), WonderSwan ws => ws.GetSettings(), - _ => (object) null + _ => null }; public PutSettingsDirtyBits PutSettings(object settings) => Emulator switch @@ -214,7 +214,7 @@ namespace BizHawk.Client.Common public void SetRenderPlanes(params bool[] args) { static bool GetSetting(bool[] settings, int index) => index >= settings.Length || settings[index]; - void SetBSNES(LibsnesCore core) + void SetBsnes(LibsnesCore core) { var s = core.GetSettings(); s.ShowBG1_0 = s.ShowBG1_1 = GetSetting(args, 0); @@ -273,7 +273,7 @@ namespace BizHawk.Client.Common else if (!showSp && s.NumSprites > 0) s.NumSprites = 0; quicknes.PutSettings(s); } - void SetSMSHawk(SMS sms) + void SetSmsHawk(SMS sms) { var s = sms.GetSettings(); s.DispOBJ = GetSetting(args, 0); @@ -286,7 +286,7 @@ namespace BizHawk.Client.Common SetGPGX(gpgx); break; case LibsnesCore snes: - SetBSNES(snes); + SetBsnes(snes); break; case NES nes: SetNesHawk(nes); @@ -298,7 +298,7 @@ namespace BizHawk.Client.Common SetQuickNES(quicknes); break; case SMS sms: - SetSMSHawk(sms); + SetSmsHawk(sms); break; case WonderSwan ws: SetCygne(ws); diff --git a/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs b/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs index abc13d069c..542061ffe2 100644 --- a/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs @@ -165,7 +165,7 @@ namespace BizHawk.Client.Common } case 4: { - d.PokeUint(addr, (uint)value, _isBigEndian); + d.PokeUint(addr, value, _isBigEndian); break; } } diff --git a/src/BizHawk.Client.Common/DisplayManager/Filters/BaseFilter.cs b/src/BizHawk.Client.Common/DisplayManager/Filters/BaseFilter.cs index 3784940308..5e6e7dcc46 100644 --- a/src/BizHawk.Client.Common/DisplayManager/Filters/BaseFilter.cs +++ b/src/BizHawk.Client.Common/DisplayManager/Filters/BaseFilter.cs @@ -36,8 +36,8 @@ namespace BizHawk.Client.Common.Filters var output = FindOutput(channel); if (input != null && output != null) { - point.X *= ((float)input.SurfaceFormat.Size.Width) / (float)output.SurfaceFormat.Size.Width; - point.Y *= ((float)input.SurfaceFormat.Size.Height) / (float)output.SurfaceFormat.Size.Height; + point.X *= input.SurfaceFormat.Size.Width / (float)output.SurfaceFormat.Size.Width; + point.Y *= input.SurfaceFormat.Size.Height / (float)output.SurfaceFormat.Size.Height; } return point; } @@ -49,8 +49,8 @@ namespace BizHawk.Client.Common.Filters var output = FindOutput(channel); if (input != null && output != null) { - point.X *= ((float)output.SurfaceFormat.Size.Width) / (float)input.SurfaceFormat.Size.Width; - point.Y *= ((float)output.SurfaceFormat.Size.Height) / (float)input.SurfaceFormat.Size.Height; + point.X *= output.SurfaceFormat.Size.Width / (float)input.SurfaceFormat.Size.Width; + point.Y *= output.SurfaceFormat.Size.Height / (float)input.SurfaceFormat.Size.Height; } return point; } diff --git a/src/BizHawk.Client.Common/DisplayManager/Filters/Gui.cs b/src/BizHawk.Client.Common/DisplayManager/Filters/Gui.cs index 8ec0553ac7..84b5702d9b 100644 --- a/src/BizHawk.Client.Common/DisplayManager/Filters/Gui.cs +++ b/src/BizHawk.Client.Common/DisplayManager/Filters/Gui.cs @@ -40,8 +40,8 @@ namespace BizHawk.Client.Common.Filters //zero 02-jun-2014 - we passed these in, but ignored them. kind of weird.. int oldSourceWidth = sourceWidth; int oldSourceHeight = sourceHeight; - sourceWidth = (int)virtualWidth; - sourceHeight = (int)virtualHeight; + sourceWidth = virtualWidth; + sourceHeight = virtualHeight; // this doesn't make sense if (!maintainAspect) @@ -83,7 +83,7 @@ namespace BizHawk.Client.Common.Filters PS + new Vector2(1, 1) }; - bool[] trialsLimited = new bool[3] { false,false,false}; + bool[] trialsLimited = new bool[] { false, false, false}; int bestIndex = -1; float bestValue = 1000.0f; for (int t = 0; t < trials.Length; t++) @@ -177,7 +177,7 @@ namespace BizHawk.Client.Common.Filters public IGL GL; public IGuiRenderer GuiRenderer; - private MelonDS nds; + private readonly MelonDS nds; //TODO: actually use this private bool nop = false; @@ -344,7 +344,7 @@ namespace BizHawk.Client.Common.Filters { point = Transform(matBotInvert, point); - //hack to accomodate input tracking system's float-point sense (based on the core's videobuffer height) + //hack to accomodate input tracking system's float-point sense (based on the core's VideoBuffer height) //actually, this is needed for a reason similar to the "TouchScreenStart" that I removed. //So, something like that needs readding if we're to get rid of this hack. //(should redo it as a mouse coordinate offset or something.. but the key is to pipe it to the point where this is needed.. that is where MainForm does DisplayManager.UntransformPoint() @@ -425,7 +425,7 @@ namespace BizHawk.Client.Common.Filters public FinalPresentation(Size size) { - this.OutputSize = size; + OutputSize = size; } private Size OutputSize, InputSize; @@ -489,13 +489,7 @@ namespace BizHawk.Client.Common.Filters public override void SetInputFormat(string channel, SurfaceState state) { - bool need = false; - if (state.SurfaceFormat.Size != OutputSize) - need = true; - if (FilterOption != eFilterOption.None) - need = true; - if (Flip) - need = true; + bool need = state.SurfaceFormat.Size != OutputSize || FilterOption != eFilterOption.None || Flip; if (!need) { diff --git a/src/BizHawk.Client.Common/DisplayManager/Filters/Retro.cs b/src/BizHawk.Client.Common/DisplayManager/Filters/Retro.cs index f369f637f8..284d2e58e9 100644 --- a/src/BizHawk.Client.Common/DisplayManager/Filters/Retro.cs +++ b/src/BizHawk.Client.Common/DisplayManager/Filters/Retro.cs @@ -153,7 +153,7 @@ namespace BizHawk.Client.Common.Filters Passes.Add(sp); sp.InputFilterLinear = FetchBool(dict, $"filter_linear{i}", false); //Should this value not be defined, the filtering option is implementation defined. - sp.OuputFloat = FetchBool(dict, $"float_framebuffer{i}", false); + sp.OutputFloat = FetchBool(dict, $"float_framebuffer{i}", false); sp.FrameCountMod = FetchInt(dict, $"frame_count_mod{i}", 1); sp.ShaderPath = FetchString(dict, $"shader{i}", "?"); //todo - change extension to .cg for better compatibility? just change .cg to .glsl transparently at last second? @@ -191,24 +191,24 @@ namespace BizHawk.Client.Common.Filters public int Index; public string ShaderPath; public bool InputFilterLinear; - public bool OuputFloat; + public bool OutputFloat; public int FrameCountMod; public ScaleType ScaleTypeX; public ScaleType ScaleTypeY; public Vector2 Scale; } - private string FetchString(IDictionary dict, string key, string @default) + private static string FetchString(IDictionary dict, string key, string @default) { return dict.TryGetValue(key, out var str) ? str : @default; } - private int FetchInt(IDictionary dict, string key, int @default) + private static int FetchInt(IDictionary dict, string key, int @default) { return dict.TryGetValue(key, out var str) ? int.Parse(str) : @default; } - private float FetchFloat(IDictionary dict, string key, float @default) + private static float FetchFloat(IDictionary dict, string key, float @default) { return dict.TryGetValue(key, out var str) ? float.Parse(str) : @default; } diff --git a/src/BizHawk.Client.Common/PropertyGridConverters/IntConverter.cs b/src/BizHawk.Client.Common/PropertyGridConverters/IntConverter.cs index a7d39aee94..63e05c278f 100644 --- a/src/BizHawk.Client.Common/PropertyGridConverters/IntConverter.cs +++ b/src/BizHawk.Client.Common/PropertyGridConverters/IntConverter.cs @@ -14,7 +14,7 @@ namespace BizHawk.Client.Common { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { - return ((sourceType == typeof(string)) || base.CanConvertFrom(context, sourceType)); + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) @@ -44,7 +44,7 @@ namespace BizHawk.Client.Common { if (destinationType == null) { - throw new ArgumentNullException("destinationType"); + throw new ArgumentNullException(nameof(destinationType)); } if (destinationType == typeof(string)) diff --git a/src/BizHawk.Client.Common/QuickBmpFile.cs b/src/BizHawk.Client.Common/QuickBmpFile.cs index a5fee187c4..1fc6b34378 100644 --- a/src/BizHawk.Client.Common/QuickBmpFile.cs +++ b/src/BizHawk.Client.Common/QuickBmpFile.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using BizHawk.Common; using BizHawk.Emulation.Common; +// ReSharper disable FieldCanBeMadeReadOnly.Local // ReSharper disable InconsistentNaming // ReSharper disable StyleCop.SA1304 // ReSharper disable StyleCop.SA1307 diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index 7ad6ebef23..8f032a3b4c 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -98,11 +98,6 @@ namespace BizHawk.Client.Common // For not throwing errors but simply outputting information to the screen public Action MessageCallback { get; set; } - private void DoMessageCallback(string message) - { - MessageCallback?.Invoke(message); - } - // TODO: reconsider the need for exposing these; public IEmulator LoadedEmulator { get; private set; } public GameInfo Game { get; private set; } @@ -237,7 +232,6 @@ namespace BizHawk.Client.Common private GameInfo MakeGameFromDisc(Disc disc, string ext, string name) { - GameInfo game; // TODO - use more sophisticated IDer var discType = new DiscIdentifier(disc).DetectDiscType(); var discHasher = new DiscHasher(disc); @@ -245,7 +239,7 @@ namespace BizHawk.Client.Common ? discHasher.Calculate_PSX_BizIDHash().ToString("X8") : discHasher.OldHash(); - game = Database.CheckDatabase(discHash); + var game = Database.CheckDatabase(discHash); if (game == null) { // try to use our wizard methods diff --git a/src/BizHawk.Client.Common/Sound/Utilities/BufferedAsync.cs b/src/BizHawk.Client.Common/Sound/Utilities/BufferedAsync.cs index c2587c721d..2972060f92 100644 --- a/src/BizHawk.Client.Common/Sound/Utilities/BufferedAsync.cs +++ b/src/BizHawk.Client.Common/Sound/Utilities/BufferedAsync.cs @@ -21,7 +21,7 @@ namespace BizHawk.Client.Common * Why use this, when each core has it's own Async sound output? * * It is true that each emulation core provides its own async sound output, either through directly - * rendering to arbitrary buffers (pce not turbocd, sms), or using one of the metaspus (nes, turbocd). + * rendering to arbitrary buffers (pce not TurboCD, sms), or using one of the metaspus (nes, TurboCD). * * Unfortunately, the vecna metaspu is not perfect, and for maintaining near-realtime playback (the usual * situation which we want to optimize for), it simply sounds better with a BufferedAsync on top of it. diff --git a/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs index cb98c5a29a..ddda6f1698 100644 --- a/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs @@ -47,7 +47,7 @@ namespace BizHawk.Client.Common.cheats }; - private IDecodeResult GameBoy(string code) + private static IDecodeResult GameBoy(string code) { // Game Genie if (code.LastIndexOf("-") == 7 && code.IndexOf("-") == 3) @@ -65,7 +65,7 @@ namespace BizHawk.Client.Common.cheats return new InvalidCheatCode($"Unknown code type: {code}"); } - private IDecodeResult Gba(string code) + private static IDecodeResult Gba(string code) { if (code.Length == 12) { @@ -75,7 +75,7 @@ namespace BizHawk.Client.Common.cheats return GbaGameSharkDecoder.Decode(code); } - private IDecodeResult Gen(string code) + private static IDecodeResult Gen(string code) { // Game Genie only if (code.Length == 9 && code.Contains("-")) @@ -99,15 +99,15 @@ namespace BizHawk.Client.Common.cheats return new InvalidCheatCode($"Unknown code type: {code}"); } - private IDecodeResult N64(string code) => N64GameSharkDecoder.Decode(code); + private static IDecodeResult N64(string code) => N64GameSharkDecoder.Decode(code); - private IDecodeResult Nes(string code) => NesGameGenieDecoder.Decode(code); + private static IDecodeResult Nes(string code) => NesGameGenieDecoder.Decode(code); - private IDecodeResult Psx(string code) => PsxGameSharkDecoder.Decode(code); + private static IDecodeResult Psx(string code) => PsxGameSharkDecoder.Decode(code); - private IDecodeResult Saturn(string code) => SaturnGameSharkDecoder.Decode(code); + private static IDecodeResult Saturn(string code) => SaturnGameSharkDecoder.Decode(code); - private IDecodeResult Sms(string code) + private static IDecodeResult Sms(string code) { // Game Genie if (code.LastIndexOf("-") == 7 && code.IndexOf("-") == 3) @@ -124,7 +124,7 @@ namespace BizHawk.Client.Common.cheats return new InvalidCheatCode($"Unknown code type: {code}"); } - private IDecodeResult Snes(string code) + private static IDecodeResult Snes(string code) { if (code.Contains("-") && code.Length == 9) { diff --git a/src/BizHawk.Client.Common/input/DistinctKey.cs b/src/BizHawk.Client.Common/input/DistinctKey.cs index c02e549bf9..6b6dc1f6d4 100644 --- a/src/BizHawk.Client.Common/input/DistinctKey.cs +++ b/src/BizHawk.Client.Common/input/DistinctKey.cs @@ -1,5 +1,8 @@ #nullable enable +// ReSharper disable CommentTypo +// ReSharper disable IdentifierTypo +// ReSharper disable UnusedMember.Global namespace BizHawk.Client.Common { /// values are one-to-one with System.Windows.Input.Key except and which were added for this project diff --git a/src/BizHawk.Client.Common/input/HostInputAdapter.cs b/src/BizHawk.Client.Common/input/HostInputAdapter.cs index d3b635af4a..f02b915852 100644 --- a/src/BizHawk.Client.Common/input/HostInputAdapter.cs +++ b/src/BizHawk.Client.Common/input/HostInputAdapter.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace BizHawk.Client.Common { /// this was easier than trying to make static classes instantiable... - public interface HostInputAdapter + public interface IHostInputAdapter { void DeInitAll(); diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/CommLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/CommLuaLibrary.cs index 7601789c20..ce605cb614 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/CommLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/CommLuaLibrary.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Net.WebSockets; using System.Text; namespace BizHawk.Client.Common diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/GuiLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/GuiLuaLibrary.cs index 95e9ee5053..77ae56fc8b 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/GuiLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/GuiLuaLibrary.cs @@ -48,7 +48,7 @@ namespace BizHawk.Client.Common public void SetDefaultBackgroundColor(Color color) => APIs.Gui.SetDefaultBackgroundColor(color); [LuaMethodExample("gui.defaultTextBackground( 0x000000FF );")] - [LuaMethod("defaultTextBackground", "Sets the default backgroiund color to use in text drawing methods, half-transparent black by default")] + [LuaMethod("defaultTextBackground", "Sets the default background color to use in text drawing methods, half-transparent black by default")] public void SetDefaultTextBackground(Color color) => APIs.Gui.SetDefaultTextBackground(color); [LuaMethodExample("gui.defaultPixelFont( \"Arial Narrow\");")] diff --git a/src/BizHawk.Client.Common/movie/MovieSession.cs b/src/BizHawk.Client.Common/movie/MovieSession.cs index fb6cb86a33..9841d4f49a 100644 --- a/src/BizHawk.Client.Common/movie/MovieSession.cs +++ b/src/BizHawk.Client.Common/movie/MovieSession.cs @@ -209,20 +209,17 @@ namespace BizHawk.Client.Common { if (string.IsNullOrWhiteSpace(movie.Core)) { - if (preferredCores.TryGetValue(systemId, out var coreName)) - { - PopupMessage($"No core specified in the movie file, using the preferred core {preferredCores[systemId]} instead."); - } - else - { - PopupMessage($"No core specified in the movie file, using the default core instead."); - } + PopupMessage(preferredCores.TryGetValue(systemId, out _) + ? $"No core specified in the movie file, using the preferred core {preferredCores[systemId]} instead." + : "No core specified in the movie file, using the default core instead."); } else { var keys = preferredCores.Keys.ToList(); foreach (var k in keys) + { preferredCores[k] = movie.Core; + } } } diff --git a/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs b/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs index 4a3198c955..4b632e57d3 100644 --- a/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs +++ b/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs @@ -23,18 +23,18 @@ namespace BizHawk.Client.Common ["SNES_PAL"] = 21281370.0 / (4 * 341 * 312), // 50.0069789082 ["SGB"] = 21477272.0 / (4 * 341 * 262), // 60.098475521 ["SGB_PAL"] = 21281370.0 / (4 * 341 * 312), // 50.0069789082 - ["PCE"] = (7159090.90909090 / 455 / 263), // 59.8261054535 - ["PCECD"] = (7159090.90909090 / 455 / 263), // 59.8261054535 - ["SMS"] = (3579545 / 262.0 / 228.0), // 59.9227434043 - ["SMS_PAL"] = (3546893 / 313.0 / 228.0), // 49.7014320946 - ["GG"] = (3579545 / 262.0 / 228.0), // 59.9227434043 - ["GG_PAL"] = (3546893 / 313.0 / 228.0), // 49.7014320946 - ["SG"] = (3579545 / 262.0 / 228.0), // 59.9227434043 - ["SG_PAL"] = (3546893 / 313.0 / 228.0), // 49.7014320946 - ["NGP"] = (6144000.0 / (515 * 198)), // 60.2530155928 - ["VB"] = (20000000.0 / (259 * 384 * 4)), // 50.2734877735 + ["PCE"] = 7159090.90909090 / 455 / 263, // 59.8261054535 + ["PCECD"] = 7159090.90909090 / 455 / 263, // 59.8261054535 + ["SMS"] = 3579545 / 262.0 / 228.0, // 59.9227434043 + ["SMS_PAL"] = 3546893 / 313.0 / 228.0, // 49.7014320946 + ["GG"] = 3579545 / 262.0 / 228.0, // 59.9227434043 + ["GG_PAL"] = 3546893 / 313.0 / 228.0, // 49.7014320946 + ["SG"] = 3579545 / 262.0 / 228.0, // 59.9227434043 + ["SG_PAL"] = 3546893 / 313.0 / 228.0, // 49.7014320946 + ["NGP"] = 6144000.0 / (515 * 198), // 60.2530155928 + ["VB"] = 20000000.0 / (259 * 384 * 4), // 50.2734877735 ["Lynx"] = 16000000.0 / (16 * 105 * 159), // 59.89817310572028 - ["WSWAN"] = (3072000.0 / (159 * 256)), // 75.4716981132 + ["WSWAN"] = 3072000.0 / (159 * 256), // 75.4716981132 ["GB"] = 262144.0 / 4389.0, // 59.7275005696 ["GBC"] = 262144.0 / 4389.0, // 59.7275005696 diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs index d801642ea9..d77c751241 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs @@ -95,7 +95,7 @@ namespace BizHawk.Client.Common } } - private void CreateDirectoryIfNotExists(string fn) + private static void CreateDirectoryIfNotExists(string fn) { var file = new FileInfo(fn); if (file.Directory != null && !file.Directory.Exists) diff --git a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManagerSettings.cs b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManagerSettings.cs index 0bb879bb58..8d0abb11d9 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManagerSettings.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManagerSettings.cs @@ -83,7 +83,7 @@ namespace BizHawk.Client.Common // Just to simplify some other code. public RewindConfig Current() { - return new RewindConfig() + return new RewindConfig { UseCompression = CurrentUseCompression, BufferSize = CurrentBufferSize, @@ -92,7 +92,7 @@ namespace BizHawk.Client.Common } public RewindConfig Recent() { - return new RewindConfig() + return new RewindConfig { UseCompression = RecentUseCompression, BufferSize = RecentBufferSize, @@ -101,7 +101,7 @@ namespace BizHawk.Client.Common } public RewindConfig GapFiller() { - return new RewindConfig() + return new RewindConfig { UseCompression = GapsUseCompression, BufferSize = GapsBufferSize, diff --git a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs index 3f0a421677..5fcd0c59f0 100644 --- a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs +++ b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.IO.Compression; -using System.Runtime.InteropServices; using BizHawk.BizInvoke; using BizHawk.Common; diff --git a/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs b/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs index d12a07ef8b..372901b926 100644 --- a/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs +++ b/src/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs @@ -5,7 +5,6 @@ using System.Globalization; using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; using BizHawk.Emulation.Common; diff --git a/src/BizHawk.Client.EmuHawk/Input/Input.cs b/src/BizHawk.Client.EmuHawk/Input/Input.cs index 847f6ea68f..6b0eef135c 100644 --- a/src/BizHawk.Client.EmuHawk/Input/Input.cs +++ b/src/BizHawk.Client.EmuHawk/Input/Input.cs @@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk private readonly Thread _updateThread; - public readonly HostInputAdapter Adapter; + public readonly IHostInputAdapter Adapter; private readonly Func _getConfigCallback; diff --git a/src/BizHawk.Client.EmuHawk/Input/OpenTKInputAdapter.cs b/src/BizHawk.Client.EmuHawk/Input/OpenTKInputAdapter.cs index 18e8202183..dfb15db9db 100644 --- a/src/BizHawk.Client.EmuHawk/Input/OpenTKInputAdapter.cs +++ b/src/BizHawk.Client.EmuHawk/Input/OpenTKInputAdapter.cs @@ -7,7 +7,7 @@ using BizHawk.Client.Common; namespace BizHawk.Client.EmuHawk { - public sealed class OpenTKInputAdapter : HostInputAdapter + public sealed class OpenTKInputAdapter : IHostInputAdapter { public void DeInitAll() {}