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 -->
<Rule Id="SA1122" Action="Hidden" />
<!-- Do not use regions -->
<Rule Id="SA1124" Action="Hidden" />
<!-- Generic type constraints should be on their own line -->
<Rule Id="SA1127" Action="Hidden" />

View File

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

View File

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

View File

@ -4,8 +4,6 @@ namespace Cyotek.Drawing.BitmapFont
{
public struct Kerning
{
#region  Public Constructors
public Kerning(char firstCharacter, char secondCharacter, int amount)
: this()
{
@ -14,25 +12,15 @@ namespace Cyotek.Drawing.BitmapFont
this.Amount = amount;
}
#endregion  Public Constructors
#region  Public Methods
public override string ToString()
{
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 SecondCharacter { get; set; }
public int Amount { get; set; }
#endregion  Public Properties
}
}

View File

@ -4,8 +4,6 @@ namespace Cyotek.Drawing.BitmapFont
{
public struct Padding
{
#region  Public Constructors
public Padding(int left, int top, int right, int bottom)
: this()
{
@ -15,19 +13,11 @@ namespace Cyotek.Drawing.BitmapFont
this.Bottom = bottom;
}
#endregion  Public Constructors
#region  Public Methods
public override string ToString()
{
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 Left { get; set; }
@ -35,7 +25,5 @@ namespace Cyotek.Drawing.BitmapFont
public int Right { 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;
}
#region Endian Handling
private uint ReadUnsignedLittle(long addr, int size, string domain = null)
{
uint v = 0;
@ -152,10 +150,6 @@ namespace BizHawk.Client.Common
else WriteUnsignedLittle(addr, value, size, domain);
}
#endregion
#region Unique Library Methods
public void SetBigEndian(bool enabled = true) => _isBigEndian = enabled;
public List<string> GetMemoryDomainList() =>
@ -210,10 +204,6 @@ namespace BizHawk.Client.Common
return hasher.ComputeHash(data).BytesToHexString();
}
#endregion
#region Common Special and Legacy Methods
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);
@ -272,10 +262,6 @@ namespace BizHawk.Client.Common
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 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);
#endregion
#region 2 Byte
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);
@ -296,10 +278,6 @@ namespace BizHawk.Client.Common
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 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);
#endregion
#region 4 Byte
public int ReadS32(long addr, string domain = null) => ReadSigned(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 WriteU32(long addr, uint value, string domain = null) => WriteUnsigned(addr, value, 4, domain);
#endregion
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,8 +21,6 @@ namespace BizHawk.Client.Common
public override string Name => "memory";
#region Unique Library Methods
[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")]
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.")]
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( ) );")]
[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);
@ -120,10 +114,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteFloat(addr, value, domain);
}
#endregion
#region 1 Byte
[LuaMethodExample("local inmemrea = memory.read_s8( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s8", "read signed byte")]
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")]
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( ) );")]
[LuaMethod("read_s16_le", "read signed 2 byte value, little endian")]
public int ReadS16Little(int addr, string domain = null)
@ -208,10 +194,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteU16(addr, value, domain);
}
#endregion
#region 3 Byte
[LuaMethodExample("local inmemrea = memory.read_s24_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s24_le", "read signed 24 bit value, little endian")]
public int ReadS24Little(int addr, string domain = null)
@ -276,10 +258,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteU24(addr, value, domain);
}
#endregion
#region 4 Byte
[LuaMethodExample("local inmemrea = memory.read_s32_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s32_le", "read signed 4 byte value, little endian")]
public int ReadS32Little(int addr, string domain = null)
@ -343,7 +321,5 @@ namespace BizHawk.Client.Common
APIs.Mem.SetBigEndian();
APIs.Mem.WriteU32(addr, value, domain);
}
#endregion
}
}

View File

@ -32,8 +32,6 @@ namespace BizHawk.Client.Common
public override string Name => "event";
#region Events Library Helpers
public void CallExitEvent(LuaFile luaFile)
{
var exitCallbacks = RegisteredFunctions
@ -127,8 +125,6 @@ namespace BizHawk.Client.Common
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\" );")]
[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( );")]
[LuaMethod("getname", "returns the name of the domain defined as main memory for the given core")]
public string GetName()
@ -56,10 +54,6 @@ namespace BizHawk.Client.Common
return (uint)Domain.Size;
}
#endregion
#region Common Special and Legacy Methods
[LuaMethodExample("local uimairea = mainmemory.readbyte( 0x100 );")]
[LuaMethod("readbyte", "gets the value from the given address as an unsigned byte")]
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);
}
#endregion
#region 1 Byte
[LuaMethodExample("local inmairea = mainmemory.read_s8( 0x100 );")]
[LuaMethod("read_s8", "read signed byte")]
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")]
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 );")]
[LuaMethod("read_s16_le", "read signed 2 byte value, little endian")]
public int ReadS16Little(int addr)
@ -212,10 +198,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteU16(addr, value, Domain.Name);
}
#endregion
#region 3 Byte
[LuaMethodExample("local inmairea = mainmemory.read_s24_le( 0x100 );")]
[LuaMethod("read_s24_le", "read signed 24 bit value, little endian")]
public int ReadS24Little(int addr)
@ -280,10 +262,6 @@ namespace BizHawk.Client.Common
APIs.Mem.WriteU24(addr, value, Domain.Name);
}
#endregion
#region 4 Byte
[LuaMethodExample("local inmairea = mainmemory.read_s32_le( 0x100 );")]
[LuaMethod("read_s32_le", "read signed 4 byte value, little endian")]
public int ReadS32Little(int addr)
@ -347,7 +325,5 @@ namespace BizHawk.Client.Common
APIs.Mem.SetBigEndian();
APIs.Mem.WriteU32(addr, value, Domain.Name);
}
#endregion
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,8 +19,6 @@ namespace BizHawk.Client.Common
public sealed partial class WatchList
: IList<Watch>
{
#region Fields
public const string Address = "AddressColumn";
public const string Value = "ValueColumn";
public const string Prev = "PrevColumn";
@ -36,10 +34,6 @@ namespace BizHawk.Client.Common
private readonly string _systemId;
private IMemoryDomains _memoryDomains;
#endregion
#region cTor(s)
/// <summary>
/// Static constructor for the <see cref="WatchList"/> class.
/// </summary>
@ -71,12 +65,6 @@ namespace BizHawk.Client.Common
_systemId = systemId;
}
#endregion
#region Methods
#region ICollection<Watch>
/// <summary>
/// Adds a <see cref="Watch"/> into the current collection
/// </summary>
@ -135,10 +123,6 @@ namespace BizHawk.Client.Common
return result;
}
#endregion
#region IList<Watch>
/// <summary>
/// Determines the zero-base position of the specified <see cref="Watch"/>
/// into the <see cref="WatchList"/>
@ -170,10 +154,6 @@ namespace BizHawk.Client.Common
Changes = true;
}
#endregion IList<Watch>
#region IEnumerable<Watch>
/// <summary>
/// Returns an enumerator that iterates through the collection
/// </summary>
@ -192,8 +172,6 @@ namespace BizHawk.Client.Common
return GetEnumerator();
}
#endregion IEnumerable<Watch>
/// <summary>
/// Add an existing collection of <see cref="Watch"/> into the current one
/// <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>
/// Gets the number of elements contained in this <see cref="WatchList"/>
/// </summary>
@ -301,10 +273,6 @@ namespace BizHawk.Client.Common
/// </summary>
public bool IsReadOnly => false;
#endregion ICollection<Watch>
#region IList<Watch>
/// <summary>
/// Gets or sets element at the specified index
/// </summary>
@ -316,8 +284,6 @@ namespace BizHawk.Client.Common
set => _watchList[index] = value;
}
#endregion IList<Watch>
/// <summary>
/// Gets or sets a value indicating whether the collection has changed or not
/// </summary>
@ -333,10 +299,6 @@ namespace BizHawk.Client.Common
/// </summary>
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)
{
var result = LoadFile(path, append);
@ -519,6 +481,5 @@ namespace BizHawk.Client.Common
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
#region simple buffer reuser
public class ReusableBufferPool<T>
{
private readonly List<T[]> _available = new List<T[]>();
@ -84,10 +82,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region binary write helpers
/// <summary>
/// variable length value, unsigned
/// </summary>
@ -183,10 +177,6 @@ namespace BizHawk.Client.EmuHawk
stream.Write(b, 0, 4);
}
#endregion
#region CRC calculator
private static readonly uint[] CrcTable =
{
0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9,
@ -211,8 +201,6 @@ namespace BizHawk.Client.EmuHawk
return crc;
}
#endregion
/// <summary>
/// writes a single packet out, including CheckSums
/// </summary>
@ -303,8 +291,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#region fields
/// <summary>
/// stores basic AV parameters
/// </summary>
@ -354,10 +340,6 @@ namespace BizHawk.Client.EmuHawk
readonly ReusableBufferPool<byte> _bufferPool = new ReusableBufferPool<byte>(12);
#endregion
#region header writers
/// <summary>
/// write out the main header
/// </summary>
@ -442,8 +424,6 @@ namespace BizHawk.Client.EmuHawk
header.Flush();
}
#endregion
/// <summary>
/// stores a single frame with syncpoint, in mux-ready form
/// used because reordering of audio and video can be needed for proper interleave

View File

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

View File

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

View File

@ -28,8 +28,6 @@ namespace BizHawk.Client.EmuHawk
public string SocketServerGetInfo() => GlobalWin.socketServer.GetInfo();
#region MemoryMappedFile
public void MmfSetFilename(string filename) => GlobalWin.memoryMappedFiles.Filename = 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);
#endregion
#region HTTP
public string HttpTest() => string.Join("\n", GlobalWin.httpCommunication.TestGet(), GlobalWin.httpCommunication.SendScreenshot(), "done testing");
public string HttpTestGet() => GlobalWin.httpCommunication.TestGet();
@ -63,7 +57,5 @@ namespace BizHawk.Client.EmuHawk
public string HttpGetPostUrl() => GlobalWin.httpCommunication.PostUrl;
public string HttpGetGetUrl() => GlobalWin.httpCommunication.GetUrl;
#endregion
}
}

View File

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

View File

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

View File

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

View File

@ -15,8 +15,6 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
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>
private const int MAX_GAMEPADS = 4;
@ -45,7 +43,7 @@ namespace BizHawk.Client.EmuHawk
{
lock (_syncObj)
{
if (initialized)
if (initialized)
foreach (var device in Devices) yield return device;
}
@ -77,10 +75,6 @@ namespace BizHawk.Client.EmuHawk
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>
public readonly Guid Guid;
@ -366,8 +360,6 @@ namespace BizHawk.Client.EmuHawk
_gamePadCapabilities?.HasLeftVibrationMotor == true ? left : 0,
_gamePadCapabilities?.HasRightVibrationMotor == true ? right : 0
);
#endregion
}
}

