From 28498da7c1ca0b074f33827a21c0df6fcc569e95 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 16 Mar 2025 19:53:27 +1000 Subject: [PATCH] Fix mixed line endings in main solution --- src/BizHawk.Client.Common/Api/SocketServer.cs | 44 +++++----- src/BizHawk.Client.Common/BreakpointList.cs | 4 +- .../savestates/ZipStateSaver.cs | 16 ++-- .../CustomControls/ExceptionBox.designer.cs | 84 +++++++++---------- src/BizHawk.Common/IMonitor.cs | 16 ++-- src/BizHawk.Common/checksums/LibBizHash.cs | 18 ++-- .../Base Implementations/Bk2MnemonicLookup.cs | 36 ++++---- .../Computers/Doom/DSDA.ISoundProvider.cs | 6 +- .../Computers/Doom/DSDA.IVideoProvider.cs | 16 ++-- .../Computers/MSX/MSX.cs | 4 +- .../Nintendo/NES/Boards/NesBoardBase.cs | 24 +++--- 11 files changed, 134 insertions(+), 134 deletions(-) diff --git a/src/BizHawk.Client.Common/Api/SocketServer.cs b/src/BizHawk.Client.Common/Api/SocketServer.cs index b3fb8e0df8..6aed56d0d5 100644 --- a/src/BizHawk.Client.Common/Api/SocketServer.cs +++ b/src/BizHawk.Client.Common/Api/SocketServer.cs @@ -98,40 +98,40 @@ namespace BizHawk.Client.Common var myencoding = encoding ?? Encoding.UTF8; - try - { - //build length of string into a string - byte[] oneByte = new byte[1]; + try + { + //build length of string into a string + byte[] oneByte = new byte[1]; StringBuilder sb = new StringBuilder(); - for (; ; ) - { - int recvd = _soc.Receive(oneByte, 1, 0); - if (oneByte[0] == (byte)' ') - break; - sb.Append((char)oneByte[0]); - } - - //receive string of indicated length + for (; ; ) + { + int recvd = _soc.Receive(oneByte, 1, 0); + if (oneByte[0] == (byte)' ') + break; + sb.Append((char)oneByte[0]); + } + + //receive string of indicated length int lenStringBytes = int.Parse(sb.ToString()); byte[] buf = new byte[lenStringBytes]; int todo = lenStringBytes; int at = 0; - for (; ; ) + for (; ; ) { int recvd = _soc.Receive(buf, at, todo, SocketFlags.None); if (recvd == 0) throw new InvalidOperationException("ReceiveString terminated early"); - todo -= recvd; - at += recvd; - if (todo == 0) - break; + todo -= recvd; + at += recvd; + if (todo == 0) + break; } - return myencoding.GetString(buf, 0, lenStringBytes); + return myencoding.GetString(buf, 0, lenStringBytes); } catch - { - //not sure I like this, but that's how it was - return ""; + { + //not sure I like this, but that's how it was + return ""; } } diff --git a/src/BizHawk.Client.Common/BreakpointList.cs b/src/BizHawk.Client.Common/BreakpointList.cs index 3b135b3ffb..e9f3eb1014 100644 --- a/src/BizHawk.Client.Common/BreakpointList.cs +++ b/src/BizHawk.Client.Common/BreakpointList.cs @@ -164,8 +164,8 @@ namespace BizHawk.Client.Common private void RemoveCallback() { _core.MemoryCallbacks.Remove(DoCallback); - } - + } + private void DoCallback(uint address, uint value, uint flags) => Callback(address, value, flags); diff --git a/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs b/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs index 7cd3db218b..92b5cbb8aa 100644 --- a/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs +++ b/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs @@ -23,12 +23,12 @@ namespace BizHawk.Client.Common public ZipStateSaver(string path, int compressionLevel) { - _zip = new FrameworkZipWriter(path, compressionLevel); - - // we put these in every zip, so we know where they came from - // a bit redundant for movie files given their headers, but w/e + _zip = new FrameworkZipWriter(path, compressionLevel); + + // we put these in every zip, so we know where they came from + // a bit redundant for movie files given their headers, but w/e PutLump(BinaryStateLump.ZipVersion, WriteZipVersion, false); - PutLump(BinaryStateLump.BizVersion, WriteEmuVersion, false); + PutLump(BinaryStateLump.BizVersion, WriteEmuVersion, false); } public void PutLump(BinaryStateLump lump, Action callback, bool zstdCompress = true) @@ -39,9 +39,9 @@ namespace BizHawk.Client.Common public void PutLump(BinaryStateLump lump, Action callback) { PutLump(lump, s => - { - var bw = new BinaryWriter(s); - callback(bw); + { + var bw = new BinaryWriter(s); + callback(bw); bw.Flush(); }); } diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.designer.cs b/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.designer.cs index ef2d4b1260..dedfe7c8c4 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.designer.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.designer.cs @@ -1,33 +1,33 @@ -namespace BizHawk.Client.EmuHawk -{ - partial class ExceptionBox - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { +namespace BizHawk.Client.EmuHawk +{ + partial class ExceptionBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { this.components = new System.ComponentModel.Container(); this.btnOK = new System.Windows.Forms.Button(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); @@ -134,16 +134,16 @@ this.flowLayoutPanel1.PerformLayout(); this.ResumeLayout(false); - } - - #endregion - - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.TextBox txtException; - private System.Windows.Forms.Timer timer1; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; - private System.Windows.Forms.Button btnCopy; - private ExceptionBox.MyLabel lblDone; - } + } + + #endregion + + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.TextBox txtException; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.Button btnCopy; + private ExceptionBox.MyLabel lblDone; + } } \ No newline at end of file diff --git a/src/BizHawk.Common/IMonitor.cs b/src/BizHawk.Common/IMonitor.cs index 8e54fd9405..48f3c793d5 100644 --- a/src/BizHawk.Common/IMonitor.cs +++ b/src/BizHawk.Common/IMonitor.cs @@ -13,15 +13,15 @@ => new(m); public readonly ref struct EnterExitWrapper - { - // yes, this can be null - private readonly IMonitor? _m; - - // disallow public construction outside of EnterExit extension + { + // yes, this can be null + private readonly IMonitor? _m; + + // disallow public construction outside of EnterExit extension internal EnterExitWrapper(IMonitor? m) - { - _m = m; - _m?.Enter(); + { + _m = m; + _m?.Enter(); } public void Dispose() diff --git a/src/BizHawk.Common/checksums/LibBizHash.cs b/src/BizHawk.Common/checksums/LibBizHash.cs index 3bd9051418..aad0aeb0de 100644 --- a/src/BizHawk.Common/checksums/LibBizHash.cs +++ b/src/BizHawk.Common/checksums/LibBizHash.cs @@ -3,18 +3,18 @@ using System.Runtime.InteropServices; namespace BizHawk.Common { public static class LibBizHash - { - private const CallingConvention cc = CallingConvention.Cdecl; - - [UnmanagedFunctionPointer(cc)] - public delegate uint CalcCRC(uint current, IntPtr buffer, int len); + { + private const CallingConvention cc = CallingConvention.Cdecl; + + [UnmanagedFunctionPointer(cc)] + public delegate uint CalcCRC(uint current, IntPtr buffer, int len); [DllImport("libbizhash", CallingConvention = cc)] - public static extern IntPtr BizCalcCrcFunc(); - + public static extern IntPtr BizCalcCrcFunc(); + [DllImport("libbizhash", CallingConvention = cc)] - public static extern bool BizSupportsShaInstructions(); - + public static extern bool BizSupportsShaInstructions(); + [DllImport("libbizhash", CallingConvention = cc)] public static extern void BizCalcSha1(IntPtr state, byte[] data, int len); } diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs b/src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs index 89984cc29e..dbad2bdbe3 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs @@ -817,26 +817,26 @@ namespace BizHawk.Emulation.Common ["HOLD"] = 'H', ["START"] = 'S', ["RESET"] = 'r', - }, + }, [VSystemID.Raw.Doom] = new() - { + { ["Backward"] = 'v', - ["End Player"] = 'E', - ["Fire"] = 'F', + ["End Player"] = 'E', + ["Fire"] = 'F', ["Forward"] = '^', - ["Jump"] = 'J', - ["Run"] = 'R', - ["Strafe Left"] = '<', - ["Strafe Right"] = '>', - ["Turn Left"] = 'l', - ["Turn Right"] = 'r', - ["Use"] = 'U', - ["Weapon Select 1"] = '1', - ["Weapon Select 2"] = '2', - ["Weapon Select 3"] = '3', - ["Weapon Select 4"] = '4', - ["Weapon Select 5"] = '5', - ["Weapon Select 6"] = '6', + ["Jump"] = 'J', + ["Run"] = 'R', + ["Strafe Left"] = '<', + ["Strafe Right"] = '>', + ["Turn Left"] = 'l', + ["Turn Right"] = 'r', + ["Use"] = 'U', + ["Weapon Select 1"] = '1', + ["Weapon Select 2"] = '2', + ["Weapon Select 3"] = '3', + ["Weapon Select 4"] = '4', + ["Weapon Select 5"] = '5', + ["Weapon Select 6"] = '6', ["Weapon Select 7"] = '7', }, }; @@ -888,7 +888,7 @@ namespace BizHawk.Emulation.Common ["Mouse Position Y"] = "mpY", ["Mouse Scroll X"] = "msX", ["Mouse Scroll Y"] = "msY", - }, + }, [VSystemID.Raw.Doom] = new() { ["Run Speed"] = "R", diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISoundProvider.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISoundProvider.cs index 6289352d8c..1439fe37ff 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISoundProvider.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISoundProvider.cs @@ -47,9 +47,9 @@ namespace BizHawk.Emulation.Cores.Computers.Doom Marshal.Copy(src, _samples, 0, _nsamp * 2); } } - else - { - _nsamp = 0; + else + { + _nsamp = 0; } } } diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IVideoProvider.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IVideoProvider.cs index 2aebd97795..621966d61c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IVideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IVideoProvider.cs @@ -32,15 +32,15 @@ namespace BizHawk.Emulation.Cores.Computers.Doom { var videoBufferSrc = IntPtr.Zero; var palletteBufferSrc = IntPtr.Zero; - _core.dsda_get_video(out var width, out var height, out var pitch, ref videoBufferSrc, out var paletteSize, ref palletteBufferSrc); - - // Handling pallette buffer - PaletteSize = paletteSize; - if (_palBuffer.Length < PaletteSize) _palBuffer = new int[PaletteSize]; + _core.dsda_get_video(out var width, out var height, out var pitch, ref videoBufferSrc, out var paletteSize, ref palletteBufferSrc); + + // Handling pallette buffer + PaletteSize = paletteSize; + if (_palBuffer.Length < PaletteSize) _palBuffer = new int[PaletteSize]; var paletteBuffer = (int*) palletteBufferSrc.ToPointer(); - for (var i = 0; i < _palBuffer.Length; i++) _palBuffer[i] = paletteBuffer[i]; - - // Handling video buffer + for (var i = 0; i < _palBuffer.Length; i++) _palBuffer[i] = paletteBuffer[i]; + + // Handling video buffer BufferWidth = width; BufferHeight = height; if (_vidBuff.Length < BufferWidth * BufferHeight) _vidBuff = new int[BufferWidth * BufferHeight]; diff --git a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs index 4d78e9b54d..abe0d68034 100644 --- a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs +++ b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs @@ -18,8 +18,8 @@ namespace BizHawk.Emulation.Cores.Computers.MSX var rom = lp.Roms.FirstOrDefault() ?? throw new Exception("Must have a ROM for MSX!"); if (rom.Extension.ToLowerInvariant() is not ".rom") - { - throw new NotSupportedException("Only MSX .rom files are supported!"); + { + throw new NotSupportedException("Only MSX .rom files are supported!"); } RomData = new byte[rom.RomData.Length]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs index 5cf7cfbd6c..013ff63849 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs @@ -37,18 +37,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //this is set to true when SyncState is called, so that we know the base class SyncState was used public bool SyncStateFlag; - public virtual NES.CDLog_MapResults MapMemory(ushort addr, bool write) - { - NES.CDLog_MapResults ret = new NES.CDLog_MapResults(); - ret.Type = NES.CDLog_AddrType.None; - - if (addr < 0x2000) - { - ret.Type = NES.CDLog_AddrType.MainRAM; - ret.Address = addr & 0x7FF; - } - - return ret; + public virtual NES.CDLog_MapResults MapMemory(ushort addr, bool write) + { + NES.CDLog_MapResults ret = new NES.CDLog_MapResults(); + ret.Type = NES.CDLog_AddrType.None; + + if (addr < 0x2000) + { + ret.Type = NES.CDLog_AddrType.MainRAM; + ret.Address = addr & 0x7FF; + } + + return ret; } public virtual void SyncState(Serializer ser)