diff --git a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs index c70228b197..f6cefb42de 100644 --- a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs +++ b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs @@ -104,9 +104,8 @@ namespace BizHawk.Emulation.Cores.Components.M6502 }; } - int length; string rawbytes = ""; - string disasm = Disassemble(PC, out length); + string disasm = Disassemble(PC, out var length); for (int i = 0; i < length; i++) { diff --git a/BizHawk.Emulation.Cores/Computers/AmstradCPC/SoundProviderMixer.cs b/BizHawk.Emulation.Cores/Computers/AmstradCPC/SoundProviderMixer.cs index 246e625374..53216dc24b 100644 --- a/BizHawk.Emulation.Cores/Computers/AmstradCPC/SoundProviderMixer.cs +++ b/BizHawk.Emulation.Cores/Computers/AmstradCPC/SoundProviderMixer.cs @@ -144,9 +144,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // get samples from all the providers foreach (var sp in SoundProviders) { - int sampCount; - short[] samp; - sp.SoundProvider.GetSamplesSync(out samp, out sampCount); + sp.SoundProvider.GetSamplesSync(out var samp, out var sampCount); sp.NSamp = sampCount; sp.Buffer = samp; } diff --git a/BizHawk.Emulation.Cores/Computers/AppleII/LBSON.cs b/BizHawk.Emulation.Cores/Computers/AppleII/LBSON.cs index c59c7d0c03..d2895b8802 100644 --- a/BizHawk.Emulation.Cores/Computers/AppleII/LBSON.cs +++ b/BizHawk.Emulation.Cores/Computers/AppleII/LBSON.cs @@ -132,8 +132,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII case JsonToken.Float: return Convert.ToInt32(_v); case JsonToken.String: - int i; - if (int.TryParse(_v.ToString(), out i)) + if (int.TryParse(_v.ToString(), out var i)) { return i; } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Media/D64.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Media/D64.cs index 42fdfe16a1..a4e60bf1a0 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Media/D64.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Media/D64.cs @@ -222,9 +222,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media using var trackMem = new MemoryStream(); for (var j = 0; j < sectors; j++) { - int bitsWritten; var sectorData = reader.ReadBytes(256); - var diskData = ConvertSectorToGcr(sectorData, (byte)j, (byte)(i + 1), formatA, formatB, StandardSectorGapLength[DensityTable[i]], errorType, out bitsWritten); + var diskData = ConvertSectorToGcr(sectorData, (byte)j, (byte)(i + 1), formatA, formatB, StandardSectorGapLength[DensityTable[i]], errorType, out var bitsWritten); trackMem.Write(diskData, 0, diskData.Length); trackLengthBits += bitsWritten; } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs index 4592226767..3d762ce92d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs @@ -155,8 +155,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk // if such a game is being played, tell the user and disable it if (dict.ContainsKey("No_HS")) { - bool no_hs; - bool.TryParse(dict["No_HS"], out no_hs); + bool.TryParse(dict["No_HS"], out var no_hs); if (no_hs) { diff --git a/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/TstControllerDeck.cs b/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/TstControllerDeck.cs index 790d01ffeb..b5a03c1e43 100644 --- a/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/TstControllerDeck.cs +++ b/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/TstControllerDeck.cs @@ -39,10 +39,9 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCFX } }).ToArray(); - List tmp; Definition = ControllerDefinitionMerger.GetMerged( _devices.Select(d => d.Definition), - out tmp); + out var tmp); _cdums = tmp.ToArray(); Definition.Name = "PC-FX Controller"; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs index c1c0d30f20..f2c3287784 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs @@ -619,20 +619,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x public void GetSamplesSync(out short[] samples, out int nsamp) { - short[] temp_samp_A; - short[] temp_samp_B; - short[] temp_samp_C; - short[] temp_samp_D; - - int nsamp_A; - int nsamp_B; - int nsamp_C; - int nsamp_D; - - A.audio.GetSamplesSync(out temp_samp_A, out nsamp_A); - B.audio.GetSamplesSync(out temp_samp_B, out nsamp_B); - C.audio.GetSamplesSync(out temp_samp_C, out nsamp_C); - D.audio.GetSamplesSync(out temp_samp_D, out nsamp_D); + A.audio.GetSamplesSync(out var temp_samp_A, out var nsamp_A); + B.audio.GetSamplesSync(out short[] temp_samp_B, out var nsamp_B); + C.audio.GetSamplesSync(out var temp_samp_C, out var nsamp_C); + D.audio.GetSamplesSync(out var temp_samp_D, out var nsamp_D); if (Link4xSettings.AudioSet == GBLink4xSettings.AudioSrc.A) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GBDisassembler.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GBDisassembler.cs index c384134e12..079a7c5f67 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GBDisassembler.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GBDisassembler.cs @@ -16,8 +16,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy public override string Disassemble(MemoryDomain m, uint addr, out int length) { - ushort tmp; - string ret = LR35902.Disassemble((ushort)addr, a => m.PeekByte(a), out tmp); + string ret = LR35902.Disassemble((ushort)addr, a => m.PeekByte(a), out var tmp); length = tmp; return ret; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs index 77386f09d2..12a120e750 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs @@ -1007,8 +1007,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi public void DetachPlugin(m64p_plugin_type type) { - AttachedPlugin plugin; - if (plugins.TryGetValue(type, out plugin)) + if (plugins.TryGetValue(type, out var plugin)) { plugins.Remove(type); m64pCoreDetachPlugin(type); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/DatachBarcode.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/DatachBarcode.cs index 59b2730990..39cf00ca5f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/DatachBarcode.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/DatachBarcode.cs @@ -107,8 +107,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public void Transfer(string s) { - string why; - if (!ValidString(s, out why)) + if (!ValidString(s, out var why)) throw new InvalidOperationException(why); Reset(); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs index ff555d35d4..3745af4ee0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs @@ -438,10 +438,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public override byte ReadPRG(int addr) { - bool ram; byte ret; int offs = addr & 0x1fff; - int bank = PRGGetBank(addr, out ram); + int bank = PRGGetBank(addr, out var ram); if (ram) ret = ReadWRAMActual(bank, offs); @@ -463,10 +462,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public byte PeekPRG(int addr) { - bool ram; byte ret; int offs = addr & 0x1fff; - int bank = PRGGetBank(addr, out ram); + int bank = PRGGetBank(addr, out var ram); if (ram) ret = ReadWRAMActual(bank, offs); @@ -479,8 +477,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public override void WritePRG(int addr, byte value) { - bool ram; - int bank = PRGGetBank(addr, out ram); + int bank = PRGGetBank(addr, out var ram); if (ram) WriteWRAMActual(bank, addr & 0x1fff, value); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs index 7af7b11b12..39c7684fe0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs @@ -781,8 +781,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { string Name = ((MapperPropAttribute)attrib).Name ?? field.Name; - string Value; - if (board.InitialRegisterValues.TryGetValue(Name, out Value)) + if (board.InitialRegisterValues.TryGetValue(Name, out var Value)) { try { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs index 63ed46dc4c..76c0eda438 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs @@ -138,8 +138,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { this.Left = Left; this.Right = Right; - List cdum; - Definition = ControllerDefinitionMerger.GetMerged(new[] { Left.GetDefinition(), Right.GetDefinition() }, out cdum); + Definition = ControllerDefinitionMerger.GetMerged(new[] { Left.GetDefinition(), Right.GetDefinition() }, out var cdum); LeftU = cdum[0]; RightU = cdum[1]; @@ -684,9 +683,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public FamicomDeck(IFamicomExpansion ExpSlot, LightgunDelegate PPUCallback) { Player3 = ExpSlot; - List cdum; Definition = ControllerDefinitionMerger.GetMerged( - new[] { Player1.GetDefinition(), Player2.GetDefinition(), Player3.GetDefinition() }, out cdum); + new[] { Player1.GetDefinition(), Player2.GetDefinition(), Player3.GetDefinition() }, out var cdum); Definition.BoolButtons.Add("P2 Microphone"); Player1U = cdum[0]; Player2U = cdum[1]; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs index c9b66f13c3..c9aaa083f4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs @@ -23,8 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void TryAdd(Stream s, string key) { - byte[] data; - if (!chunks.TryGetValue(key, out data)) + if (!chunks.TryGetValue(key, out var data)) return; s.Write(data, 0, data.Length); } @@ -64,9 +63,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ci.prg_size = (short)(prgrom.Length / 1024); ci.chr_size = (short)(chrrom.Length / 1024); - byte[] tmp; - - if (chunks.TryGetValue("MIRR", out tmp)) + if (chunks.TryGetValue("MIRR", out var tmp)) { switch (tmp[0]) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/Nes_NTSC_Colors.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/Nes_NTSC_Colors.cs index c5036880d2..0c041c3280 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/Nes_NTSC_Colors.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/Nes_NTSC_Colors.cs @@ -55,8 +55,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES float g = to_float * inp[1]; float b = to_float * inp[2]; - float y, i, q; - RGB_TO_YIQ(r, g, b, out y, out i, out q); + RGB_TO_YIQ(r, g, b, out float y, out var i, out var q); if (tint > 0 && color < 0x0d) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs index 2a9129567b..5df6d37396 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs @@ -203,8 +203,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES if (controller.IsPressed("Reset")) QN.qn_reset(Context, false); - int j1, j2; - SetPads(controller, out j1, out j2); + SetPads(controller, out var j1, out var j2); if (Tracer.Enabled) QN.qn_set_tracecb(Context, _traceCb); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_QUERY.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_QUERY.cs index a68a11879e..111dd8f0d3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_QUERY.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_QUERY.cs @@ -29,8 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES public byte* QUERY_get_memory_data(SNES_MEMORY id) { string name = QUERY_MemoryNameForId(id); - IntPtr ret; - _sharedMemoryBlocks.TryGetValue(name, out ret); + _sharedMemoryBlocks.TryGetValue(name, out var ret); return (byte*)ret; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesControllerDeck.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesControllerDeck.cs index ee305fa527..f878fb43b8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesControllerDeck.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesControllerDeck.cs @@ -59,8 +59,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES Factory(ss.RightPort, ss) }; - List tmp; - Definition = ControllerDefinitionMerger.GetMerged(_ports.Select(p => p.Definition), out tmp); + Definition = ControllerDefinitionMerger.GetMerged(_ports.Select(p => p.Definition), out var tmp); _mergers = tmp.ToArray(); // add buttons that the core itself will handle diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs index c1cdcdca1a..48d6b8210a 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs @@ -552,8 +552,7 @@ namespace BizHawk.Emulation.Cores.PCEngine // zero 07-jul-2015 - I may have broken this int totalLbaLength = disc.Session1.LeadoutLBA; - byte m, s, f; - DiscUtils.Convert_LBA_To_AMSF(totalLbaLength + 150, out m, out s, out f); + DiscUtils.Convert_LBA_To_AMSF(totalLbaLength + 150, out var m, out var s, out var f); DataIn.Clear(); DataIn.Enqueue(m.BinToBCD()); @@ -577,8 +576,7 @@ namespace BizHawk.Emulation.Cores.PCEngine else lbaPos = tracks[track].LBA; - byte m, s, f; - DiscUtils.Convert_LBA_To_AMSF(lbaPos, out m, out s, out f); + DiscUtils.Convert_LBA_To_AMSF(lbaPos, out var m, out var s, out var f); DataIn.Clear(); DataIn.Enqueue(m.BinToBCD()); diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs index 185d4f81f6..f745815fe7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs @@ -352,11 +352,8 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink short[] temp_samp_L = new short[735 * 2]; short[] temp_samp_R = new short[735 * 2]; - int nsamp_L = 735; - int nsamp_R = 735; - - L.GetSamplesSync(out temp_samp_L, out nsamp_L); - R.GetSamplesSync(out temp_samp_R, out nsamp_L); + L.GetSamplesSync(out temp_samp_L, out int nsamp_L); + R.GetSamplesSync(out temp_samp_R, out int nsamp_R); if (linkSettings.AudioSet == GGLinkSettings.AudioSrc.Left) { diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/SaturnusControllerDeck.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/SaturnusControllerDeck.cs index 3b9fa7f694..176b5cf8ab 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/SaturnusControllerDeck.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/SaturnusControllerDeck.cs @@ -49,9 +49,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn .ToArray(); _data = new byte[count * DataSize]; - List cdum; Definition = ControllerDefinitionMerger.GetMerged(_devices.Select(d => d.Definition), - out cdum); + out var cdum); _unmerger = cdum.ToArray(); } diff --git a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs index e468c90680..df77bef0ea 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs @@ -90,8 +90,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX if (discInterfaces.Count != 0) { //determine region of one of the discs - OctoshockDll.ShockDiscInfo discInfo; - OctoshockDll.shock_AnalyzeDisc(discInterfaces[0].OctoshockHandle, out discInfo); + OctoshockDll.shock_AnalyzeDisc(discInterfaces[0].OctoshockHandle, out var discInfo); //try to acquire the appropriate firmware if (discInfo.region == OctoshockDll.eRegion.EU) firmwareRegion = "E"; @@ -928,10 +927,8 @@ namespace BizHawk.Emulation.Cores.Sony.PSX unsafe void SetMemoryDomains() { var mmd = new List(); - IntPtr ptr; - int size; - OctoshockDll.shock_GetMemData(psx, out ptr, out size, OctoshockDll.eMemType.MainRAM); + OctoshockDll.shock_GetMemData(psx, out var ptr, out var size, OctoshockDll.eMemType.MainRAM); mmd.Add(new MemoryDomainIntPtr("MainRAM", MemoryDomain.Endian.Little, ptr, size, true, 4)); OctoshockDll.shock_GetMemData(psx, out ptr, out size, OctoshockDll.eMemType.GPURAM); diff --git a/BizHawk.Emulation.Cores/FileID.cs b/BizHawk.Emulation.Cores/FileID.cs index 9a4511a2e0..773b5a50f7 100644 --- a/BizHawk.Emulation.Cores/FileID.cs +++ b/BizHawk.Emulation.Cores/FileID.cs @@ -167,8 +167,7 @@ namespace BizHawk.Emulation.Cores if(job.Extension != null) { //first test everything associated with this extension - ExtensionInfo handler = null; - if (ExtensionHandlers.TryGetValue(ext, out handler)) + if (ExtensionHandlers.TryGetValue(ext, out var handler)) { foreach (var del in handler.Testers) { diff --git a/BizHawk.Emulation.Cores/Sound/DualSyncSound.cs b/BizHawk.Emulation.Cores/Sound/DualSyncSound.cs index 25a37a607b..7cd8d9801a 100644 --- a/BizHawk.Emulation.Cores/Sound/DualSyncSound.cs +++ b/BizHawk.Emulation.Cores/Sound/DualSyncSound.cs @@ -37,10 +37,8 @@ namespace BizHawk.Emulation.Cores.Sound public void Fetch() { - int nsampl, nsampr; - short[] sampl, sampr; - _left.GetSamplesSync(out sampl, out nsampl); - _right.GetSamplesSync(out sampr, out nsampr); + _left.GetSamplesSync(out var sampl, out int nsampl); + _right.GetSamplesSync(out var sampr, out var nsampr); int n = Math.Min(nsampl + _leftOverflowCount, nsampr + _rightOverflowCount); diff --git a/BizHawk.Emulation.Cores/Sound/YM2612.cs b/BizHawk.Emulation.Cores/Sound/YM2612.cs index a880d1a7c0..e73196ba09 100644 --- a/BizHawk.Emulation.Cores/Sound/YM2612.cs +++ b/BizHawk.Emulation.Cores/Sound/YM2612.cs @@ -183,8 +183,7 @@ namespace BizHawk.Emulation.Cores.Components void Part1_WriteRegister(byte register, byte value) { - int chan, oper; - GetChanOpP1(register, out chan, out oper); + GetChanOpP1(register, out var chan, out var oper); switch (register & 0xF0) { @@ -203,8 +202,7 @@ namespace BizHawk.Emulation.Cores.Components void Part2_WriteRegister(byte register, byte value) { - int chan, oper; - GetChanOpP2(register, out chan, out oper); + GetChanOpP2(register, out var chan, out var oper); switch (register & 0xF0) { diff --git a/BizHawk.Emulation.Cores/Waterbox/PeRunner.cs b/BizHawk.Emulation.Cores/Waterbox/PeRunner.cs index f598a1029c..8b7a31e312 100644 --- a/BizHawk.Emulation.Cores/Waterbox/PeRunner.cs +++ b/BizHawk.Emulation.Cores/Waterbox/PeRunner.cs @@ -511,8 +511,7 @@ namespace BizHawk.Emulation.Cores.Waterbox [BizExport(CallingConvention.Cdecl, EntryPoint = "n2")] public int Open(string path, int flags, int mode) { - IFileObject o; - if (!_availableFiles.TryGetValue(path, out o)) + if (!_availableFiles.TryGetValue(path, out var o)) return -1; if (_openFiles.Contains(o)) return -1; @@ -760,8 +759,7 @@ namespace BizHawk.Emulation.Cores.Waterbox private T RemoveFileInternal(string name) where T : IFileObject { - IFileObject o; - if (!_availableFiles.TryGetValue(name, out o)) + if (!_availableFiles.TryGetValue(name, out var o)) throw new InvalidOperationException("File was never registered!"); if (o.GetType() != typeof(T)) throw new InvalidOperationException("Object was not a the right kind of file"); @@ -1107,8 +1105,7 @@ namespace BizHawk.Emulation.Cores.Waterbox // but it breaks xor state verification, so when we seal, nuke it. // this could be the responsibility of something else other than the PeRunner; I am not sure yet... - IImportResolver libco; - if (_exports.TryGetValue("libco.so", out libco)) + if (_exports.TryGetValue("libco.so", out var libco)) { Console.WriteLine("Calling co_clean()..."); CallingConventionAdapters.Waterbox.GetDelegateForFunctionPointer(libco.GetProcAddrOrThrow("co_clean"))(); diff --git a/BizHawk.Emulation.Cores/Waterbox/PeWrapper.cs b/BizHawk.Emulation.Cores/Waterbox/PeWrapper.cs index e8969ae523..9bb0200f75 100644 --- a/BizHawk.Emulation.Cores/Waterbox/PeWrapper.cs +++ b/BizHawk.Emulation.Cores/Waterbox/PeWrapper.cs @@ -247,8 +247,7 @@ namespace BizHawk.Emulation.Cores.Waterbox // NB: Hints are not the same as Ordinals foreach (var import in _pe.ImportedFunctions) { - Dictionary module; - if (!ImportsByModule.TryGetValue(import.DLL, out module)) + if (!ImportsByModule.TryGetValue(import.DLL, out var module)) { module = new Dictionary(); ImportsByModule.Add(import.DLL, module); @@ -260,8 +259,7 @@ namespace BizHawk.Emulation.Cores.Waterbox module.Add(import.Name, Z.US(dest)); } - Section midipix; - if (_sectionsByName.TryGetValue(".midipix", out midipix)) + if (_sectionsByName.TryGetValue(".midipix", out Section midipix)) { var dataOffset = midipix.DiskStart; CtorList = Z.SS(BitConverter.ToInt64(fileData, (int)(dataOffset + 0x30)) + LoadOffset); @@ -313,8 +311,7 @@ namespace BizHawk.Emulation.Cores.Waterbox if (_everythingSealed && _imports != null) Memory.Protect(_imports.Start, _imports.Size, MemoryBlockBase.Protection.RW); - Dictionary imports; - if (ImportsByModule.TryGetValue(moduleName, out imports)) + if (ImportsByModule.TryGetValue(moduleName, out var imports)) { foreach (var kvp in imports) {