Enable SA1124 "Do not use regions" and fix compliance

This commit is contained in:
YoshiRulz 2020-05-15 16:48:01 +10:00
parent 87ec2618a1
commit 7725d59636
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
196 changed files with 10 additions and 2983 deletions

View File

@ -331,9 +331,6 @@
<!-- Use string.Empty for empty strings --> <!-- Use string.Empty for empty strings -->
<Rule Id="SA1122" Action="Hidden" /> <Rule Id="SA1122" Action="Hidden" />
<!-- Do not use regions -->
<Rule Id="SA1124" Action="Hidden" />
<!-- Generic type constraints should be on their own line --> <!-- Generic type constraints should be on their own line -->
<Rule Id="SA1127" Action="Hidden" /> <Rule Id="SA1127" Action="Hidden" />

View File

@ -12,8 +12,6 @@ namespace Cyotek.Drawing.BitmapFont
public static class BitmapFontLoader public static class BitmapFontLoader
{ {
#region  Public Class Methods
/// <summary> /// <summary>
/// Loads a bitmap font from an XML file. /// Loads a bitmap font from an XML file.
/// </summary> /// </summary>
@ -115,10 +113,6 @@ namespace Cyotek.Drawing.BitmapFont
return font; return font;
} }
#endregion  Public Class Methods
#region  Private Class Methods
/// <summary> /// <summary>
/// Creates a Padding object from a string representation /// Creates a Padding object from a string representation
/// </summary> /// </summary>
@ -164,7 +158,5 @@ namespace Cyotek.Drawing.BitmapFont
return result; return result;
} }
#endregion  Private Class Methods
} }
} }

View File

@ -6,17 +6,11 @@ namespace Cyotek.Drawing.BitmapFont
{ {
public struct Character public struct Character
{ {
#region  Public Methods
public override string ToString() public override string ToString()
{ {
return this.Char.ToString(); return this.Char.ToString();
} }
#endregion  Public Methods
#region  Public Properties
public int Channel { get; set; } public int Channel { get; set; }
public Rectangle Bounds { get; set; } public Rectangle Bounds { get; set; }
@ -28,7 +22,5 @@ namespace Cyotek.Drawing.BitmapFont
public int TexturePage { get; set; } public int TexturePage { get; set; }
public int XAdvance { get; set; } public int XAdvance { get; set; }
#endregion  Public Properties
} }
} }

View File

@ -4,8 +4,6 @@ namespace Cyotek.Drawing.BitmapFont
{ {
public struct Kerning public struct Kerning
{ {
#region  Public Constructors
public Kerning(char firstCharacter, char secondCharacter, int amount) public Kerning(char firstCharacter, char secondCharacter, int amount)
: this() : this()
{ {
@ -14,25 +12,15 @@ namespace Cyotek.Drawing.BitmapFont
this.Amount = amount; this.Amount = amount;
} }
#endregion  Public Constructors
#region  Public Methods
public override string ToString() public override string ToString()
{ {
return string.Format("{0} to {1} = {2}", this.FirstCharacter, this.SecondCharacter, this.Amount); return string.Format("{0} to {1} = {2}", this.FirstCharacter, this.SecondCharacter, this.Amount);
} }
#endregion  Public Methods
#region  Public Properties
public char FirstCharacter { get; set; } public char FirstCharacter { get; set; }
public char SecondCharacter { get; set; } public char SecondCharacter { get; set; }
public int Amount { get; set; } public int Amount { get; set; }
#endregion  Public Properties
} }
} }

View File

@ -4,8 +4,6 @@ namespace Cyotek.Drawing.BitmapFont
{ {
public struct Padding public struct Padding
{ {
#region  Public Constructors
public Padding(int left, int top, int right, int bottom) public Padding(int left, int top, int right, int bottom)
: this() : this()
{ {
@ -15,19 +13,11 @@ namespace Cyotek.Drawing.BitmapFont
this.Bottom = bottom; this.Bottom = bottom;
} }
#endregion  Public Constructors
#region  Public Methods
public override string ToString() public override string ToString()
{ {
return string.Format("{0}, {1}, {2}, {3}", this.Left, this.Top, this.Right, this.Bottom); return string.Format("{0}, {1}, {2}, {3}", this.Left, this.Top, this.Right, this.Bottom);
} }
#endregion  Public Methods
#region  Public Properties
public int Top { get; set; } public int Top { get; set; }
public int Left { get; set; } public int Left { get; set; }
@ -35,7 +25,5 @@ namespace Cyotek.Drawing.BitmapFont
public int Right { get; set; } public int Right { get; set; }
public int Bottom { get; set; } public int Bottom { get; set; }
#endregion  Public Properties
} }
} }

View File

@ -114,8 +114,6 @@ namespace BizHawk.Client.Common
return ((int) u << sh) >> sh; return ((int) u << sh) >> sh;
} }
#region Endian Handling
private uint ReadUnsignedLittle(long addr, int size, string domain = null) private uint ReadUnsignedLittle(long addr, int size, string domain = null)
{ {
uint v = 0; uint v = 0;
@ -152,10 +150,6 @@ namespace BizHawk.Client.Common
else WriteUnsignedLittle(addr, value, size, domain); else WriteUnsignedLittle(addr, value, size, domain);
} }
#endregion
#region Unique Library Methods
public void SetBigEndian(bool enabled = true) => _isBigEndian = enabled; public void SetBigEndian(bool enabled = true) => _isBigEndian = enabled;
public List<string> GetMemoryDomainList() => public List<string> GetMemoryDomainList() =>
@ -210,10 +204,6 @@ namespace BizHawk.Client.Common
return hasher.ComputeHash(data).BytesToHexString(); return hasher.ComputeHash(data).BytesToHexString();
} }
#endregion
#region Common Special and Legacy Methods
public uint ReadByte(long addr, string domain = null) => ReadUnsignedByte(addr, domain); public uint ReadByte(long addr, string domain = null) => ReadUnsignedByte(addr, domain);
public void WriteByte(long addr, uint value, string domain = null) => WriteUnsignedByte(addr, value, domain); public void WriteByte(long addr, uint value, string domain = null) => WriteUnsignedByte(addr, value, domain);
@ -272,10 +262,6 @@ namespace BizHawk.Client.Common
d.PokeUint(addr, BitConverter.ToUInt32(BitConverter.GetBytes((float) value), 0), _isBigEndian); d.PokeUint(addr, BitConverter.ToUInt32(BitConverter.GetBytes((float) value), 0), _isBigEndian);
} }
#endregion
#region 1 Byte
public int ReadS8(long addr, string domain = null) => (sbyte) ReadUnsignedByte(addr, domain); public int ReadS8(long addr, string domain = null) => (sbyte) ReadUnsignedByte(addr, domain);
public uint ReadU8(long addr, string domain = null) => (byte) ReadUnsignedByte(addr, domain); public uint ReadU8(long addr, string domain = null) => (byte) ReadUnsignedByte(addr, domain);
@ -284,10 +270,6 @@ namespace BizHawk.Client.Common
public void WriteU8(long addr, uint value, string domain = null) => WriteUnsignedByte(addr, value, domain); public void WriteU8(long addr, uint value, string domain = null) => WriteUnsignedByte(addr, value, domain);
#endregion
#region 2 Byte
public int ReadS16(long addr, string domain = null) => (short) ReadSigned(addr, 2, domain); public int ReadS16(long addr, string domain = null) => (short) ReadSigned(addr, 2, domain);
public uint ReadU16(long addr, string domain = null) => (ushort) ReadUnsigned(addr, 2, domain); public uint ReadU16(long addr, string domain = null) => (ushort) ReadUnsigned(addr, 2, domain);
@ -296,10 +278,6 @@ namespace BizHawk.Client.Common
public void WriteU16(long addr, uint value, string domain = null) => WriteUnsigned(addr, value, 2, domain); public void WriteU16(long addr, uint value, string domain = null) => WriteUnsigned(addr, value, 2, domain);
#endregion
#region 3 Byte
public int ReadS24(long addr, string domain = null) => ReadSigned(addr, 3, domain); public int ReadS24(long addr, string domain = null) => ReadSigned(addr, 3, domain);
public uint ReadU24(long addr, string domain = null) => ReadUnsigned(addr, 3, domain); public uint ReadU24(long addr, string domain = null) => ReadUnsigned(addr, 3, domain);
@ -308,10 +286,6 @@ namespace BizHawk.Client.Common
public void WriteU24(long addr, uint value, string domain = null) => WriteUnsigned(addr, value, 3, domain); public void WriteU24(long addr, uint value, string domain = null) => WriteUnsigned(addr, value, 3, domain);
#endregion
#region 4 Byte
public int ReadS32(long addr, string domain = null) => ReadSigned(addr, 4, domain); public int ReadS32(long addr, string domain = null) => ReadSigned(addr, 4, domain);
public uint ReadU32(long addr, string domain = null) => ReadUnsigned(addr, 4, domain); public uint ReadU32(long addr, string domain = null) => ReadUnsigned(addr, 4, domain);
@ -319,7 +293,5 @@ namespace BizHawk.Client.Common
public void WriteS32(long addr, int value, string domain = null) => WriteSigned(addr, value, 4, domain); public void WriteS32(long addr, int value, string domain = null) => WriteSigned(addr, value, 4, domain);
public void WriteU32(long addr, uint value, string domain = null) => WriteUnsigned(addr, value, 4, domain); public void WriteU32(long addr, uint value, string domain = null) => WriteUnsigned(addr, value, 4, domain);
#endregion
} }
} }

View File

@ -2,24 +2,19 @@
{ {
public interface IComm : IExternalApi public interface IComm : IExternalApi
{ {
#region Sockets
string SocketServerScreenShot(); string SocketServerScreenShot();
string SocketServerScreenShotResponse(); string SocketServerScreenShotResponse();
string SocketServerSend(string SendString); string SocketServerSend(string SendString);
string SocketServerResponse(); string SocketServerResponse();
bool SocketServerSuccessful(); bool SocketServerSuccessful();
void SocketServerSetTimeout(int timeout); void SocketServerSetTimeout(int timeout);
#endregion
#region MemoryMappedFiles
void MmfSetFilename(string filename); void MmfSetFilename(string filename);
string MmfGetFilename(); string MmfGetFilename();
int MmfScreenshot(); int MmfScreenshot();
int MmfWrite(string mmf_filename, string outputString); int MmfWrite(string mmf_filename, string outputString);
string MmfRead(string mmf_filename, int expectedSize); string MmfRead(string mmf_filename, int expectedSize);
#endregion
#region HTTP
string HttpTest(); string HttpTest();
string HttpTestGet(); string HttpTestGet();
string HttpGet(string url); string HttpGet(string url);
@ -30,6 +25,5 @@
void HttpSetGetUrl(string url); void HttpSetGetUrl(string url);
string HttpGetPostUrl(); string HttpGetPostUrl();
string HttpGetGetUrl(); string HttpGetGetUrl();
#endregion
} }
} }

View File

@ -6,21 +6,17 @@ namespace BizHawk.Client.Common
{ {
public interface IGui : IDisposable, IExternalApi public interface IGui : IDisposable, IExternalApi
{ {
#region Gui API
void ToggleCompositingMode(); void ToggleCompositingMode();
ImageAttributes GetAttributes(); ImageAttributes GetAttributes();
void SetAttributes(ImageAttributes a); void SetAttributes(ImageAttributes a);
void DrawNew(string name, bool clear = true); void DrawNew(string name, bool clear = true);
void DrawFinish(); void DrawFinish();
bool HasGUISurface { get; } bool HasGUISurface { get; }
#endregion
#region Helpers
void SetPadding(int all); void SetPadding(int all);
void SetPadding(int x, int y); void SetPadding(int x, int y);
void SetPadding(int l, int t, int r, int b); void SetPadding(int l, int t, int r, int b);
(int Left, int Top, int Right, int Bottom) GetPadding(); (int Left, int Top, int Right, int Bottom) GetPadding();
#endregion
void AddMessage(string message); void AddMessage(string message);
void ClearGraphics(); void ClearGraphics();

View File

@ -6,51 +6,39 @@ namespace BizHawk.Client.Common
{ {
void SetBigEndian(bool enabled = true); void SetBigEndian(bool enabled = true);
#region Domains
List<string> GetMemoryDomainList(); List<string> GetMemoryDomainList();
uint GetMemoryDomainSize(string name = ""); uint GetMemoryDomainSize(string name = "");
string GetCurrentMemoryDomain(); string GetCurrentMemoryDomain();
uint GetCurrentMemoryDomainSize(); uint GetCurrentMemoryDomainSize();
bool UseMemoryDomain(string domain); bool UseMemoryDomain(string domain);
string HashRegion(long addr, int count, string domain = null); string HashRegion(long addr, int count, string domain = null);
#endregion
#region Read
#region Special and Legacy Methods
uint ReadByte(long addr, string domain = null); uint ReadByte(long addr, string domain = null);
List<byte> ReadByteRange(long addr, int length, string domain = null); List<byte> ReadByteRange(long addr, int length, string domain = null);
float ReadFloat(long addr, string domain = null); float ReadFloat(long addr, string domain = null);
#endregion
#region Signed
int ReadS8(long addr, string domain = null); int ReadS8(long addr, string domain = null);
int ReadS16(long addr, string domain = null); int ReadS16(long addr, string domain = null);
int ReadS24(long addr, string domain = null); int ReadS24(long addr, string domain = null);
int ReadS32(long addr, string domain = null); int ReadS32(long addr, string domain = null);
#endregion
#region Unsigned
uint ReadU8(long addr, string domain = null); uint ReadU8(long addr, string domain = null);
uint ReadU16(long addr, string domain = null); uint ReadU16(long addr, string domain = null);
uint ReadU24(long addr, string domain = null); uint ReadU24(long addr, string domain = null);
uint ReadU32(long addr, string domain = null); uint ReadU32(long addr, string domain = null);
#endregion
#endregion
#region Write
#region Special and Legacy Methods
void WriteByte(long addr, uint value, string domain = null); void WriteByte(long addr, uint value, string domain = null);
void WriteByteRange(long addr, List<byte> memoryblock, string domain = null); void WriteByteRange(long addr, List<byte> memoryblock, string domain = null);
void WriteFloat(long addr, double value, string domain = null); void WriteFloat(long addr, double value, string domain = null);
#endregion
#region Signed
void WriteS8(long addr, int value, string domain = null); void WriteS8(long addr, int value, string domain = null);
void WriteS16(long addr, int value, string domain = null); void WriteS16(long addr, int value, string domain = null);
void WriteS24(long addr, int value, string domain = null); void WriteS24(long addr, int value, string domain = null);
void WriteS32(long addr, int value, string domain = null); void WriteS32(long addr, int value, string domain = null);
#endregion
#region Unigned
void WriteU8(long addr, uint value, string domain = null); void WriteU8(long addr, uint value, string domain = null);
void WriteU16(long addr, uint value, string domain = null); void WriteU16(long addr, uint value, string domain = null);
void WriteU24(long addr, uint value, string domain = null); void WriteU24(long addr, uint value, string domain = null);
void WriteU32(long addr, uint value, string domain = null); void WriteU32(long addr, uint value, string domain = null);
#endregion
#endregion
} }
} }

View File

@ -13,8 +13,6 @@ namespace BizHawk.Client.Common
{ {
public class QuickBmpFile public class QuickBmpFile
{ {
#region Structs
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
private class BITMAPFILEHEADER private class BITMAPFILEHEADER
{ {
@ -86,8 +84,6 @@ namespace BizHawk.Client.Common
BI_PNG = 5 BI_PNG = 5
} }
#endregion
private static unsafe byte[] GetBytes(object o) private static unsafe byte[] GetBytes(object o)
{ {
byte[] ret = new byte[Marshal.SizeOf(o)]; byte[] ret = new byte[Marshal.SizeOf(o)];

View File

@ -30,10 +30,6 @@ namespace BizHawk.Client.Common
AllSystemInfos.Add(this); AllSystemInfos.Add(this);
} }
#region Methods
#region Get SystemInfo
/// <summary> /// <summary>
/// Gets the <see cref="SystemInfo"/> instance for Apple II /// Gets the <see cref="SystemInfo"/> instance for Apple II
/// </summary> /// </summary>
@ -235,8 +231,6 @@ namespace BizHawk.Client.Common
public static SystemInfo Sgb { get; } = new SystemInfo("SGB", CoreSystem.SuperGameBoy, 4); public static SystemInfo Sgb { get; } = new SystemInfo("SGB", CoreSystem.SuperGameBoy, 4);
#endregion Get SystemInfo
/// <summary> /// <summary>
/// Get a <see cref="SystemInfo"/> by its <see cref="CoreSystem"/> /// Get a <see cref="SystemInfo"/> by its <see cref="CoreSystem"/>
/// </summary> /// </summary>
@ -294,10 +288,6 @@ namespace BizHawk.Client.Common
return !(system1 == system2); return !(system1 == system2);
} }
#endregion
#region Properties
/// <summary> /// <summary>
/// Gets <see cref="JoypadButton"/> available for this system /// Gets <see cref="JoypadButton"/> available for this system
/// </summary> /// </summary>
@ -317,7 +307,5 @@ namespace BizHawk.Client.Common
/// Gets core used for this system as <see cref="CoreSystem"/> enum /// Gets core used for this system as <see cref="CoreSystem"/> enum
/// </summary> /// </summary>
public CoreSystem System { get; } public CoreSystem System { get; }
#endregion
} }
} }

View File

@ -21,8 +21,6 @@ namespace BizHawk.Client.Common
public override string Name => "memory"; public override string Name => "memory";
#region Unique Library Methods
[LuaMethodExample("local nlmemget = memory.getmemorydomainlist();")] [LuaMethodExample("local nlmemget = memory.getmemorydomainlist();")]
[LuaMethod("getmemorydomainlist", "Returns a string of the memory domains for the loaded platform core. List will be a single string delimited by line feeds")] [LuaMethod("getmemorydomainlist", "Returns a string of the memory domains for the loaded platform core. List will be a single string delimited by line feeds")]
public LuaTable GetMemoryDomainList() public LuaTable GetMemoryDomainList()
@ -52,10 +50,6 @@ namespace BizHawk.Client.Common
[LuaMethod("hash_region", "Returns a hash as a string of a region of memory, starting from addr, through count bytes. If the domain is unspecified, it uses the current region.")] [LuaMethod("hash_region", "Returns a hash as a string of a region of memory, starting from addr, through count bytes. If the domain is unspecified, it uses the current region.")]
public string HashRegion(int addr, int count, string domain = null) => APIs.Mem.HashRegion(addr, count, domain); public string HashRegion(int addr, int count, string domain = null) => APIs.Mem.HashRegion(addr, count, domain);
#endregion
#region Common Special and Legacy Methods
[LuaMethodExample("local uimemrea = memory.readbyte( 0x100, mainmemory.getname( ) );")] [LuaMethodExample("local uimemrea = memory.readbyte( 0x100, mainmemory.getname( ) );")]
[LuaMethod("readbyte", "gets the value from the given address as an unsigned byte")] [LuaMethod("readbyte", "gets the value from the given address as an unsigned byte")]
public uint ReadByte(int addr, string domain = null) => APIs.Mem.ReadByte(addr, domain); public uint ReadByte(int addr, string domain = null) => APIs.Mem.ReadByte(addr, domain);
@ -120,10 +114,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteFloat(addr, value, domain); APIs.Mem.WriteFloat(addr, value, domain);
} }
#endregion
#region 1 Byte
[LuaMethodExample("local inmemrea = memory.read_s8( 0x100, mainmemory.getname( ) );")] [LuaMethodExample("local inmemrea = memory.read_s8( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s8", "read signed byte")] [LuaMethod("read_s8", "read signed byte")]
public int ReadS8(int addr, string domain = null) => APIs.Mem.ReadS8(addr, domain); public int ReadS8(int addr, string domain = null) => APIs.Mem.ReadS8(addr, domain);
@ -140,10 +130,6 @@ namespace BizHawk.Client.Common
[LuaMethod("write_u8", "write unsigned byte")] [LuaMethod("write_u8", "write unsigned byte")]
public void WriteU8(int addr, uint value, string domain = null) => APIs.Mem.WriteU8(addr, value, domain); public void WriteU8(int addr, uint value, string domain = null) => APIs.Mem.WriteU8(addr, value, domain);
#endregion
#region 2 Byte
[LuaMethodExample("local inmemrea = memory.read_s16_le( 0x100, mainmemory.getname( ) );")] [LuaMethodExample("local inmemrea = memory.read_s16_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s16_le", "read signed 2 byte value, little endian")] [LuaMethod("read_s16_le", "read signed 2 byte value, little endian")]
public int ReadS16Little(int addr, string domain = null) public int ReadS16Little(int addr, string domain = null)
@ -208,10 +194,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteU16(addr, value, domain); APIs.Mem.WriteU16(addr, value, domain);
} }
#endregion
#region 3 Byte
[LuaMethodExample("local inmemrea = memory.read_s24_le( 0x100, mainmemory.getname( ) );")] [LuaMethodExample("local inmemrea = memory.read_s24_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s24_le", "read signed 24 bit value, little endian")] [LuaMethod("read_s24_le", "read signed 24 bit value, little endian")]
public int ReadS24Little(int addr, string domain = null) public int ReadS24Little(int addr, string domain = null)
@ -276,10 +258,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteU24(addr, value, domain); APIs.Mem.WriteU24(addr, value, domain);
} }
#endregion
#region 4 Byte
[LuaMethodExample("local inmemrea = memory.read_s32_le( 0x100, mainmemory.getname( ) );")] [LuaMethodExample("local inmemrea = memory.read_s32_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s32_le", "read signed 4 byte value, little endian")] [LuaMethod("read_s32_le", "read signed 4 byte value, little endian")]
public int ReadS32Little(int addr, string domain = null) public int ReadS32Little(int addr, string domain = null)
@ -343,7 +321,5 @@ namespace BizHawk.Client.Common
APIs.Mem.SetBigEndian(); APIs.Mem.SetBigEndian();
APIs.Mem.WriteU32(addr, value, domain); APIs.Mem.WriteU32(addr, value, domain);
} }
#endregion
} }
} }

View File

@ -32,8 +32,6 @@ namespace BizHawk.Client.Common
public override string Name => "event"; public override string Name => "event";
#region Events Library Helpers
public void CallExitEvent(LuaFile luaFile) public void CallExitEvent(LuaFile luaFile)
{ {
var exitCallbacks = RegisteredFunctions var exitCallbacks = RegisteredFunctions
@ -127,8 +125,6 @@ namespace BizHawk.Client.Common
Log($"{scope} is not an available scope for {Emulator.Attributes().CoreName}"); Log($"{scope} is not an available scope for {Emulator.Attributes().CoreName}");
} }
#endregion
[LuaMethodExample("local steveonf = event.onframeend(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function at the end of each frame, after all emulation and drawing has completed. Note: this is the default behavior of lua scripts\" );\r\n\tend\r\n\t, \"Frame name\" );")] [LuaMethodExample("local steveonf = event.onframeend(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function at the end of each frame, after all emulation and drawing has completed. Note: this is the default behavior of lua scripts\" );\r\n\tend\r\n\t, \"Frame name\" );")]
[LuaMethod("onframeend", "Calls the given lua function at the end of each frame, after all emulation and drawing has completed. Note: this is the default behavior of lua scripts")] [LuaMethod("onframeend", "Calls the given lua function at the end of each frame, after all emulation and drawing has completed. Note: this is the default behavior of lua scripts")]

