Fix mixed line endings in main solution
This commit is contained in:
parent
7f0b55c550
commit
28498da7c1
|
@ -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 "";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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<Stream> callback, bool zstdCompress = true)
|
||||
|
@ -39,9 +39,9 @@ namespace BizHawk.Client.Common
|
|||
public void PutLump(BinaryStateLump lump, Action<BinaryWriter> callback)
|
||||
{
|
||||
PutLump(lump, s =>
|
||||
{
|
||||
var bw = new BinaryWriter(s);
|
||||
callback(bw);
|
||||
{
|
||||
var bw = new BinaryWriter(s);
|
||||
callback(bw);
|
||||
bw.Flush();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
partial class ExceptionBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
partial class ExceptionBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -47,9 +47,9 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
|||
Marshal.Copy(src, _samples, 0, _nsamp * 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_nsamp = 0;
|
||||
else
|
||||
{
|
||||
_nsamp = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue