Remove line-end whitespace across main solution

...except in Designer files. Done with
`find src -type f -name '*.cs' -exec sed 's/[ \t][ \t]*$//' -i {} \;`
(and again w/ `\r`) followed by
`git restore src/*.Designer.cs`
This commit is contained in:
YoshiRulz 2025-04-29 02:20:29 +10:00
parent 4cfc20e3ff
commit 605deb682d
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
556 changed files with 2270 additions and 2270 deletions

View File

@ -38,7 +38,7 @@ namespace BizHawk.Bizware.Audio
AudioFormat.S32LSB or AudioFormat.F32LSB => 32,
_ => throw new InvalidOperationException(),
};
[DllImport("SDL2", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr SDL_LoadWAV_RW(
IntPtr src,

View File

@ -100,7 +100,7 @@ namespace BizHawk.Bizware.Graphics.Controls
_graphicsControl.SwapBuffers();
return;
}
// if we're retaining, then we cant draw until we unbind! its semantically a bit odd, but we expect users to call SwapBuffers() before end, so we cant unbind in End() even thoug hit makes a bit more sense.
_gl.BindDefaultRenderTarget();
Draw();

View File

@ -145,7 +145,7 @@ namespace BizHawk.Bizware.Graphics
}
UnlockBits(bmpdata);
Pixels = newPixels;
}
@ -266,7 +266,7 @@ namespace BizHawk.Bizware.Graphics
Width = widthRound;
Height = heightRound;
}
/// <summary>
/// Creates a BitmapBuffer image from the specified filename
/// </summary>
@ -376,7 +376,7 @@ namespace BizHawk.Bizware.Graphics
if (srcPixel != 0)
{
var color = palette[srcPixel].ToArgb();
// make transparent pixels turn into black to avoid filtering issues and other annoying issues with stray junk in transparent pixels.
// (yes, we can have palette entries with transparency in them (PNGs support this, annoyingly))
if (cleanup)

View File

@ -128,7 +128,7 @@ namespace BizHawk.Bizware.Graphics
{
throw new($"Could not set GL Major Version! SDL Error: {SDL_GetError()}");
}
if (SDL_GL_SetAttribute(SDL_GLattr.SDL_GL_CONTEXT_MINOR_VERSION, minorVersion) != 0)
{
throw new($"Could not set GL Minor Version! SDL Error: {SDL_GetError()}");

View File

@ -164,7 +164,7 @@ namespace BizHawk.Bizware.Graphics
{
RenderCommand(sdlRenderer, IntPtr.Zero, _imGuiDrawList, cmd);
}
break;
}
case DrawCallbackId.DisableBlending:

View File

@ -16,7 +16,7 @@ namespace BizHawk.Bizware.Graphics
Owner = owner;
FontInfo = new();
FontInfo.LoadBinary(fontInfo);
// load textures
for (var i = 0; i < FontInfo.Pages.Length; i++)
{

View File

@ -22,7 +22,7 @@ namespace BizHawk.Bizware.Input
/// <summary>Contains name and delegate function for all buttons, hats and axis</summary>
public readonly IReadOnlyCollection<(string ButtonName, Func<bool> GetIsPressed)> ButtonGetters;
/// <summary>For use in keybind boxes</summary>
public string InputNamePrefix { get; private set; }

View File

@ -174,7 +174,7 @@ namespace BizHawk.Bizware.Input
const float SCALE_FACTOR = (float) (WIDTH / (double) int.MaxValue);
Console.WriteLine($"rumble: [{PACKED_BAR_GRAPHICS.Substring(startIndex: (leftStrength * SCALE_FACTOR).RoundToInt(), length: WIDTH)}] L / R [{PACKED_BAR_GRAPHICS.Substring(startIndex: 2 * WIDTH - (rightStrength * SCALE_FACTOR).RoundToInt(), length: WIDTH)}]");
#endif
pad.SetVibration(leftStrength, rightStrength);
pad.SetVibration(leftStrength, rightStrength);
}
}
}

View File

@ -58,16 +58,16 @@ namespace BizHawk.Client.Common
#pragma warning disable MA0091 // passing through `sender` is intentional
private void CallBeforeQuickLoad(object sender, BeforeQuickLoadEventArgs args)
=> BeforeQuickLoad?.Invoke(sender, args);
private void CallBeforeQuickSave(object sender, BeforeQuickSaveEventArgs args)
=> BeforeQuickSave?.Invoke(sender, args);
private void CallRomLoaded(object sender, EventArgs args)
=> RomLoaded?.Invoke(sender, args);
private void CallStateLoaded(object sender, StateLoadedEventArgs args)
=> StateLoaded?.Invoke(sender, args);
private void CallStateSaved(object sender, StateSavedEventArgs args)
=> StateSaved?.Invoke(sender, args);
#pragma warning restore MA0091

View File

@ -68,7 +68,7 @@ namespace BizHawk.Client.Common
var buttonToSet = controller == null ? button : $"P{controller} {button}";
if (state == null) _inputManager.ButtonOverrideAdapter.UnSet(buttonToSet);
else _inputManager.ButtonOverrideAdapter.SetButton(buttonToSet, state.Value);
//"Overrides" is a gross line of code in that flushes overrides into the current controller.
//That's not really the way it was meant to work which was that it should pull all its values through the filters before ever using them.
//Of course the code that does that is in the main loop and the lua API wouldnt know how to do it.

View File

@ -72,7 +72,7 @@ namespace BizHawk.Client.Common
public void LatchFromPhysical(IController finalHostController)
{
_buttons.Clear();
foreach (var (k, v) in _bindings)
{
_buttons[k] = false;

View File

@ -18,7 +18,7 @@ namespace BizHawk.Client.Common
/// returns a sole path to use for opening a rom (not sure if this is a good idea)
/// </summary>
string SimplePath { get; }
void Deserialize(string str);
void Serialize(TextWriter tw);
}
@ -96,7 +96,7 @@ namespace BizHawk.Client.Common
{
token = JsonConvert.DeserializeObject<Token>(str);
}
public void Serialize(TextWriter tw)
{
tw.Write(JsonConvert.SerializeObject(token));

View File

@ -138,7 +138,7 @@ namespace BizHawk.Client.Common.cheats
{
return SnesActionReplayDecoder.Decode(code);
}
return new InvalidCheatCode($"Unknown code type: {code}");
}
}

View File