View File

@ -40,8 +40,6 @@ namespace BizHawk.Client.Common
} }
} }
#region Unique Library Methods
[LuaMethodExample("local stmaiget = mainmemory.getname( );")] [LuaMethodExample("local stmaiget = mainmemory.getname( );")]
[LuaMethod("getname", "returns the name of the domain defined as main memory for the given core")] [LuaMethod("getname", "returns the name of the domain defined as main memory for the given core")]
public string GetName() public string GetName()
@ -56,10 +54,6 @@ namespace BizHawk.Client.Common
return (uint)Domain.Size; return (uint)Domain.Size;
} }
#endregion
#region Common Special and Legacy Methods
[LuaMethodExample("local uimairea = mainmemory.readbyte( 0x100 );")] [LuaMethodExample("local uimairea = mainmemory.readbyte( 0x100 );")]
[LuaMethod("readbyte", "gets the value from the given address as an unsigned byte")] [LuaMethod("readbyte", "gets the value from the given address as an unsigned byte")]
public uint ReadByte(int addr) => APIs.Mem.ReadByte(addr, Domain.Name); public uint ReadByte(int addr) => APIs.Mem.ReadByte(addr, Domain.Name);
@ -124,10 +118,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteFloat(addr, value, Domain.Name); APIs.Mem.WriteFloat(addr, value, Domain.Name);
} }
#endregion
#region 1 Byte
[LuaMethodExample("local inmairea = mainmemory.read_s8( 0x100 );")] [LuaMethodExample("local inmairea = mainmemory.read_s8( 0x100 );")]
[LuaMethod("read_s8", "read signed byte")] [LuaMethod("read_s8", "read signed byte")]
public int ReadS8(int addr) => APIs.Mem.ReadS8(addr, Domain.Name); public int ReadS8(int addr) => APIs.Mem.ReadS8(addr, Domain.Name);
@ -144,10 +134,6 @@ namespace BizHawk.Client.Common
[LuaMethod("write_u8", "write unsigned byte")] [LuaMethod("write_u8", "write unsigned byte")]
public void WriteU8(int addr, uint value) => APIs.Mem.WriteU8(addr, value, Domain.Name); public void WriteU8(int addr, uint value) => APIs.Mem.WriteU8(addr, value, Domain.Name);
#endregion
#region 2 Byte
[LuaMethodExample("local inmairea = mainmemory.read_s16_le( 0x100 );")] [LuaMethodExample("local inmairea = mainmemory.read_s16_le( 0x100 );")]
[LuaMethod("read_s16_le", "read signed 2 byte value, little endian")] [LuaMethod("read_s16_le", "read signed 2 byte value, little endian")]
public int ReadS16Little(int addr) public int ReadS16Little(int addr)
@ -212,10 +198,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteU16(addr, value, Domain.Name); APIs.Mem.WriteU16(addr, value, Domain.Name);
} }
#endregion
#region 3 Byte
[LuaMethodExample("local inmairea = mainmemory.read_s24_le( 0x100 );")] [LuaMethodExample("local inmairea = mainmemory.read_s24_le( 0x100 );")]
[LuaMethod("read_s24_le", "read signed 24 bit value, little endian")] [LuaMethod("read_s24_le", "read signed 24 bit value, little endian")]
public int ReadS24Little(int addr) public int ReadS24Little(int addr)
@ -280,10 +262,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteU24(addr, value, Domain.Name); APIs.Mem.WriteU24(addr, value, Domain.Name);
} }
#endregion
#region 4 Byte
[LuaMethodExample("local inmairea = mainmemory.read_s32_le( 0x100 );")] [LuaMethodExample("local inmairea = mainmemory.read_s32_le( 0x100 );")]
[LuaMethod("read_s32_le", "read signed 4 byte value, little endian")] [LuaMethod("read_s32_le", "read signed 4 byte value, little endian")]
public int ReadS32Little(int addr) public int ReadS32Little(int addr)
@ -347,7 +325,5 @@ namespace BizHawk.Client.Common
APIs.Mem.SetBigEndian(); APIs.Mem.SetBigEndian();
APIs.Mem.WriteU32(addr, value, Domain.Name); APIs.Mem.WriteU32(addr, value, Domain.Name);
} }
#endregion
} }
} }

View File

@ -41,17 +41,11 @@ namespace BizHawk.Client.Common
.ToList(); .ToList();
} }
#region IController Implementation
public ControllerDefinition Definition => _type; public ControllerDefinition Definition => _type;
public bool IsPressed(string button) => _myBoolButtons[button]; public bool IsPressed(string button) => _myBoolButtons[button];
public float AxisValue(string name) => _myAxisControls[name]; public float AxisValue(string name) => _myAxisControls[name];
#endregion
#region IMovieController Implementation
public void SetFrom(IController source) public void SetFrom(IController source)
{ {
foreach (var button in Definition.BoolButtons) foreach (var button in Definition.BoolButtons)
@ -146,8 +140,6 @@ namespace BizHawk.Client.Common
_myAxisControls[buttonName] = value; _myAxisControls[buttonName] = value;
} }
#endregion
private class ControlMap private class ControlMap
{ {
public string Name { get; set; } public string Name { get; set; }

View File

@ -81,8 +81,6 @@ namespace BizHawk.Client.Common
} }
} }
#region Log Editing
public void AppendFrame(IController source) public void AppendFrame(IController source)
{ {
var lg = LogGeneratorInstance(source); var lg = LogGeneratorInstance(source);
@ -165,8 +163,6 @@ namespace BizHawk.Client.Common
Changes = true; Changes = true;
} }
#endregion
protected void SetFrameAt(int frameNum, string frame) protected void SetFrameAt(int frameNum, string frame)
{ {
if (Log.Count > frameNum) if (Log.Count > frameNum)

View File

@ -7,8 +7,6 @@ namespace BizHawk.Client.Common
{ {
internal class BkmControllerAdapter : IController internal class BkmControllerAdapter : IController
{ {
#region IController Implementation
public ControllerDefinition Definition { get; set; } public ControllerDefinition Definition { get; set; }
public bool IsPressed(string button) public bool IsPressed(string button)
@ -21,8 +19,6 @@ namespace BizHawk.Client.Common
return _myFloatControls[name]; return _myFloatControls[name];
} }
#endregion
/// <summary> /// <summary>
/// latches all buttons from the supplied mnemonic string /// latches all buttons from the supplied mnemonic string
/// </summary> /// </summary>

View File

@ -33,8 +33,6 @@ namespace BizHawk.Client.Common
// TODO: consider other event handlers, switching modes? // TODO: consider other event handlers, switching modes?
public interface IMovie public interface IMovie
{ {
#region Status
/// <summary> /// <summary>
/// Gets the current movie mode /// Gets the current movie mode
/// </summary> /// </summary>
@ -44,10 +42,6 @@ namespace BizHawk.Client.Common
bool Changes { get; } bool Changes { get; }
#endregion
#region Properties
string Name { get; } string Name { get; }
/// <summary> /// <summary>
@ -120,10 +114,6 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
ILogEntryGenerator LogGeneratorInstance(IController source); ILogEntryGenerator LogGeneratorInstance(IController source);
#endregion
#region File Handling API
// Filename of the movie, settable by the client // Filename of the movie, settable by the client
string Filename { get; set; } string Filename { get; set; }
@ -165,10 +155,6 @@ namespace BizHawk.Client.Common
/// <param name="errorMessage">Returns an error message, if any</param> /// <param name="errorMessage">Returns an error message, if any</param>
bool ExtractInputLog(TextReader reader, out string errorMessage); bool ExtractInputLog(TextReader reader, out string errorMessage);
#endregion
#region Mode Handling API
/// <summary> /// <summary>
/// Tells the movie to start recording from the beginning. /// Tells the movie to start recording from the beginning.
/// </summary> /// </summary>
@ -202,10 +188,6 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
void FinishedMode(); void FinishedMode();
#endregion
#region Editing API
/// <summary> /// <summary>
/// Replaces the given frame's input with an empty frame /// Replaces the given frame's input with an empty frame
/// </summary> /// </summary>
@ -242,8 +224,6 @@ namespace BizHawk.Client.Common
/// <param name="frame">The frame of input to be retrieved</param> /// <param name="frame">The frame of input to be retrieved</param>
/// <returns>A controller state representing the specified frame of input, if frame is out of range, will return null</returns> /// <returns>A controller state representing the specified frame of input, if frame is out of range, will return null</returns>
IMovieController GetInputState(int frame); IMovieController GetInputState(int frame);
#endregion
} }
public static class MovieExtensions public static class MovieExtensions

View File

@ -282,8 +282,6 @@ namespace BizHawk.Client.Common
} }
} }
#region Change History
private bool AddMovieAction(string name) private bool AddMovieAction(string name)
{ {
if (UndoIndex + 1 != _history.Count) if (UndoIndex + 1 != _history.Count)
@ -379,12 +377,8 @@ namespace BizHawk.Client.Common
_history.Last().Add(new MovieActionBindInput(_movie, frame, isDelete)); _history.Last().Add(new MovieActionBindInput(_movie, frame, isDelete));
} }
} }
#endregion
} }
#region Classes
public interface IMovieAction public interface IMovieAction
{ {
void Undo(ITasMovie movie); void Undo(ITasMovie movie);
@ -747,6 +741,4 @@ namespace BizHawk.Client.Common
movie.BindMarkersToInput = _bindMarkers; movie.BindMarkersToInput = _bindMarkers;
} }
} }
#endregion
} }

View File

@ -325,8 +325,6 @@ namespace BizHawk.Client.Common
Changes = true; Changes = true;
} }
#region Events and Handlers
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
private bool _changes; private bool _changes;
@ -357,7 +355,5 @@ namespace BizHawk.Client.Common
public void ClearChanges() => Changes = false; public void ClearChanges() => Changes = false;
public void FlagChanges() => Changes = true; public void FlagChanges() => Changes = true;
#endregion
} }
} }

View File

@ -41,8 +41,6 @@ namespace BizHawk.Client.Common.RamSearchEngine
CompareValue = compareValue; CompareValue = compareValue;
} }
#region API
public IEnumerable<long> OutOfRangeAddress => _watchList public IEnumerable<long> OutOfRangeAddress => _watchList
.Where(watch => watch.Address >= Domain.Size) .Where(watch => watch.Address >= Domain.Size)
.Select(watch => watch.Address); .Select(watch => watch.Address);
@ -313,10 +311,6 @@ namespace BizHawk.Client.Common.RamSearchEngine
} }
} }
#endregion
#region Undo API
public bool UndoEnabled { get; set; } public bool UndoEnabled { get; set; }
@ -350,10 +344,6 @@ namespace BizHawk.Client.Common.RamSearchEngine
return _watchList.Count; return _watchList.Count;
} }
#endregion
#region Comparisons
private IEnumerable<IMiniWatch> ComparePrevious(IEnumerable<IMiniWatch> watchList) private IEnumerable<IMiniWatch> ComparePrevious(IEnumerable<IMiniWatch> watchList)
{ {
switch (Operator) switch (Operator)
@ -599,8 +589,6 @@ namespace BizHawk.Client.Common.RamSearchEngine
throw new InvalidCastException(); throw new InvalidCastException();
} }
#endregion
private long SignExtendAsNeeded(long val) private long SignExtendAsNeeded(long val)
{ {
if (_settings.Type != DisplayType.Signed) if (_settings.Type != DisplayType.Signed)

View File

@ -50,10 +50,6 @@ namespace BizHawk.Client.Common
} }
} }
#region Methods
#region Static
/// <summary> /// <summary>
/// Generate sa <see cref="Watch"/> from a given string /// Generate sa <see cref="Watch"/> from a given string
/// String is tab separate /// String is tab separate
@ -146,8 +142,6 @@ namespace BizHawk.Client.Common
}; };
} }
#region Operators
/// <summary> /// <summary>
/// Equality operator between two <see cref="Watch"/> /// Equality operator between two <see cref="Watch"/>
/// </summary> /// </summary>
@ -255,12 +249,6 @@ namespace BizHawk.Client.Common
return a.CompareTo(b) >= 0; return a.CompareTo(b) >= 0;
} }
#endregion Operators
#endregion Static
#region Abstracts
/// <summary> /// <summary>
/// Gets a list a <see cref="DisplayType"/> that can be used for this <see cref="Watch"/> /// Gets a list a <see cref="DisplayType"/> that can be used for this <see cref="Watch"/>
/// </summary> /// </summary>
@ -277,10 +265,6 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
public abstract void Update(); public abstract void Update();
#endregion Abstracts
#region Protected
protected byte GetByte(bool bypassFreeze = false) protected byte GetByte(bool bypassFreeze = false)
{ {
if (!bypassFreeze && Global.CheatList.IsActive(_domain, Address)) if (!bypassFreeze && Global.CheatList.IsActive(_domain, Address))
@ -365,8 +349,6 @@ namespace BizHawk.Client.Common
} }
} }
#endregion Protected
/// <summary> /// <summary>
/// Sets the number of changes to 0 /// Sets the number of changes to 0
/// </summary> /// </summary>
@ -375,8 +357,6 @@ namespace BizHawk.Client.Common
ChangeCount = 0; ChangeCount = 0;
} }
#region IEquatable<Watch>
/// <summary> /// <summary>
/// Determines if this <see cref="Watch"/> is equals to another /// Determines if this <see cref="Watch"/> is equals to another
/// </summary> /// </summary>
@ -394,10 +374,6 @@ namespace BizHawk.Client.Common
Size == other.Size; Size == other.Size;
} }
#endregion IEquatable<Watch>
#region IEquatable<Cheat>
/// <summary> /// <summary>
/// Determines if this <see cref="Watch"/> is equals to an instance of <see cref="Cheat"/> /// Determines if this <see cref="Watch"/> is equals to an instance of <see cref="Cheat"/>
/// </summary> /// </summary>
@ -411,10 +387,6 @@ namespace BizHawk.Client.Common
&& Size == other.Size; && Size == other.Size;
} }
#endregion IEquatable<Cheat>
#region IComparable<Watch>
/// <summary> /// <summary>
/// Compares two <see cref="Watch"/> together and determine which one comes first. /// Compares two <see cref="Watch"/> together and determine which one comes first.
/// First we look the address and then the size /// First we look the address and then the size
@ -442,8 +414,6 @@ namespace BizHawk.Client.Common
return Address.CompareTo(other.Address); return Address.CompareTo(other.Address);
} }
#endregion IComparable<Watch>
/// <summary> /// <summary>
/// Determines if this object is Equals to another /// Determines if this object is Equals to another
/// </summary> /// </summary>
@ -499,12 +469,6 @@ namespace BizHawk.Client.Common
/// <returns>A well formatted string representation</returns> /// <returns>A well formatted string representation</returns>
public virtual string ToDisplayString() => $"{Notes}: {ValueString}"; public virtual string ToDisplayString() => $"{Notes}: {ValueString}";
#endregion
#region Properties
#region Abstracts
/// <summary> /// <summary>
/// Gets a string representation of difference /// Gets a string representation of difference
/// between current value and the previous one /// between current value and the previous one
@ -551,8 +515,6 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
public abstract string PreviousStr { get; } public abstract string PreviousStr { get; }
#endregion Abstracts
/// <summary> /// <summary>
/// Gets the address in the <see cref="MemoryDomain"/> /// Gets the address in the <see cref="MemoryDomain"/>
/// </summary> /// </summary>
@ -631,8 +593,6 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
public WatchSize Size { get; } public WatchSize Size { get; }
#endregion
// TODO: Replace all the following stuff by implementing ISerializable // TODO: Replace all the following stuff by implementing ISerializable
public static string DisplayTypeToString(DisplayType type) public static string DisplayTypeToString(DisplayType type)
{ {

View File

@ -19,8 +19,6 @@ namespace BizHawk.Client.Common
public sealed partial class WatchList public sealed partial class WatchList
: IList<Watch> : IList<Watch>
{ {
#region Fields
public const string Address = "AddressColumn"; public const string Address = "AddressColumn";
public const string Value = "ValueColumn"; public const string Value = "ValueColumn";
public const string Prev = "PrevColumn"; public const string Prev = "PrevColumn";
@ -36,10 +34,6 @@ namespace BizHawk.Client.Common
private readonly string _systemId; private readonly string _systemId;
private IMemoryDomains _memoryDomains; private IMemoryDomains _memoryDomains;
#endregion
#region cTor(s)
/// <summary> /// <summary>
/// Static constructor for the <see cref="WatchList"/> class. /// Static constructor for the <see cref="WatchList"/> class.
/// </summary> /// </summary>
@ -71,12 +65,6 @@ namespace BizHawk.Client.Common
_systemId = systemId; _systemId = systemId;
} }
#endregion
#region Methods
#region ICollection<Watch>
/// <summary> /// <summary>
/// Adds a <see cref="Watch"/> into the current collection /// Adds a <see cref="Watch"/> into the current collection
/// </summary> /// </summary>
@ -135,10 +123,6 @@ namespace BizHawk.Client.Common
return result; return result;
} }
#endregion
#region IList<Watch>
/// <summary> /// <summary>
/// Determines the zero-base position of the specified <see cref="Watch"/> /// Determines the zero-base position of the specified <see cref="Watch"/>
/// into the <see cref="WatchList"/> /// into the <see cref="WatchList"/>
@ -170,10 +154,6 @@ namespace BizHawk.Client.Common
Changes = true; Changes = true;
} }
#endregion IList<Watch>
#region IEnumerable<Watch>
/// <summary> /// <summary>
/// Returns an enumerator that iterates through the collection /// Returns an enumerator that iterates through the collection
/// </summary> /// </summary>
@ -192,8 +172,6 @@ namespace BizHawk.Client.Common
return GetEnumerator(); return GetEnumerator();
} }
#endregion IEnumerable<Watch>
/// <summary> /// <summary>
/// Add an existing collection of <see cref="Watch"/> into the current one /// Add an existing collection of <see cref="Watch"/> into the current one
/// <see cref="Watch"/> equality will be checked to avoid doubles /// <see cref="Watch"/> equality will be checked to avoid doubles
@ -284,12 +262,6 @@ namespace BizHawk.Client.Common
}); });
} }
#endregion
#region Propeties
#region ICollection<Watch>
/// <summary> /// <summary>
/// Gets the number of elements contained in this <see cref="WatchList"/> /// Gets the number of elements contained in this <see cref="WatchList"/>
/// </summary> /// </summary>
@ -301,10 +273,6 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
public bool IsReadOnly => false; public bool IsReadOnly => false;
#endregion ICollection<Watch>
#region IList<Watch>
/// <summary> /// <summary>
/// Gets or sets element at the specified index /// Gets or sets element at the specified index
/// </summary> /// </summary>
@ -316,8 +284,6 @@ namespace BizHawk.Client.Common
set => _watchList[index] = value; set => _watchList[index] = value;
} }
#endregion IList<Watch>
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the collection has changed or not /// Gets or sets a value indicating whether the collection has changed or not
/// </summary> /// </summary>
@ -333,10 +299,6 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
public int WatchCount => _watchList.Count(watch => !watch.IsSeparator); public int WatchCount => _watchList.Count(watch => !watch.IsSeparator);
#endregion
#region File handling logic - probably needs to be its own class
public bool Load(string path, bool append) public bool Load(string path, bool append)
{ {
var result = LoadFile(path, append); var result = LoadFile(path, append);
@ -519,6 +481,5 @@ namespace BizHawk.Client.Common
return true; return true;
} }
#endregion
} }
} }

View File

@ -15,8 +15,6 @@ namespace BizHawk.Client.EmuHawk
{ {
// this code isn't really any good for general purpose nut creation // this code isn't really any good for general purpose nut creation
#region simple buffer reuser
public class ReusableBufferPool<T> public class ReusableBufferPool<T>
{ {
private readonly List<T[]> _available = new List<T[]>(); private readonly List<T[]> _available = new List<T[]>();
@ -84,10 +82,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region binary write helpers
/// <summary> /// <summary>
/// variable length value, unsigned /// variable length value, unsigned
/// </summary> /// </summary>
@ -183,10 +177,6 @@ namespace BizHawk.Client.EmuHawk
stream.Write(b, 0, 4); stream.Write(b, 0, 4);
} }
#endregion
#region CRC calculator
private static readonly uint[] CrcTable = private static readonly uint[] CrcTable =
{ {
0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9,
@ -211,8 +201,6 @@ namespace BizHawk.Client.EmuHawk
return crc; return crc;
} }
#endregion
/// <summary> /// <summary>
/// writes a single packet out, including CheckSums /// writes a single packet out, including CheckSums
/// </summary> /// </summary>
@ -303,8 +291,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region fields
/// <summary> /// <summary>
/// stores basic AV parameters /// stores basic AV parameters
/// </summary> /// </summary>
@ -354,10 +340,6 @@ namespace BizHawk.Client.EmuHawk
readonly ReusableBufferPool<byte> _bufferPool = new ReusableBufferPool<byte>(12); readonly ReusableBufferPool<byte> _bufferPool = new ReusableBufferPool<byte>(12);
#endregion
#region header writers
/// <summary> /// <summary>
/// write out the main header /// write out the main header
/// </summary> /// </summary>
@ -442,8 +424,6 @@ namespace BizHawk.Client.EmuHawk
header.Flush(); header.Flush();
} }
#endregion
/// <summary> /// <summary>
/// stores a single frame with syncpoint, in mux-ready form /// stores a single frame with syncpoint, in mux-ready form
/// used because reordering of audio and video can be needed for proper interleave /// used because reordering of audio and video can be needed for proper interleave

View File