View File

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

View File

@ -41,8 +41,6 @@ namespace BizHawk.Client.EmuHawk
private readonly string[] _nonArchive = { ".ISO", ".CUE", ".CCD" };
#region Loaders
private void LoadCdl(string filename, string archive = null)
{
if (Tools.IsAvailable<CDL>())
@ -127,8 +125,6 @@ namespace BizHawk.Client.EmuHawk
((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)
{
foreach (string file in fileList)

View File

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

View File

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

View File

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

View File

@ -58,8 +58,6 @@ namespace BizHawk.Client.EmuHawk
private bool _previousDisplayMessage;
private bool _previousInvisibleEmulation;
#region Services and Settings
[RequiredService]
private IEmulator Emulator { get; set; }
@ -80,8 +78,6 @@ namespace BizHawk.Client.EmuHawk
public bool InvisibleEmulation { get; set; }
}
#endregion
public BasicBot()
{
InitializeComponent();
@ -98,8 +94,6 @@ namespace BizHawk.Client.EmuHawk
_previousDisplayMessage = Config.DisplayMessages;
}
#region UI Bindings
private Dictionary<string, double> ControlProbabilities =>
ControlProbabilityPanel.Controls
.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.
// 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..
#endregion
protected override void UpdateBefore() => Update(fast: false);
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)
{
SaveMenuItem.Enabled = !string.IsNullOrWhiteSpace(CurrentFileName);
@ -373,10 +361,6 @@ namespace BizHawk.Client.EmuHawk
Close();
}
#endregion
#region Options Menu
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{
TurboWhileBottingMenuItem.Checked = Settings.TurboWhenBotting;
@ -423,8 +407,6 @@ namespace BizHawk.Client.EmuHawk
Settings.TurboWhenBotting ^= true;
}
#endregion
private void RunBtn_Click(object sender, EventArgs e)
{
StartBot();
@ -469,10 +451,6 @@ namespace BizHawk.Client.EmuHawk
Frames = 0;
}
#endregion
#region Classes
private class BotAttempt
{
public long Attempt { get; set; }
@ -518,10 +496,6 @@ namespace BizHawk.Client.EmuHawk
public int DataSize { get; set; }
}
#endregion
#region File Handling
private void LoadFileFromRecent(string path)
{
var result = LoadBotFile(path);
@ -667,8 +641,6 @@ namespace BizHawk.Client.EmuHawk
MessageLabel.Text = $"{Path.GetFileName(CurrentFileName)} saved";
}
#endregion
public bool HasFrameAdvanced()
{
// 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;
}
#region Privates
private const string HexInd = "0x";
private Cheat _cheat;
@ -271,10 +269,6 @@ namespace BizHawk.Client.EmuHawk
_editCallback?.Invoke();
}
#endregion
#region API
public void SetCheat(Cheat cheat)
{
_editMode = true;
@ -346,8 +340,6 @@ namespace BizHawk.Client.EmuHawk
_editCallback = editCallback;
}
#endregion
private void CompareBox_TextChanged(object sender, EventArgs e)
{
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)
{
SaveMenuItem.Enabled = Global.CheatList.Changes;
@ -391,10 +387,6 @@ namespace BizHawk.Client.EmuHawk
Close();
}
#endregion
#region Cheats
private void CheatsSubMenu_DropDownOpened(object sender, EventArgs e)
{
RemoveCheatMenuItem.Enabled =
@ -520,10 +512,6 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<GameShark>();
}
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{
AlwaysLoadCheatsMenuItem.Checked = Config.LoadCheatFileByGame;
@ -592,10 +580,6 @@ namespace BizHawk.Client.EmuHawk
SetColumns();
}
#endregion
#region ListView and Dialog Events
private void CheatListView_DoubleClick(object sender, EventArgs e)
{
ToggleMenuItem_Click(sender, e);
@ -682,10 +666,6 @@ namespace BizHawk.Client.EmuHawk
base.OnShown(e);
}
#endregion
#endregion
public class CheatsSettings : ToolDialogSettings
{
public CheatsSettings()

View File

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

View File

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

View File

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

View File

@ -100,8 +100,6 @@ namespace BizHawk.Client.EmuHawk
}
#region drawing primitives
/// <summary>
/// draw a single 2bpp tile
/// </summary>
@ -354,8 +352,6 @@ namespace BizHawk.Client.EmuHawk
b.UnlockBits(lockData);
}
#endregion
void ScanlineCallback(byte lcdc)
{
using (_memory.EnterExit())
@ -483,8 +479,6 @@ namespace BizHawk.Client.EmuHawk
Gb?.SetScanlineCallback(null, 0);
}
#region refresh
private void radioButtonRefreshFrame_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
private void radioButtonRefreshScanline_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 Bitmap _freezeBmp;
private string _freezeDetails;
@ -894,8 +884,6 @@ namespace BizHawk.Client.EmuHawk
SpriteMouseover(e.X, e.Y);
}
#endregion
private void bmpView_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
@ -909,8 +897,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#region copyimage
private readonly Timer _messageTimer = new Timer();
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.";
}
#endregion
private void ButtonChangeColor_Click(object sender, EventArgs e)
{
using var dlg = new ColorDialog

View File

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

View File

@ -152,8 +152,6 @@ namespace BizHawk.Client.EmuHawk
GeneralUpdate();
}
#region API
protected override void UpdateAfter()
{
AddressesLabel.Text = GenerateMemoryViewString(true);
@ -344,8 +342,6 @@ namespace BizHawk.Client.EmuHawk
_hexFind.Close();
}
#endregion
private byte[] ConvertHexStringToByteArray(string str)
{
if (string.IsNullOrWhiteSpace(str)) {
@ -1247,10 +1243,6 @@ namespace BizHawk.Client.EmuHawk
return true;
}
#region Events
#region File Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{
if (_domain.Name == "File on Disk")
@ -1395,10 +1387,6 @@ namespace BizHawk.Client.EmuHawk
Close();
}
#endregion
#region Edit
private void EditMenuItem_DropDownOpened(object sender, EventArgs e)
{
var data = Clipboard.GetDataObject();
@ -1551,10 +1539,6 @@ namespace BizHawk.Client.EmuHawk
FindPrev(_findStr, false);
}
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{
BigEndianMenuItem.Checked = BigEndian;
@ -1729,10 +1713,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Settings Menu
private void SetColorsMenuItem_Click(object sender, EventArgs e)
{
using var form = new HexColorsForm(this);
@ -1749,10 +1729,6 @@ namespace BizHawk.Client.EmuHawk
Colors = new ColorConfig();
}
#endregion
#region Context Menu and Dialog Events
private void HexEditor_Resize(object sender, EventArgs e)
{
SetUpScrollBar();
@ -2086,10 +2062,6 @@ namespace BizHawk.Client.EmuHawk
GeneralUpdate();
}
#endregion
#region MemoryViewer Events
private void HexEditor_MouseWheel(object sender, MouseEventArgs e)
{
var delta = 0;
@ -2284,10 +2256,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#endregion
private void viewN64MatrixToolStripMenuItem_Click(object sender, EventArgs e)
{
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
public override string Name => "forms";
#region Forms Library Helpers
private readonly List<LuaWinform> _luaForms = new List<LuaWinform>();
public void WindowClosed(IntPtr handle)
@ -60,8 +58,6 @@ namespace BizHawk.Client.EmuHawk
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 );")]
[LuaMethod("addclick", "adds the given lua function as a click event to the given control")]
public void AddClick(int handle, LuaFunction clickEvent)
@ -448,8 +444,6 @@ namespace BizHawk.Client.EmuHawk
return (int)pictureBox.Handle;
}
#region LuaPictureBox Methods
[LuaMethodExample("forms.clear( 334, 0x000000FF );")]
[LuaMethod(
"clear",
@ -1236,8 +1230,6 @@ namespace BizHawk.Client.EmuHawk
return 0;
}
#endregion
[LuaMethodExample("forms.setdropdownitems( 332, { \"item1\", \"item2\" } );")]
[LuaMethod("setdropdownitems", "Sets the items for a given dropdown box")]
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 );")]
[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)
@ -407,10 +405,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Markers
[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")]
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 );")]
[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)
@ -572,7 +562,5 @@ namespace BizHawk.Client.EmuHawk
};
}
}
#endregion
}
}