@ -12,7 +12,7 @@ namespace BizHawk.Client.Common.cheats
{
throw new ArgumentNullException(nameof(code));
}
if (code.IndexOf(" ", StringComparison.Ordinal) != 8)
{
return new InvalidCheatCode("GameShark Codes need to contain a space after the eighth character.");

View File

@ -36,7 +36,7 @@ namespace BizHawk.Client.Common.cheats
{
result.Size = WatchSize.Byte;
}
var s = code.Remove(0, 2);
result.Address = int.Parse(s.Remove(6, 5), NumberStyles.HexNumber);
result.Value = int.Parse(s.Remove(0, 7));

View File

@ -25,7 +25,7 @@ namespace BizHawk.Client.Common
// because of the peculiar setup of Binding.cs and PathEntry.cs
ObjectCreationHandling = ObjectCreationHandling.Replace,
ContractResolver = new DefaultContractResolver
{
DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic,

View File

@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Client.Common
{
// don't take my word for it, but here is a guide...
// user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> ..
// .. -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game

View File

@ -416,10 +416,10 @@ namespace BizHawk.Client.Common
Log($"cheat codes not supported by the current system: {MainForm.Emulator.SystemId}");
return;
}
var decoder = new GameSharkDecoder(MainForm.Emulator.AsMemoryDomains(), MainForm.Emulator.SystemId);
var result = decoder.Decode(code);
if (result.IsValid(out var valid))
{
var domain = decoder.CheatDomain();

View File

@ -11,7 +11,7 @@ namespace BizHawk.Client.Common
public string ToTASVideosWikiMarkup()
{
var sb = new StringBuilder();
sb.AppendLine("__This is an autogenerated page, do not edit.__ (To update, open the function list dialog on a Debug build and click the wiki button.)")
.AppendLine()
.AppendLine("This page documents the the behavior and parameters of Lua functions available for the [BizHawk] emulator. The function list is also available from within EmuHawk. From the Lua Console, click Help > Lua Functions List or press F1.")

View File

@ -23,7 +23,7 @@ namespace BizHawk.Client.Common
get => APIs.Emulation.GetSettings() as GPGX.GPGXSettings ?? new GPGX.GPGXSettings();
set => APIs.Emulation.PutSettings(value);
}
[LuaMethodExample("if ( genesis.getlayer_bga( ) ) then\r\n\tconsole.log( \"Returns whether the bg layer A is displayed\" );\r\nend;")]
[LuaMethod("getlayer_bga", "Returns whether the bg layer A is displayed")]
public bool GetLayerBgA()

View File

@ -100,7 +100,7 @@ namespace BizHawk.Client.Common
{
return sandbox;
}
// for now: throw exception (I want to manually creating them)
// return CreateSandbox(thread);
throw new InvalidOperationException("HOARY GORILLA HIJINX");

View File

@ -95,7 +95,7 @@ namespace BizHawk.Client.Common
["ChannelF"] = 234375.0 / 3872.0, // (NTSCCarrier * 8 / 7) / (256 * 264)
// note: ChannelF II PAL timings might be slightly different...
["ChannelF_PAL"] = 15625.0 / 312.0, // 4000000 / (256 * 312)
["ChannelF_PAL"] = 15625.0 / 312.0, // 4000000 / (256 * 312)
};
public static double GetFrameRate(string systemId, bool pal)

View File

@ -60,7 +60,7 @@ namespace BizHawk.Client.Common
return false;
}
}
return false;
}

View File

@ -211,7 +211,7 @@ namespace BizHawk.Client.Common
}
void IEnumerator.Reset() { _index = -1; }
public void Dispose() { }
}

View File

@ -17,7 +17,7 @@ namespace BizHawk.Client.Common.movie.import
{
using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read);
using var r = new BinaryReader(fs, Encoding.ASCII);
// 000 16-byte signature and format version: "Gens Movie TEST9"
byte[] signature = r.ReadBytes(15);
if (!signature.SequenceEqual("Gens Movie TEST"u8))
@ -37,7 +37,7 @@ namespace BizHawk.Client.Common.movie.import
uint rerecordCount = r.ReadUInt32();
Result.Movie.Rerecords = rerecordCount;
// 014 ASCII-encoded controller config for player 1. '3' or '6'.
char player1Config = r.ReadChar();

View File