@ -22,8 +22,6 @@ namespace BizHawk.Client.EmuHawk
/// </summary> /// </summary>
public static class ClientApi public static class ClientApi
{ {
#region Fields
private static IEmulator Emulator { get; set; } private static IEmulator Emulator { get; set; }
private static IVideoProvider VideoProvider { get; set; } private static IVideoProvider VideoProvider { get; set; }
@ -60,10 +58,6 @@ namespace BizHawk.Client.EmuHawk
/// </summary> /// </summary>
public static event StateSavedEventHandler StateSaved; public static event StateSavedEventHandler StateSaved;
#endregion
#region cTor(s)
/// <summary> /// <summary>
/// Static stuff initialization /// Static stuff initialization
/// </summary> /// </summary>
@ -80,12 +74,6 @@ namespace BizHawk.Client.EmuHawk
VideoProvider = emu.AsVideoProviderOrDefault(); VideoProvider = emu.AsVideoProviderOrDefault();
} }
#endregion
#region Methods
#region Helpers
private static void InvokeMainFormMethod(string name, object[] paramList = null) private static void InvokeMainFormMethod(string name, object[] paramList = null)
{ {
List<Type> typeList = new List<Type>(); List<Type> typeList = new List<Type>();
@ -114,9 +102,6 @@ namespace BizHawk.Client.EmuHawk
MainFormClass.GetField(name).SetValue(ClientMainFormInstance, value); MainFormClass.GetField(name).SetValue(ClientMainFormInstance, value);
} }
#endregion
#region Public
/// <summary> /// <summary>
/// THE FrameAdvance stuff /// THE FrameAdvance stuff
/// </summary> /// </summary>
@ -393,7 +378,6 @@ namespace BizHawk.Client.EmuHawk
{ {
InvokeMainFormMethod("UnpauseEmulator"); InvokeMainFormMethod("UnpauseEmulator");
} }
#endregion Public
/// <summary> /// <summary>
/// Gets all current inputs for each joypad and store /// Gets all current inputs for each joypad and store
@ -690,10 +674,6 @@ namespace BizHawk.Client.EmuHawk
return (int)t.GetField("Y").GetValue(o); return (int)t.GetField("Y").GetValue(o);
} }
#endregion
#region Properties
/// <summary> /// <summary>
/// Gets current emulated system /// Gets current emulated system
/// </summary> /// </summary>
@ -748,7 +728,5 @@ namespace BizHawk.Client.EmuHawk
} }
} }
} }
#endregion
} }
} }

View File

@ -9,17 +9,11 @@ namespace BizHawk.Client.EmuHawk
/// </summary> /// </summary>
public sealed class Joypad public sealed class Joypad
{ {
#region Fields
private JoypadButton _pressedButtons; private JoypadButton _pressedButtons;
private float _analogX; private float _analogX;
private float _analogY; private float _analogY;
private int _player; private int _player;
#endregion
#region cTor(s)
/// <summary> /// <summary>
/// Initialize a new instance of <see cref="Joypad"/> /// Initialize a new instance of <see cref="Joypad"/>
/// </summary> /// </summary>
@ -37,10 +31,6 @@ namespace BizHawk.Client.EmuHawk
_player = player; _player = player;
} }
#endregion
#region Methods
/// <summary> /// <summary>
/// Add specified input to current ones /// Add specified input to current ones
/// </summary> /// </summary>
@ -68,10 +58,6 @@ namespace BizHawk.Client.EmuHawk
_pressedButtons ^= input; _pressedButtons ^= input;
} }
#endregion
#region Properties
/// <summary> /// <summary>
/// Gets or sets X value for Analog stick /// Gets or sets X value for Analog stick
/// </summary> /// </summary>
@ -111,7 +97,5 @@ namespace BizHawk.Client.EmuHawk
/// Gets <see cref="SystemInfo"/> for current <see cref="Joypad"/> /// Gets <see cref="SystemInfo"/> for current <see cref="Joypad"/>
/// </summary> /// </summary>
public SystemInfo System { get; } public SystemInfo System { get; }
#endregion
} }
} }

View File

@ -28,8 +28,6 @@ namespace BizHawk.Client.EmuHawk
public string SocketServerGetInfo() => GlobalWin.socketServer.GetInfo(); public string SocketServerGetInfo() => GlobalWin.socketServer.GetInfo();
#region MemoryMappedFile
public void MmfSetFilename(string filename) => GlobalWin.memoryMappedFiles.Filename = filename; public void MmfSetFilename(string filename) => GlobalWin.memoryMappedFiles.Filename = filename;
public string MmfGetFilename() => GlobalWin.memoryMappedFiles.Filename; public string MmfGetFilename() => GlobalWin.memoryMappedFiles.Filename;
@ -40,10 +38,6 @@ namespace BizHawk.Client.EmuHawk
public string MmfRead(string mmf_filename, int expectedSize) => GlobalWin.memoryMappedFiles.ReadFromFile(mmf_filename, expectedSize); public string MmfRead(string mmf_filename, int expectedSize) => GlobalWin.memoryMappedFiles.ReadFromFile(mmf_filename, expectedSize);
#endregion
#region HTTP
public string HttpTest() => string.Join("\n", GlobalWin.httpCommunication.TestGet(), GlobalWin.httpCommunication.SendScreenshot(), "done testing"); public string HttpTest() => string.Join("\n", GlobalWin.httpCommunication.TestGet(), GlobalWin.httpCommunication.SendScreenshot(), "done testing");
public string HttpTestGet() => GlobalWin.httpCommunication.TestGet(); public string HttpTestGet() => GlobalWin.httpCommunication.TestGet();
@ -63,7 +57,5 @@ namespace BizHawk.Client.EmuHawk
public string HttpGetPostUrl() => GlobalWin.httpCommunication.PostUrl; public string HttpGetPostUrl() => GlobalWin.httpCommunication.PostUrl;
public string HttpGetGetUrl() => GlobalWin.httpCommunication.GetUrl; public string HttpGetGetUrl() => GlobalWin.httpCommunication.GetUrl;
#endregion
} }
} }

View File

@ -12,8 +12,6 @@ namespace BizHawk.Client.EmuHawk
{ {
public partial class CoreFeatureAnalysis : ToolFormBase, IToolFormAutoConfig public partial class CoreFeatureAnalysis : ToolFormBase, IToolFormAutoConfig
{ {
#region ConfigPersist
private class CoreInfo private class CoreInfo
{ {
public string CoreName { get; set; } public string CoreName { get; set; }
@ -106,8 +104,6 @@ namespace BizHawk.Client.EmuHawk
[ConfigPersist] [ConfigPersist]
private Dictionary<string, CoreInfo> KnownCores { get; set; } private Dictionary<string, CoreInfo> KnownCores { get; set; }
#endregion
// ReSharper disable once UnusedAutoPropertyAccessor.Local // ReSharper disable once UnusedAutoPropertyAccessor.Local
[RequiredService] [RequiredService]
IEmulator Emulator { get; set; } IEmulator Emulator { get; set; }

View File

@ -36,8 +36,8 @@ namespace BizHawk.Client.EmuHawk
private int _rowCount; private int _rowCount;
private SizeF _charSize; private SizeF _charSize;
private int[] _horizontalColumnTops; // Updated on paint, contains one extra item to allow inference of last column height private int[] _horizontalColumnTops; // Updated on paint, contains one extra item to allow inference of last column height
private RollColumn _columnDown; private RollColumn _columnDown;
private RollColumn _columnResizing; private RollColumn _columnResizing;
@ -178,8 +178,6 @@ namespace BizHawk.Client.EmuHawk
base.OnDoubleClick(e); base.OnDoubleClick(e);
} }
#region Properties
/// <summary> /// <summary>
/// Gets or sets the amount of left and right padding on the text inside a cell /// Gets or sets the amount of left and right padding on the text inside a cell
/// </summary> /// </summary>
@ -400,10 +398,6 @@ namespace BizHawk.Client.EmuHawk
[Category("Behavior")] [Category("Behavior")]
public bool Rotatable { get; set; } public bool Rotatable { get; set; }
#endregion
#region Event Handlers
/// <summary> /// <summary>
/// Fire the <see cref="QueryItemText"/> event which requests the text for the passed cell /// Fire the <see cref="QueryItemText"/> event which requests the text for the passed cell
/// </summary> /// </summary>
@ -556,10 +550,6 @@ namespace BizHawk.Client.EmuHawk
public int NewDisplayIndex { get; } public int NewDisplayIndex { get; }
} }
#endregion
#region Api
private int? _lastSelectedRow; private int? _lastSelectedRow;
public void SelectRow(int index, bool val) public void SelectRow(int index, bool val)
@ -962,10 +952,6 @@ namespace BizHawk.Client.EmuHawk
public string RotateHotkeyStr => "Ctrl+Shift+F"; public string RotateHotkeyStr => "Ctrl+Shift+F";
#endregion
#region Mouse and Key Events
private bool _columnDownMoved; private bool _columnDownMoved;
private int _previousX; // TODO: move me private int _previousX; // TODO: move me
@ -1549,10 +1535,6 @@ namespace BizHawk.Client.EmuHawk
base.OnKeyDown(e); base.OnKeyDown(e);
} }
#endregion
#region Change Events
protected override void OnResize(EventArgs e) protected override void OnResize(EventArgs e)
{ {
RecalculateScrollBars(); RecalculateScrollBars();
@ -1634,10 +1616,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Helpers
private void DoColumnReorder() private void DoColumnReorder()
{ {
if (_columnDown != CurrentCell.Column) if (_columnDown != CurrentCell.Column)
@ -2092,7 +2070,5 @@ namespace BizHawk.Client.EmuHawk
{ {
return (VisibleRows + 1) * LagFramesToHide; return (VisibleRows + 1) * LagFramesToHide;
} }
#endregion
} }
} }

View File

@ -125,8 +125,6 @@ namespace BizHawk.Client.EmuHawk
return instance; return instance;
} }
#region Enumerable to Enumerable<T>
/// <summary> /// <summary>
/// Converts the outdated IEnumerable Controls property to an <see cref="IEnumerable{T}"/> like .NET should have done a long time ago /// Converts the outdated IEnumerable Controls property to an <see cref="IEnumerable{T}"/> like .NET should have done a long time ago
/// </summary> /// </summary>
@ -140,8 +138,6 @@ namespace BizHawk.Client.EmuHawk
{ {
return tabControl.TabPages.Cast<TabPage>(); return tabControl.TabPages.Cast<TabPage>();
} }
#endregion
} }
public static class FormExtensions public static class FormExtensions

View File

@ -15,8 +15,6 @@ namespace BizHawk.Client.EmuHawk
/// </summary> /// </summary>
public class OTK_GamePad public class OTK_GamePad
{ {
#region Static Members
/// <remarks>They don't have a way to query this for some reason. 4 is the minimum promised.</remarks> /// <remarks>They don't have a way to query this for some reason. 4 is the minimum promised.</remarks>
private const int MAX_GAMEPADS = 4; private const int MAX_GAMEPADS = 4;
@ -45,7 +43,7 @@ namespace BizHawk.Client.EmuHawk
{ {
lock (_syncObj) lock (_syncObj)
{ {
if (initialized) if (initialized)
foreach (var device in Devices) yield return device; foreach (var device in Devices) yield return device;
} }
@ -77,10 +75,6 @@ namespace BizHawk.Client.EmuHawk
return num * 10000.0f; return num * 10000.0f;
} }
#endregion
#region Instance Members
/// <summary>The GUID as detected by OpenTK.Input.Joystick (or if that failed, a random one generated on construction)</summary> /// <summary>The GUID as detected by OpenTK.Input.Joystick (or if that failed, a random one generated on construction)</summary>
public readonly Guid Guid; public readonly Guid Guid;
@ -366,8 +360,6 @@ namespace BizHawk.Client.EmuHawk
_gamePadCapabilities?.HasLeftVibrationMotor == true ? left : 0, _gamePadCapabilities?.HasLeftVibrationMotor == true ? left : 0,
_gamePadCapabilities?.HasRightVibrationMotor == true ? right : 0 _gamePadCapabilities?.HasRightVibrationMotor == true ? right : 0
); );
#endregion
} }
} }

View File

@ -32,8 +32,6 @@ namespace BizHawk.Client.EmuHawk
{ {
public partial class MainForm public partial class MainForm
{ {
#region File Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
SaveStateSubMenu.Enabled = SaveStateSubMenu.Enabled =
@ -685,10 +683,6 @@ namespace BizHawk.Client.EmuHawk
_exitCode = exitCode; _exitCode = exitCode;
} }
#endregion
#region Emulation Menu
private void EmulationMenuItem_DropDownOpened(object sender, EventArgs e) private void EmulationMenuItem_DropDownOpened(object sender, EventArgs e)
{ {
PauseMenuItem.Checked = _didMenuPause ? _wasPaused : EmulatorPaused; PauseMenuItem.Checked = _didMenuPause ? _wasPaused : EmulatorPaused;
@ -736,10 +730,6 @@ namespace BizHawk.Client.EmuHawk
HardReset(); HardReset();
} }
#endregion
#region View
private void ViewSubMenu_DropDownOpened(object sender, EventArgs e) private void ViewSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
DisplayFPSMenuItem.Checked = Config.DisplayFps; DisplayFPSMenuItem.Checked = Config.DisplayFps;
@ -857,10 +847,6 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<LogWindow>(); Tools.Load<LogWindow>();
} }
#endregion
#region Config
private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e) private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
ControllersMenuItem.Enabled = Emulator.ControllerDefinition.Any(); ControllersMenuItem.Enabled = Emulator.ControllerDefinition.Any();
@ -1378,10 +1364,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Tools
private void ToolsSubMenu_DropDownOpened(object sender, EventArgs e) private void ToolsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
ToolBoxMenuItem.ShortcutKeyDisplayString = Config.HotkeyBindings["ToolBox"].Bindings; ToolBoxMenuItem.ShortcutKeyDisplayString = Config.HotkeyBindings["ToolBox"].Bindings;
@ -1535,10 +1517,6 @@ namespace BizHawk.Client.EmuHawk
form.ShowDialog(); form.ShowDialog();
} }
#endregion
#region NES
private void NesSubMenu_DropDownOpened(object sender, EventArgs e) private void NesSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
var boardName = Emulator.HasBoardInfo() ? Emulator.AsBoardInfo().BoardName : null; var boardName = Emulator.HasBoardInfo() ? Emulator.AsBoardInfo().BoardName : null;
@ -1720,10 +1698,6 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<BarcodeEntry>(); Tools.Load<BarcodeEntry>();
} }
#endregion
#region PCE
private void PceSettingsMenuItem_Click(object sender, EventArgs e) private void PceSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "PCE Settings"); GenericCoreConfig.DoDialog(this, "PCE Settings");
@ -1744,10 +1718,6 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<PCESoundDebugger>(); Tools.Load<PCESoundDebugger>();
} }
#endregion
#region SMS
private void SmsSubMenu_DropDownOpened(object sender, EventArgs e) private void SmsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
SmsVdpViewerMenuItem.Visible = Game.System != "SG"; SmsVdpViewerMenuItem.Visible = Game.System != "SG";
@ -1763,10 +1733,6 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<SmsVdpViewer>(); Tools.Load<SmsVdpViewer>();
} }
#endregion
#region TI83
private void Ti83SubMenu_DropDownOpened(object sender, EventArgs e) private void Ti83SubMenu_DropDownOpened(object sender, EventArgs e)
{ {
AutoloadKeypadMenuItem.Checked = Config.Ti83AutoloadKeyPad; AutoloadKeypadMenuItem.Checked = Config.Ti83AutoloadKeyPad;
@ -1826,19 +1792,11 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Atari
private void AtariSettingsMenuItem_Click(object sender, EventArgs e) private void AtariSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Atari 2600 Settings"); GenericCoreConfig.DoDialog(this, "Atari 2600 Settings");
} }
#endregion
#region Atari7800
private void A7800SubMenu_DropDownOpened(object sender, EventArgs e) private void A7800SubMenu_DropDownOpened(object sender, EventArgs e)
{ {
A7800ControllerSettingsMenuItem.Enabled A7800ControllerSettingsMenuItem.Enabled
@ -1864,10 +1822,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region GB
private void GbSubMenu_DropDownOpened(object sender, EventArgs e) private void GbSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
LoadGBInSGBMenuItem.Checked = Config.GbAsSgb; LoadGBInSGBMenuItem.Checked = Config.GbAsSgb;
@ -1901,10 +1855,6 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<GBPrinterView>(); Tools.Load<GBPrinterView>();
} }
#endregion
#region GBA
private void GbaCoreSettingsMenuItem_Click(object sender, EventArgs e) private void GbaCoreSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Gameboy Advance Settings"); GenericCoreConfig.DoDialog(this, "Gameboy Advance Settings");
@ -1920,10 +1870,6 @@ namespace BizHawk.Client.EmuHawk
GbaGpuViewerMenuItem.Enabled = !OSTailoredCode.IsUnixHost; GbaGpuViewerMenuItem.Enabled = !OSTailoredCode.IsUnixHost;
} }
#endregion
#region NDS
private void NDSSubMenu_DropDownOpened(object sender, EventArgs e) private void NDSSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
NdsSyncSettingsMenuItem.Enabled = MovieSession.Movie.NotActive(); NdsSyncSettingsMenuItem.Enabled = MovieSession.Movie.NotActive();
@ -1944,10 +1890,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region PSX
private void PsxSubMenu_DropDownOpened(object sender, EventArgs e) private void PsxSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
PSXControllerSettingsMenuItem.Enabled = MovieSession.Movie.NotActive(); PSXControllerSettingsMenuItem.Enabled = MovieSession.Movie.NotActive();
@ -1987,10 +1929,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region SNES
private void SnesSubMenu_DropDownOpened(object sender, EventArgs e) private void SnesSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
if (((LibsnesCore)Emulator).IsSGB) if (((LibsnesCore)Emulator).IsSGB)
@ -2040,10 +1978,6 @@ namespace BizHawk.Client.EmuHawk
GenericCoreConfig.DoDialog(this, "Snes9x Settings"); GenericCoreConfig.DoDialog(this, "Snes9x Settings");
} }
#endregion
#region Coleco
private void ColecoSubMenu_DropDownOpened(object sender, EventArgs e) private void ColecoSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
if (Emulator is ColecoVision coleco) if (Emulator is ColecoVision coleco)
@ -2084,10 +2018,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region N64
private void N64SubMenu_DropDownOpened(object sender, EventArgs e) private void N64SubMenu_DropDownOpened(object sender, EventArgs e)
{ {
N64PluginSettingsMenuItem.Enabled = N64PluginSettingsMenuItem.Enabled =
@ -2157,19 +2087,11 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Saturn
private void SaturnPreferencesMenuItem_Click(object sender, EventArgs e) private void SaturnPreferencesMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Saturn Settings"); GenericCoreConfig.DoDialog(this, "Saturn Settings");
} }
#endregion
#region DGB
private void DgbSettingsMenuItem_Click(object sender, EventArgs e) private void DgbSettingsMenuItem_Click(object sender, EventArgs e)
{ {
if (Emulator is GambatteLink gambatte) if (Emulator is GambatteLink gambatte)
@ -2183,64 +2105,36 @@ namespace BizHawk.Client.EmuHawk
GenericCoreConfig.DoDialog(this, "Gameboy Settings"); GenericCoreConfig.DoDialog(this, "Gameboy Settings");
} }
#endregion
#region GB3x
private void GB3xSettingsMenuItem_Click(object sender, EventArgs e) private void GB3xSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Gameboy Settings"); GenericCoreConfig.DoDialog(this, "Gameboy Settings");
} }
#endregion
#region GB4x
private void GB4xSettingsMenuItem_Click(object sender, EventArgs e) private void GB4xSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Gameboy Settings"); GenericCoreConfig.DoDialog(this, "Gameboy Settings");
} }
#endregion
#region GGL
private void GgSettingsMenuItem_Click(object sender, EventArgs e) private void GgSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Game Gear Settings"); GenericCoreConfig.DoDialog(this, "Game Gear Settings");
} }
#endregion
#region Vectrex
private void VectrexSettingsMenuItem_Click(object sender, EventArgs e) private void VectrexSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Vectrex Settings", true, false); GenericCoreConfig.DoDialog(this, "Vectrex Settings", true, false);
} }
#endregion
#region MSX
private void MsxSettingsMenuItem_Click(object sender, EventArgs e) private void MsxSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "MSX Settings"); GenericCoreConfig.DoDialog(this, "MSX Settings");
} }
#endregion
#region O2Hawk
private void O2HawkSettingsMenuItem_Click(object sender, EventArgs e) private void O2HawkSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Odyssey Settings"); GenericCoreConfig.DoDialog(this, "Odyssey Settings");
} }
#endregion
#region GEN
private void GenVdpViewerMenuItem_Click(object sender, EventArgs e) private void GenVdpViewerMenuItem_Click(object sender, EventArgs e)
{ {
Tools.Load<GenVdpViewer>(); Tools.Load<GenVdpViewer>();
@ -2251,19 +2145,11 @@ namespace BizHawk.Client.EmuHawk
GenericCoreConfig.DoDialog(this, "Genesis Settings"); GenericCoreConfig.DoDialog(this, "Genesis Settings");
} }
#endregion
#region Wondersawn
private void WonderSwanSettingsMenuItem_Click(object sender, EventArgs e) private void WonderSwanSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "WonderSwan Settings"); GenericCoreConfig.DoDialog(this, "WonderSwan Settings");
} }
#endregion
#region Apple II
private void AppleIISettingsMenuItem_Click(object sender, EventArgs e) private void AppleIISettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Apple II Settings"); GenericCoreConfig.DoDialog(this, "Apple II Settings");
@ -2303,10 +2189,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region C64
private void C64SubMenu_DropDownOpened(object sender, EventArgs e) private void C64SubMenu_DropDownOpened(object sender, EventArgs e)
{ {
if (Emulator is C64 c64) if (Emulator is C64 c64)
@ -2346,10 +2228,6 @@ namespace BizHawk.Client.EmuHawk
GenericCoreConfig.DoDialog(this, "C64 Settings"); GenericCoreConfig.DoDialog(this, "C64 Settings");
} }
#endregion
#region Intv
private void IntVSubMenu_DropDownOpened(object sender, EventArgs e) private void IntVSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
IntVControllerSettingsMenuItem.Enabled = MovieSession.Movie.NotActive(); IntVControllerSettingsMenuItem.Enabled = MovieSession.Movie.NotActive();
@ -2364,36 +2242,21 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region VirtualBoy
private void VirtualBoySettingsMenuItem_Click(object sender, EventArgs e) private void VirtualBoySettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "VirtualBoy Settings"); GenericCoreConfig.DoDialog(this, "VirtualBoy Settings");
} }
#endregion
#region NeoGeoPocket
private void NeoGeoSettingsMenuItem_Click(object sender, EventArgs e) private void NeoGeoSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "NeoPop Settings"); GenericCoreConfig.DoDialog(this, "NeoPop Settings");
} }
#endregion
#region PC-FX
private void PCFXSettingsMenuItem_Click(object sender, EventArgs e) private void PCFXSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "PC-FX Settings"); GenericCoreConfig.DoDialog(this, "PC-FX Settings");
} }
#endregion
#region ZXSpectrum
private void ZXSpectrumControllerConfigurationMenuItem_Click(object sender, EventArgs e) private void ZXSpectrumControllerConfigurationMenuItem_Click(object sender, EventArgs e)
{ {
if (Emulator is ZXSpectrum zxs) if (Emulator is ZXSpectrum zxs)
@ -2542,10 +2405,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region AmstradCPC
private void AmstradCpcCoreEmulationSettingsMenuItem_Click(object sender, EventArgs e) private void AmstradCpcCoreEmulationSettingsMenuItem_Click(object sender, EventArgs e)
{ {
if (Emulator is AmstradCPC cpc) if (Emulator is AmstradCPC cpc)
@ -2660,18 +2519,11 @@ namespace BizHawk.Client.EmuHawk
} }
#endregion
#region Arcade
private void ArcadeSettingsMenuItem_Click(object sender, EventArgs e) private void ArcadeSettingsMenuItem_Click(object sender, EventArgs e)
{ {
GenericCoreConfig.DoDialog(this, "Arcade Settings"); GenericCoreConfig.DoDialog(this, "Arcade Settings");
} }
#endregion
#region Help
private void HelpSubMenu_DropDownOpened(object sender, EventArgs e) private void HelpSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
FeaturesMenuItem.Visible = VersionInfo.DeveloperBuild; FeaturesMenuItem.Visible = VersionInfo.DeveloperBuild;
@ -2698,10 +2550,6 @@ namespace BizHawk.Client.EmuHawk
form.ShowDialog(); form.ShowDialog();
} }
#endregion
#region Context Menu
private void MainFormContextMenu_Opening(object sender, System.ComponentModel.CancelEventArgs e) private void MainFormContextMenu_Opening(object sender, System.ComponentModel.CancelEventArgs e)
{ {
_wasPaused = EmulatorPaused; _wasPaused = EmulatorPaused;
@ -2914,10 +2762,6 @@ namespace BizHawk.Client.EmuHawk
FrameBufferResized(); FrameBufferResized();
} }
#endregion
#region Status Bar
private void DumpStatusButton_Click(object sender, EventArgs e) private void DumpStatusButton_Click(object sender, EventArgs e)
{ {
string details = Emulator.RomDetails(); string details = Emulator.RomDetails();
@ -3031,10 +2875,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Form Events
private void MainForm_Activated(object sender, EventArgs e) private void MainForm_Activated(object sender, EventArgs e)
{ {
if (!Config.RunInBackground) if (!Config.RunInBackground)
@ -3167,7 +3007,5 @@ namespace BizHawk.Client.EmuHawk
Sound.StartSound(); Sound.StartSound();
} }
} }
#endregion
} }
} }