View File

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

View File

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

View File

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

View File

@ -275,8 +275,6 @@ namespace BizHawk.Client.EmuHawk
_controller = _movieSession.GenerateMovieController(d);
}
#region Custom Latch
private void LatchFromSourceButtons(IMovieController latching, IController source)
{
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();
}
#region Events
#region Menu and Context Menu
private void ScreenshotMenuItem_Click(object sender, EventArgs e)
{
NameTableView.Screenshot();
@ -204,10 +200,6 @@ namespace BizHawk.Client.EmuHawk
NameTableView.Refresh();
}
#endregion
#region Dialog and Controls
private void NesNameTableViewer_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
@ -322,9 +314,5 @@ namespace BizHawk.Client.EmuHawk
TableLabel.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)
{
PaletteView.Screenshot();
@ -350,10 +344,6 @@ namespace BizHawk.Client.EmuHawk
Close();
}
#endregion
#region Pattern
private void Table0PaletteSubMenu_DropDownOpened(object sender, EventArgs e)
{
Table0P0MenuItem.Checked = PatternView.Pal0 == 0;
@ -448,19 +438,11 @@ namespace BizHawk.Client.EmuHawk
UpdatePaletteSelection();
}
#endregion
#region Settings
private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e)
{
cHRROMTileViewerToolStripMenuItem.Checked = ChrRomView;
}
#endregion
#region Context Menus
private void PaletteRefreshMenuItem_Click(object sender, EventArgs e)
{
PaletteView.Refresh();
@ -476,12 +458,6 @@ namespace BizHawk.Client.EmuHawk
SpriteView.Refresh();
}
#endregion
#endregion
#region Dialog and Controls
private void NesPPU_MouseClick(object sender, MouseEventArgs e)
{
ZoomBox.Image = new Bitmap(64, 64);
@ -779,8 +755,6 @@ namespace BizHawk.Client.EmuHawk
_ppu?.RemoveCallback2();
}
#endregion
private MemoryDomain _chrRom;
private readonly byte[] _chrRomCache = new byte[8192];
@ -824,8 +798,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
private void NumericUpDownChrRomBank_ValueChanged(object sender, EventArgs e)
{
ChrRomViewRefresh();

View File

@ -83,10 +83,6 @@ namespace BizHawk.Client.EmuHawk
protected override void UpdateBefore() => Generate();
#region Events
#region Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{
VDC2MenuItem.Enabled = PCE.SystemId == "SGX";
@ -110,8 +106,6 @@ namespace BizHawk.Client.EmuHawk
Close();
}
#endregion
private void Canvas_MouseMove(object sender, MouseEventArgs e)
{
var vdc = _vdcType == 0 ? PCE.VDC1 : PCE.VDC2;
@ -123,7 +117,5 @@ namespace BizHawk.Client.EmuHawk
XYLabel.Text = $"{xTile}:{yTile}";
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)
{
text = "";
@ -125,10 +123,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Actions
public void Branch()
{
var branch = CreateBranch();
@ -574,10 +568,6 @@ namespace BizHawk.Client.EmuHawk
return false;
}
#endregion
#region Events
private void BranchView_MouseDown(object sender, MouseEventArgs e)
{
BranchesContextMenu.Close();
@ -676,7 +666,5 @@ namespace BizHawk.Client.EmuHawk
_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_InputLog => Color.FromArgb(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);
}
#endregion
#region Events
private void TasView_ColumnClick(object sender, InputRoll.ColumnClickEventArgs e)
{
if (TasView.AnyRowsSelected)
@ -1460,7 +1454,5 @@ namespace BizHawk.Client.EmuHawk
RefreshDialog();
}
#endregion
}
}