@ -9,7 +9,7 @@ namespace BizHawk.Client.Common
// In better detail, from archive.org: http://web.archive.org/web/20070630072856/http://demospecs.planetquake.gamespy.com/lmp/lmp.html
[ImporterFor("Heretic", ".hereticlmp")]
internal class HereticLmpImport : MovieImporter
{
{
protected override void RunImport()
{
var input = SourceFile.OpenRead().ReadAllBytes();

View File

@ -9,7 +9,7 @@ namespace BizHawk.Client.Common
// In better detail, from archive.org: http://web.archive.org/web/20070630072856/http://demospecs.planetquake.gamespy.com/lmp/lmp.html
[ImporterFor("Hexen", ".hexenlmp")]
internal class HexenLmpImport : MovieImporter
{
{
protected override void RunImport()
{
var input = SourceFile.OpenRead().ReadAllBytes();

View File

@ -101,7 +101,7 @@ namespace BizHawk.Client.Common
/// <param name="errorMessage">Returns an error message, if any</param>
/// <returns>Returns whether or not the input log in reader is in the same timeline as the movie</returns>
bool CheckTimeLines(TextReader reader, out string errorMessage);
/// <summary>
/// Takes reader and extracts the input log, then replaces the movies input log with it
/// </summary>

View File

@ -186,7 +186,7 @@ namespace BizHawk.Client.Common
Changes = true;
InvalidateAfter(frame);
ChangeLog.AddInsertInput(frame, inputLog.ToList(), $"Insert {inputLog.Count()} frame(s) at {frame}");
}
@ -207,7 +207,7 @@ namespace BizHawk.Client.Common
{
int firstChangedFrame = -1;
ChangeLog.BeginNewBatch($"Copy Over Input: {frame}");
var states = inputStates.ToList();
if (Log.Count < states.Count + frame)

View File

@ -782,7 +782,7 @@ namespace BizHawk.Client.Common
_onlyEmpty = false;
_newInputs = newInputs;
}
public void Undo(ITasMovie movie)
{
bool wasRecording = movie.ChangeLog.IsRecording;
@ -826,7 +826,7 @@ namespace BizHawk.Client.Common
_oldInputs = oldInputs;
_removedMarkers = removedMarkers;
}
public void Undo(ITasMovie movie)
{
bool wasRecording = movie.ChangeLog.IsRecording;

View File

@ -60,7 +60,7 @@ namespace BizHawk.Client.Common
Markers.Clear();
ChangeLog.Clear();
}
protected override void LoadFields(ZipStateLoader bl)
{
base.LoadFields(bl);
@ -78,7 +78,7 @@ namespace BizHawk.Client.Common
ChangeLog.Clear();
Changes = false;
}
private void LoadTasprojExtras(ZipStateLoader bl)
{
bl.GetLump(BinaryStateLump.LagLog, abort: false, tr => LagLog.Load(tr));

View File

@ -153,7 +153,7 @@ namespace BizHawk.Client.Common
_displayCache.Controller.SetFromMnemonic(Log[frame]);
_displayCache.Frame = frame;
}
return CreateDisplayValueForButton(_displayCache.Controller, buttonName);
}
@ -192,7 +192,7 @@ namespace BizHawk.Client.Common
TasStateManager.Capture(Emulator.Frame, Emulator.AsStatable(), Emulator.Frame == LastEditedFrame - 1);
}
public void CopyVerificationLog(IEnumerable<string> log)
{
foreach (string entry in log)

View File

@ -81,7 +81,7 @@ namespace BizHawk.Client.Common
public class TasMovieMarkerList : List<TasMovieMarker>
{
private readonly ITasMovie _movie;
public TasMovieMarkerList(ITasMovie movie)
{
_movie = movie;
@ -336,7 +336,7 @@ namespace BizHawk.Client.Common
{
return Find(m => m == frame);
}
public void ShiftAt(int frame, int offset)
{
foreach (var marker in this.Where(m => m.Frame >= frame).ToList())

View File

@ -62,7 +62,7 @@ namespace BizHawk.Client.Common
// init the reserved dictionary
RebuildReserved();
}
public byte[] this[int frame]
{
get
@ -174,7 +174,7 @@ namespace BizHawk.Client.Common
if (_reserveCallback(si.Frame))
AddToReserved(si);
else
buffer.Capture(si.Frame, s =>
buffer.Capture(si.Frame, s =>
{
using var rs = si.GetReadStream();
rs.CopyTo(s);

View File

@ -135,7 +135,7 @@ namespace BizHawk.Client.Common
{
return 1; // shrug
}
if (_fixedRewindInterval)
{
return _targetRewindInterval;

View File

@ -116,7 +116,7 @@ namespace BizHawk.Client.Common
_ => string.Empty,
};
}
return "";
}
}

View File

@ -177,7 +177,7 @@ namespace BizHawk.Client.Common
Changes = true;
return true;
}
return false;
}
@ -320,7 +320,7 @@ namespace BizHawk.Client.Common
}
using var sr = file.OpenText();
if (!append)
{
Clear();
@ -372,7 +372,7 @@ namespace BizHawk.Client.Common
type = Watch.DisplayTypeFromChar(vals[7][0]);
bigEndian = vals[8] == "1";
}
// For backwards compatibility, don't assume these values exist
if (vals.Length > 9)
{

View File

@ -359,7 +359,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
get => _settings.UseUndoHistory;
set => _settings.UseUndoHistory = value;
}
public bool CanUndo => UndoEnabled && _history.CanUndo;
public bool CanRedo => UndoEnabled && _history.CanRedo;

View File

@ -485,7 +485,7 @@ namespace BizHawk.Client.EmuHawk
opts = _comprOptions;
}
private byte[] SerializeToByteArray()
{
var m = new MemoryStream();

View File

@ -73,7 +73,7 @@ namespace BizHawk.Client.EmuHawk
}
}
}
//throw new Exception("test of download failure");
//if we were ordered to exit, bail without wasting any more time

View File

@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk
_segment = 0;
OpenFileSegment();
}
/// <summary>
/// starts an ffmpeg process and sets up associated sockets
/// </summary>

View File

@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk
/// total length of the movie: ms
/// </summary>
public ulong LengthMs { get; set; }
/// <summary>
/// number of rerecords
/// </summary>
@ -382,7 +382,7 @@ namespace BizHawk.Client.EmuHawk
Data = source,
Timestamp = TimestampCalc(_fpsNum, _fpsDen, _totalFrames),
};
_totalFrames++;
WriteVideo(j);
}
@ -422,7 +422,7 @@ namespace BizHawk.Client.EmuHawk
Subtype = 1, // raw PCM audio
Data = new byte[4],
};
j.Data[0] = (byte)(l >> 8);
j.Data[1] = (byte)(l & 255);
j.Data[2] = (byte)(r >> 8);
@ -628,7 +628,7 @@ namespace BizHawk.Client.EmuHawk
/// blocking thread safe queue, used for communication between main program and file writing thread
/// </summary>
private BlockingCollection<object> _threadQ;
/// <summary>
/// file writing thread; most of the work happens here
/// </summary>
@ -738,7 +738,7 @@ namespace BizHawk.Client.EmuHawk
/// <param name="v">VideoCopy to compress</param>
/// <returns>gzipped stream with width and height prepended</returns>
private delegate byte[] GzipFrameD(VideoCopy v);
// delegate for GzipFrame
private GzipFrameD _gzipFrameDelegate;

View File

@ -257,7 +257,7 @@ namespace BizHawk.Client.EmuHawk
_data = null;
}
public override long Length => throw new NotImplementedException();
public override long Position
@ -280,7 +280,7 @@ namespace BizHawk.Client.EmuHawk
{
throw new NotImplementedException();
}
public override void Write(byte[] buffer, int offset, int count)
{
_data.Write(buffer, offset, count);
@ -324,13 +324,13 @@ namespace BizHawk.Client.EmuHawk
// has EOR been written on this stream?
private bool _videoDone;
// has EOR been written on this stream?
private bool _audioDone;
// video packets waiting to be written
private readonly Queue<NutFrame> _videoQueue;
// audio packets waiting to be written
private readonly Queue<NutFrame> _audioQueue;

View File

@ -43,7 +43,7 @@ namespace BizHawk.Client.EmuHawk
if (result is null) return;
_mSynclessConfigFile = result;
//---- this is pretty crappy:
var lines = File.ReadAllLines(_mSynclessConfigFile);
@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk
}
_mFramesDirectory = Path.Combine(Path.GetDirectoryName(Path.GetFullPath(_mSynclessConfigFile)), framesDir);
// scan frames directory
int frame = 1; // hacky! skip frame 0, because we have a problem with dumping that frame somehow
for (;;)
@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk
PngPath = png,
WavPath = wav,
});
frame++;
}

View File

