From 2b4267d2c985966c74715460e8e34a2c9f93a9c2 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 16 Dec 2016 15:47:19 -0600 Subject: [PATCH] nitpicky code refactorings on unimportant files, nothing to see here --- .../Base Implementations/NullEmulator.cs | 225 ++++++++++++------ BizHawk.Emulation.Cores/Calculator/TI83.cs | 15 +- 2 files changed, 156 insertions(+), 84 deletions(-) diff --git a/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs b/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs index 0b89fe25b8..36c2d3bc82 100644 --- a/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs +++ b/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; -using System.IO; -using BizHawk.Common; using System.ComponentModel; +using System.IO; + +using BizHawk.Common; namespace BizHawk.Emulation.Common { @@ -19,77 +20,107 @@ namespace BizHawk.Emulation.Common _settings = (NullEmulatorSettings)settings ?? new NullEmulatorSettings(); var d = DateTime.Now; - xmas = d.Month == 12 && d.Day >= 17 && d.Day <= 27; - if (xmas) - pleg = new Pleg(); + _xmas = d.Month == 12 && d.Day >= 17 && d.Day <= 27; + if (_xmas) + { + _pleg = new Pleg(); + } } + #region IEmulator + public IEmulatorServiceProvider ServiceProvider { get; private set; } - public string SystemId { get { return "NULL"; } } - public static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" }; - - public string BoardName { get { return null; } } - - private bool frameBufferClear = true; - private readonly int[] frameBuffer = new int[256 * 192]; - private readonly Random rand = new Random(); - public CoreComm CoreComm { get; private set; } - - public void ResetCounters() + public ControllerDefinition ControllerDefinition { - Frame = 0; + get { return NullController; } } + public IController Controller { get; set; } + public void FrameAdvance(bool render, bool rendersound) { if (render == false) return; if (!_settings.SnowyDisplay) { - if (frameBufferClear) return; - frameBufferClear = true; - Array.Clear(frameBuffer, 0, 256 * 192); + if (_frameBufferClear) return; + _frameBufferClear = true; + Array.Clear(FrameBuffer, 0, 256 * 192); return; } - frameBufferClear = false; - if (xmas) + _frameBufferClear = false; + if (_xmas) { for (int i = 0; i < 256 * 192; i++) { - byte b = (byte)rand.Next(); - frameBuffer[i] = Colors.ARGB(b, (byte)(255 - b), 0, 255); + byte b = (byte)Rand.Next(); + FrameBuffer[i] = Colors.ARGB(b, (byte)(255 - b), 0, 255); } } else { - for (int i = 0; i < 256*192; i++) + for (int i = 0; i < 256 * 192; i++) { - frameBuffer[i] = Colors.Luminosity((byte) rand.Next()); + FrameBuffer[i] = Colors.Luminosity((byte)Rand.Next()); } } Frame++; } - public ControllerDefinition ControllerDefinition { get { return NullController; } } - public IController Controller { get; set; } public int Frame { get; set; } + + public string SystemId { get { return "NULL"; } } + public bool DeterministicEmulation { get { return true; } } - public int[] GetVideoBuffer() { return frameBuffer; } - public int VirtualWidth { get { return 256; } } - public int VirtualHeight { get { return 192; } } - public int BufferWidth { get { return 256; } } - public int BufferHeight { get { return 192; } } - public int BackgroundColor { get { return 0; } } + public void ResetCounters() + { + Frame = 0; + } + + public string BoardName { get { return null; } } + + public CoreComm CoreComm { get; private set; } public void Dispose() { } - private bool xmas; - private Pleg pleg; + #endregion - private short[] sampbuff = new short[735 * 2]; + #region IVideoProvider + + public int[] GetVideoBuffer() + { + return FrameBuffer; + } + + public int VirtualWidth + { + get { return 256; } + } + + public int VirtualHeight + { + get { return 192; } + } + + public int BufferWidth + { + get { return 256; } + } + + public int BufferHeight + { + get { return 192; } + } + + public int BackgroundColor + { + get { return 0; } + } + + #endregion #region ISoundProvider @@ -101,11 +132,16 @@ namespace BizHawk.Emulation.Common } nsamp = 735; - samples = sampbuff; + samples = SampleBuffer; if (!_settings.SnowyDisplay) + { return; - if (xmas) - pleg.Generate(samples); + } + + if (_xmas) + { + _pleg.Generate(samples); + } } public void DiscardSamples() @@ -120,9 +156,14 @@ namespace BizHawk.Emulation.Common } if (!_settings.SnowyDisplay) + { return; - if (xmas) - pleg.Generate(samples); + } + + if (_xmas) + { + _pleg.Generate(samples); + } } public bool CanProvideAsync @@ -139,23 +180,7 @@ namespace BizHawk.Emulation.Common #endregion - private NullEmulatorSettings _settings; - - public class NullEmulatorSettings - { - [DefaultValue(false)] - public bool SnowyDisplay { get; set; } - - public NullEmulatorSettings() - { - SettingsUtil.SetDefaultValues(this); - } - - public NullEmulatorSettings Clone() - { - return (NullEmulatorSettings)MemberwiseClone(); - } - } + #region ISettable public NullEmulatorSettings GetSettings() { @@ -177,14 +202,45 @@ namespace BizHawk.Emulation.Common { return false; } + + #endregion + + public static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" }; + + private readonly int[] FrameBuffer = new int[256 * 192]; + private readonly short[] SampleBuffer = new short[735 * 2]; + private readonly Random Rand = new Random(); + + private bool _frameBufferClear = true; + + private bool _xmas; + private Pleg _pleg; + + private NullEmulatorSettings _settings; + + public class NullEmulatorSettings + { + [DefaultValue(false)] + public bool SnowyDisplay { get; set; } + + public NullEmulatorSettings() + { + SettingsUtil.SetDefaultValues(this); + } + + public NullEmulatorSettings Clone() + { + return (NullEmulatorSettings)MemberwiseClone(); + } + } } #region super tone generator - class Bell + internal class Bell { // ms ima adpcm - const string dataz = "H4sICHbdkVQCAGJlbGxzb3V0LnJhdwDtWOdz+nQYz8BZsqmrkJBAXS1JgNZZZqueo4XW8Upt63jpqPOd486X7vf6c7zxzlHQO19pgeqdq4VA62yBBOpqIQvqKknEP8PT50VeJt/k+cwAOPD//D//z390IHx4cQH/z79lQBxgVFuJECSHdxqAznFRFu1ut/wgMS2oe4ogRYBpf7er+OvaOWGNqaa2dDDKDioBfx2Elg5lAGIxI41+JRPTfHvV7m5oF/ohnPR93CQJLkobvyq+zVUj7LjXAQckbxEb2AZQDgTvYvYkpmH9fBeANfR9k7koBfxa4RiKHefflXE9AuCmKE2eSv9gRjjhY+hPDZxjAiPNQTOKXJfV7F4sR/+eaPo1gH3bCNzMdNt3PKdDs5ETY6Q11l4Meqt8beEUZ7m8tZTr6pzfEOVZpvt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1+KvEfUAjkeIdYvYmu1efqMRL4qNSClcFSvRQwWwfp85EIuxOvdCUp9SA4c63SbMJVrYs4Hyteqc1/SVfB/E+9mhzULeWkR6qBtWwe+oyYOFYfvjVAgLqh4vMPN6ZI8VDF4Jbyfy0c+p0EGovVAgHKF6jwNhhfjW6XRPNEI5usCq9yDUfFHYDqCutC6uM+8F6tfQfT5HVCAgTHhOlEs3xcqcDSObiBRtr0m3/AB52/HSqsZqxD5pKg+0soM+Uou9IWqLNPk9abX5nwUZt+jN0Gn+/szu+b0JJSulmp4uV05XRt0kRoPAxuJJwNvjJb4Imiy5dMHOTYVkc+7Eg4K26Qb/AXiqI8UqP4bOzUisqpZT6j3WNRbo2/SaSTx2ri05CtB61NBBpGIHwWR/ZdtzCDL9RDUrj8mZEmn0Q18LL+KbzE62xxeFDcfjTAvcFlPBXxzXSQVvDjYT70dYWfwBeieAsfJDFe7UUNjkRC1V8NsB/vnLrL7v62HycAgn+Fd/onVnKV0I1LkxkMH8pr873aF+gPxD088tvOZvzspZjdq3Tf0u3zgqoQUsMIcFz4LONIRaShYVLNehhJTzyD71AzygeCNu0i+QDoycMQkwfwNoPjsGACAAAA=="; private static readonly int[] AdaptationTable = { 230, 230, 230, 230, 307, 409, 512, 614, 768, 614, 512, 409, 307, 230, 230, 230 }; private static readonly int[] AdaptCoeff1 = { 256, 512, 0, 192, 240, 460, 392 }; @@ -201,7 +257,9 @@ namespace BizHawk.Emulation.Common gz.CopyTo(ms); data = ms.ToArray(); for (int i = 0; i < 3800; i++) // compenstate for sample start point + { Next(); + } } private int blockpredictor; @@ -258,22 +316,27 @@ namespace BizHawk.Emulation.Common delta >>= 8; if (delta < 16) delta = 16; } + samplectr++; if (samplectr == sampleloop) { samplectr = 0; idx = 0; } + return (short)ret; } } - class Pleg + internal class Pleg { - const string data = "H4sICI/2sVICAG91dDMudHh0AOxazdLbIAy8d6bvgkFImFsvufb936Yt3YyKvjBY5UvS6XDSxOZndyULy9H3ylLD1y8/baxHs/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y7oo9qp2YCNe59xGwe0RmWco1CWaDAfeKUA95KfXmA6+qlWKOpwieUZlTW/0NNSqH9DoAcAfmosUuYx2d5wf+MpP4ZYYbqAdBpoP5x73ExrRFHXwuKpSa+Z0R0mo+aFqsygKRrj9SerYqrZu1V3CRuqRbougPdId0qxLlfR6Psgam9PBxhT+wd+71zcKmeg05bVBWQboBkIF7Zq8xWxdXJ2iuZfILTSuil/SxIqSxDu+bX+RHOYjIxwUZTQIgeKoOuQ2Ac993tbsTdjbi7EXc34u5G3N2IuxtxdyPubsTdjbi7EXc34u5G3N2IuxtxdyPubsTdjbi7EXc34o927dAGAACEgeB27D8SEoVBleRmqGg+ORqRRqQRaUQakUakEWlEGjG1rmlEGpFGpBFpRBqRRqQRaUQakUakEWlEGpFGpBFpRBqRRqQRaUQakUakEWlEGpFGpBFpRBqRRqQRaUQakUb86OhoRBqRRqQRk+qaRqQRaUQakUakEWlEGpFGpBFvGnFXiHMetSzUwqZz46p5AAA="; - List Lines = new List(); - int LineIDX = 0; - Bell bell = new Bell(); + private const string data = "H4sICI/2sVICAG91dDMudHh0AOxazdLbIAy8d6bvgkFImFsvufb936Yt3YyKvjBY5UvS6XDSxOZndyULy9H3ylLD1y8/baxHs/Lb5rNG2IT7zVKq9Msmrmf7Tb/st3qcP4ff7rdhb7itw04eXrVzsYWOTuXTt7yzl/OXvYHtDWwN+0cQi0IcqzJnxtchy9lDbo5rVODAAJvbdXWk1PiQooBiMBQPnxcOnYbhfkoCSgGUMmLxbgsoCSgdoCSgFEApwxZQArZ0uryWTp227DUBxVzDpbXLNUhlAVIGJELsZ6hb+kzACdePGqFqxPiE8QnjEualCcUZtb+mRKAUP0tlfyxHQAiIZUEsJ6gZYVXtTlVOiGWBmhk29qoS+zIQ6zQvJZ3rUHFtSwm9I++q5WJUS1At90mNAywhA/CqausZIPaPG/Jtgwhq6ug3qU5GdZMRMg+OmNR7IxfjjQwbDLXD5Q09Yta9QcfqKQfkz4Aw3fptrP0xNVfsCVu++j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EWlEGpFGpBFpRBqRRqQRaUQakUakEWlEGpFGpBFpRBqRRqQRaUQakUb86OhoRBqRRqQRk+qaRqQRaUQakUakEWlEGpFGpBFvGnFXiHMetSzUwqZz46p5AAA="; + private readonly List SinMen = new List(); + private readonly List Lines = new List(); + private readonly Bell Bell = new Bell(); + + private int LineIDX = 0; + private int deadtime = 0; public Pleg() { @@ -283,32 +346,36 @@ namespace BizHawk.Emulation.Common var tr = new StreamReader(gz); string line; while ((line = tr.ReadLine()) != null) + { Lines.Add(line); + } } - List SinMen = new List(); - - int deadtime = 0; - - void Off(int c, int n) + private void Off(int c, int n) { foreach (var s in SinMen) { if (s.c == c && s.n == n && !s.fading) + { s.fading = true; + } } } - void On(int c, int n) + + private void On(int c, int n) { if (c == 9) + { return; + } + var s = new SinMan(1500, n); s.c = c; s.n = n; SinMen.Add(s); } - short Next() + private short Next() { int ret = 0; for (int i = 0; i < SinMen.Count; i++) @@ -329,7 +396,7 @@ namespace BizHawk.Emulation.Common return (short)ret; } - string FetchNext() + private string FetchNext() { string ret = Lines[LineIDX]; LineIDX++; @@ -346,7 +413,7 @@ namespace BizHawk.Emulation.Common if (deadtime > 0) { short n = Next(); - n += bell.Next(); + n += Bell.Next(); dest[idx++] = n; dest[idx++] = n; deadtime--; @@ -367,7 +434,7 @@ namespace BizHawk.Emulation.Common } } - class SinMan + internal class SinMan { public int c; public int n; @@ -378,7 +445,10 @@ namespace BizHawk.Emulation.Common public bool fading = false; - public bool Done { get { return amp < 2.0; } } + public bool Done + { + get { return amp < 2.0; } + } static double GetFreq(int note) { @@ -401,7 +471,6 @@ namespace BizHawk.Emulation.Common this.amp = amp; this.freq = GetFreq(note); } - } #endregion diff --git a/BizHawk.Emulation.Cores/Calculator/TI83.cs b/BizHawk.Emulation.Cores/Calculator/TI83.cs index 2a496c9ca6..eb9f86b9a3 100644 --- a/BizHawk.Emulation.Cores/Calculator/TI83.cs +++ b/BizHawk.Emulation.Cores/Calculator/TI83.cs @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Calculators if (game["initPC"]) { - startPC = ushort.Parse(game.OptionValue("initPC"), NumberStyles.HexNumber); + _startPC = ushort.Parse(game.OptionValue("initPC"), NumberStyles.HexNumber); } HardReset(); @@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Calculators serviceProvider.Register(new Disassembler()); } - private ITraceable Tracer { get; set; } + private readonly ITraceable Tracer; // hardware private const ushort RamSizeMask = 0x7FFF; @@ -80,10 +80,10 @@ namespace BizHawk.Emulation.Cores.Calculators private int _frame; // configuration - private ushort startPC; + private ushort _startPC; // Link Cable - public TI83LinkPort LinkPort { get; set; } + public TI83LinkPort LinkPort { get; private set; } internal bool LinkActive; internal int LinkOutput, LinkInput; @@ -306,7 +306,6 @@ namespace BizHawk.Emulation.Cores.Calculators } return (byte)ret; - } private byte ReadDispData() @@ -384,9 +383,13 @@ namespace BizHawk.Emulation.Cores.Calculators private void WriteDispCtrl(byte value) { if (value <= 1) + { _displayMode = value; + } else if (value >= 4 && value <= 7) + { _displayMove = value - 4; + } else if ((value & 0xC0) == 0x40) { //hardware scroll @@ -434,7 +437,7 @@ namespace BizHawk.Emulation.Cores.Calculators _ram = new byte[0x8000]; for (int i = 0; i < 0x8000; i++) _ram[i] = 0xFF; - Cpu.RegisterPC = startPC; + Cpu.RegisterPC = _startPC; Cpu.IFF1 = false; Cpu.IFF2 = false;