View File

@ -12,8 +12,6 @@ namespace BizHawk.Client.EmuHawk
{
public partial class TAStudio
{
#region File Menu
private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{
ToBk2MenuItem.Enabled =
@ -304,10 +302,6 @@ namespace BizHawk.Client.EmuHawk
Close();
}
#endregion
#region Edit
private void EditSubMenu_DropDownOpened(object sender, EventArgs e)
{
DeselectMenuItem.Enabled =
@ -775,10 +769,6 @@ namespace BizHawk.Client.EmuHawk
MessageBox.Show("Integrity Check passed");
}
#endregion
#region Config
private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e)
{
AutopauseAtEndOfMovieMenuItem.Checked = Settings.AutoPause;
@ -981,10 +971,6 @@ namespace BizHawk.Client.EmuHawk
Settings.LoadBranchOnDoubleClick ^= true;
}
#endregion
#region Metadata
private void HeaderMenuItem_Click(object sender, EventArgs e)
{
new MovieHeaderEditor(CurrentTasMovie)
@ -1030,10 +1016,6 @@ namespace BizHawk.Client.EmuHawk
}.ShowDialog();
}
#endregion
#region Settings Menu
private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e)
{
RotateMenuItem.ShortcutKeyDisplayString = TasView.RotateHotkeyStr;
@ -1163,10 +1145,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Columns
private void SetUpToolStripColumns()
{
ColumnsSubMenu.DropDownItems.Clear();
@ -1336,10 +1314,6 @@ namespace BizHawk.Client.EmuHawk
BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance;
}
#endregion
#region Context Menu
private void RightClickMenu_Opened(object sender, EventArgs e)
{
SetMarkersContextMenuItem.Enabled =
@ -1393,10 +1367,6 @@ namespace BizHawk.Client.EmuHawk
BookMarkControl.Branch();
}
#endregion
#region Help
private void TASEditorManualOnlineMenuItem_Click(object sender, EventArgs e)
{
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");
}
#endregion
}
}

View File