@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk
{
InitializeComponent();
CoreNameLabel.Text = attributes.CoreName;
if (!string.IsNullOrEmpty(attributes.Author))
{
CoreAuthorLabel.Text = $"authors: {attributes.Author}";

View File

@ -7,7 +7,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
{
protected override void WndProc(ref Message m)
{
// WM_PASTE is also sent when pasting through the OS context menu, but doesn't work on Mono
// WM_PASTE is also sent when pasting through the OS context menu, but doesn't work on Mono
const int WM_PASTE = 0x302;
if (m.Msg is WM_PASTE && !OSTailoredCode.IsUnixHost)

View File

@ -39,9 +39,9 @@
this.tableLayoutPanel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
//
// btnOK
//
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnOK.Location = new System.Drawing.Point(625, 304);
this.btnOK.Name = "btnOK";
@ -50,9 +50,9 @@
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
//
// tableLayoutPanel1
//
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
@ -68,9 +68,9 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(703, 330);
this.tableLayoutPanel1.TabIndex = 1;
//
//
// txtException
//
//
this.tableLayoutPanel1.SetColumnSpan(this.txtException, 2);
this.txtException.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtException.Location = new System.Drawing.Point(3, 3);
@ -80,9 +80,9 @@
this.txtException.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtException.Size = new System.Drawing.Size(697, 295);
this.txtException.TabIndex = 1;
//
//
// flowLayoutPanel1
//
//
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.Controls.Add(this.btnCopy);
this.flowLayoutPanel1.Controls.Add(this.lblDone);
@ -91,9 +91,9 @@
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(87, 29);
this.flowLayoutPanel1.TabIndex = 2;
//
//
// btnCopy
//
//
this.btnCopy.Location = new System.Drawing.Point(3, 3);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(75, 23);
@ -101,23 +101,23 @@
this.btnCopy.Text = "Copy";
this.btnCopy.UseVisualStyleBackColor = true;
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
//
// lblDone
//
//
this.lblDone.AutoSize = true;
this.lblDone.Location = new System.Drawing.Point(84, 10);
this.lblDone.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0);
this.lblDone.Name = "lblDone";
this.lblDone.Size = new System.Drawing.Size(0, 13);
this.lblDone.TabIndex = 4;
//
//
// timer1
//
//
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
//
// ExceptionBox
//
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

View File

@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk
{
return;
}
if (!e.KeyChar.IsHex())
{
e.Handled = true;
@ -154,7 +154,7 @@ namespace BizHawk.Client.EmuHawk
{
return null;
}
return 0;
}
@ -212,7 +212,7 @@ namespace BizHawk.Client.EmuHawk
{
return;
}
if (!e.KeyChar.IsUnsigned())
{
e.Handled = true;
@ -287,7 +287,7 @@ namespace BizHawk.Client.EmuHawk
{
return null;
}
return 0;
}

View File

@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk
? string.CompareOrdinal(c1.Column?.Name, c2.Column?.Name)
: row;
}
return 1;
}

View File

@ -196,7 +196,7 @@ namespace BizHawk.Client.EmuHawk
_columns.ColumnsChanged();
Refresh();
}
}
base.OnDoubleClick(e);
@ -1043,7 +1043,7 @@ namespace BizHawk.Client.EmuHawk
}
Cell newCell = CalculatePointedCell(_currentX.Value, _currentY.Value);
// SuuperW: Hide lag frames
if (QueryFrameLag != null && newCell.RowIndex.HasValue)
{
@ -1485,7 +1485,7 @@ namespace BizHawk.Client.EmuHawk
else
{
SelectRow(_lastSelectedRow.Value + 1, true);
}
Refresh();
@ -1547,7 +1547,7 @@ namespace BizHawk.Client.EmuHawk
//jump to above marker with selection courser
if (LetKeysModifySelection)
{
}
}
else if (e.IsCtrl(Keys.PageDown))
@ -1963,7 +1963,7 @@ namespace BizHawk.Client.EmuHawk
var size2 = _renderer.MeasureString("AA", Font);
_charSize = new SizeF(size2.Width - size1.Width, size1.Height);
}
if (_columns.VisibleColumns.Any())
{
MaxColumnWidth = _columns.VisibleColumns.Max(c => c.VerticalWidth);

View File

@ -131,7 +131,7 @@ namespace BizHawk.Client.EmuHawk
{
Input.Instance.Update();
var bindingStr = Input.Instance.GetNextBindEvent(ref _lastPress);
if (bindingStr != null)
{
// has special meaning for the binding UI system (clear it).
@ -167,7 +167,7 @@ namespace BizHawk.Client.EmuHawk
_bindings.Add(bindingStr);
}
UpdateLabel();
Increment();
}

View File

@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
// draw text-label part of the control with something so that it isn't hallofmirrorsy
using(var brush = new SolidBrush(Parent.BackColor))
pevent.Graphics.FillRectangle(brush, ClientRectangle);
var r = new Rectangle(ClientRectangle.Location, SystemInformation.MenuCheckSize);
var glyphLoc = ClientRectangle;
glyphLoc.Size = SystemInformation.MenuCheckSize;

View File

@ -34,9 +34,9 @@
this.messageLbl = new BizHawk.WinForms.Controls.LocLabelEx();
this.btn3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
//
// chkBx
//
//
this.chkBx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.chkBx.AutoSize = true;
this.chkBx.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -47,9 +47,9 @@
this.chkBx.Text = "Don\'t show this again";
this.chkBx.UseVisualStyleBackColor = true;
this.chkBx.Visible = false;
//
//
// btn1
//
//
this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn1.AutoSize = true;
this.btn1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
@ -61,9 +61,9 @@
this.btn1.UseVisualStyleBackColor = true;
this.btn1.Visible = false;
this.btn1.Click += new System.EventHandler(this.ButtonClick);
//
//
// btn2
//
//
this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn2.AutoSize = true;
this.btn2.Location = new System.Drawing.Point(317, 114);
@ -74,16 +74,16 @@
this.btn2.UseVisualStyleBackColor = true;
this.btn2.Visible = false;
this.btn2.Click += new System.EventHandler(this.ButtonClick);
//
//
// messageLbl
//
//
this.messageLbl.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.messageLbl.Location = new System.Drawing.Point(58, 10);
this.messageLbl.Name = "messageLbl";
this.messageLbl.Text = "[Message]";
//
//
// btn3
//
//
this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn3.AutoSize = true;
this.btn3.Location = new System.Drawing.Point(398, 114);
@ -94,9 +94,9 @@
this.btn3.UseVisualStyleBackColor = true;
this.btn3.Visible = false;
this.btn3.Click += new System.EventHandler(this.ButtonClick);
//
//
// DialogBox
//
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btn1;

View File

@ -14,7 +14,7 @@ namespace BizHawk.Client.EmuHawk
public class ScreenshotForm : Form
{
private const int WS_EX_TOPMOST = 0x00000008;
private const int Interval = 40;
private const double AlphaStep = 0.125;

View File

@ -31,7 +31,7 @@ namespace BizHawk.Client.EmuHawk
public RetainedViewportPanel(bool doubleBuffer = false)
{
CreateHandle();
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, doubleBuffer);

View File

@ -65,7 +65,7 @@ namespace BizHawk.Client.EmuHawk
public void ShowReport(string title, string report)
{
var ss = report.Split('\n');
lock (_lines)
foreach (var s in ss)
{

View File

@ -95,7 +95,7 @@ namespace BizHawk.Client.EmuHawk
Console.WriteLine($"{nameof(descr.NeedsRomAsPath)}: {descr.NeedsRomAsPath}");
Console.WriteLine($"{nameof(descr.NeedsArchives)}: {descr.NeedsArchives}");
Console.WriteLine($"{nameof(descr.SupportsNoGame)}: {descr.SupportsNoGame}");
foreach (var v in descr.Variables.Values)
Console.WriteLine(v);
}

View File

@ -15,7 +15,7 @@ namespace BizHawk.Client.EmuHawk
private static RAInterface _RA;
private static DynamicLibraryImportResolver _resolver;
private static Version _version;
public static bool IsAvailable => _RA != null;
// can't have both a proxy with a monitor and without one, so...

View File

@ -128,7 +128,7 @@ namespace BizHawk.Client.EmuHawk
{
_memGuard = new(_memLock, _memSema, _memSync);
_memAccess = new(_memLock, _memSema, _memSync);
RA = BizInvoker.GetInvoker<RAInterface>(_resolver, _memAccess, CallingConventionAdapters.Native);
// make sure clientName and clientVer match our user agent, as these get put into RAIntegration's user agent
@ -172,7 +172,7 @@ namespace BizHawk.Client.EmuHawk
RA.OnLoadState(path);
}
private void QuickLoadCallback(object _, BeforeQuickLoadEventArgs e)
{
if (RA.HardcoreModeIsActive())

View File

@ -91,8 +91,8 @@ namespace BizHawk.Client.EmuHawk
{
_badgeUnlockedRequest = new(BadgeName, LibRCheevos.rc_api_image_type_t.RC_IMAGE_TYPE_ACHIEVEMENT);
_badgeLockedRequest = new(BadgeName, LibRCheevos.rc_api_image_type_t.RC_IMAGE_TYPE_ACHIEVEMENT_LOCKED);
requests.Add(_badgeUnlockedRequest);
requests.Add(_badgeLockedRequest);
requests.Add(_badgeUnlockedRequest);
requests.Add(_badgeLockedRequest);
}
public Cheevo(in LibRCheevos.rc_api_achievement_definition_t cheevo, Func<bool> allowUnofficialCheevos)
@ -166,7 +166,7 @@ namespace BizHawk.Client.EmuHawk
private void ToSoftcoreMode()
{
if (_gameData == null || _gameData.GameID == 0) return;
// don't worry if the meanings of _active and _inactive are wrong
// if they are, then they're both already finished

View File

@ -134,7 +134,7 @@ namespace BizHawk.Client.EmuHawk
_domain.PokeByte(FixAddr(addr) ^ _addressMangler, val);
}
}
protected virtual uint ReadMemBlock(uint addr, IntPtr buffer, uint bytes)
{
addr = FixAddr(addr);
@ -492,7 +492,7 @@ namespace BizHawk.Client.EmuHawk
TryAddDomain(cartRam, 0x2000);
mfs.Add(new(domains[wram], 0x0000, 0x2000));
mfs.Add(new(domains[sysBus], 0xE000, 0x2000));
mfs.Add(domains[wram].Size == 0x8000
mfs.Add(domains[wram].Size == 0x8000
? new MemFunctions(domains[wram], 0x2000, 0x6000)
: new NullMemFunctions(0x6000));
if (domains.Has(cartRam) && domains[cartRam].Size > 0x2000)

View File

@ -29,7 +29,7 @@ namespace BizHawk.Client.EmuHawk
protected RetroAchievements(
MainForm mainForm,
InputManager inputManager,
ToolManager tools,
ToolManager tools,
Func<Config> getConfig,
ToolStripItemCollection raDropDownItems,
Action shutdownRACallback)

View File

@ -104,7 +104,7 @@ namespace BizHawk.Client.EmuHawk
ScaledX * 2 - 3,
ScaledY * 2 - 3);
}
base.OnPaint(e);
}

View File

@ -179,7 +179,7 @@ namespace BizHawk.Client.EmuHawk
_emulator = emulator;
_config = config;
DialogController = dialogController;
InitializeComponent();
SuspendLayout();

View File

@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk
{
_panelSize = Size;
}
_realConfigObject = config;
_realConfigButtons = buttons;
SetButtonList();

View File

@ -149,7 +149,7 @@ namespace BizHawk.Client.EmuHawk
_config.DispFullscreenHacks = cbFullscreenHacks.Checked;
_config.DispAutoPrescale = cbAutoPrescale.Checked;
_config.ScaleOSDWithSystemScale = cbScaleOSD.Checked;
_config.DispAllowTearing = cbAllowTearing.Checked;
_config.DispChromeStatusBarWindowed = cbStatusBarWindowed.Checked;
@ -283,7 +283,7 @@ namespace BizHawk.Client.EmuHawk
rbUser.Checked = true;
var choice = Path.GetFullPath(result);
//test the preset
using (var stream = File.OpenRead(choice))
{

View File

@ -317,7 +317,7 @@ namespace BizHawk.Client.EmuHawk
{
// lazy substring extraction. really should do a better job
var basePath = _pathEntries.FirmwareAbsolutePath() + Path.DirectorySeparatorChar;
var path = ri.FilePath.Replace(basePath, "");
// bolden the item if the user has specified a path for it

View File

@ -76,7 +76,7 @@ namespace BizHawk.Client.EmuHawk
{
_s.Muted = ((CheckBox)sender).Checked;
}
private void CbRgbdsSyntax_CheckedChanged(object sender, EventArgs e)
{
_s.RgbdsSyntax = ((CheckBox)sender).Checked;

View File

@ -24,7 +24,7 @@ namespace BizHawk.Client.EmuHawk
var tsi = new ToolStripMenuItem(spec.BindingName) { ToolTipText = spec.TooltipText };
_dropdownMenu.Items.Add(tsi);
}
btnSpecial.ContextMenuStrip = _dropdownMenu;
widget.CompositeWidget = this;

View File

@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk
_reRecordCounter = _config.ReRecordCounter.Clone();
_messages = _config.Messages.Clone();
_autohold = _config.Autohold.Clone();
_ramWatches = _config.RamWatches.Clone();
_ramWatches = _config.RamWatches.Clone();
InitializeComponent();
@ -139,7 +139,7 @@ namespace BizHawk.Client.EmuHawk
ColorBox.Controls.Add(row);
}
}
private void Ok_Click(object sender, EventArgs e)
{
_config.Fps = _fps;

View File

@ -209,7 +209,7 @@ namespace BizHawk.Client.EmuHawk
bestFit = 0;
break;
}
bestFit = i - 1;
break;
}

View File

@ -112,7 +112,7 @@ namespace BizHawk.Client.EmuHawk
return _settings.Palette;
}
// no filename: interpret this as "reset to default"
if (showMsg)
{
@ -120,9 +120,9 @@ namespace BizHawk.Client.EmuHawk
}
return (byte[,])Palettes.QuickNESPalette.Clone();
}
// checkbox unchecked: we're reusing whatever palette was set
return _settings.Palette;
}