View File

@ -41,8 +41,6 @@ namespace BizHawk.Client.EmuHawk
private readonly string[] _nonArchive = { ".ISO", ".CUE", ".CCD" }; private readonly string[] _nonArchive = { ".ISO", ".CUE", ".CCD" };
#region Loaders
private void LoadCdl(string filename, string archive = null) private void LoadCdl(string filename, string archive = null)
{ {
if (Tools.IsAvailable<CDL>()) if (Tools.IsAvailable<CDL>())
@ -127,8 +125,6 @@ namespace BizHawk.Client.EmuHawk
((RamWatch) Tools.Get<RamWatch>()).LoadWatchFile(new FileInfo(filename), false); ((RamWatch) Tools.Get<RamWatch>()).LoadWatchFile(new FileInfo(filename), false);
} }
#endregion
private void ProcessFileList(IEnumerable<string> fileList, ref Dictionary<LoadOrdering, List<FileInformation>> sortedFiles, string archive = null) private void ProcessFileList(IEnumerable<string> fileList, ref Dictionary<LoadOrdering, List<FileInformation>> sortedFiles, string archive = null)
{ {
foreach (string file in fileList) foreach (string file in fileList)

View File

@ -36,8 +36,6 @@ namespace BizHawk.Client.EmuHawk
{ {
public partial class MainForm : Form public partial class MainForm : Form
{ {
#region Constructors and Initialization, and Tear down
private void MainForm_Load(object sender, EventArgs e) private void MainForm_Load(object sender, EventArgs e)
{ {
SetWindowText(); SetWindowText();
@ -634,10 +632,6 @@ namespace BizHawk.Client.EmuHawk
base.Dispose(disposing); base.Dispose(disposing);
} }
#endregion
#region Pause
private bool _emulatorPaused; private bool _emulatorPaused;
public bool EmulatorPaused public bool EmulatorPaused
{ {
@ -668,10 +662,6 @@ namespace BizHawk.Client.EmuHawk
public bool Paused { get; } public bool Paused { get; }
} }
#endregion
#region Properties
public string CurrentlyOpenRom { get; private set; } // todo - delete me and use only args instead public string CurrentlyOpenRom { get; private set; } // todo - delete me and use only args instead
public LoadRomArgs CurrentlyOpenRomArgs { get; private set; } public LoadRomArgs CurrentlyOpenRomArgs { get; private set; }
public bool PauseAvi { get; set; } public bool PauseAvi { get; set; }
@ -726,10 +716,6 @@ namespace BizHawk.Client.EmuHawk
private bool IsTurboSeeking => PauseOnFrame.HasValue && Config.TurboSeek; private bool IsTurboSeeking => PauseOnFrame.HasValue && Config.TurboSeek;
public bool IsTurboing => InputManager.ClientControls["Turbo"] || IsTurboSeeking; public bool IsTurboing => InputManager.ClientControls["Turbo"] || IsTurboSeeking;
#endregion
#region Public Methods
public void AddOnScreenMessage(string message) public void AddOnScreenMessage(string message)
{ {
GlobalWin.OSD.AddMessage(message); GlobalWin.OSD.AddMessage(message);
@ -1427,10 +1413,6 @@ namespace BizHawk.Client.EmuHawk
return true; return true;
} }
#endregion
#region Private variables
private Size _lastVideoSize = new Size(-1, -1), _lastVirtualSize = new Size(-1, -1); private Size _lastVideoSize = new Size(-1, -1), _lastVirtualSize = new Size(-1, -1);
private readonly SaveSlotManager _stateSlots = new SaveSlotManager(); private readonly SaveSlotManager _stateSlots = new SaveSlotManager();
@ -1496,9 +1478,6 @@ namespace BizHawk.Client.EmuHawk
// countdown for saveram autoflushing // countdown for saveram autoflushing
public int AutoFlushSaveRamIn { get; set; } public int AutoFlushSaveRamIn { get; set; }
#endregion
#region Private methods
private void SetStatusBar() private void SetStatusBar()
{ {
@ -2804,10 +2783,6 @@ namespace BizHawk.Client.EmuHawk
AddOnScreenMessage($"Config file loaded: {iniPath}"); AddOnScreenMessage($"Config file loaded: {iniPath}");
} }
#endregion
#region Frame Loop
private void StepRunLoop_Throttle() private void StepRunLoop_Throttle()
{ {
SyncThrottle(); SyncThrottle();
@ -3098,10 +3073,6 @@ namespace BizHawk.Client.EmuHawk
_framesSinceLastFpsUpdate = 0; _framesSinceLastFpsUpdate = 0;
} }
#endregion
#region AVI Stuff
/// <summary> /// <summary>
/// start AVI recording, unattended /// start AVI recording, unattended
/// </summary> /// </summary>
@ -3459,10 +3430,6 @@ namespace BizHawk.Client.EmuHawk
return null; return null;
} }
#endregion
#region Scheduled for refactor
public string SaveStatePrefix() public string SaveStatePrefix()
{ {
var name = Game.FilesystemSafeName(); var name = Game.FilesystemSafeName();
@ -3998,10 +3965,6 @@ namespace BizHawk.Client.EmuHawk
Rewinder.Clear(); Rewinder.Clear();
} }
#endregion
#region Tool Control API
// TODO: move me // TODO: move me
public IControlMainform Master { get; private set; } public IControlMainform Master { get; private set; }
@ -4448,7 +4411,5 @@ namespace BizHawk.Client.EmuHawk
return isRewinding; return isRewinding;
} }
#endregion
} }
} }

View File

@ -292,8 +292,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Events
private void NewPathConfig_Load(object sender, EventArgs e) private void NewPathConfig_Load(object sender, EventArgs e)
{ {
LoadSettings(); LoadSettings();
@ -335,7 +333,5 @@ namespace BizHawk.Client.EmuHawk
_mainForm.AddOnScreenMessage("Path config aborted"); _mainForm.AddOnScreenMessage("Path config aborted");
Close(); Close();
} }
#endregion
} }
} }

View File

@ -287,10 +287,6 @@ namespace BizHawk.Client.EmuHawk
RefreshMovieList(); RefreshMovieList();
} }
#region Events
#region Movie List
private void RefreshMovieList() private void RefreshMovieList()
{ {
MovieView.VirtualListSize = _movieList.Count; MovieView.VirtualListSize = _movieList.Count;
@ -473,10 +469,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Details
private void DetailsView_ColumnClick(object sender, ColumnClickEventArgs e) private void DetailsView_ColumnClick(object sender, ColumnClickEventArgs e)
{ {
var detailsList = new List<MovieDetails>(); var detailsList = new List<MovieDetails>();
@ -543,10 +535,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Misc Widgets
private void BrowseMovies_Click(object sender, EventArgs e) private void BrowseMovies_Click(object sender, EventArgs e)
{ {
using var ofd = new OpenFileDialog using var ofd = new OpenFileDialog
@ -616,8 +604,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
private bool _programmaticallyChangingStopFrameCheckbox; private bool _programmaticallyChangingStopFrameCheckbox;
private void StopOnFrameCheckbox_CheckedChanged(object sender, EventArgs e) private void StopOnFrameCheckbox_CheckedChanged(object sender, EventArgs e)
{ {
@ -645,7 +631,5 @@ namespace BizHawk.Client.EmuHawk
StopOnFrameTextBox.Enabled = !LastFrameCheckbox.Checked; StopOnFrameTextBox.Enabled = !LastFrameCheckbox.Checked;
} }
#endregion
} }
} }

View File

@ -58,8 +58,6 @@ namespace BizHawk.Client.EmuHawk
private bool _previousDisplayMessage; private bool _previousDisplayMessage;
private bool _previousInvisibleEmulation; private bool _previousInvisibleEmulation;
#region Services and Settings
[RequiredService] [RequiredService]
private IEmulator Emulator { get; set; } private IEmulator Emulator { get; set; }
@ -80,8 +78,6 @@ namespace BizHawk.Client.EmuHawk
public bool InvisibleEmulation { get; set; } public bool InvisibleEmulation { get; set; }
} }
#endregion
public BasicBot() public BasicBot()
{ {
InitializeComponent(); InitializeComponent();
@ -98,8 +94,6 @@ namespace BizHawk.Client.EmuHawk
_previousDisplayMessage = Config.DisplayMessages; _previousDisplayMessage = Config.DisplayMessages;
} }
#region UI Bindings
private Dictionary<string, double> ControlProbabilities => private Dictionary<string, double> ControlProbabilities =>
ControlProbabilityPanel.Controls ControlProbabilityPanel.Controls
.OfType<BotControlsRow>() .OfType<BotControlsRow>()
@ -250,8 +244,6 @@ namespace BizHawk.Client.EmuHawk
// However this also causes a problem with RamWatch not being up to date since that TOO gets called. // However this also causes a problem with RamWatch not being up to date since that TOO gets called.
// Need to find out if having RamWatch open while TasStudio is open causes issues. // Need to find out if having RamWatch open while TasStudio is open causes issues.
// there appears to be "hack"(?) line in ToolManager.UpdateBefore that seems to refresh the RamWatch. Not sure that is causing any issue since it does look like the RamWatch is ahead too much.. // there appears to be "hack"(?) line in ToolManager.UpdateBefore that seems to refresh the RamWatch. Not sure that is causing any issue since it does look like the RamWatch is ahead too much..
#endregion
protected override void UpdateBefore() => Update(fast: false); protected override void UpdateBefore() => Update(fast: false);
protected override void FastUpdateBefore() => Update(fast: true); protected override void FastUpdateBefore() => Update(fast: true);
@ -283,10 +275,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Control Events
#region FileMenu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
SaveMenuItem.Enabled = !string.IsNullOrWhiteSpace(CurrentFileName); SaveMenuItem.Enabled = !string.IsNullOrWhiteSpace(CurrentFileName);
@ -373,10 +361,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
#region Options Menu
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
TurboWhileBottingMenuItem.Checked = Settings.TurboWhenBotting; TurboWhileBottingMenuItem.Checked = Settings.TurboWhenBotting;
@ -423,8 +407,6 @@ namespace BizHawk.Client.EmuHawk
Settings.TurboWhenBotting ^= true; Settings.TurboWhenBotting ^= true;
} }
#endregion
private void RunBtn_Click(object sender, EventArgs e) private void RunBtn_Click(object sender, EventArgs e)
{ {
StartBot(); StartBot();
@ -469,10 +451,6 @@ namespace BizHawk.Client.EmuHawk
Frames = 0; Frames = 0;
} }
#endregion
#region Classes
private class BotAttempt private class BotAttempt
{ {
public long Attempt { get; set; } public long Attempt { get; set; }
@ -518,10 +496,6 @@ namespace BizHawk.Client.EmuHawk
public int DataSize { get; set; } public int DataSize { get; set; }
} }
#endregion
#region File Handling
private void LoadFileFromRecent(string path) private void LoadFileFromRecent(string path)
{ {
var result = LoadBotFile(path); var result = LoadBotFile(path);
@ -667,8 +641,6 @@ namespace BizHawk.Client.EmuHawk
MessageLabel.Text = $"{Path.GetFileName(CurrentFileName)} saved"; MessageLabel.Text = $"{Path.GetFileName(CurrentFileName)} saved";
} }
#endregion
public bool HasFrameAdvanced() public bool HasFrameAdvanced()
{ {
// If the emulator frame is different from the last time it tried calling // If the emulator frame is different from the last time it tried calling

View File

@ -19,8 +19,6 @@ namespace BizHawk.Client.EmuHawk
ValueBox.Nullable = false; ValueBox.Nullable = false;
} }
#region Privates
private const string HexInd = "0x"; private const string HexInd = "0x";
private Cheat _cheat; private Cheat _cheat;
@ -271,10 +269,6 @@ namespace BizHawk.Client.EmuHawk
_editCallback?.Invoke(); _editCallback?.Invoke();
} }
#endregion
#region API
public void SetCheat(Cheat cheat) public void SetCheat(Cheat cheat)
{ {
_editMode = true; _editMode = true;
@ -346,8 +340,6 @@ namespace BizHawk.Client.EmuHawk
_editCallback = editCallback; _editCallback = editCallback;
} }
#endregion
private void CompareBox_TextChanged(object sender, EventArgs e) private void CompareBox_TextChanged(object sender, EventArgs e)
{ {
var compareBox = (WatchValueBox)sender; var compareBox = (WatchValueBox)sender;

View File

@ -332,10 +332,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Events
#region File
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
SaveMenuItem.Enabled = Global.CheatList.Changes; SaveMenuItem.Enabled = Global.CheatList.Changes;
@ -391,10 +387,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
#region Cheats
private void CheatsSubMenu_DropDownOpened(object sender, EventArgs e) private void CheatsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
RemoveCheatMenuItem.Enabled = RemoveCheatMenuItem.Enabled =
@ -520,10 +512,6 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<GameShark>(); Tools.Load<GameShark>();
} }
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
AlwaysLoadCheatsMenuItem.Checked = Config.LoadCheatFileByGame; AlwaysLoadCheatsMenuItem.Checked = Config.LoadCheatFileByGame;
@ -592,10 +580,6 @@ namespace BizHawk.Client.EmuHawk
SetColumns(); SetColumns();
} }
#endregion
#region ListView and Dialog Events
private void CheatListView_DoubleClick(object sender, EventArgs e) private void CheatListView_DoubleClick(object sender, EventArgs e)
{ {
ToggleMenuItem_Click(sender, e); ToggleMenuItem_Click(sender, e);
@ -682,10 +666,6 @@ namespace BizHawk.Client.EmuHawk
base.OnShown(e); base.OnShown(e);
} }
#endregion
#endregion
public class CheatsSettings : ToolDialogSettings public class CheatsSettings : ToolDialogSettings
{ {
public CheatsSettings() public CheatsSettings()

View File

@ -21,8 +21,6 @@ namespace BizHawk.Client.EmuHawk
private RegisterValue PCRegister => Debuggable.GetCpuFlagsAndRegisters()[Disassembler.PCRegisterName]; private RegisterValue PCRegister => Debuggable.GetCpuFlagsAndRegisters()[Disassembler.PCRegisterName];
#region Implementation checking
// TODO: be cachey with checks that depend on catching exceptions // TODO: be cachey with checks that depend on catching exceptions
private bool CanUseMemoryCallbacks private bool CanUseMemoryCallbacks
{ {
@ -128,8 +126,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
private void FullUpdate() private void FullUpdate()
{ {
RegisterPanel.UpdateValues(); RegisterPanel.UpdateValues();

View File

@ -185,17 +185,11 @@ namespace BizHawk.Client.EmuHawk
Disassembler.Cpu = ((ComboBox) sender).SelectedItem.ToString(); Disassembler.Cpu = ((ComboBox) sender).SelectedItem.ToString();
} }
#region File
private void ExitMenuItem_Click(object sender, EventArgs e) private void ExitMenuItem_Click(object sender, EventArgs e)
{ {
Close(); Close();
} }
#endregion
#region Debug
private void RunBtn_Click(object sender, EventArgs e) private void RunBtn_Click(object sender, EventArgs e)
{ {
MainForm.UnpauseEmulator(); MainForm.UnpauseEmulator();
@ -228,8 +222,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{ {
if (keyData == Keys.F11) if (keyData == Keys.F11)

View File

@ -17,15 +17,9 @@ namespace BizHawk.Client.EmuHawk
/// </summary> /// </summary>
public static class ExternalToolManager public static class ExternalToolManager
{ {
#region Fields
private static readonly FileSystemWatcher DirectoryMonitor; private static readonly FileSystemWatcher DirectoryMonitor;
private static readonly List<ToolStripMenuItem> MenuItems = new List<ToolStripMenuItem>(); private static readonly List<ToolStripMenuItem> MenuItems = new List<ToolStripMenuItem>();
#endregion
#region cTor(s)
/// <summary> /// <summary>
/// Initialization /// Initialization
/// </summary> /// </summary>
@ -50,10 +44,6 @@ namespace BizHawk.Client.EmuHawk
BuildToolStrip(); BuildToolStrip();
} }
#endregion
#region Methods
/// <summary> /// <summary>
/// Build the ToolStrip menu /// Build the ToolStrip menu
/// </summary> /// </summary>
@ -162,16 +152,10 @@ namespace BizHawk.Client.EmuHawk
MenuItems.Add(GenerateToolTipFromFileName(e.FullPath)); MenuItems.Add(GenerateToolTipFromFileName(e.FullPath));
} }
#endregion
#region Properties
/// <summary> /// <summary>
/// Gets a prebuild <see cref="ToolStripMenuItem"/> /// Gets a prebuild <see cref="ToolStripMenuItem"/>
/// This list auto-updated by the <see cref="ExternalToolManager"/> itself /// This list auto-updated by the <see cref="ExternalToolManager"/> itself
/// </summary> /// </summary>
public static IEnumerable<ToolStripMenuItem> ToolStripMenu => MenuItems; public static IEnumerable<ToolStripMenuItem> ToolStripMenu => MenuItems;
#endregion
} }
} }

View File

@ -100,8 +100,6 @@ namespace BizHawk.Client.EmuHawk
} }
#region drawing primitives
/// <summary> /// <summary>
/// draw a single 2bpp tile /// draw a single 2bpp tile
/// </summary> /// </summary>
@ -354,8 +352,6 @@ namespace BizHawk.Client.EmuHawk
b.UnlockBits(lockData); b.UnlockBits(lockData);
} }
#endregion
void ScanlineCallback(byte lcdc) void ScanlineCallback(byte lcdc)
{ {
using (_memory.EnterExit()) using (_memory.EnterExit())
@ -483,8 +479,6 @@ namespace BizHawk.Client.EmuHawk
Gb?.SetScanlineCallback(null, 0); Gb?.SetScanlineCallback(null, 0);
} }
#region refresh
private void radioButtonRefreshFrame_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); } private void radioButtonRefreshFrame_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
private void radioButtonRefreshScanline_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); } private void radioButtonRefreshScanline_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
private void radioButtonRefreshManual_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); } private void radioButtonRefreshManual_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
@ -565,10 +559,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region mouseovers
private string _freezeLabel; private string _freezeLabel;
private Bitmap _freezeBmp; private Bitmap _freezeBmp;
private string _freezeDetails; private string _freezeDetails;
@ -894,8 +884,6 @@ namespace BizHawk.Client.EmuHawk
SpriteMouseover(e.X, e.Y); SpriteMouseover(e.X, e.Y);
} }
#endregion
private void bmpView_MouseClick(object sender, MouseEventArgs e) private void bmpView_MouseClick(object sender, MouseEventArgs e)
{ {
if (e.Button == MouseButtons.Right) if (e.Button == MouseButtons.Right)
@ -909,8 +897,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region copyimage
private readonly Timer _messageTimer = new Timer(); private readonly Timer _messageTimer = new Timer();
private void GbGpuView_KeyDown(object sender, KeyEventArgs e) private void GbGpuView_KeyDown(object sender, KeyEventArgs e)
@ -943,8 +929,6 @@ namespace BizHawk.Client.EmuHawk
labelClipboard.Text = "CTRL+C copies the pane under the mouse."; labelClipboard.Text = "CTRL+C copies the pane under the mouse.";
} }
#endregion
private void ButtonChangeColor_Click(object sender, EventArgs e) private void ButtonChangeColor_Click(object sender, EventArgs e)
{ {
using var dlg = new ColorDialog using var dlg = new ColorDialog

View File

@ -44,8 +44,6 @@ namespace BizHawk.Client.EmuHawk
RecomputeRefresh(); RecomputeRefresh();
} }
#region drawing primitives
private unsafe void DrawTile256(int* dest, int pitch, byte* tile, ushort* palette, bool hFlip, bool vFlip) private unsafe void DrawTile256(int* dest, int pitch, byte* tile, ushort* palette, bool hFlip, bool vFlip)
{ {
if (vFlip) if (vFlip)
@ -535,8 +533,6 @@ namespace BizHawk.Client.EmuHawk
} }
#endregion
private unsafe void DrawEverything() private unsafe void DrawEverything()
{ {
ushort dispcnt = ((ushort*)_mmio)[0]; ushort dispcnt = ((ushort*)_mmio)[0];
@ -751,8 +747,6 @@ namespace BizHawk.Client.EmuHawk
ShowSelectedWidget(); ShowSelectedWidget();
} }
#region refresh control
private int? _cbScanline; private int? _cbScanline;
private int? _cbScanlineEmu = 500; private int? _cbScanlineEmu = 500;
@ -793,15 +787,11 @@ namespace BizHawk.Client.EmuHawk
DrawEverything(); DrawEverything();
} }
#endregion
private void GbaGpuView_FormClosed(object sender, FormClosedEventArgs e) private void GbaGpuView_FormClosed(object sender, FormClosedEventArgs e)
{ {
GBA?.SetScanlineCallback(null, 0); GBA?.SetScanlineCallback(null, 0);
} }
#region copy to clipboard
private void timerMessage_Tick(object sender, EventArgs e) private void timerMessage_Tick(object sender, EventArgs e)
{ {
timerMessage.Stop(); timerMessage.Stop();
@ -831,6 +821,5 @@ namespace BizHawk.Client.EmuHawk
} }
} }
} }
#endregion
} }
} }

View File