@ -102,8 +102,6 @@ namespace BizHawk.Client.EmuHawk
public bool BindMarkersToInput { get; set; }
}
#region Initializing
public TAStudio()
{
void SetImages()
@ -610,10 +608,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Loading
private void ConvertCurrentMovieToTasproj()
{
MovieSession.ConvertToTasProj();
@ -780,8 +774,6 @@ namespace BizHawk.Client.EmuHawk
loadZone.PlaceZone(CurrentTasMovie);
}
#endregion
private void TastudioPlayMode()
{
TasPlaybackBox.RecordingMode = false;
@ -1130,8 +1122,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#region Dialog Events
private void Tastudio_Closing(object sender, FormClosingEventArgs e)
{
if (!_initialized)
@ -1199,8 +1189,6 @@ namespace BizHawk.Client.EmuHawk
return base.ProcessCmdKey(ref msg, keyData);
}
#endregion
private bool AutoAdjustInput()
{
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();
}
#region Events
#region Menu
private void ExitMenuItem_Click(object sender, EventArgs e)
{
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 DashButton_Click(object sender, EventArgs e) => KeyClick("DASH");
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 PeriodButton_Click(object sender, EventArgs e) => KeyClick("DOT");
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));
// 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()
{
@ -750,10 +749,6 @@ namespace BizHawk.Client.EmuHawk
public TAStudio TAStudio => GetTool<TAStudio>();
#endregion
#region Specialized Tool Loading Logic
public void LoadRamWatch(bool loadDialog)
{
if (IsLoaded<RamWatch>())
@ -777,8 +772,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
public string GenerateDefaultCheatFilename()
{
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;
}
#region Events
#region Menu Items
private void SaveLogMenuItem_Click(object sender, EventArgs e)
{
LogFile = GetFileFromUser();
@ -380,10 +376,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Dialog and ListView Events
private void LoggingEnabled_CheckedChanged(object sender, EventArgs e)
{
//Tracer.Enabled = LoggingEnabled.Checked;
@ -485,10 +477,6 @@ namespace BizHawk.Client.EmuHawk
SetTracerBoxTitle();
}
#endregion
#endregion
private void ClearMenuItem_Click(object sender, EventArgs e)
{
ClearList();

View File

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

View File

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

View File

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

View File

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

View File

@ -32,8 +32,6 @@ namespace BizHawk.Client.EmuHawk
YNumeric.Maximum = TargetPanel.Height - 1;
}
#region IVirtualPadControl Implementation
public void UpdateValues()
{
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
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!
#region Initialize, Load, and Save
public RamSearch()
{
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
@ -233,10 +231,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Public
/// <summary>
/// This should be called anytime the search list changes
/// </summary>
@ -413,10 +407,6 @@ namespace BizHawk.Client.EmuHawk
mi?.Invoke(radios[index], new object[] { new EventArgs() });
}
#endregion
#region Private
private void ToggleSearchDependentToolBarItems()
{
DoSearchToolButton.Enabled =
@ -937,8 +927,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
public class RamSearchSettings : ToolDialogSettings
{
public RamSearchSettings()
@ -965,10 +953,6 @@ namespace BizHawk.Client.EmuHawk
public RecentFiles RecentSearches { get; set; }
}
#region Winform Events
#region File
private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{
SaveMenuItem.Enabled = !string.IsNullOrWhiteSpace(_currentFileName);
@ -1040,10 +1024,6 @@ namespace BizHawk.Client.EmuHawk
Close();
}
#endregion
#region Settings
private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e)
{
CheckMisalignedMenuItem.Checked = _settings.CheckMisAligned;
@ -1183,10 +1163,6 @@ namespace BizHawk.Client.EmuHawk
_searches.SetEndian(_settings.BigEndian);
}
#endregion
#region Search
private void SearchSubMenu_DropDownOpened(object sender, EventArgs e)
{
ClearChangeCountsMenuItem.Enabled = _settings.IsDetailed();
@ -1294,10 +1270,6 @@ namespace BizHawk.Client.EmuHawk
UpdateUndoToolBarButtons();
}
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{
AutoloadDialogMenuItem.Checked = Settings.AutoLoad;
@ -1392,10 +1364,6 @@ namespace BizHawk.Client.EmuHawk
SetColumns();
}
#endregion
#region ContextMenu and Toolbar
private void ListViewContextMenu_Opening(object sender, CancelEventArgs e)
{
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)
{
SpecificValueBox.Enabled = false;
@ -1611,10 +1575,6 @@ namespace BizHawk.Client.EmuHawk
SetCompareValue(((INumberBox)sender).ToRawInt());
}
#endregion
#region Comparison Operator Box
private void EqualToRadio_Click(object sender, EventArgs e)
{
DifferentByBox.Enabled = false;
@ -1676,10 +1636,6 @@ namespace BizHawk.Client.EmuHawk
WatchListView.Refresh();
}
#endregion
#region ListView Events
private void WatchListView_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
@ -1736,10 +1692,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Dialog Events
private void NewRamSearch_Activated(object sender, EventArgs e)
{
WatchListView.Refresh();
@ -1769,9 +1721,5 @@ namespace BizHawk.Client.EmuHawk
{
GenericDragEnter(sender, e);
}
#endregion
#endregion
}
}

View File

@ -99,8 +99,6 @@ namespace BizHawk.Client.EmuHawk
public IEnumerable<Watch> Watches => _watches.Where(x => !x.IsSeparator);
#region API
public void AddWatch(Watch watch)
{
_watches.Add(watch);
@ -234,10 +232,6 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Private Methods
private void MinimalUpdate()
{
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)
{
SaveMenuItem.Enabled = _watches.Changes;
@ -691,10 +679,6 @@ namespace BizHawk.Client.EmuHawk
Close();
}
#endregion
#region Watch
private void WatchesSubMenu_DropDownOpened(object sender, EventArgs e)
{
EditWatchMenuItem.Enabled =
@ -945,10 +929,6 @@ namespace BizHawk.Client.EmuHawk
WatchListView.SelectAll();
}
#endregion
#region Options
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{
WatchesOnScreenMenuItem.Checked = Config.DisplayRamWatch;
@ -1029,10 +1009,6 @@ namespace BizHawk.Client.EmuHawk
SetColumns();
}
#endregion
#region Dialog, Context Menu, and ListView Events
private void RamWatch_Load(object sender, EventArgs e)
{
// Hack for previous config settings
@ -1230,9 +1206,6 @@ namespace BizHawk.Client.EmuHawk
UpdateStatusBar();
}
#endregion
#endregion
// Stupid designer
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;
}
#region Events
private void Cancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
@ -323,7 +321,5 @@ namespace BizHawk.Client.EmuHawk
{
_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]
public class BinaryQuickSerializer
{
#region methodinfo from a lambda expression. cool.
private static MethodInfo FromExpression(Expression e)
{
var caller = e as MethodCallExpression;
@ -34,10 +32,6 @@ namespace BizHawk.Common
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> Writehandlers = new Dictionary<Type, MethodInfo>();
@ -93,10 +87,6 @@ namespace BizHawk.Common
AddW<ulong>(r => r.Write(0UL));
}
#endregion
#region dynamic code generation
private delegate void Reader(object target, BinaryReader r);
private delegate void Writer(object target, BinaryWriter w);
@ -171,8 +161,6 @@ namespace BizHawk.Common
};
}
#endregion
private static readonly IDictionary<Type, SerializationFactory> Serializers =
new ConcurrentDictionary<Type, SerializationFactory>();

View File

@ -14,8 +14,6 @@ namespace BizHawk.Common
{
public Serializer() { }
#region Public
public bool IsReader => _isReader;
public bool IsWriter => !IsReader;
@ -749,10 +747,6 @@ namespace BizHawk.Common
}
}
#endregion
#region Privates
private BinaryReader _br;
private BinaryWriter _bw;
private TextReader _tr;
@ -1283,7 +1277,5 @@ namespace BizHawk.Common
public string Name = "";
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 string TrackIdent { get; set; }
@ -407,7 +405,5 @@ namespace BizHawk.Emulation.Common
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
};
#region C API
// main launcher
[DllImport(dll, CallingConvention = cc)]
public static extern uint mame_launch(int argc, string[] argv);
@ -30,10 +28,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
[DllImport(dll, CallingConvention = cc)]
public static extern SaveError mame_load_buffer(byte[] buf, int length);
#endregion
#region Lua API
// execute
[DllImport(dll, CallingConvention = cc)]
public static extern void mame_lua_execute(string code);
@ -58,10 +52,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
[DllImport(dll, CallingConvention = cc)]
public static extern bool mame_lua_free_string(IntPtr pointer);
#endregion
#region Callbacks
// periodic
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PeriodicCallbackDelegate();
@ -85,7 +75,5 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
public delegate void LogCallbackDelegate(OutputChannel channel, int size, string data);
[DllImport(dll, CallingConvention = cc)]
public static extern void mame_set_log_callback(LogCallbackDelegate cb);
#endregion
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,8 +12,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
public class DatacorderDevice
{
#region Construction
private CPCBase _machine;
private Z80A _cpu => _machine.CPU;
private IBeeperDevice _buzzer => _machine.TapeBuzzer;
@ -34,10 +32,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
_machine = machine;
}
#endregion
#region State Information
/// <summary>
/// Signs whether the tape motor is running
/// </summary>
@ -142,20 +136,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
private bool currentState = false;
#endregion
#region Datacorder Device Settings
/// <summary>
/// Signs whether the device should autodetect when the Z80 has entered into
/// 'load' mode and auto-play the tape if neccesary
/// </summary>
private bool _autoPlay;
#endregion
#region Emulator
/// <summary>
/// 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)
@ -170,10 +156,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
//_buzzer.ProcessPulseValue(currentState);
}
#endregion
#region Tape Controls
/// <summary>
/// Starts the tape playing from the beginning of the current block
/// </summary>
@ -380,10 +362,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
RTZ();
}
#endregion
#region Tape Device Methods
/// <summary>
/// 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
@ -642,11 +620,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
currentState = !currentState;
}
#endregion
#region TapeMonitor
public void AutoStopTape()
{
@ -743,10 +716,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
*/
#endregion
#region IPortIODevice
/// <summary>
/// Mask constants
/// </summary>
@ -800,10 +769,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
*/
}
#endregion
#region State Serialization
/// <summary>
/// BizHawk state serialization
/// </summary>
@ -820,7 +785,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.Sync(nameof(tapeMotor), ref tapeMotor);
ser.EndSection();
}
#endregion
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,8 +16,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
public class AmstradGateArray : IPortIODevice, IVideoProvider
{
#region Devices
private CPCBase _machine;
private Z80A CPU => _machine.CPU;
private CRCT_6845 CRCT => _machine.CRCT;
@ -30,10 +28,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private GateArrayType ChipType;
#endregion
#region Palettes
/// <summary>
/// The standard CPC Pallete (ordered by firmware #)
/// 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
};
#endregion
#region Clocks and Timing
/// <summary>
/// The Gate Array Clock Speed
/// </summary>
@ -143,10 +133,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
public int GAFrameLength = 319488;
#endregion
#region Construction
public AmstradGateArray(CPCBase machine, GateArrayType chipType)
{
_machine = machine;
@ -164,10 +150,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
CalculateNextScreenMemory();
}
#endregion
#region Registers and Internal State
/// <summary>
/// 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).
@ -427,10 +409,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
private byte VideoByte2;
#endregion
#region Clock Business
/// <summary>
/// Called every CPU cycle
/// 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>
/// 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:
@ -661,10 +635,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
}
#endregion
#region Rendering Business
/// <summary>
/// Builds up current scanline character information
/// 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>
/// Called when the Z80 acknowledges an interrupt
/// </summary>
@ -973,10 +939,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
slCounter = 0;
}
#endregion
#region IVideoProvider
public int[] ScreenBuffer;
private int _virtualWidth;
@ -1178,10 +1140,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
set => _borderType = value;
}
#endregion
#region IPortIODevice
/// <summary>
/// Device responds to an IN instruction
/// </summary>
@ -1237,10 +1195,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return true;
}
#endregion
#region Serialization
public void SyncState(Serializer ser)
{
ser.BeginSection("GateArray");
@ -1275,10 +1229,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.EndSection();
}
#endregion
#region Enums, Classes & Lookups
/// <summary>
/// Represents a single scanline (in characters)
/// </summary>
@ -1379,7 +1329,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
Amstrad40489,
}
#endregion
}
}

