From 6e40c46aa163ff8d52b26b05132cb4c3dcef29c1 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 12 Apr 2020 12:38:02 -0500 Subject: [PATCH] some nitpick cleanups --- BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs | 8 ++++---- .../Consoles/Nintendo/GBA/MGBAHawk.cs | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs b/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs index 3c2fac3b4a..3120b570a3 100644 --- a/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs +++ b/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs @@ -540,7 +540,7 @@ namespace BizHawk.Client.EmuHawk #endregion - unsafe void DrawEverything() + private unsafe void DrawEverything() { ushort dispcnt = ((ushort*)_mmio)[0]; @@ -654,7 +654,7 @@ namespace BizHawk.Client.EmuHawk return mdv; } - void GenerateWidgets() + private void GenerateWidgets() { listBoxWidgets.BeginUpdate(); _bg0 = MakeMBVWidget("Background 0", 256, 256); @@ -688,7 +688,7 @@ namespace BizHawk.Client.EmuHawk } } - static void BringToFrontHack(Control c, Control top) + private static void BringToFrontHack(Control c, Control top) { c.Click += (o, e) => top.BringToFront(); if (c.HasChildren) @@ -742,7 +742,7 @@ namespace BizHawk.Client.EmuHawk // Do nothing } - void ShowSelectedWidget() + private void ShowSelectedWidget() { if (listBoxWidgets.SelectedItem != null) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs index abd01ee169..7fe3cd88ac 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs @@ -54,12 +54,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA ServiceProvider = ser; PutSettings(_settings); - _tracer = new TraceBuffer + Tracer = new TraceBuffer { Header = "ARM7: PC, machine code, mnemonic, operands, registers" }; - _tracecb = new LibmGBA.TraceCallback((msg) => _tracer.Put(_traceInfo(msg))); - ser.Register(_tracer); + _tracecb = msg => Tracer.Put(_traceInfo(msg)); + ser.Register(Tracer); MemoryCallbacks = new MGBAMemoryCallbackSystem(this); } catch @@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA public ControllerDefinition ControllerDefinition => GBA.GBAController; - private ITraceable _tracer { get; set; } + private ITraceable Tracer { get; } private LibmGBA.TraceCallback _tracecb { get; set; } @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA }; } - public bool FrameAdvance(IController controller, bool render, bool rendersound = true) + public bool FrameAdvance(IController controller, bool render, bool renderSound = true) { Frame++; if (controller.IsPressed("Power")) @@ -113,14 +113,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA WireMemoryDomainPointers(); } - LibmGBA.BizSetTraceCallback(_tracer.Enabled ? _tracecb : null); + LibmGBA.BizSetTraceCallback(Tracer.Enabled ? _tracecb : null); IsLagFrame = LibmGBA.BizAdvance( Core, VBANext.GetButtons(controller), render ? _videobuff : _dummyvideobuff, ref _nsamp, - rendersound ? _soundbuff : _dummysoundbuff, + renderSound ? _soundbuff : _dummysoundbuff, RTCTime(), (short)controller.AxisValue("Tilt X"), (short)controller.AxisValue("Tilt Y"), @@ -245,9 +245,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA return (long)DateTime.Now.Subtract(new DateTime(1970, 1, 1)).TotalSeconds; } - long basetime = (long)_syncSettings.RTCInitialTime.Subtract(new DateTime(1970, 1, 1)).TotalSeconds; + long baseTime = (long)_syncSettings.RTCInitialTime.Subtract(new DateTime(1970, 1, 1)).TotalSeconds; long increment = Frame * 4389L >> 18; - return basetime + increment; + return baseTime + increment; } } }