@ -152,8 +152,6 @@ namespace BizHawk.Client.EmuHawk
GeneralUpdate(); GeneralUpdate();
} }
#region API
protected override void UpdateAfter() protected override void UpdateAfter()
{ {
AddressesLabel.Text = GenerateMemoryViewString(true); AddressesLabel.Text = GenerateMemoryViewString(true);
@ -344,8 +342,6 @@ namespace BizHawk.Client.EmuHawk
_hexFind.Close(); _hexFind.Close();
} }
#endregion
private byte[] ConvertHexStringToByteArray(string str) private byte[] ConvertHexStringToByteArray(string str)
{ {
if (string.IsNullOrWhiteSpace(str)) { if (string.IsNullOrWhiteSpace(str)) {
@ -1247,10 +1243,6 @@ namespace BizHawk.Client.EmuHawk
return true; return true;
} }
#region Events
#region File Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
if (_domain.Name == "File on Disk") if (_domain.Name == "File on Disk")
@ -1395,10 +1387,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
#region Edit
private void EditMenuItem_DropDownOpened(object sender, EventArgs e) private void EditMenuItem_DropDownOpened(object sender, EventArgs e)
{ {
var data = Clipboard.GetDataObject(); var data = Clipboard.GetDataObject();
@ -1551,10 +1539,6 @@ namespace BizHawk.Client.EmuHawk
FindPrev(_findStr, false); FindPrev(_findStr, false);
} }
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
BigEndianMenuItem.Checked = BigEndian; BigEndianMenuItem.Checked = BigEndian;
@ -1729,10 +1713,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Settings Menu
private void SetColorsMenuItem_Click(object sender, EventArgs e) private void SetColorsMenuItem_Click(object sender, EventArgs e)
{ {
using var form = new HexColorsForm(this); using var form = new HexColorsForm(this);
@ -1749,10 +1729,6 @@ namespace BizHawk.Client.EmuHawk
Colors = new ColorConfig(); Colors = new ColorConfig();
} }
#endregion
#region Context Menu and Dialog Events
private void HexEditor_Resize(object sender, EventArgs e) private void HexEditor_Resize(object sender, EventArgs e)
{ {
SetUpScrollBar(); SetUpScrollBar();
@ -2086,10 +2062,6 @@ namespace BizHawk.Client.EmuHawk
GeneralUpdate(); GeneralUpdate();
} }
#endregion
#region MemoryViewer Events
private void HexEditor_MouseWheel(object sender, MouseEventArgs e) private void HexEditor_MouseWheel(object sender, MouseEventArgs e)
{ {
var delta = 0; var delta = 0;
@ -2284,10 +2256,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#endregion
private void viewN64MatrixToolStripMenuItem_Click(object sender, EventArgs e) private void viewN64MatrixToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (!_highlightedAddress.HasValue) if (!_highlightedAddress.HasValue)

View File

@ -23,8 +23,6 @@ namespace BizHawk.Client.EmuHawk
// TODO: replace references to ConsoleLuaLibrary.Log with a callback that is passed in // TODO: replace references to ConsoleLuaLibrary.Log with a callback that is passed in
public override string Name => "forms"; public override string Name => "forms";
#region Forms Library Helpers
private readonly List<LuaWinform> _luaForms = new List<LuaWinform>(); private readonly List<LuaWinform> _luaForms = new List<LuaWinform>();
public void WindowClosed(IntPtr handle) public void WindowClosed(IntPtr handle)
@ -60,8 +58,6 @@ namespace BizHawk.Client.EmuHawk
control.Text = caption ?? ""; control.Text = caption ?? "";
} }
#endregion
[LuaMethodExample("forms.addclick( 332, function()\r\n\tconsole.log( \"adds the given lua function as a click event to the given control\" );\r\nend );")] [LuaMethodExample("forms.addclick( 332, function()\r\n\tconsole.log( \"adds the given lua function as a click event to the given control\" );\r\nend );")]
[LuaMethod("addclick", "adds the given lua function as a click event to the given control")] [LuaMethod("addclick", "adds the given lua function as a click event to the given control")]
public void AddClick(int handle, LuaFunction clickEvent) public void AddClick(int handle, LuaFunction clickEvent)
@ -448,8 +444,6 @@ namespace BizHawk.Client.EmuHawk
return (int)pictureBox.Handle; return (int)pictureBox.Handle;
} }
#region LuaPictureBox Methods
[LuaMethodExample("forms.clear( 334, 0x000000FF );")] [LuaMethodExample("forms.clear( 334, 0x000000FF );")]
[LuaMethod( [LuaMethod(
"clear", "clear",
@ -1236,8 +1230,6 @@ namespace BizHawk.Client.EmuHawk
return 0; return 0;
} }
#endregion
[LuaMethodExample("forms.setdropdownitems( 332, { \"item1\", \"item2\" } );")] [LuaMethodExample("forms.setdropdownitems( 332, { \"item1\", \"item2\" } );")]
[LuaMethod("setdropdownitems", "Sets the items for a given dropdown box")] [LuaMethod("setdropdownitems", "Sets the items for a given dropdown box")]
public void SetDropdownItems(int handle, LuaTable items) public void SetDropdownItems(int handle, LuaTable items)

View File

@ -329,8 +329,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Branches
[LuaMethodExample("tastudio.setbranchtext( \"Some text\", 1 );")] [LuaMethodExample("tastudio.setbranchtext( \"Some text\", 1 );")]
[LuaMethod("setbranchtext", "adds the given message to the existing branch, or to the branch that will be created next if branch index is not specified")] [LuaMethod("setbranchtext", "adds the given message to the existing branch, or to the branch that will be created next if branch index is not specified")]
public void SetBranchText(string text, int? index = null) public void SetBranchText(string text, int? index = null)
@ -407,10 +405,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Markers
[LuaMethodExample("local sttasget = tastudio.getmarker( 500 );")] [LuaMethodExample("local sttasget = tastudio.getmarker( 500 );")]
[LuaMethod("getmarker", "returns the marker text at the given frame, or an empty string if there is no marker for the given frame")] [LuaMethod("getmarker", "returns the marker text at the given frame, or an empty string if there is no marker for the given frame")]
public string GetMarker(int frame) public string GetMarker(int frame)
@ -461,10 +455,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Events
[LuaMethodExample("tastudio.onqueryitembg( function( currentindex, itemname )\r\n\tconsole.log( \"called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")] [LuaMethodExample("tastudio.onqueryitembg( function( currentindex, itemname )\r\n\tconsole.log( \"called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethod("onqueryitembg", "called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)")] [LuaMethod("onqueryitembg", "called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)")]
public void OnQueryItemBg(LuaFunction luaf) public void OnQueryItemBg(LuaFunction luaf)
@ -572,7 +562,5 @@ namespace BizHawk.Client.EmuHawk
}; };
} }
} }
#endregion
} }
} }

View File

@ -6,8 +6,6 @@ namespace BizHawk.Client.EmuHawk
{ {
public class LuaAutocompleteInstaller public class LuaAutocompleteInstaller
{ {
#region API
public enum TextEditors { Sublime2, NotePad } public enum TextEditors { Sublime2, NotePad }
public bool IsInstalled(TextEditors editor) public bool IsInstalled(TextEditors editor)
@ -43,8 +41,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
private string AppDataFolder => Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); private string AppDataFolder => Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
private bool IsSublimeInstalled() private bool IsSublimeInstalled()

View File

@ -723,10 +723,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Events
#region File Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
SaveSessionMenuItem.Enabled = LuaImp.ScriptList.Changes; SaveSessionMenuItem.Enabled = LuaImp.ScriptList.Changes;
@ -808,10 +804,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
#region Script
private void ScriptSubMenu_DropDownOpened(object sender, EventArgs e) private void ScriptSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
ToggleScriptMenuItem.Enabled = ToggleScriptMenuItem.Enabled =
@ -1124,10 +1116,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
DisableScriptsOnLoadMenuItem.Checked = Config.DisableLuaScriptsOnLoad; DisableScriptsOnLoadMenuItem.Checked = Config.DisableLuaScriptsOnLoad;
@ -1219,10 +1207,6 @@ namespace BizHawk.Client.EmuHawk
_luaAutoInstaller.InstallBizLua(LuaAutocompleteInstaller.TextEditors.NotePad, LuaImp.Docs); _luaAutoInstaller.InstallBizLua(LuaAutocompleteInstaller.TextEditors.NotePad, LuaImp.Docs);
} }
#endregion
#region Help
private void FunctionsListMenuItem_Click(object sender, EventArgs e) private void FunctionsListMenuItem_Click(object sender, EventArgs e)
{ {
new LuaFunctionsForm(LuaImp.Docs).Show(); new LuaFunctionsForm(LuaImp.Docs).Show();
@ -1233,10 +1217,6 @@ namespace BizHawk.Client.EmuHawk
Process.Start("http://tasvideos.org/BizHawk/LuaFunctions.html"); Process.Start("http://tasvideos.org/BizHawk/LuaFunctions.html");
} }
#endregion
#region Toolbar and Context Menu
private void ScriptListContextMenu_Opening(object sender, CancelEventArgs e) private void ScriptListContextMenu_Opening(object sender, CancelEventArgs e)
{ {
ToggleScriptContextItem.Enabled = ToggleScriptContextItem.Enabled =
@ -1302,10 +1282,6 @@ namespace BizHawk.Client.EmuHawk
LuaImp.RegisteredFunctions.Clear(Emulator); LuaImp.RegisteredFunctions.Clear(Emulator);
} }
#endregion
#region Dialog, Listview, OutputBox, InputBox
private void LuaConsole_DragDrop(object sender, DragEventArgs e) private void LuaConsole_DragDrop(object sender, DragEventArgs e)
{ {
if (OSTailoredCode.IsUnixHost) if (OSTailoredCode.IsUnixHost)
@ -1510,8 +1486,6 @@ namespace BizHawk.Client.EmuHawk
return false; return false;
} }
#endregion
private void EraseToolbarItem_Click(object sender, EventArgs e) private void EraseToolbarItem_Click(object sender, EventArgs e)
{ {
GlobalWin.DisplayManager.ClearLuaSurfaces(); GlobalWin.DisplayManager.ClearLuaSurfaces();
@ -1523,8 +1497,6 @@ namespace BizHawk.Client.EmuHawk
GenericDragEnter(sender, e); GenericDragEnter(sender, e);
} }
#endregion
private void LuaListView_DoubleClick(object sender, EventArgs e) private void LuaListView_DoubleClick(object sender, EventArgs e)
{ {
var index = LuaListView.CurrentCell?.RowIndex; var index = LuaListView.CurrentCell?.RowIndex;

View File

@ -9,7 +9,6 @@ namespace BizHawk.Client.EmuHawk
{ {
public class LuaPictureBox : PictureBox public class LuaPictureBox : PictureBox
{ {
#region Helpers
private readonly Dictionary<string, Image> _imageCache = new Dictionary<string, Image>(); private readonly Dictionary<string, Image> _imageCache = new Dictionary<string, Image>();
private readonly Dictionary<Color, SolidBrush> _solidBrushes = new Dictionary<Color, SolidBrush>(); private readonly Dictionary<Color, SolidBrush> _solidBrushes = new Dictionary<Color, SolidBrush>();
@ -37,8 +36,6 @@ namespace BizHawk.Client.EmuHawk
return p; return p;
} }
#endregion
private Color _defaultForeground = Color.Black; private Color _defaultForeground = Color.Black;
private Color? _defaultBackground; private Color? _defaultBackground;
private Color? _defaultTextBackground = Color.FromArgb(128, 0, 0, 0); private Color? _defaultTextBackground = Color.FromArgb(128, 0, 0, 0);

View File

@ -214,8 +214,6 @@ namespace BizHawk.Client.EmuHawk
SelectedZone.PlaceZone(CurrentMovie); SelectedZone.PlaceZone(CurrentMovie);
} }
#region Menu Items
private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (SelectedZone == null) if (SelectedZone == null)
@ -265,8 +263,6 @@ namespace BizHawk.Client.EmuHawk
Global.Game.FilesystemSafeName()), null); Global.Game.FilesystemSafeName()), null);
} }
#endregion
public bool SaveMacroAs(MovieZone macro) public bool SaveMacroAs(MovieZone macro)
{ {
using var dialog = new SaveFileDialog using var dialog = new SaveFileDialog

View File

@ -275,8 +275,6 @@ namespace BizHawk.Client.EmuHawk
_controller = _movieSession.GenerateMovieController(d); _controller = _movieSession.GenerateMovieController(d);
} }
#region Custom Latch
private void LatchFromSourceButtons(IMovieController latching, IController source) private void LatchFromSourceButtons(IMovieController latching, IController source)
{ {
foreach (string button in source.Definition.BoolButtons) foreach (string button in source.Definition.BoolButtons)
@ -307,7 +305,5 @@ namespace BizHawk.Client.EmuHawk
} }
} }
} }
#endregion
} }
} }

View File

@ -179,10 +179,6 @@ namespace BizHawk.Client.EmuHawk
NameTableView.Refresh(); NameTableView.Refresh();
} }
#region Events
#region Menu and Context Menu
private void ScreenshotMenuItem_Click(object sender, EventArgs e) private void ScreenshotMenuItem_Click(object sender, EventArgs e)
{ {
NameTableView.Screenshot(); NameTableView.Screenshot();
@ -204,10 +200,6 @@ namespace BizHawk.Client.EmuHawk
NameTableView.Refresh(); NameTableView.Refresh();
} }
#endregion
#region Dialog and Controls
private void NesNameTableViewer_KeyDown(object sender, KeyEventArgs e) private void NesNameTableViewer_KeyDown(object sender, KeyEventArgs e)
{ {
switch (e.KeyCode) switch (e.KeyCode)
@ -322,9 +314,5 @@ namespace BizHawk.Client.EmuHawk
TableLabel.Text = ""; TableLabel.Text = "";
PaletteLabel.Text = ""; PaletteLabel.Text = "";
} }
#endregion
#endregion
} }
} }

View File

@ -309,12 +309,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Events
#region Menu and Context Menu
#region File
private void SavePaletteScreenshotMenuItem_Click(object sender, EventArgs e) private void SavePaletteScreenshotMenuItem_Click(object sender, EventArgs e)
{ {
PaletteView.Screenshot(); PaletteView.Screenshot();
@ -350,10 +344,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
#region Pattern
private void Table0PaletteSubMenu_DropDownOpened(object sender, EventArgs e) private void Table0PaletteSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
Table0P0MenuItem.Checked = PatternView.Pal0 == 0; Table0P0MenuItem.Checked = PatternView.Pal0 == 0;
@ -448,19 +438,11 @@ namespace BizHawk.Client.EmuHawk
UpdatePaletteSelection(); UpdatePaletteSelection();
} }
#endregion
#region Settings
private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e) private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
cHRROMTileViewerToolStripMenuItem.Checked = ChrRomView; cHRROMTileViewerToolStripMenuItem.Checked = ChrRomView;
} }
#endregion
#region Context Menus
private void PaletteRefreshMenuItem_Click(object sender, EventArgs e) private void PaletteRefreshMenuItem_Click(object sender, EventArgs e)
{ {
PaletteView.Refresh(); PaletteView.Refresh();
@ -476,12 +458,6 @@ namespace BizHawk.Client.EmuHawk
SpriteView.Refresh(); SpriteView.Refresh();
} }
#endregion
#endregion
#region Dialog and Controls
private void NesPPU_MouseClick(object sender, MouseEventArgs e) private void NesPPU_MouseClick(object sender, MouseEventArgs e)
{ {
ZoomBox.Image = new Bitmap(64, 64); ZoomBox.Image = new Bitmap(64, 64);
@ -779,8 +755,6 @@ namespace BizHawk.Client.EmuHawk
_ppu?.RemoveCallback2(); _ppu?.RemoveCallback2();
} }
#endregion
private MemoryDomain _chrRom; private MemoryDomain _chrRom;
private readonly byte[] _chrRomCache = new byte[8192]; private readonly byte[] _chrRomCache = new byte[8192];
@ -824,8 +798,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
private void NumericUpDownChrRomBank_ValueChanged(object sender, EventArgs e) private void NumericUpDownChrRomBank_ValueChanged(object sender, EventArgs e)
{ {
ChrRomViewRefresh(); ChrRomViewRefresh();

View File

@ -83,10 +83,6 @@ namespace BizHawk.Client.EmuHawk
protected override void UpdateBefore() => Generate(); protected override void UpdateBefore() => Generate();
#region Events
#region Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
VDC2MenuItem.Enabled = PCE.SystemId == "SGX"; VDC2MenuItem.Enabled = PCE.SystemId == "SGX";
@ -110,8 +106,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
private void Canvas_MouseMove(object sender, MouseEventArgs e) private void Canvas_MouseMove(object sender, MouseEventArgs e)
{ {
var vdc = _vdcType == 0 ? PCE.VDC1 : PCE.VDC2; var vdc = _vdcType == 0 ? PCE.VDC1 : PCE.VDC2;
@ -123,7 +117,5 @@ namespace BizHawk.Client.EmuHawk
XYLabel.Text = $"{xTile}:{yTile}"; XYLabel.Text = $"{xTile}:{yTile}";
PaletteLabel.Text = paletteNo.ToString(); PaletteLabel.Text = paletteNo.ToString();
} }
#endregion
} }
} }

View File

@ -77,8 +77,6 @@ namespace BizHawk.Client.EmuHawk
}); });
} }
#region Query callbacks
private void QueryItemText(int index, RollColumn column, out string text, ref int offsetX, ref int offsetY) private void QueryItemText(int index, RollColumn column, out string text, ref int offsetX, ref int offsetY)
{ {
text = ""; text = "";
@ -125,10 +123,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Actions
public void Branch() public void Branch()
{ {
var branch = CreateBranch(); var branch = CreateBranch();
@ -574,10 +568,6 @@ namespace BizHawk.Client.EmuHawk
return false; return false;
} }
#endregion
#region Events
private void BranchView_MouseDown(object sender, MouseEventArgs e) private void BranchView_MouseDown(object sender, MouseEventArgs e)
{ {
BranchesContextMenu.Close(); BranchesContextMenu.Close();
@ -676,7 +666,5 @@ namespace BizHawk.Client.EmuHawk
_screenshot.FadeOut(); _screenshot.FadeOut();
} }
} }
#endregion
} }
} }

View File

@ -125,8 +125,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Query callbacks
// public static Color CurrentFrame_FrameCol = Color.FromArgb(0xCF, 0xED, 0xFC); Why? // public static Color CurrentFrame_FrameCol = Color.FromArgb(0xCF, 0xED, 0xFC); Why?
public static Color CurrentFrame_InputLog => Color.FromArgb(0xB5, 0xE7, 0xF7); public static Color CurrentFrame_InputLog => Color.FromArgb(0xB5, 0xE7, 0xF7);
public static Color SeekFrame_InputLog => Color.FromArgb(0x70, 0xB5, 0xE7, 0xF7); public static Color SeekFrame_InputLog => Color.FromArgb(0x70, 0xB5, 0xE7, 0xF7);
@ -362,10 +360,6 @@ namespace BizHawk.Client.EmuHawk
return (lag.Lagged.HasValue && lag.Lagged.Value) || (hideWasLag && lag.WasLagged.HasValue && lag.WasLagged.Value); return (lag.Lagged.HasValue && lag.Lagged.Value) || (hideWasLag && lag.WasLagged.HasValue && lag.WasLagged.Value);
} }
#endregion
#region Events
private void TasView_ColumnClick(object sender, InputRoll.ColumnClickEventArgs e) private void TasView_ColumnClick(object sender, InputRoll.ColumnClickEventArgs e)
{ {
if (TasView.AnyRowsSelected) if (TasView.AnyRowsSelected)
@ -1460,7 +1454,5 @@ namespace BizHawk.Client.EmuHawk
RefreshDialog(); RefreshDialog();
} }
#endregion
} }
} }

View File

@ -12,8 +12,6 @@ namespace BizHawk.Client.EmuHawk
{ {
public partial class TAStudio public partial class TAStudio
{ {
#region File Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
ToBk2MenuItem.Enabled = ToBk2MenuItem.Enabled =
@ -304,10 +302,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
#region Edit
private void EditSubMenu_DropDownOpened(object sender, EventArgs e) private void EditSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
DeselectMenuItem.Enabled = DeselectMenuItem.Enabled =
@ -775,10 +769,6 @@ namespace BizHawk.Client.EmuHawk
MessageBox.Show("Integrity Check passed"); MessageBox.Show("Integrity Check passed");
} }
#endregion
#region Config
private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e) private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
AutopauseAtEndOfMovieMenuItem.Checked = Settings.AutoPause; AutopauseAtEndOfMovieMenuItem.Checked = Settings.AutoPause;
@ -981,10 +971,6 @@ namespace BizHawk.Client.EmuHawk
Settings.LoadBranchOnDoubleClick ^= true; Settings.LoadBranchOnDoubleClick ^= true;
} }
#endregion
#region Metadata
private void HeaderMenuItem_Click(object sender, EventArgs e) private void HeaderMenuItem_Click(object sender, EventArgs e)
{ {
new MovieHeaderEditor(CurrentTasMovie) new MovieHeaderEditor(CurrentTasMovie)
@ -1030,10 +1016,6 @@ namespace BizHawk.Client.EmuHawk
}.ShowDialog(); }.ShowDialog();
} }
#endregion
#region Settings Menu
private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e) private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
RotateMenuItem.ShortcutKeyDisplayString = TasView.RotateHotkeyStr; RotateMenuItem.ShortcutKeyDisplayString = TasView.RotateHotkeyStr;
@ -1163,10 +1145,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Columns
private void SetUpToolStripColumns() private void SetUpToolStripColumns()
{ {
ColumnsSubMenu.DropDownItems.Clear(); ColumnsSubMenu.DropDownItems.Clear();
@ -1336,10 +1314,6 @@ namespace BizHawk.Client.EmuHawk
BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance; BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance;
} }
#endregion
#region Context Menu
private void RightClickMenu_Opened(object sender, EventArgs e) private void RightClickMenu_Opened(object sender, EventArgs e)
{ {
SetMarkersContextMenuItem.Enabled = SetMarkersContextMenuItem.Enabled =
@ -1393,10 +1367,6 @@ namespace BizHawk.Client.EmuHawk
BookMarkControl.Branch(); BookMarkControl.Branch();
} }
#endregion
#region Help
private void TASEditorManualOnlineMenuItem_Click(object sender, EventArgs e) private void TASEditorManualOnlineMenuItem_Click(object sender, EventArgs e)
{ {
System.Diagnostics.Process.Start("http://www.fceux.com/web/help/taseditor/"); System.Diagnostics.Process.Start("http://www.fceux.com/web/help/taseditor/");
@ -1406,7 +1376,5 @@ namespace BizHawk.Client.EmuHawk
{ {
System.Diagnostics.Process.Start("http://tasvideos.org/forum/viewtopic.php?t=13505"); System.Diagnostics.Process.Start("http://tasvideos.org/forum/viewtopic.php?t=13505");
} }
#endregion
} }
} }

View File