View File

@ -10,15 +10,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
public class CRCT_6845 : IPortIODevice
{
#region Devices
private CPCBase _machine { get; set; }
private CRCTType ChipType;
#endregion
#region CallBacks
public delegate void CallBack();
private CallBack HSYNC_Callbacks;
@ -34,10 +28,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
HSYNC_Callbacks += hCall;
}
#endregion
#region Construction
public CRCT_6845(CRCTType chipType, CPCBase machine)
{
_machine = machine;
@ -48,10 +38,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private const int WRITE = 0;
private const int READ = 1;
#endregion
#region Public Lines
/// <summary>
/// Denotes that HSYNC is active
/// </summary>
@ -84,10 +70,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
public int VLC;
#endregion
#region Public Lookups
/*
* These are not accessible directlyon real hardware
* 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>
public int LatchedScreenWidthBytes;
#endregion
#region Internal Registers and State
/*
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.
@ -430,10 +408,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
private int VSYNCCounter;
#endregion
#region Public Methods
public void ClockCycle()
{
CheckHSYNCOff();
@ -796,10 +770,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
VLC = 0;
}
#endregion
#region Internal Methods
/// <summary>
/// Selects a register
/// </summary>
@ -1018,10 +988,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
}
#endregion
#region PortIODevice
/*
#BCXX %x0xxxx00 xxxxxxxx 6845 CRTC Index - Write
#BDXX %x0xxxx01 xxxxxxxx 6845 CRTC Data Out - Write
@ -1094,10 +1060,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return accessed;
}
#endregion
#region Serialization
public void SyncState(Serializer ser)
{
ser.BeginSection("CRTC");
@ -1122,10 +1084,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ser.EndSection();
}
#endregion
#region Enums
/// <summary>
/// The types of CRCT chip found in the CPC range
/// </summary>
@ -1138,7 +1096,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
AMS40489 = 3,
AMS40226 = 4
}
#endregion
}
}

View File

@ -42,8 +42,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
private CRTCType ChipType;
#region Construction
/// <summary>
/// The only constructor
/// </summary>
@ -52,10 +50,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ChipType = type;
}
#endregion
#region Input Lines
/// <summary>
/// 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.
@ -85,10 +79,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private bool _LPSTB;
#endregion
#region Output Lines
// State output lines
/// <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.
@ -199,10 +189,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
}
#endregion
#region Internal State
/// <summary>
/// Character pos address (0 index).
/// Feeds the MA lines
@ -291,10 +277,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
private int StartAddressLatch;
#endregion
#region Internal Registers
/// <summary>
/// The currently selected register
/// </summary>
@ -324,10 +306,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
/// </summary>
private byte AsicStatusRegister2;
#endregion
#region Databus Interface
/*
RegIdx Register Name Type
0 1 2 3 4
@ -430,10 +408,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return accessed;
}
#endregion
#region Type-Specific Logic
/// <summary>
/// Runs a clock cycle for the current chip type
/// 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>
/// Current programmed HSYNC width for Type 0 (HD6845S & UM6845) & Type 1 (UM6845R)
/// </summary>
@ -731,10 +699,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
// Vertical Sync is fixed at 16 lines.
private int VSYNCWidth_Type1_2 => 16;
#endregion
#region Register Access
/// <summary>
/// Read Register (HD6845S & UM6845)
/// </summary>
@ -1129,12 +1093,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return false;
}
#endregion
#endregion
#region Clock Cycles
/* persistent switch signals */
bool s_VS;
bool s_HDISP;
@ -2147,10 +2105,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
#endregion
#region Enums & Constants
/* Horizontal Timing Register Constants */
/// <summary>
/// This 8 bit write-only register determines the horizontal frequency of HS.
@ -2283,10 +2237,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
TransparentMemory
}
#endregion
#region Serialization
public void SyncState(Serializer ser)
{
ser.BeginSection("CRCT");
@ -2324,7 +2274,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
//ser.Sync(nameof(VS), ref VS);
ser.EndSection();
}
#endregion
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,17 +16,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public int Z80ClockSpeed = 4000000;
public int FrameLength = 79872;
#region Devices
private CPCBase _machine;
private Z80A CPU => _machine.CPU;
private CRCT_6845 CRCT => _machine.CRCT;
private IPSG PSG => _machine.AYDevice;
#endregion
#region Constants
/// <summary>
/// CRTC Register constants
/// </summary>
@ -49,10 +43,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public const int LPEN_ADDR_H = 16;
public const int LPEN_ADDR_L = 17;
#endregion
#region Palletes
/// <summary>
/// The standard CPC Pallete (ordered by firmware #)
/// 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
};
#endregion
#region Construction
public GateArrayBase(CPCBase machine)
{
_machine = machine;
@ -204,10 +190,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
}
#endregion
#region State
private int[] PenColours;
private int CurrentPen;
private int ScreenMode;
@ -225,10 +207,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public bool WaitLine;
#endregion
#region Clock Operations
/// <summary>
/// The gatearray runs on a 16Mhz 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>
/// Selects the pen
/// </summary>
@ -363,13 +337,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
#endregion
#region Reset
public void Reset()
{
CurrentPen = 0;
@ -380,10 +347,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
//VSYNCDelyCnt = 0;
}
#endregion
#region IPortIODevice
/// <summary>
/// Device responds to an IN instruction
/// </summary>
@ -434,10 +397,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return true;
}
#endregion
#region IVideoProvider
/// <summary>
/// Video output buffer
/// </summary>
@ -512,7 +471,5 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
protected int[] croppedBuffer;
#endregion
}
}

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