View File

@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
if (pictureBox1.Image != null)
{
pictureBox1.Image.Dispose();

View File

@ -141,7 +141,7 @@ namespace BizHawk.Client.EmuHawk
{
_syncSettings.FIOConfig = UserConfigFromGui();
_settable.PutCoreSyncSettings(_syncSettings);
DialogResult = DialogResult.OK;
Close();
}

View File

@ -94,7 +94,7 @@ namespace BizHawk.Client.EmuHawk
for (int i = 0; i < SubGrid.Rows.Count - 1; i++)
{
var sub = new Subtitle();
var c = SubGrid.Rows[i].Cells[0];
try { sub.Frame = int.Parse(c.Value.ToString()); }
catch { ShowError(i, 0); return; }
@ -149,7 +149,7 @@ namespace BizHawk.Client.EmuHawk
{
return new Subtitle();
}
var sub = new Subtitle();
if (int.TryParse(SubGrid.Rows[index].Cells[0].Value.ToString(), out int frame))
@ -171,12 +171,12 @@ namespace BizHawk.Client.EmuHawk
{
sub.Duration = duration;
}
if (uint.TryParse(SubGrid.Rows[index].Cells[4].Value.ToString(), out uint color))
{
sub.Color = color;
}
sub.Message = SubGrid.Rows[index].Cells[5].Value?.ToString() ?? "";
_selectedMovie.Subtitles.Add(sub);

View File

@ -277,7 +277,7 @@ namespace BizHawk.Client.EmuHawk
private void BrowseBtn_Click(object sender, EventArgs e)
{
string movieFolderPath = _config.PathEntries.MovieAbsolutePath();
// Create movie folder if it doesn't already exist
try
{
@ -292,7 +292,7 @@ namespace BizHawk.Client.EmuHawk
}
else throw;
}
var filterset = _movieSession.Movie.GetFSFilterSet();
var result = this.ShowFileSaveDialog(
fileExt: $".{filterset.Filters[0].Extensions.First()}",

View File

@ -58,7 +58,7 @@ namespace BizHawk.Client.EmuHawk
private int _dataSize;
private Dictionary<string, double> _cachedControlProbabilities;
private bool _previousDisplayMessage;
private bool _previousInvisibleEmulation;
@ -153,7 +153,7 @@ namespace BizHawk.Client.EmuHawk
ControlProbabilityPanel.Controls
.OfType<BotControlsRow>()
.ToDictionary(tkey => tkey.ButtonName, tvalue => tvalue.Probability);
private int SelectedSlot
=> 1 + StartFromSlotBox.SelectedIndex;

View File

@ -167,7 +167,7 @@ namespace BizHawk.Client.EmuHawk
try
{
emu.FrameAdvance(controller, true);
// some cores really really really like it if you drain their audio every frame
if (emu.HasSoundProvider())
{

View File

@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk
[ConfigPersist]
private bool CDLAutoStart { get; set; } = true;
[ConfigPersist]
private bool CDLAutoResume { get; set; } = true;
@ -145,7 +145,7 @@ namespace BizHawk.Client.EmuHawk
{
int[] totals = new int[8];
int total = 0;
for (int i = 0; i < 256; i++)
map[i] = 0;
@ -236,7 +236,7 @@ namespace BizHawk.Client.EmuHawk
ShutdownCDL();
return true;
}
ShutdownCDL();
return false;
}
@ -385,7 +385,7 @@ namespace BizHawk.Client.EmuHawk
if (file == null)
return false;
SetCurrentFilename(file.FullName);
RunSave();
return true;

View File

@ -56,15 +56,15 @@ namespace BizHawk.Client.EmuHawk
this.menuStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
//
// menuStrip1
//
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.FileSubMenu});
this.menuStrip1.TabIndex = 2;
//
//
// FileSubMenu
//
//
this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.NewMenuItem,
this.OpenMenuItem,
@ -80,75 +80,75 @@ namespace BizHawk.Client.EmuHawk
this.DisassembleMenuItem});
this.FileSubMenu.Text = "&File";
this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened);
//
//
// NewMenuItem
//
//
this.NewMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.NewMenuItem.Text = "&New";
this.NewMenuItem.Click += new System.EventHandler(this.NewMenuItem_Click);
//
//
// OpenMenuItem
//
//
this.OpenMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.OpenMenuItem.Text = "&Open...";
this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click);
//
//
// SaveMenuItem
//
//
this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.SaveMenuItem.Text = "&Save";
this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click);
//
//
// SaveAsMenuItem
//
this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
//
this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S)));
this.SaveAsMenuItem.Text = "&Save As...";
this.SaveAsMenuItem.Click += new System.EventHandler(this.SaveAsMenuItem_Click);
//
//
// AppendMenuItem
//
//
this.AppendMenuItem.Text = "&Append File...";
this.AppendMenuItem.Click += new System.EventHandler(this.AppendMenuItem_Click);
//
//
// RecentSubMenu
//
//
this.RecentSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.noneToolStripMenuItem});
this.RecentSubMenu.Text = "Recent";
this.RecentSubMenu.DropDownOpened += new System.EventHandler(this.RecentSubMenu_DropDownOpened);
//
//
// noneToolStripMenuItem
//
//
this.noneToolStripMenuItem.Text = "None";
//
//
// miAutoStart
//
//
this.miAutoStart.Text = "Auto-Start";
this.miAutoStart.Click += new System.EventHandler(this.MiAutoStart_Click);
//
//
// miAutoSave
//
//
this.miAutoSave.Text = "Auto-Save";
this.miAutoSave.Click += new System.EventHandler(this.MiAutoSave_Click);
//
//
// miAutoResume
//
//
this.miAutoResume.Text = "Auto-Resume";
this.miAutoResume.Click += new System.EventHandler(this.MiAutoResume_Click);
//
//
// ClearMenuItem
//
//
this.ClearMenuItem.Text = "&Clear";
this.ClearMenuItem.Click += new System.EventHandler(this.ClearMenuItem_Click);
//
//
// DisassembleMenuItem
//
//
this.DisassembleMenuItem.Text = "&Disassemble...";
this.DisassembleMenuItem.Click += new System.EventHandler(this.DisassembleMenuItem_Click);
//
//
// toolStrip1
//
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbLoggingActive,
this.toolStripSeparator3,
@ -159,9 +159,9 @@ namespace BizHawk.Client.EmuHawk
this.toolStrip1.Location = new System.Drawing.Point(0, 24);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.TabIndex = 8;
//
//
// tsbLoggingActive
//
//
this.tsbLoggingActive.CheckOnClick = true;
this.tsbLoggingActive.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.tsbLoggingActive.ImageTransparentColor = System.Drawing.Color.Magenta;
@ -169,9 +169,9 @@ namespace BizHawk.Client.EmuHawk
this.tsbLoggingActive.Size = new System.Drawing.Size(44, 22);
this.tsbLoggingActive.Text = "Active";
this.tsbLoggingActive.CheckedChanged += new System.EventHandler(this.TsbLoggingActive_CheckedChanged);
//
//
// tsbViewUpdate
//
//
this.tsbViewUpdate.Checked = true;
this.tsbViewUpdate.CheckOnClick = true;
this.tsbViewUpdate.CheckState = System.Windows.Forms.CheckState.Checked;
@ -180,9 +180,9 @@ namespace BizHawk.Client.EmuHawk
this.tsbViewUpdate.Name = "tsbViewUpdate";
this.tsbViewUpdate.Size = new System.Drawing.Size(49, 22);
this.tsbViewUpdate.Text = "Update";
//
//
// tsbViewStyle
//
//
this.tsbViewStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.tsbViewStyle.Items.AddRange(new object[] {
"Show %",
@ -191,17 +191,17 @@ namespace BizHawk.Client.EmuHawk
this.tsbViewStyle.Name = "tsbViewStyle";
this.tsbViewStyle.Size = new System.Drawing.Size(121, 25);
this.tsbViewStyle.SelectedIndexChanged += new System.EventHandler(this.TsbViewStyle_SelectedIndexChanged);
//
//
// tsbExportText
//
//
this.tsbExportText.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbExportText.Name = "tsbExportText";
this.tsbExportText.Size = new System.Drawing.Size(78, 22);
this.tsbExportText.Text = "To Clipboard";
this.tsbExportText.Click += new System.EventHandler(this.TsbExportText_Click);
//
//
// lvCDL
//
//
this.lvCDL.AllowColumnReorder = false;
this.lvCDL.AllowColumnResize = true;
this.lvCDL.AllowMassNavigationShortcuts = true;
@ -219,9 +219,9 @@ namespace BizHawk.Client.EmuHawk
this.lvCDL.Size = new System.Drawing.Size(992, 323);
this.lvCDL.TabIndex = 9;
this.lvCDL.QueryItemText += new BizHawk.Client.EmuHawk.InputRoll.QueryItemTextHandler(this.LvCDL_QueryItemText);
//
//
// CDL
//
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

View File

@ -369,7 +369,7 @@ namespace BizHawk.Client.EmuHawk
{
return;
}
// Don't need to do anything in this case
if (!empty && CompareTypeDropDown.Items.Count == 6)
{

View File

@ -488,7 +488,7 @@ namespace BizHawk.Client.EmuHawk
}
private void DisableAllCheatsMenuItem_Click(object sender, EventArgs e)
{
{
MainForm.CheatList.DisableAll();
}

View File

@ -175,7 +175,7 @@ namespace BizHawk.Client.EmuHawk
}
private IEnumerable<int> SelectedIndices => BreakpointView.SelectedIndices.Cast<int>();
private IEnumerable<Breakpoint> SelectedItems => SelectedIndices.Select(index => _breakpoints[index]);
private IEnumerable<Breakpoint> EditableItems => SelectedItems.Where(item => !item.ReadOnly);

View File

@ -50,7 +50,7 @@ namespace BizHawk.Client.EmuHawk
Disassemble();
}
}
private void Disassemble()
{
_disassemblyLines.Clear();
@ -136,7 +136,7 @@ namespace BizHawk.Client.EmuHawk
if (DisassemblerView.VisibleRows > 0)
{
DisassemblerView.RowCount = DisassemblerView.VisibleRows * 6 + 2;
}
}
}
private void DisassemblerView_SizeChanged(object sender, EventArgs e)