@ -102,8 +102,6 @@ namespace BizHawk.Client.EmuHawk
public bool BindMarkersToInput { get; set; } public bool BindMarkersToInput { get; set; }
} }
#region Initializing
public TAStudio() public TAStudio()
{ {
void SetImages() void SetImages()
@ -610,10 +608,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Loading
private void ConvertCurrentMovieToTasproj() private void ConvertCurrentMovieToTasproj()
{ {
MovieSession.ConvertToTasProj(); MovieSession.ConvertToTasProj();
@ -780,8 +774,6 @@ namespace BizHawk.Client.EmuHawk
loadZone.PlaceZone(CurrentTasMovie); loadZone.PlaceZone(CurrentTasMovie);
} }
#endregion
private void TastudioPlayMode() private void TastudioPlayMode()
{ {
TasPlaybackBox.RecordingMode = false; TasPlaybackBox.RecordingMode = false;
@ -1130,8 +1122,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Dialog Events
private void Tastudio_Closing(object sender, FormClosingEventArgs e) private void Tastudio_Closing(object sender, FormClosingEventArgs e)
{ {
if (!_initialized) if (!_initialized)
@ -1199,8 +1189,6 @@ namespace BizHawk.Client.EmuHawk
return base.ProcessCmdKey(ref msg, keyData); return base.ProcessCmdKey(ref msg, keyData);
} }
#endregion
private bool AutoAdjustInput() private bool AutoAdjustInput()
{ {
var lagLog = CurrentTasMovie[Emulator.Frame - 1]; // Minus one because get frame is +1; var lagLog = CurrentTasMovie[Emulator.Frame - 1]; // Minus one because get frame is +1;

View File

@ -99,10 +99,6 @@ namespace BizHawk.Client.EmuHawk
KeyPadToolTips.RemoveAll(); KeyPadToolTips.RemoveAll();
} }
#region Events
#region Menu
private void ExitMenuItem_Click(object sender, EventArgs e) private void ExitMenuItem_Click(object sender, EventArgs e)
{ {
Close(); Close();
@ -127,10 +123,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Dialog and Controls
private void EnterButton_Click(object sender, EventArgs e) => KeyClick("ENTER"); private void EnterButton_Click(object sender, EventArgs e) => KeyClick("ENTER");
private void DashButton_Click(object sender, EventArgs e) => KeyClick("DASH"); private void DashButton_Click(object sender, EventArgs e) => KeyClick("DASH");
private void OneButton_Click(object sender, EventArgs e) => KeyClick("1"); private void OneButton_Click(object sender, EventArgs e) => KeyClick("1");
@ -183,9 +175,5 @@ namespace BizHawk.Client.EmuHawk
private void GraphButton_Click(object sender, EventArgs e) => KeyClick("GRAPH"); private void GraphButton_Click(object sender, EventArgs e) => KeyClick("GRAPH");
private void PeriodButton_Click(object sender, EventArgs e) => KeyClick("DOT"); private void PeriodButton_Click(object sender, EventArgs e) => KeyClick("DOT");
private void ZeroButton_Click(object sender, EventArgs e) => KeyClick("0"); private void ZeroButton_Click(object sender, EventArgs e) => KeyClick("0");
#endregion
#endregion
} }
} }

View File

@ -718,7 +718,6 @@ namespace BizHawk.Client.EmuHawk
public bool IsAvailable<T>() => IsAvailable(typeof(T)); public bool IsAvailable<T>() => IsAvailable(typeof(T));
// Note: Referencing these properties creates an instance of the tool and persists it. They should be referenced by type if this is not desired // Note: Referencing these properties creates an instance of the tool and persists it. They should be referenced by type if this is not desired
#region Tools
private T GetTool<T>() where T : class, IToolForm, new() private T GetTool<T>() where T : class, IToolForm, new()
{ {
@ -750,10 +749,6 @@ namespace BizHawk.Client.EmuHawk
public TAStudio TAStudio => GetTool<TAStudio>(); public TAStudio TAStudio => GetTool<TAStudio>();
#endregion
#region Specialized Tool Loading Logic
public void LoadRamWatch(bool loadDialog) public void LoadRamWatch(bool loadDialog)
{ {
if (IsLoaded<RamWatch>()) if (IsLoaded<RamWatch>())
@ -777,8 +772,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
public string GenerateDefaultCheatFilename() public string GenerateDefaultCheatFilename()
{ {
var path = _config.PathEntries.CheatsAbsolutePath(Global.Game.System); var path = _config.PathEntries.CheatsAbsolutePath(Global.Game.System);

View File

@ -297,10 +297,6 @@ namespace BizHawk.Client.EmuHawk
return result.IsOk() ? new FileInfo(sfd.FileName) : null; return result.IsOk() ? new FileInfo(sfd.FileName) : null;
} }
#region Events
#region Menu Items
private void SaveLogMenuItem_Click(object sender, EventArgs e) private void SaveLogMenuItem_Click(object sender, EventArgs e)
{ {
LogFile = GetFileFromUser(); LogFile = GetFileFromUser();
@ -380,10 +376,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Dialog and ListView Events
private void LoggingEnabled_CheckedChanged(object sender, EventArgs e) private void LoggingEnabled_CheckedChanged(object sender, EventArgs e)
{ {
//Tracer.Enabled = LoggingEnabled.Checked; //Tracer.Enabled = LoggingEnabled.Checked;
@ -485,10 +477,6 @@ namespace BizHawk.Client.EmuHawk
SetTracerBoxTitle(); SetTracerBoxTitle();
} }
#endregion
#endregion
private void ClearMenuItem_Click(object sender, EventArgs e) private void ClearMenuItem_Click(object sender, EventArgs e)
{ {
ClearList(); ClearList();

View File

@ -182,8 +182,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#region Menu
private void PadsSubMenu_DropDownOpened(object sender, EventArgs e) private void PadsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
StickyMenuItem.Checked = StickyPads; StickyMenuItem.Checked = StickyPads;
@ -218,7 +216,5 @@ namespace BizHawk.Client.EmuHawk
{ {
ClearAlsoClearsAnalog ^= true; ClearAlsoClearsAnalog ^= true;
} }
#endregion
} }
} }

View File

@ -30,8 +30,6 @@ namespace BizHawk.Client.EmuHawk
InitializeComponent(); InitializeComponent();
} }
#region IVirtualPadControl Implementation
public void UpdateValues() public void UpdateValues()
{ {
if (AnalogTrackBar.Value != (int)Global.InputManager.StickyXorAdapter.AxisValue(Name)) if (AnalogTrackBar.Value != (int)Global.InputManager.StickyXorAdapter.AxisValue(Name))
@ -75,8 +73,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
public void Bump(int? x) public void Bump(int? x)
{ {
if (x.HasValue) if (x.HasValue)

View File

@ -23,8 +23,6 @@ namespace BizHawk.Client.EmuHawk
ForeColor = SystemColors.ControlText; ForeColor = SystemColors.ControlText;
} }
#region IVirtualPadControl Implementation
public void Clear() public void Clear()
{ {
if (!ReadOnly) if (!ReadOnly)
@ -75,8 +73,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
protected override void WndProc(ref Message m) protected override void WndProc(ref Message m)
{ {
switch (m.Msg) switch (m.Msg)

View File

@ -64,8 +64,6 @@ namespace BizHawk.Client.EmuHawk
} }
#region IVirtualPadControl
public void Clear() public void Clear()
{ {
} }
@ -132,8 +130,6 @@ namespace BizHawk.Client.EmuHawk
public bool ReadOnly { get; set; } public bool ReadOnly { get; set; }
#endregion
private void lvDiscs_SelectedIndexChanged(object sender, EventArgs e) private void lvDiscs_SelectedIndexChanged(object sender, EventArgs e)
{ {
// emergency measure: if no selection, set no disc // emergency measure: if no selection, set no disc

View File

@ -32,8 +32,6 @@ namespace BizHawk.Client.EmuHawk
YNumeric.Maximum = TargetPanel.Height - 1; YNumeric.Maximum = TargetPanel.Height - 1;
} }
#region IVirtualPadControl Implementation
public void UpdateValues() public void UpdateValues()
{ {
TargetPanel.Refresh(); TargetPanel.Refresh();
@ -99,8 +97,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
// Size of the extra controls to the right / bottom of the target panel at 96 DPI // Size of the extra controls to the right / bottom of the target panel at 96 DPI
private Size PaddingSize => new Size(0, 30); private Size PaddingSize => new Size(0, 30);

View File

@ -40,8 +40,6 @@ namespace BizHawk.Client.EmuHawk
private bool _dropdownDontfire; // Used as a hack to get around lame .net dropdowns, there's no way to set their index without firing the SelectedIndexChanged event! private bool _dropdownDontfire; // Used as a hack to get around lame .net dropdowns, there's no way to set their index without firing the SelectedIndexChanged event!
#region Initialize, Load, and Save
public RamSearch() public RamSearch()
{ {
SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true);
@ -233,10 +231,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Public
/// <summary> /// <summary>
/// This should be called anytime the search list changes /// This should be called anytime the search list changes
/// </summary> /// </summary>
@ -413,10 +407,6 @@ namespace BizHawk.Client.EmuHawk
mi?.Invoke(radios[index], new object[] { new EventArgs() }); mi?.Invoke(radios[index], new object[] { new EventArgs() });
} }
#endregion
#region Private
private void ToggleSearchDependentToolBarItems() private void ToggleSearchDependentToolBarItems()
{ {
DoSearchToolButton.Enabled = DoSearchToolButton.Enabled =
@ -937,8 +927,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
public class RamSearchSettings : ToolDialogSettings public class RamSearchSettings : ToolDialogSettings
{ {
public RamSearchSettings() public RamSearchSettings()
@ -965,10 +953,6 @@ namespace BizHawk.Client.EmuHawk
public RecentFiles RecentSearches { get; set; } public RecentFiles RecentSearches { get; set; }
} }
#region Winform Events
#region File
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
SaveMenuItem.Enabled = !string.IsNullOrWhiteSpace(_currentFileName); SaveMenuItem.Enabled = !string.IsNullOrWhiteSpace(_currentFileName);
@ -1040,10 +1024,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
#region Settings
private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e) private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
CheckMisalignedMenuItem.Checked = _settings.CheckMisAligned; CheckMisalignedMenuItem.Checked = _settings.CheckMisAligned;
@ -1183,10 +1163,6 @@ namespace BizHawk.Client.EmuHawk
_searches.SetEndian(_settings.BigEndian); _searches.SetEndian(_settings.BigEndian);
} }
#endregion
#region Search
private void SearchSubMenu_DropDownOpened(object sender, EventArgs e) private void SearchSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
ClearChangeCountsMenuItem.Enabled = _settings.IsDetailed(); ClearChangeCountsMenuItem.Enabled = _settings.IsDetailed();
@ -1294,10 +1270,6 @@ namespace BizHawk.Client.EmuHawk
UpdateUndoToolBarButtons(); UpdateUndoToolBarButtons();
} }
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
AutoloadDialogMenuItem.Checked = Settings.AutoLoad; AutoloadDialogMenuItem.Checked = Settings.AutoLoad;
@ -1392,10 +1364,6 @@ namespace BizHawk.Client.EmuHawk
SetColumns(); SetColumns();
} }
#endregion
#region ContextMenu and Toolbar
private void ListViewContextMenu_Opening(object sender, CancelEventArgs e) private void ListViewContextMenu_Opening(object sender, CancelEventArgs e)
{ {
DoSearchContextMenuItem.Enabled = _searches.Count > 0; DoSearchContextMenuItem.Enabled = _searches.Count > 0;
@ -1509,10 +1477,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Compare To Box
private void PreviousValueRadio_Click(object sender, EventArgs e) private void PreviousValueRadio_Click(object sender, EventArgs e)
{ {
SpecificValueBox.Enabled = false; SpecificValueBox.Enabled = false;
@ -1611,10 +1575,6 @@ namespace BizHawk.Client.EmuHawk
SetCompareValue(((INumberBox)sender).ToRawInt()); SetCompareValue(((INumberBox)sender).ToRawInt());
} }
#endregion
#region Comparison Operator Box
private void EqualToRadio_Click(object sender, EventArgs e) private void EqualToRadio_Click(object sender, EventArgs e)
{ {
DifferentByBox.Enabled = false; DifferentByBox.Enabled = false;
@ -1676,10 +1636,6 @@ namespace BizHawk.Client.EmuHawk
WatchListView.Refresh(); WatchListView.Refresh();
} }
#endregion
#region ListView Events
private void WatchListView_KeyDown(object sender, KeyEventArgs e) private void WatchListView_KeyDown(object sender, KeyEventArgs e)
{ {
switch (e.KeyCode) switch (e.KeyCode)
@ -1736,10 +1692,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Dialog Events
private void NewRamSearch_Activated(object sender, EventArgs e) private void NewRamSearch_Activated(object sender, EventArgs e)
{ {
WatchListView.Refresh(); WatchListView.Refresh();
@ -1769,9 +1721,5 @@ namespace BizHawk.Client.EmuHawk
{ {
GenericDragEnter(sender, e); GenericDragEnter(sender, e);
} }
#endregion
#endregion
} }
} }

View File

@ -99,8 +99,6 @@ namespace BizHawk.Client.EmuHawk
public IEnumerable<Watch> Watches => _watches.Where(x => !x.IsSeparator); public IEnumerable<Watch> Watches => _watches.Where(x => !x.IsSeparator);
#region API
public void AddWatch(Watch watch) public void AddWatch(Watch watch)
{ {
_watches.Add(watch); _watches.Add(watch);
@ -234,10 +232,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Private Methods
private void MinimalUpdate() private void MinimalUpdate()
{ {
if ((!IsHandleCreated || IsDisposed) && !Config.DisplayRamWatch) if ((!IsHandleCreated || IsDisposed) && !Config.DisplayRamWatch)
@ -637,12 +631,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
#endregion
#region Winform Events
#region File Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e) private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
SaveMenuItem.Enabled = _watches.Changes; SaveMenuItem.Enabled = _watches.Changes;
@ -691,10 +679,6 @@ namespace BizHawk.Client.EmuHawk
Close(); Close();
} }
#endregion
#region Watch
private void WatchesSubMenu_DropDownOpened(object sender, EventArgs e) private void WatchesSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
EditWatchMenuItem.Enabled = EditWatchMenuItem.Enabled =
@ -945,10 +929,6 @@ namespace BizHawk.Client.EmuHawk
WatchListView.SelectAll(); WatchListView.SelectAll();
} }
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
WatchesOnScreenMenuItem.Checked = Config.DisplayRamWatch; WatchesOnScreenMenuItem.Checked = Config.DisplayRamWatch;
@ -1029,10 +1009,6 @@ namespace BizHawk.Client.EmuHawk
SetColumns(); SetColumns();
} }
#endregion
#region Dialog, Context Menu, and ListView Events
private void RamWatch_Load(object sender, EventArgs e) private void RamWatch_Load(object sender, EventArgs e)
{ {
// Hack for previous config settings // Hack for previous config settings
@ -1230,9 +1206,6 @@ namespace BizHawk.Client.EmuHawk
UpdateStatusBar(); UpdateStatusBar();
} }
#endregion
#endregion
// Stupid designer // Stupid designer
protected void DragEnterWrapper(object sender, DragEventArgs e) protected void DragEnterWrapper(object sender, DragEventArgs e)
{ {

View File

@ -200,8 +200,6 @@ namespace BizHawk.Client.EmuHawk
BigEndianCheckBox.Checked = domain.EndianType == Emu.MemoryDomain.Endian.Big; BigEndianCheckBox.Checked = domain.EndianType == Emu.MemoryDomain.Endian.Big;
} }
#region Events
private void Cancel_Click(object sender, EventArgs e) private void Cancel_Click(object sender, EventArgs e)
{ {
DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
@ -323,7 +321,5 @@ namespace BizHawk.Client.EmuHawk
{ {
_changedDisplayType = true; _changedDisplayType = true;
} }
#endregion
} }
} }

View File

@ -16,8 +16,6 @@ namespace BizHawk.Common
// to do anything useful, passed targets should be [StructLayout.Sequential] or [StructLayout.Explicit] // to do anything useful, passed targets should be [StructLayout.Sequential] or [StructLayout.Explicit]
public class BinaryQuickSerializer public class BinaryQuickSerializer
{ {
#region methodinfo from a lambda expression. cool.
private static MethodInfo FromExpression(Expression e) private static MethodInfo FromExpression(Expression e)
{ {
var caller = e as MethodCallExpression; var caller = e as MethodCallExpression;
@ -34,10 +32,6 @@ namespace BizHawk.Common
return FromExpression(f.Body); return FromExpression(f.Body);
} }
#endregion
#region read and write handlers for individual fields
private static readonly Dictionary<Type, MethodInfo> Readhandlers = new Dictionary<Type, MethodInfo>(); private static readonly Dictionary<Type, MethodInfo> Readhandlers = new Dictionary<Type, MethodInfo>();
private static readonly Dictionary<Type, MethodInfo> Writehandlers = new Dictionary<Type, MethodInfo>(); private static readonly Dictionary<Type, MethodInfo> Writehandlers = new Dictionary<Type, MethodInfo>();
@ -93,10 +87,6 @@ namespace BizHawk.Common
AddW<ulong>(r => r.Write(0UL)); AddW<ulong>(r => r.Write(0UL));
} }
#endregion
#region dynamic code generation
private delegate void Reader(object target, BinaryReader r); private delegate void Reader(object target, BinaryReader r);
private delegate void Writer(object target, BinaryWriter w); private delegate void Writer(object target, BinaryWriter w);
@ -171,8 +161,6 @@ namespace BizHawk.Common
}; };
} }
#endregion
private static readonly IDictionary<Type, SerializationFactory> Serializers = private static readonly IDictionary<Type, SerializationFactory> Serializers =
new ConcurrentDictionary<Type, SerializationFactory>(); new ConcurrentDictionary<Type, SerializationFactory>();

View File

@ -14,8 +14,6 @@ namespace BizHawk.Common
{ {
public Serializer() { } public Serializer() { }
#region Public
public bool IsReader => _isReader; public bool IsReader => _isReader;
public bool IsWriter => !IsReader; public bool IsWriter => !IsReader;
@ -749,10 +747,6 @@ namespace BizHawk.Common
} }
} }
#endregion
#region Privates
private BinaryReader _br; private BinaryReader _br;
private BinaryWriter _bw; private BinaryWriter _bw;
private TextReader _tr; private TextReader _tr;
@ -1283,7 +1277,5 @@ namespace BizHawk.Common
public string Name = ""; public string Name = "";
public readonly Dictionary<string, string> Items = new Dictionary<string, string>(); public readonly Dictionary<string, string> Items = new Dictionary<string, string>();
} }
#endregion
} }
} }

View File

@ -363,8 +363,6 @@ namespace BizHawk.Emulation.Common
} }
} }
#region Internal Classes
public class Track public class Track
{ {
public string TrackIdent { get; set; } public string TrackIdent { get; set; }
@ -407,7 +405,5 @@ namespace BizHawk.Emulation.Common
public int GetChecksum256() => SectorData.Sum(b => b % 256); public int GetChecksum256() => SectorData.Sum(b => b % 256);
} }
#endregion
} }
} }

View File

@ -18,8 +18,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
NONE, NOT_FOUND, ILLEGAL_REGISTRATIONS, INVALID_HEADER, READ_ERROR, WRITE_ERROR, DISABLED NONE, NOT_FOUND, ILLEGAL_REGISTRATIONS, INVALID_HEADER, READ_ERROR, WRITE_ERROR, DISABLED
}; };
#region C API
// main launcher // main launcher
[DllImport(dll, CallingConvention = cc)] [DllImport(dll, CallingConvention = cc)]
public static extern uint mame_launch(int argc, string[] argv); public static extern uint mame_launch(int argc, string[] argv);
@ -30,10 +28,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
[DllImport(dll, CallingConvention = cc)] [DllImport(dll, CallingConvention = cc)]
public static extern SaveError mame_load_buffer(byte[] buf, int length); public static extern SaveError mame_load_buffer(byte[] buf, int length);
#endregion
#region Lua API
// execute // execute
[DllImport(dll, CallingConvention = cc)] [DllImport(dll, CallingConvention = cc)]
public static extern void mame_lua_execute(string code); public static extern void mame_lua_execute(string code);
@ -58,10 +52,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
[DllImport(dll, CallingConvention = cc)] [DllImport(dll, CallingConvention = cc)]
public static extern bool mame_lua_free_string(IntPtr pointer); public static extern bool mame_lua_free_string(IntPtr pointer);
#endregion
#region Callbacks
// periodic // periodic
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PeriodicCallbackDelegate(); public delegate void PeriodicCallbackDelegate();
@ -85,7 +75,5 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
public delegate void LogCallbackDelegate(OutputChannel channel, int size, string data); public delegate void LogCallbackDelegate(OutputChannel channel, int size, string data);
[DllImport(dll, CallingConvention = cc)] [DllImport(dll, CallingConvention = cc)]
public static extern void mame_set_log_callback(LogCallbackDelegate cb); public static extern void mame_set_log_callback(LogCallbackDelegate cb);
#endregion
} }
} }

View File

@ -1,5 +1,3 @@
#region Implementation docs
/* /*
FrameAdvance() FrameAdvance()
@ -68,8 +66,6 @@ made that way to make the buffer persist actoss C API calls.
*/ */
#endregion
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -116,8 +112,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
} }
} }
#region Utility
private static string MameGetString(string command) private static string MameGetString(string command)
{ {
IntPtr ptr = LibMAME.mame_lua_get_string(command, out var lengthInBytes); IntPtr ptr = LibMAME.mame_lua_get_string(command, out var lengthInBytes);
@ -138,10 +132,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
return ret; return ret;
} }
#endregion
#region Properties
public IEmulatorServiceProvider ServiceProvider { get; } public IEmulatorServiceProvider ServiceProvider { get; }
public ControllerDefinition ControllerDefinition => MAMEController; public ControllerDefinition ControllerDefinition => MAMEController;
public string SystemId => "MAME"; public string SystemId => "MAME";
@ -163,10 +153,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
[FeatureNotImplemented] [FeatureNotImplemented]
public IInputCallbackSystem InputCallbacks => throw new NotImplementedException(); public IInputCallbackSystem InputCallbacks => throw new NotImplementedException();
#endregion
#region Fields
private SyncSettings _syncSettings; private SyncSettings _syncSettings;
private Thread _mameThread; private Thread _mameThread;
private ManualResetEvent _mameStartupComplete = new ManualResetEvent(false); private ManualResetEvent _mameStartupComplete = new ManualResetEvent(false);
@ -197,10 +183,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
private LibMAME.BootCallbackDelegate _bootCallback; private LibMAME.BootCallbackDelegate _bootCallback;
private LibMAME.LogCallbackDelegate _logCallback; private LibMAME.LogCallbackDelegate _logCallback;
#endregion
#region Launchers
private void AsyncLaunchMAME() private void AsyncLaunchMAME()
{ {
_mameThread.Start(); _mameThread.Start();
@ -250,10 +232,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
LibMAME.mame_launch(args.Length, args); LibMAME.mame_launch(args.Length, args);
} }
#endregion
#region IEmulator
public bool FrameAdvance(IController controller, bool render, bool renderSound = true) public bool FrameAdvance(IController controller, bool render, bool renderSound = true)
{ {
if (_exiting) if (_exiting)
@ -300,10 +278,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
_hawkSaveBuffer = new byte[0]; _hawkSaveBuffer = new byte[0];
} }
#endregion
#region IStatable
public void SaveStateBinary(BinaryWriter writer) public void SaveStateBinary(BinaryWriter writer)
{ {
writer.Write(_mameSaveBuffer.Length); writer.Write(_mameSaveBuffer.Length);
@ -364,10 +338,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
return _hawkSaveBuffer; return _hawkSaveBuffer;
} }
#endregion
#region ISettable
public object GetSettings() => null; public object GetSettings() => null;
public PutSettingsDirtyBits PutSettings(object o) => PutSettingsDirtyBits.None; public PutSettingsDirtyBits PutSettings(object o) => PutSettingsDirtyBits.None;
@ -398,10 +368,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
public ExpandoObject ExpandoSettings { get; set; } public ExpandoObject ExpandoSettings { get; set; }
} }
#endregion
#region ISoundProvider
public void SetSyncMode(SyncSoundMode mode) public void SetSyncMode(SyncSoundMode mode)
{ {
if (mode == SyncSoundMode.Async) if (mode == SyncSoundMode.Async)
@ -471,10 +437,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
_audioSamples.Clear(); _audioSamples.Clear();
} }
#endregion
#region IMemoryDomains
private byte _peek(long addr, int firstOffset, long size) private byte _peek(long addr, int firstOffset, long size)
{ {
if (addr < 0 || addr >= size) if (addr < 0 || addr >= size)
@ -576,10 +538,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
(ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(_memoryDomains); (ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(_memoryDomains);
} }
#endregion
#region Updaters
private void UpdateFramerate() private void UpdateFramerate()
{ {
VsyncNumerator = 1000000000; VsyncNumerator = 1000000000;
@ -646,10 +604,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
$"MAMEHawk is { version }"); $"MAMEHawk is { version }");
} }
#endregion
#region Callbacks
private void MAMEPeriodicCallback() private void MAMEPeriodicCallback()
{ {
if (_exiting) if (_exiting)
@ -757,10 +711,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
} }
} }
#endregion
#region Input
public static ControllerDefinition MAMEController = new ControllerDefinition public static ControllerDefinition MAMEController = new ControllerDefinition
{ {
Name = "MAME Controller", Name = "MAME Controller",
@ -800,10 +750,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
} }
} }
#endregion
#region Lua Commands
private class MAMELuaCommand private class MAMELuaCommand
{ {
// commands // commands
@ -861,7 +807,5 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
"table.sort(final) " + "table.sort(final) " +
"return table.concat(final)"; "return table.concat(final)";
} }
#endregion
} }
} }

View File

@ -163,8 +163,6 @@ namespace BizHawk.Emulation.Cores.Components.M68000
return res; return res;
} }
#region Tables
static readonly string[] Size2_0 = { "01", "11", "10" }; static readonly string[] Size2_0 = { "01", "11", "10" };
static readonly string[] Size2_1 = { "00", "01", "10" }; static readonly string[] Size2_1 = { "00", "01", "10" };
static readonly string[] Size1 = { "0", "1" }; static readonly string[] Size1 = { "0", "1" };
@ -347,7 +345,5 @@ namespace BizHawk.Emulation.Cores.Components.M68000
"1110", // GT Greater Than (signed) "1110", // GT Greater Than (signed)
"1111" // LE Less or Equal (signed) "1111" // LE Less or Equal (signed)
}; };
#endregion
} }
} }

View File

@ -431,8 +431,6 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
return temp; return temp;
} }
#region IDisassemblable
public string Cpu public string Cpu
{ {
get => "Z80"; get => "Z80";
@ -451,7 +449,5 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
string ret = Disassemble((ushort)addr, a => m.PeekByte(a), out length); string ret = Disassemble((ushort)addr, a => m.PeekByte(a), out length);
return ret; return ret;
} }
#endregion
} }
} }

View File

@ -43,8 +43,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
CoreComm.Notify(sb.ToString()); CoreComm.Notify(sb.ToString());
} }
#region Input Message Methods
/// <summary> /// <summary>
/// Called when certain input presses are detected /// Called when certain input presses are detected
/// </summary> /// </summary>
@ -55,10 +53,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
SendMessage(sb.ToString().TrimEnd('\n'), MessageCategory.Input); SendMessage(sb.ToString().TrimEnd('\n'), MessageCategory.Input);
} }
#endregion
#region DiskDevice Message Methods
/// <summary> /// <summary>
/// Disk message that is fired on core init /// Disk message that is fired on core init
/// </summary> /// </summary>
@ -146,10 +140,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region TapeDevice Message Methods
/// <summary> /// <summary>
/// Tape message that is fired on core init /// Tape message that is fired on core init
/// </summary> /// </summary>
@ -458,8 +448,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
SendMessage(sb.ToString().TrimEnd('\n'), MessageCategory.Tape); SendMessage(sb.ToString().TrimEnd('\n'), MessageCategory.Tape);
} }
#endregion
/// <summary> /// <summary>
/// Checks whether message category is allowed to be sent /// Checks whether message category is allowed to be sent
/// </summary> /// </summary>

View File

@ -185,20 +185,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
#region IRegionable
public DisplayType Region => DisplayType.PAL; public DisplayType Region => DisplayType.PAL;
#endregion
#region IDriveLight
public bool DriveLightEnabled => true; public bool DriveLightEnabled => true;
public bool DriveLightOn => public bool DriveLightOn =>
(_machine?.TapeDevice != null && _machine.TapeDevice.TapeIsPlaying) (_machine?.TapeDevice != null && _machine.TapeDevice.TapeIsPlaying)
|| (_machine?.UPDDiskDevice != null && _machine.UPDDiskDevice.DriveLight); || (_machine?.UPDDiskDevice != null && _machine.UPDDiskDevice.DriveLight);
#endregion
} }
} }

View File

@ -12,8 +12,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public class DatacorderDevice public class DatacorderDevice
{ {
#region Construction
private CPCBase _machine; private CPCBase _machine;
private Z80A _cpu => _machine.CPU; private Z80A _cpu => _machine.CPU;
private IBeeperDevice _buzzer => _machine.TapeBuzzer; private IBeeperDevice _buzzer => _machine.TapeBuzzer;
@ -34,10 +32,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
_machine = machine; _machine = machine;
} }
#endregion
#region State Information
/// <summary> /// <summary>
/// Signs whether the tape motor is running /// Signs whether the tape motor is running
/// </summary> /// </summary>
@ -142,20 +136,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private bool currentState = false; private bool currentState = false;
#endregion
#region Datacorder Device Settings
/// <summary> /// <summary>
/// Signs whether the device should autodetect when the Z80 has entered into /// Signs whether the device should autodetect when the Z80 has entered into
/// 'load' mode and auto-play the tape if neccesary /// 'load' mode and auto-play the tape if neccesary
/// </summary> /// </summary>
private bool _autoPlay; private bool _autoPlay;
#endregion
#region Emulator
/// <summary> /// <summary>
/// Should be fired at the end of every frame /// Should be fired at the end of every frame
/// Primary purpose is to detect tape traps and manage auto play (if/when this is ever implemented) /// Primary purpose is to detect tape traps and manage auto play (if/when this is ever implemented)
@ -170,10 +156,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
//_buzzer.ProcessPulseValue(currentState); //_buzzer.ProcessPulseValue(currentState);
} }
#endregion
#region Tape Controls
/// <summary> /// <summary>
/// Starts the tape playing from the beginning of the current block /// Starts the tape playing from the beginning of the current block
/// </summary> /// </summary>
@ -380,10 +362,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
RTZ(); RTZ();
} }
#endregion
#region Tape Device Methods
/// <summary> /// <summary>
/// Is called every cpu cycle but runs every 50 t-states /// Is called every cpu cycle but runs every 50 t-states
/// This enables the tape devices to play out even if the spectrum itself is not /// This enables the tape devices to play out even if the spectrum itself is not
@ -642,11 +620,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
currentState = !currentState; currentState = !currentState;
} }
#endregion
#region TapeMonitor
public void AutoStopTape() public void AutoStopTape()
{ {
@ -743,10 +716,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
*/ */
#endregion
#region IPortIODevice
/// <summary> /// <summary>
/// Mask constants /// Mask constants
/// </summary> /// </summary>
@ -800,10 +769,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
*/ */
} }
#endregion
#region State Serialization
/// <summary> /// <summary>
/// BizHawk state serialization /// BizHawk state serialization
/// </summary> /// </summary>
@ -820,7 +785,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.Sync(nameof(tapeMotor), ref tapeMotor); ser.Sync(nameof(tapeMotor), ref tapeMotor);
ser.EndSection(); ser.EndSection();
} }
#endregion
} }
} }

View File

@ -56,8 +56,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public int DataID { get; set; } public int DataID { get; set; }
#region Helper Methods
/// <summary> /// <summary>
/// Missing Address Mark (Sector_ID or DAM not found) /// Missing Address Mark (Sector_ID or DAM not found)
/// </summary> /// </summary>
@ -174,7 +172,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
else { NECUPD765.UnSetBit(6, ref _flag2); } else { NECUPD765.UnSetBit(6, ref _flag2); }
} }
} }
#endregion
} }
} }

View File

@ -6,18 +6,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// <summary> /// <summary>
/// Definitions /// Definitions
/// </summary> /// </summary>
#region Attribution
/* /*
Implementation based on the information contained here: Implementation based on the information contained here:
http://www.cpcwiki.eu/index.php/765_FDC http://www.cpcwiki.eu/index.php/765_FDC
and here: and here:
http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf
*/ */
#endregion
public partial class NECUPD765 public partial class NECUPD765
{ {
#region Enums
/// <summary> /// <summary>
/// Defines the current phase of the controller /// Defines the current phase of the controller
/// </summary> /// </summary>
@ -307,10 +303,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
Decrement Decrement
} }
#endregion
#region Constants
// Command Instruction Constants // Command Instruction Constants
// Designates the default postitions within the cmdbuffer array // Designates the default postitions within the cmdbuffer array
@ -683,10 +675,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public const int SEEK_ABNORMALTERM = 5; public const int SEEK_ABNORMALTERM = 5;
public const int SEEK_DRIVENOTREADY = 6; public const int SEEK_DRIVENOTREADY = 6;
#endregion
#region Classes & Structs
/// <summary> /// <summary>
/// Class that holds information about a specific command /// Class that holds information about a specific command
/// </summary> /// </summary>
@ -819,8 +807,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.EndSection(); ser.EndSection();
} }
} }
#endregion
} }
} }

View File

@ -8,18 +8,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// <summary> /// <summary>
/// FDC State and Methods /// FDC State and Methods
/// </summary> /// </summary>
#region Attribution
/* /*
Implementation based on the information contained here: Implementation based on the information contained here:
http://www.cpcwiki.eu/index.php/765_FDC http://www.cpcwiki.eu/index.php/765_FDC
and here: and here:
http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf
*/ */
#endregion
public partial class NECUPD765 public partial class NECUPD765
{ {
#region Controller State
/// <summary> /// <summary>
/// Signs whether the drive is active /// Signs whether the drive is active
/// </summary> /// </summary>
@ -275,12 +271,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
*/ */
private byte Status3; private byte Status3;
#endregion
#region UPD Internal Functions
#region READ Commands
/// <summary> /// <summary>
/// Read Data /// Read Data
/// COMMAND: 8 parameter bytes /// COMMAND: 8 parameter bytes
@ -1263,10 +1253,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region WRITE Commands
/// <summary> /// <summary>
/// Write Data /// Write Data
/// COMMAND: 8 parameter bytes /// COMMAND: 8 parameter bytes
@ -1741,10 +1727,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region SCAN Commands
/// <summary> /// <summary>
/// Scan Equal /// Scan Equal
/// COMMAND: 8 parameter bytes /// COMMAND: 8 parameter bytes
@ -1853,10 +1835,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region OTHER Commands
/// <summary> /// <summary>
/// Specify /// Specify
/// COMMAND: 2 parameter bytes /// COMMAND: 2 parameter bytes
@ -2326,12 +2304,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#endregion
#region Controller Methods
/// <summary> /// <summary>
/// Called when a status register read is required /// Called when a status register read is required
/// This can be called at any time /// This can be called at any time
@ -2810,7 +2782,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
CommCounter = 0; CommCounter = 0;
ResCounter = 0; ResCounter = 0;
} }
#endregion
} }
} }

View File

@ -8,18 +8,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// <summary> /// <summary>
/// Floppy drive related stuff /// Floppy drive related stuff
/// </summary> /// </summary>
#region Attribution
/* /*
Implementation based on the information contained here: Implementation based on the information contained here:
http://www.cpcwiki.eu/index.php/765_FDC http://www.cpcwiki.eu/index.php/765_FDC
and here: and here:
http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf
*/ */
#endregion
public partial class NECUPD765 : IFDDHost public partial class NECUPD765 : IFDDHost
{ {
#region Drive State
/// <summary> /// <summary>
/// FDD Flag - motor on/off /// FDD Flag - motor on/off
/// </summary> /// </summary>
@ -50,10 +46,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private DriveState[] DriveStates = new DriveState[4]; private DriveState[] DriveStates = new DriveState[4];
#endregion
#region FDD Methods
/// <summary> /// <summary>
/// Initialization / reset of the floppy drive subsystem /// Initialization / reset of the floppy drive subsystem
/// </summary> /// </summary>
@ -145,10 +137,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return sector; return sector;
} }
#endregion
#region IFDDHost
// IFDDHost methods that fall through to the currently active drive // IFDDHost methods that fall through to the currently active drive
/// <summary> /// <summary>
@ -180,17 +168,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public FloppyDisk Disk { get; set; } public FloppyDisk Disk { get; set; }
#endregion
#region Drive Status Class
/// <summary> /// <summary>
/// Holds specfic state information about a drive /// Holds specfic state information about a drive
/// </summary> /// </summary>
private class DriveState : IFDDHost private class DriveState : IFDDHost
{ {
#region State
/// <summary> /// <summary>
/// The drive ID from an FDC perspective /// The drive ID from an FDC perspective
/// </summary> /// </summary>
@ -304,10 +286,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private NECUPD765 FDC; private NECUPD765 FDC;
#endregion
#region Lookups
/// <summary> /// <summary>
/// TRUE if we are on track 0 /// TRUE if we are on track 0
/// </summary> /// </summary>
@ -320,9 +298,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region Public Methods
/* /*
/// <summary> /// <summary>
/// Moves the head across the disk cylinders /// Moves the head across the disk cylinders
@ -763,20 +738,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
*/ */
#endregion
#region Construction
public DriveState(int driveID, NECUPD765 fdc) public DriveState(int driveID, NECUPD765 fdc)
{ {
ID = driveID; ID = driveID;
FDC = fdc; FDC = fdc;
} }
#endregion
#region IFDDHost
/// <summary> /// <summary>
/// Parses a new disk image and loads it into this floppy drive /// Parses a new disk image and loads it into this floppy drive
/// </summary> /// </summary>
@ -837,10 +804,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region StateSerialization
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
ser.Sync(nameof(ID), ref ID); ser.Sync(nameof(ID), ref ID);
@ -866,10 +829,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
//ser.SyncEnum(nameof(SeekState), ref SeekState); //ser.SyncEnum(nameof(SeekState), ref SeekState);
//ser.SyncEnum(nameof(SeekIntState), ref SeekIntState); //ser.SyncEnum(nameof(SeekIntState), ref SeekIntState);
} }
#endregion
} }
#endregion
} }
} }

View File

@ -8,18 +8,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// <summary> /// <summary>
/// IPortIODevice /// IPortIODevice
/// </summary> /// </summary>
#region Attribution
/* /*
Implementation based on the information contained here: Implementation based on the information contained here:
http://www.cpcwiki.eu/index.php/765_FDC http://www.cpcwiki.eu/index.php/765_FDC
and here: and here:
http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf
*/ */
#endregion
public partial class NECUPD765 : IPortIODevice public partial class NECUPD765 : IPortIODevice
{ {
#region Dev Logging
public string outputfile = @"D:\Dropbox\Dropbox\_Programming\TASVideos\BizHawk\output\zxhawkio-" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".csv"; public string outputfile = @"D:\Dropbox\Dropbox\_Programming\TASVideos\BizHawk\output\zxhawkio-" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".csv";
public string outputString = "STATUS,WRITE,READ,CODE,MT,MF,SK,CMDCNT,RESCNT,EXECCNT,EXECLEN\r\n"; public string outputString = "STATUS,WRITE,READ,CODE,MT,MF,SK,CMDCNT,RESCNT,EXECCNT,EXECLEN\r\n";
public bool writeDebug = false; public bool writeDebug = false;
@ -69,8 +65,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
dLog.Add(sb.ToString()); dLog.Add(sb.ToString());
} }
#endregion
public void ReadStatus(ref int data) public void ReadStatus(ref int data)
{ {
// read main status register // read main status register

View File

@ -4,14 +4,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// <summary> /// <summary>
/// Timimng /// Timimng
/// </summary> /// </summary>
#region Attribution
/* /*
Implementation based on the information contained here: Implementation based on the information contained here:
http://www.cpcwiki.eu/index.php/765_FDC http://www.cpcwiki.eu/index.php/765_FDC
and here: and here:
http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf
*/ */
#endregion
public partial class NECUPD765 public partial class NECUPD765
{ {
/// <summary> /// <summary>

View File

@ -6,27 +6,19 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// <summary> /// <summary>
/// The NEC floppy disk controller (and floppy drive) found in the +3 /// The NEC floppy disk controller (and floppy drive) found in the +3
/// </summary> /// </summary>
#region Attribution
/* /*
Implementation based on the information contained here: Implementation based on the information contained here:
http://www.cpcwiki.eu/index.php/765_FDC http://www.cpcwiki.eu/index.php/765_FDC
and here: and here:
http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf
*/ */
#endregion
public partial class NECUPD765 public partial class NECUPD765
{ {
#region Devices
/// <summary> /// <summary>
/// The emulated spectrum machine /// The emulated spectrum machine
/// </summary> /// </summary>
private CPCBase _machine; private CPCBase _machine;
#endregion
#region Construction & Initialization
/// <summary> /// <summary>
/// Main constructor /// Main constructor
/// </summary> /// </summary>
@ -148,10 +140,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}; };
} }
#endregion
#region State Serialization
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
void SyncFDDState(Serializer ser1) void SyncFDDState(Serializer ser1)
@ -242,7 +230,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
SyncTimingState(ser); SyncTimingState(ser);
ser.EndSection(); ser.EndSection();
} }
#endregion
} }
} }

View File

@ -5,14 +5,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// <summary> /// <summary>
/// Static helper methods /// Static helper methods
/// </summary> /// </summary>
#region Attribution
/* /*
Implementation based on the information contained here: Implementation based on the information contained here:
http://www.cpcwiki.eu/index.php/765_FDC http://www.cpcwiki.eu/index.php/765_FDC
and here: and here:
http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf
*/ */
#endregion
public partial class NECUPD765 public partial class NECUPD765
{ {
/// <summary> /// <summary>

View File

@ -16,8 +16,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public class AmstradGateArray : IPortIODevice, IVideoProvider public class AmstradGateArray : IPortIODevice, IVideoProvider
{ {
#region Devices
private CPCBase _machine; private CPCBase _machine;
private Z80A CPU => _machine.CPU; private Z80A CPU => _machine.CPU;
private CRCT_6845 CRCT => _machine.CRCT; private CRCT_6845 CRCT => _machine.CRCT;
@ -30,10 +28,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private GateArrayType ChipType; private GateArrayType ChipType;
#endregion
#region Palettes
/// <summary> /// <summary>
/// The standard CPC Pallete (ordered by firmware #) /// The standard CPC Pallete (ordered by firmware #)
/// http://www.cpcwiki.eu/index.php/CPC_Palette /// http://www.cpcwiki.eu/index.php/CPC_Palette
@ -109,10 +103,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
Colors.ARGB(0x80, 0x80, 0xFF), // Pastel Blue Colors.ARGB(0x80, 0x80, 0xFF), // Pastel Blue
}; };
#endregion
#region Clocks and Timing
/// <summary> /// <summary>
/// The Gate Array Clock Speed /// The Gate Array Clock Speed
/// </summary> /// </summary>
@ -143,10 +133,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public int GAFrameLength = 319488; public int GAFrameLength = 319488;
#endregion
#region Construction
public AmstradGateArray(CPCBase machine, GateArrayType chipType) public AmstradGateArray(CPCBase machine, GateArrayType chipType)
{ {
_machine = machine; _machine = machine;
@ -164,10 +150,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
CalculateNextScreenMemory(); CalculateNextScreenMemory();
} }
#endregion
#region Registers and Internal State
/// <summary> /// <summary>
/// PENR (register 0) - Pen Selection /// PENR (register 0) - Pen Selection
/// This register can be used to select one of the 17 color-registers (pen 0 to 15 or the border). /// This register can be used to select one of the 17 color-registers (pen 0 to 15 or the border).
@ -427,10 +409,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private byte VideoByte2; private byte VideoByte2;
#endregion
#region Clock Business
/// <summary> /// <summary>
/// Called every CPU cycle /// Called every CPU cycle
/// In reality the GA is clocked at 16Mhz (4 times the frequency of the CPU) /// In reality the GA is clocked at 16Mhz (4 times the frequency of the CPU)
@ -549,10 +527,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region Frame & Interrupt Handling
/// <summary> /// <summary>
/// The CRCT builds the picture in a strange way, so that the top left of the display area is the first pixel from /// The CRCT builds the picture in a strange way, so that the top left of the display area is the first pixel from
/// video RAM. The borders come either side of the HSYNC and VSYNCs later on: /// video RAM. The borders come either side of the HSYNC and VSYNCs later on:
@ -661,10 +635,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region Rendering Business
/// <summary> /// <summary>
/// Builds up current scanline character information /// Builds up current scanline character information
/// Ther GA modifies HSYNC and VSYNC signals before they are sent to the monitor /// Ther GA modifies HSYNC and VSYNC signals before they are sent to the monitor
@ -923,10 +893,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}); });
} }
#endregion
#region Public Methods
/// <summary> /// <summary>
/// Called when the Z80 acknowledges an interrupt /// Called when the Z80 acknowledges an interrupt
/// </summary> /// </summary>
@ -973,10 +939,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
slCounter = 0; slCounter = 0;
} }
#endregion
#region IVideoProvider
public int[] ScreenBuffer; public int[] ScreenBuffer;
private int _virtualWidth; private int _virtualWidth;
@ -1178,10 +1140,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
set => _borderType = value; set => _borderType = value;
} }
#endregion
#region IPortIODevice
/// <summary> /// <summary>
/// Device responds to an IN instruction /// Device responds to an IN instruction
/// </summary> /// </summary>
@ -1237,10 +1195,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return true; return true;
} }
#endregion
#region Serialization
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
ser.BeginSection("GateArray"); ser.BeginSection("GateArray");
@ -1275,10 +1229,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.EndSection(); ser.EndSection();
} }
#endregion
#region Enums, Classes & Lookups
/// <summary> /// <summary>
/// Represents a single scanline (in characters) /// Represents a single scanline (in characters)
/// </summary> /// </summary>
@ -1379,7 +1329,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
Amstrad40489, Amstrad40489,
} }
#endregion
} }
} }