View File

@ -162,7 +162,7 @@ namespace BizHawk.Client.EmuHawk
if (t.Text.Length is not 0)
{
Core.SetCpuRegister(t.Name, int.Parse(t.Text, System.Globalization.NumberStyles.HexNumber));
}
}
}
catch (InvalidOperationException)
{

View File

@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk
}
private Color _spriteback;
[ConfigPersist]
public Color Spriteback
{

View File

@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk
private string _numDigitsStr = "{0:X4}";
private string _digitFormatString = "{0:X2}";
private long _addressOver = -1;
private long _maxRow;
private MemoryDomain _domain = new NullMemoryDomain();
@ -253,7 +253,7 @@ namespace BizHawk.Client.EmuHawk
_domain = _romDomain;
}
else
{
{
_domain = MemoryDomains.Any(x => x.Name == _domain.Name)
? MemoryDomains[_domain.Name]
: MemoryDomains.MainMemory;
@ -269,7 +269,7 @@ namespace BizHawk.Client.EmuHawk
_lastRom = MainForm.CurrentlyOpenRom;
ResetScrollBar();
}
SetDataSize(DataSize);
SetHeader();
@ -427,12 +427,12 @@ namespace BizHawk.Client.EmuHawk
}
byte[] bytes = new byte[str.Length / 2];
for (int i = 0; i < str.Length; i += 2)
{
bytes[i / 2] = Convert.ToByte(str.Substring(i, 2), 16);
}
return bytes;
}
@ -502,17 +502,17 @@ namespace BizHawk.Client.EmuHawk
{
return true;
}
if (key >= 'a' && key <= 'f') // A-F
{
return true;
}
if (key >= 'A' && key <= 'F') // A-F
{
return true;
}
return false;
}
@ -603,7 +603,7 @@ namespace BizHawk.Client.EmuHawk
{
if (addr + k < _domain.Size)
{
byte b = (byte)charValues[addr + k];
char c = Remap(b);
rowStr.Append(c);
@ -1164,7 +1164,7 @@ namespace BizHawk.Client.EmuHawk
{
return string.Format(_digitFormatString, MakeValue(DataSize, address)).Trim();
}
return "";
}
@ -1175,7 +1175,7 @@ namespace BizHawk.Client.EmuHawk
var values = ValueString(_highlightedAddress.Value);
return _secondaryHighlightedAddresses.Aggregate(values, (current, x) => current + ValueString(x));
}
return "";
}
@ -1243,7 +1243,7 @@ namespace BizHawk.Client.EmuHawk
CloseTableFileMenuItem.Enabled = _textTable.Count is not 0;
}
private void SaveMenuItem_Click(object sender, EventArgs e)
{
if (!CurrentRomIsArchive())
@ -1412,7 +1412,7 @@ namespace BizHawk.Client.EmuHawk
{
return;
}
var clipboardRaw = (string)data.GetData(DataFormats.Text);
var hex = clipboardRaw.OnlyHex();
@ -1956,7 +1956,7 @@ namespace BizHawk.Client.EmuHawk
{
newValue = HexScrollBar.Maximum - HexScrollBar.LargeChange + 1;
}
if (newValue != HexScrollBar.Value)
{
HexScrollBar.Value = newValue;
@ -1981,7 +1981,7 @@ namespace BizHawk.Client.EmuHawk
}
if (gaps < 0) { gaps = 0; }
var width = (_fontWidth * 2 * (int)cheat.Size) + (gaps * _fontWidth);
var rect = new Rectangle(GetAddressCoordinates(cheat.Address ?? 0), new Size(width, _fontHeight));

View File

@ -79,7 +79,7 @@ namespace BizHawk.Client.EmuHawk
{
return;
}
if (!e.KeyChar.IsHex())
{
e.Handled = true;
@ -91,7 +91,7 @@ namespace BizHawk.Client.EmuHawk
{
return;
}
if (!e.KeyChar.IsSigned())
{
e.Handled = true;

View File

@ -129,7 +129,7 @@ namespace BizHawk.Client.EmuHawk
if (AskSaveChanges())
{
Settings.Columns = LuaListView.AllColumns;
DisplayManager.ClearApiHawkSurfaces();
DisplayManager.ClearApiHawkTextureCache();
ResetDrawSurfacePadding();
@ -502,7 +502,7 @@ namespace BizHawk.Client.EmuHawk
OutputBox.SelectionStart = OutputBox.Text.Length;
OutputBox.ScrollToCaret();
});
}
public void ClearOutputWindow()

View File

@ -141,7 +141,7 @@ namespace BizHawk.Client.EmuHawk
Clipboard.SetText(sb.ToString());
}
}
private void UpdateList()
{
GenerateFilteredList();

View File

@ -44,7 +44,7 @@ namespace BizHawk.Client.EmuHawk
LogOutputCallback = logOutputCallback;
TableHelper = tableHelper;
}
public void LuaResize(int width, int height)
{
Width = width;
@ -148,7 +148,7 @@ namespace BizHawk.Client.EmuHawk
boxBackground.FillEllipse(brush, x, y, width, height);
boxBackground = Graphics.FromImage(Image);
}
boxBackground.DrawEllipse(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x, y, width, height);
}
@ -256,7 +256,7 @@ namespace BizHawk.Client.EmuHawk
boxBackground.FillPie(brush, x, y, width, height, startAngle, sweepAngle);
boxBackground = Graphics.FromImage(Image);
}
boxBackground.DrawPie(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x + 1, y + 1, width - 1, height - 1, startAngle, sweepAngle);
}
@ -309,7 +309,7 @@ namespace BizHawk.Client.EmuHawk
boxBackground.FillRectangle(GetBrush(bg.Value), x, y, width, height);
boxBackground = Graphics.FromImage(Image);
}
boxBackground.DrawRectangle(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x, y, width, height);
}
@ -400,7 +400,7 @@ namespace BizHawk.Client.EmuHawk
boxBackground.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
boxBackground.DrawString(message, font, GetBrush(TableHelper.SafeParseColor(foreColor) ?? Color.Black), x, y);
}
public Point GetMouse()
{
var p = PointToClient(MousePosition);

View File

@ -45,7 +45,7 @@ namespace BizHawk.Client.EmuHawk
private void PopulateListView()
{
FunctionView.Items.Clear();
var functions = _registeredFunctions
.OrderBy(f => f.Event)
.ThenBy(f => f.Name);

View File

@ -435,7 +435,7 @@ namespace BizHawk.Client.EmuHawk
////ftriangle = fCPU/(32*(tval + 1))
var apu = Nes.apu;
// evaluate the pitches
int pulse0Period = apu.pulse[0].timer_reload_value;
float pulse0Freq = 1789773.0f / (16.0f * (pulse0Period + 1));

View File

@ -540,7 +540,7 @@ namespace BizHawk.Client.EmuHawk
{
ClearDetails();
}
private void SpriteView_MouseMove(object sender, MouseEventArgs e)
{
HandleSpriteViewMouseMove(e.Location);
@ -554,7 +554,7 @@ namespace BizHawk.Client.EmuHawk
byte[] ppuBus = _ppu.GetPPUBus(); // caching is quicker, but not really correct in this case
bool is8x16 = _ppu.SPTall;
//figure out which sprite we're over
int spriteSlotY = p.Y / 8;
int spriteSlotX = p.X / 8;

View File

@ -66,7 +66,7 @@ namespace BizHawk.Client.EmuHawk
}
}
public void ScreenshotToClipboard()
{

View File

@ -170,7 +170,7 @@ namespace BizHawk.Client.EmuHawk
if (index == Emulator.Frame)
{
bitmap = index == MainForm.PauseOnFrame
? TasView.HorizontalOrientation ? ts_v_arrow_green_blue : ts_h_arrow_green_blue
? TasView.HorizontalOrientation ? ts_v_arrow_green_blue : ts_h_arrow_green_blue
: TasView.HorizontalOrientation ? ts_v_arrow_blue : ts_h_arrow_blue;
}
else if (index == LastPositionFrame)
@ -576,7 +576,7 @@ namespace BizHawk.Client.EmuHawk
_axisEditYPos = e.Y;
_axisPaintState = CurrentTasMovie.GetAxisState(frame, buttonName);
_triggerAutoRestore = true;
TastudioPlayMode(true);
return;
@ -856,7 +856,7 @@ namespace BizHawk.Client.EmuHawk
{
// If painting up, we have altered frames without loading states (for smoothness)
// So now we have to ensure that all the edited frames are invalidated
GoToLastEmulatedFrameIfNecessary(_paintingMinFrame);
GoToLastEmulatedFrameIfNecessary(_paintingMinFrame);
}
ClearLeftMouseStates();

View File

@ -1030,17 +1030,17 @@ namespace BizHawk.Client.EmuHawk
private void HideWasLagFramesMenuItem_Click(object sender, EventArgs e)
=> TasView.HideWasLagFrames = !TasView.HideWasLagFrames;
private void AlwaysScrollMenuItem_Click(object sender, EventArgs e)
{
TasView.AlwaysScroll = Settings.FollowCursorAlwaysScroll = alwaysScrollToolStripMenuItem.Checked;
}
private void ScrollToViewMenuItem_Click(object sender, EventArgs e)
{
TasView.ScrollMethod = Settings.FollowCursorScrollMethod = "near";
}
private void ScrollToTopMenuItem_Click(object sender, EventArgs e)
{
TasView.ScrollMethod = Settings.FollowCursorScrollMethod = "top";

View File

@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk
{
// Get as close as we can then emulate there
StartAtNearestFrameAndEmulate(frame, fromLua, fromRewinding);
if (!OnLeftMouseDown) { MaybeFollowCursor(); }
if (!OnLeftMouseDown) { MaybeFollowCursor(); }
}
else // Emulate to a future frame
{

View File

@ -8,7 +8,7 @@ namespace BizHawk.Client.EmuHawk
{
private const string IdColumnName = "ID";
private const string UndoColumnName = "Undo Step";
private readonly TAStudio _tastudio;
private string _lastUndoAction;
private IMovieChangeLog Log => _tastudio.CurrentTasMovie.ChangeLog;

View File

@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk
[ConfigPersist]
public bool ClearAlsoClearsAnalog { get; set; }
private bool _readOnly;
private Control _lastFocusedNUD = null;

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