View File

@ -10,15 +10,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public class CRCT_6845 : IPortIODevice public class CRCT_6845 : IPortIODevice
{ {
#region Devices
private CPCBase _machine { get; set; } private CPCBase _machine { get; set; }
private CRCTType ChipType; private CRCTType ChipType;
#endregion
#region CallBacks
public delegate void CallBack(); public delegate void CallBack();
private CallBack HSYNC_Callbacks; private CallBack HSYNC_Callbacks;
@ -34,10 +28,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
HSYNC_Callbacks += hCall; HSYNC_Callbacks += hCall;
} }
#endregion
#region Construction
public CRCT_6845(CRCTType chipType, CPCBase machine) public CRCT_6845(CRCTType chipType, CPCBase machine)
{ {
_machine = machine; _machine = machine;
@ -48,10 +38,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private const int WRITE = 0; private const int WRITE = 0;
private const int READ = 1; private const int READ = 1;
#endregion
#region Public Lines
/// <summary> /// <summary>
/// Denotes that HSYNC is active /// Denotes that HSYNC is active
/// </summary> /// </summary>
@ -84,10 +70,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public int VLC; public int VLC;
#endregion
#region Public Lookups
/* /*
* These are not accessible directlyon real hardware * These are not accessible directlyon real hardware
* It just makes screen generation easier to have these accessbile from the gate array * It just makes screen generation easier to have these accessbile from the gate array
@ -227,10 +209,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public int LatchedScreenWidthBytes; public int LatchedScreenWidthBytes;
#endregion
#region Internal Registers and State
/* /*
Index Register Name Range CPC Setting Notes Index Register Name Range CPC Setting Notes
0 Horizontal Total 00000000 63 Width of the screen, in characters. Should always be 63 (64 characters). 1 character == 1μs. 0 Horizontal Total 00000000 63 Width of the screen, in characters. Should always be 63 (64 characters). 1 character == 1μs.
@ -430,10 +408,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private int VSYNCCounter; private int VSYNCCounter;
#endregion
#region Public Methods
public void ClockCycle() public void ClockCycle()
{ {
CheckHSYNCOff(); CheckHSYNCOff();
@ -796,10 +770,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
VLC = 0; VLC = 0;
} }
#endregion
#region Internal Methods
/// <summary> /// <summary>
/// Selects a register /// Selects a register
/// </summary> /// </summary>
@ -1018,10 +988,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region PortIODevice
/* /*
#BCXX %x0xxxx00 xxxxxxxx 6845 CRTC Index - Write #BCXX %x0xxxx00 xxxxxxxx 6845 CRTC Index - Write
#BDXX %x0xxxx01 xxxxxxxx 6845 CRTC Data Out - Write #BDXX %x0xxxx01 xxxxxxxx 6845 CRTC Data Out - Write
@ -1094,10 +1060,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return accessed; return accessed;
} }
#endregion
#region Serialization
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
ser.BeginSection("CRTC"); ser.BeginSection("CRTC");
@ -1122,10 +1084,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.EndSection(); ser.EndSection();
} }
#endregion
#region Enums
/// <summary> /// <summary>
/// The types of CRCT chip found in the CPC range /// The types of CRCT chip found in the CPC range
/// </summary> /// </summary>
@ -1138,7 +1096,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
AMS40489 = 3, AMS40489 = 3,
AMS40226 = 4 AMS40226 = 4
} }
#endregion
} }
} }

View File

@ -42,8 +42,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private CRTCType ChipType; private CRTCType ChipType;
#region Construction
/// <summary> /// <summary>
/// The only constructor /// The only constructor
/// </summary> /// </summary>
@ -52,10 +50,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ChipType = type; ChipType = type;
} }
#endregion
#region Input Lines
/// <summary> /// <summary>
/// The ClK isaTTUMOS-compatible input used to synchronize all CRT' functions except for the processor interface. /// The ClK isaTTUMOS-compatible input used to synchronize all CRT' functions except for the processor interface.
/// An external dot counter is used to derive this signal which is usually the character rate in an alphanumeric CRT. /// An external dot counter is used to derive this signal which is usually the character rate in an alphanumeric CRT.
@ -85,10 +79,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private bool _LPSTB; private bool _LPSTB;
#endregion
#region Output Lines
// State output lines // State output lines
/// <summary> /// <summary>
/// This TTL compatible output is an active high signal which drives the monitor directly or is fed to Video Processing Logic for composite generation. /// This TTL compatible output is an active high signal which drives the monitor directly or is fed to Video Processing Logic for composite generation.
@ -199,10 +189,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region Internal State
/// <summary> /// <summary>
/// Character pos address (0 index). /// Character pos address (0 index).
/// Feeds the MA lines /// Feeds the MA lines
@ -291,10 +277,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private int StartAddressLatch; private int StartAddressLatch;
#endregion
#region Internal Registers
/// <summary> /// <summary>
/// The currently selected register /// The currently selected register
/// </summary> /// </summary>
@ -324,10 +306,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private byte AsicStatusRegister2; private byte AsicStatusRegister2;
#endregion
#region Databus Interface
/* /*
RegIdx Register Name Type RegIdx Register Name Type
0 1 2 3 4 0 1 2 3 4
@ -430,10 +408,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return accessed; return accessed;
} }
#endregion
#region Type-Specific Logic
/// <summary> /// <summary>
/// Runs a clock cycle for the current chip type /// Runs a clock cycle for the current chip type
/// CPC will call this every 1Mhz /// CPC will call this every 1Mhz
@ -679,12 +653,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region Type-Specific Internal Methods
#region Sync Widths
/// <summary> /// <summary>
/// Current programmed HSYNC width for Type 0 (HD6845S & UM6845) & Type 1 (UM6845R) /// Current programmed HSYNC width for Type 0 (HD6845S & UM6845) & Type 1 (UM6845R)
/// </summary> /// </summary>
@ -731,10 +699,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
// Vertical Sync is fixed at 16 lines. // Vertical Sync is fixed at 16 lines.
private int VSYNCWidth_Type1_2 => 16; private int VSYNCWidth_Type1_2 => 16;
#endregion
#region Register Access
/// <summary> /// <summary>
/// Read Register (HD6845S & UM6845) /// Read Register (HD6845S & UM6845)
/// </summary> /// </summary>
@ -1129,12 +1093,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return false; return false;
} }
#endregion
#endregion
#region Clock Cycles
/* persistent switch signals */ /* persistent switch signals */
bool s_VS; bool s_VS;
bool s_HDISP; bool s_HDISP;
@ -2147,10 +2105,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
#endregion
#region Enums & Constants
/* Horizontal Timing Register Constants */ /* Horizontal Timing Register Constants */
/// <summary> /// <summary>
/// This 8 bit write-only register determines the horizontal frequency of HS. /// This 8 bit write-only register determines the horizontal frequency of HS.
@ -2283,10 +2237,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
TransparentMemory TransparentMemory
} }
#endregion
#region Serialization
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
ser.BeginSection("CRCT"); ser.BeginSection("CRCT");
@ -2324,7 +2274,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
//ser.Sync(nameof(VS), ref VS); //ser.Sync(nameof(VS), ref VS);
ser.EndSection(); ser.EndSection();
} }
#endregion
} }
} }

View File

@ -10,16 +10,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public class CRTDevice : IVideoProvider public class CRTDevice : IVideoProvider
{ {
#region Devices
private CPCBase _machine; private CPCBase _machine;
private CRCT_6845 CRCT => _machine.CRCT; private CRCT_6845 CRCT => _machine.CRCT;
private AmstradGateArray GateArray => _machine.GateArray; private AmstradGateArray GateArray => _machine.GateArray;
#endregion
#region Construction
public CRTDevice(CPCBase machine) public CRTDevice(CPCBase machine)
{ {
_machine = machine; _machine = machine;
@ -29,10 +23,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
CRCT.AttachVSYNCCallback(OnVSYNC); CRCT.AttachVSYNCCallback(OnVSYNC);
} }
#endregion
#region Palettes
/// <summary> /// <summary>
/// The standard CPC Pallete (ordered by firmware #) /// The standard CPC Pallete (ordered by firmware #)
/// http://www.cpcwiki.eu/index.php/CPC_Palette /// http://www.cpcwiki.eu/index.php/CPC_Palette
@ -109,10 +99,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}; };
#endregion
#region Public Stuff
/// <summary> /// <summary>
/// The current scanline that is being added to /// The current scanline that is being added to
/// (will be processed and committed to the screen buffer every HSYNC) /// (will be processed and committed to the screen buffer every HSYNC)
@ -170,10 +156,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
#endregion
#region IVideoProvider
/// <summary> /// <summary>
/// Video output buffer /// Video output buffer
/// </summary> /// </summary>
@ -232,10 +214,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
protected int[] croppedBuffer; protected int[] croppedBuffer;
#endregion
#region Serialization
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
ser.BeginSection("CRT"); ser.BeginSection("CRT");
@ -247,8 +225,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.Sync(nameof(ScanlineCounter), ref ScanlineCounter); ser.Sync(nameof(ScanlineCounter), ref ScanlineCounter);
ser.EndSection(); ser.EndSection();
} }
#endregion
} }
/// <summary> /// <summary>

View File

@ -11,8 +11,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public class PPI_8255 : IPortIODevice public class PPI_8255 : IPortIODevice
{ {
#region Devices
private CPCBase _machine; private CPCBase _machine;
private CRCT_6845 CRTC => _machine.CRCT; private CRCT_6845 CRTC => _machine.CRCT;
private AmstradGateArray GateArray => _machine.GateArray; private AmstradGateArray GateArray => _machine.GateArray;
@ -20,20 +18,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private DatacorderDevice Tape => _machine.TapeDevice; private DatacorderDevice Tape => _machine.TapeDevice;
private IKeyboard Keyboard => _machine.KeyboardDevice; private IKeyboard Keyboard => _machine.KeyboardDevice;
#endregion
#region Construction
public PPI_8255(CPCBase machine) public PPI_8255(CPCBase machine)
{ {
_machine = machine; _machine = machine;
Reset(); Reset();
} }
#endregion
#region Implementation
/// <summary> /// <summary>
/// BDIR Line connected to PSG /// BDIR Line connected to PSG
/// </summary> /// </summary>
@ -75,8 +65,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private PortDirection DirPortCU => Regs[PORT_CONTROL].Bit(3) ? PortDirection.Input : PortDirection.Output; private PortDirection DirPortCU => Regs[PORT_CONTROL].Bit(3) ? PortDirection.Input : PortDirection.Output;
#region OUT Methods
/// <summary> /// <summary>
/// Writes to Port A /// Writes to Port A
/// </summary> /// </summary>
@ -187,10 +175,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region IN Methods
/// <summary> /// <summary>
/// Reads from Port A /// Reads from Port A
/// </summary> /// </summary>
@ -296,12 +280,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
#endregion
#endregion
#region Reset
public void Reset() public void Reset()
{ {
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
@ -312,10 +290,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
Regs[3] = 0xff; Regs[3] = 0xff;
} }
#endregion
#region IPortIODevice
/* /*
#F4XX %xxxx0x00 xxxxxxxx 8255 PIO Port A (PSG Data) Read Write #F4XX %xxxx0x00 xxxxxxxx 8255 PIO Port A (PSG Data) Read Write
#F5XX %xxxx0x01 xxxxxxxx 8255 PIO Port B (Vsync,PrnBusy,Tape,etc.) Read - #F5XX %xxxx0x01 xxxxxxxx 8255 PIO Port B (Vsync,PrnBusy,Tape,etc.) Read -
@ -419,18 +393,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return true; return true;
} }
#endregion
#region Serialization
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
ser.BeginSection("PPI"); ser.BeginSection("PPI");
ser.Sync(nameof(Regs), ref Regs, false); ser.Sync(nameof(Regs), ref Regs, false);
ser.EndSection(); ser.EndSection();
} }
#endregion
} }
public enum PortDirection public enum PortDirection

View File

@ -13,8 +13,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public class AY38912 : IPSG public class AY38912 : IPSG
{ {
#region Device Fields
/// <summary> /// <summary>
/// The emulated machine (passed in via constructor) /// The emulated machine (passed in via constructor)
/// </summary> /// </summary>
@ -31,10 +29,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
//private int _clockCyclesPerFrame; //private int _clockCyclesPerFrame;
//private int _cyclesPerSample; //private int _cyclesPerSample;
#endregion
#region Construction & Initialization
/// <summary> /// <summary>
/// Main constructor /// Main constructor
/// </summary> /// </summary>
@ -58,12 +52,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
Reset(); Reset();
} }
#endregion
#region AY Implementation
#region Public Properties
/// <summary> /// <summary>
/// AY mixer panning configuration /// AY mixer panning configuration
/// </summary> /// </summary>
@ -124,10 +112,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
set => _activeRegister = (byte)value; set => _activeRegister = (byte)value;
} }
#endregion
#region Public Methods
/// <summary> /// <summary>
/// Resets the PSG /// Resets the PSG
/// </summary> /// </summary>
@ -357,10 +341,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
BufferUpdate(frameCycle); BufferUpdate(frameCycle);
} }
#endregion
#region Private Fields
/// <summary> /// <summary>
/// Register indicies /// Register indicies
/// </summary> /// </summary>
@ -568,10 +548,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
0x905E,0x905E,0xB550,0xB550,0xD7A0,0xD7A0,0xFFFF,0xFFFF, 0x905E,0x905E,0xB550,0xB550,0xD7A0,0xD7A0,0xFFFF,0xFFFF,
}; };
#endregion
#region Private Methods
/// <summary> /// <summary>
/// Forces an update of the volume tables /// Forces an update of the volume tables
/// </summary> /// </summary>
@ -726,12 +702,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
_lastStateRendered = cycle; _lastStateRendered = cycle;
} }
#endregion
#endregion
#region ISoundProvider
public bool CanProvideAsync => false; public bool CanProvideAsync => false;
public SyncSoundMode SyncMode => SyncSoundMode.Sync; public SyncSoundMode SyncMode => SyncSoundMode.Sync;
@ -798,10 +768,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
*/ */
} }
#endregion
#region State Serialization
public int nullDump = 0; public int nullDump = 0;
/// <summary> /// <summary>
@ -866,7 +832,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.EndSection(); ser.EndSection();
} }
#endregion
} }
} }

View File

@ -12,8 +12,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public class Beeper : ISoundProvider, IBeeperDevice public class Beeper : ISoundProvider, IBeeperDevice
{ {
#region Fields and Properties
/// <summary> /// <summary>
/// Sample Rate /// Sample Rate
/// This usually has to be 44100 for ISoundProvider /// This usually has to be 44100 for ISoundProvider
@ -72,10 +70,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
private readonly BlipBuffer blip = new BlipBuffer(883); private readonly BlipBuffer blip = new BlipBuffer(883);
#endregion
#region Private Methods
/// <summary> /// <summary>
/// Takes an int 0-100 and returns the relevant short volume to output /// Takes an int 0-100 and returns the relevant short volume to output
/// </summary> /// </summary>
@ -101,10 +95,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return shortvol / increment; return shortvol / increment;
} }
#endregion
#region Construction & Initialisation
public Beeper(CPCBase machine) public Beeper(CPCBase machine)
{ {
_machine = machine; _machine = machine;
@ -120,10 +110,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
_tStatesPerFrame = tStatesPerFrame; _tStatesPerFrame = tStatesPerFrame;
} }
#endregion
#region IBeeperDevice
/// <summary> /// <summary>
/// Processes an incoming pulse value and adds it to the blipbuffer /// Processes an incoming pulse value and adds it to the blipbuffer
/// </summary> /// </summary>
@ -151,10 +137,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
LastPulse = pulse; LastPulse = pulse;
} }
#endregion
#region ISoundProvider
public bool CanProvideAsync => false; public bool CanProvideAsync => false;
public SyncSoundMode SyncMode => SyncSoundMode.Sync; public SyncSoundMode SyncMode => SyncSoundMode.Sync;
@ -187,10 +169,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region State Serialization
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
ser.BeginSection("Buzzer"); ser.BeginSection("Buzzer");
@ -200,7 +178,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.Sync(nameof(LastPulseTState), ref LastPulseTState); ser.Sync(nameof(LastPulseTState), ref LastPulseTState);
ser.EndSection(); ser.EndSection();
} }
#endregion
} }
} }

View File

@ -8,8 +8,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public partial class CPC464 : CPCBase public partial class CPC464 : CPCBase
{ {
#region Construction
/// <summary> /// <summary>
/// Main constructor /// Main constructor
/// </summary> /// </summary>
@ -39,7 +37,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
InitializeMedia(files); InitializeMedia(files);
} }
#endregion
} }
} }

View File

@ -8,8 +8,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public partial class CPC6128 : CPCBase public partial class CPC6128 : CPCBase
{ {
#region Construction
/// <summary> /// <summary>
/// Main constructor /// Main constructor
/// </summary> /// </summary>
@ -42,7 +40,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
InitializeMedia(files); InitializeMedia(files);
} }
#endregion
} }
} }

View File

@ -6,8 +6,6 @@
/// </summary> /// </summary>
public abstract partial class CPCBase public abstract partial class CPCBase
{ {
#region Memory Fields & Properties
/* ROM Banks */ /* ROM Banks */
/// <summary> /// <summary>
/// Lower: OS ROM /// Lower: OS ROM
@ -60,10 +58,6 @@
/// </summary> /// </summary>
public int RAM64KBank; public int RAM64KBank;
#endregion
#region Memory Related Methods
/// <summary> /// <summary>
/// Simulates reading from the bus /// Simulates reading from the bus
/// Paging should be handled here /// Paging should be handled here
@ -137,7 +131,5 @@
return result; return result;
} }
#endregion
} }
} }

View File

@ -9,8 +9,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public abstract partial class CPCBase public abstract partial class CPCBase
{ {
#region Devices
/// <summary> /// <summary>
/// The calling ZXSpectrum class (piped in via constructor) /// The calling ZXSpectrum class (piped in via constructor)
/// </summary> /// </summary>
@ -77,10 +75,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary> /// </summary>
public int FrameLength; public int FrameLength;
#endregion
#region Emulator State
/// <summary> /// <summary>
/// Signs whether the frame has ended /// Signs whether the frame has ended
/// </summary> /// </summary>
@ -117,10 +111,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public bool _render; public bool _render;
public bool _renderSound; public bool _renderSound;
#endregion
#region Constants
/// <summary> /// <summary>
/// Mask constants & misc /// Mask constants & misc
/// </summary> /// </summary>
@ -130,10 +120,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
protected const int TAPE_BIT = 0x40; protected const int TAPE_BIT = 0x40;
protected const int AY_SAMPLE_RATE = 16; protected const int AY_SAMPLE_RATE = 16;
#endregion
#region Emulation Loop
/// <summary> /// <summary>
/// Executes a single frame /// Executes a single frame
/// </summary> /// </summary>
@ -199,10 +185,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
GateArray.FrameClock = 0; GateArray.FrameClock = 0;
} }
#endregion
#region Reset Functions
/// <summary> /// <summary>
/// Hard reset of the emulated machine /// Hard reset of the emulated machine
/// </summary> /// </summary>
@ -311,10 +293,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
*/ */
} }
#endregion
#region IStatable
public void SyncState(Serializer ser) public void SyncState(Serializer ser)
{ {
ser.BeginSection("CPCMachine"); ser.BeginSection("CPCMachine");
@ -363,8 +341,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.EndSection(); ser.EndSection();
} }
#endregion
} }
} }

View File

@ -16,17 +16,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public int Z80ClockSpeed = 4000000; public int Z80ClockSpeed = 4000000;
public int FrameLength = 79872; public int FrameLength = 79872;
#region Devices
private CPCBase _machine; private CPCBase _machine;
private Z80A CPU => _machine.CPU; private Z80A CPU => _machine.CPU;
private CRCT_6845 CRCT => _machine.CRCT; private CRCT_6845 CRCT => _machine.CRCT;
private IPSG PSG => _machine.AYDevice; private IPSG PSG => _machine.AYDevice;
#endregion
#region Constants
/// <summary> /// <summary>
/// CRTC Register constants /// CRTC Register constants
/// </summary> /// </summary>
@ -49,10 +43,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public const int LPEN_ADDR_H = 16; public const int LPEN_ADDR_H = 16;
public const int LPEN_ADDR_L = 17; public const int LPEN_ADDR_L = 17;
#endregion
#region Palletes
/// <summary> /// <summary>
/// The standard CPC Pallete (ordered by firmware #) /// The standard CPC Pallete (ordered by firmware #)
/// http://www.cpcwiki.eu/index.php/CPC_Palette /// http://www.cpcwiki.eu/index.php/CPC_Palette
@ -128,10 +118,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
Colors.ARGB(0x80, 0x80, 0xFF), // Pastel Blue Colors.ARGB(0x80, 0x80, 0xFF), // Pastel Blue
}; };
#endregion
#region Construction
public GateArrayBase(CPCBase machine) public GateArrayBase(CPCBase machine)
{ {
_machine = machine; _machine = machine;
@ -204,10 +190,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region State
private int[] PenColours; private int[] PenColours;
private int CurrentPen; private int CurrentPen;
private int ScreenMode; private int ScreenMode;
@ -225,10 +207,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public bool WaitLine; public bool WaitLine;
#endregion
#region Clock Operations
/// <summary> /// <summary>
/// The gatearray runs on a 16Mhz clock /// The gatearray runs on a 16Mhz clock
/// (for the purposes of emulation, we will use a 4Mhz clock) /// (for the purposes of emulation, we will use a 4Mhz clock)
@ -265,10 +243,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
} }
#endregion
#region Internal Methods
/// <summary> /// <summary>
/// Selects the pen /// Selects the pen
/// </summary> /// </summary>
@ -363,13 +337,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
#endregion
#region Reset
public void Reset() public void Reset()
{ {
CurrentPen = 0; CurrentPen = 0;
@ -380,10 +347,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
//VSYNCDelyCnt = 0; //VSYNCDelyCnt = 0;
} }
#endregion
#region IPortIODevice
/// <summary> /// <summary>
/// Device responds to an IN instruction /// Device responds to an IN instruction
/// </summary> /// </summary>
@ -434,10 +397,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return true; return true;
} }
#endregion
#region IVideoProvider
/// <summary> /// <summary>
/// Video output buffer /// Video output buffer
/// </summary> /// </summary>
@ -512,7 +471,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
} }
protected int[] croppedBuffer; protected int[] croppedBuffer;
#endregion
} }
} }

Some files were not shown because too many files have changed in this diff Show More