From caf9802412ed98501209c1c97aac3155982d9398 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 13 May 2017 13:04:02 -0500 Subject: [PATCH] C64 - remove the SaveState.DoNotSave attribute --- .../Computers/Commodore64/C64.IDebuggable.cs | 4 +- .../Commodore64/C64.IDisassemblable.cs | 5 +- .../Computers/Commodore64/C64.IEmulator.cs | 5 -- .../Commodore64/C64.IInputPollable.cs | 1 - .../Computers/Commodore64/C64.Motherboard.cs | 4 +- .../Commodore64/C64.MotherboardInput.cs | 2 +- .../Computers/Commodore64/C64.cs | 6 --- .../Commodore64/Cartridge/CartridgeDevice.cs | 7 --- .../Commodore64/Cartridge/CartridgePort.cs | 1 - .../Commodore64/Cartridge/Mapper0000.cs | 4 -- .../Commodore64/Cartridge/Mapper0001.cs | 1 - .../Commodore64/Cartridge/Mapper0005.cs | 5 -- .../Commodore64/Cartridge/Mapper000A.cs | 2 - .../Commodore64/Cartridge/Mapper000B.cs | 1 - .../Commodore64/Cartridge/Mapper000F.cs | 2 - .../Commodore64/Cartridge/Mapper0012.cs | 2 - .../Commodore64/Cartridge/Mapper0013.cs | 3 -- .../Commodore64/Cartridge/Mapper0020.cs | 6 --- .../Commodore64/Cartridge/Mapper002B.cs | 2 - .../Commodore64/Cassette/CassettePort.cs | 2 - .../Cassette/CassettePortDevice.cs | 2 - .../Commodore64/MOS/Chip6510.IDebuggable.cs | 12 ++--- .../Computers/Commodore64/MOS/Chip6510.cs | 16 ------ .../Computers/Commodore64/MOS/Cia.Port.cs | 8 +-- .../Commodore64/MOS/Cia.Registers.cs | 6 --- .../Computers/Commodore64/MOS/Cia.cs | 12 ++--- .../Computers/Commodore64/MOS/Sid.Envelope.cs | 6 +-- .../Computers/Commodore64/MOS/Sid.Voice.cs | 4 +- .../Computers/Commodore64/MOS/Sid.cs | 24 ++++----- .../Commodore64/MOS/Via.Registers.cs | 15 +----- .../Computers/Commodore64/MOS/Via.cs | 49 +++++++++--------- .../Computers/Commodore64/MOS/Vic.Parse.cs | 18 +++---- .../Computers/Commodore64/MOS/Vic.Render.cs | 50 +++++++++---------- .../Computers/Commodore64/MOS/Vic.State.cs | 24 ++++----- .../Commodore64/MOS/Vic.TimingBuilder.cs | 26 ++++------ .../Commodore64/MOS/Vic.VideoProvider.cs | 24 ++++----- .../Computers/Commodore64/MOS/Vic.cs | 22 ++++---- .../Computers/Commodore64/Media/Disk.cs | 12 ++--- .../Computers/Commodore64/Media/Tape.cs | 8 +-- .../Computers/Commodore64/SaveState.cs | 4 -- .../Serial/Drive1541.FluxTransitions.cs | 8 +-- .../Serial/Drive1541.IDebuggable.cs | 15 ++---- .../Serial/Drive1541.IDisassemblable.cs | 8 +-- .../Commodore64/Serial/Drive1541.Motor.cs | 12 ++--- .../Computers/Commodore64/Serial/Drive1541.cs | 4 -- .../Commodore64/Serial/SerialPort.cs | 6 --- .../Commodore64/Serial/SerialPortDevice.cs | 5 -- 47 files changed, 157 insertions(+), 308 deletions(-) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IDebuggable.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IDebuggable.cs index 1daea67206..72f9311a73 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IDebuggable.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 { public partial class C64 : IDebuggable { - [SaveState.DoNotSave] private IDebuggable _selectedDebuggable; + private IDebuggable _selectedDebuggable; private IEnumerable GetAvailableDebuggables() { @@ -69,10 +69,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 get { return _selectedDebuggable.TotalExecutedCycles; } } - [SaveState.DoNotSave] private readonly IMemoryCallbackSystem _memoryCallbacks; - [SaveState.DoNotSave] IMemoryCallbackSystem IDebuggable.MemoryCallbacks => _memoryCallbacks; } } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IDisassemblable.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IDisassemblable.cs index 178002cac2..f8edc971d3 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IDisassemblable.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IDisassemblable.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 { public partial class C64 : IDisassemblable { - [SaveState.DoNotSave] private IDisassemblable _selectedDisassemblable; + private IDisassemblable _selectedDisassemblable; private IEnumerable GetAvailableDisassemblables() { @@ -23,7 +23,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 _selectedDisassemblable = GetAvailableDisassemblables().First(); } - [SaveState.DoNotSave] public string Cpu { get @@ -45,7 +44,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 } } - [SaveState.DoNotSave] public string PCRegisterName { get @@ -58,7 +56,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 } } - [SaveState.DoNotSave] public IEnumerable AvailableCpus { get { return GetAvailableDisassemblables().SelectMany(d => d.AvailableCpus); } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IEmulator.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IEmulator.cs index bab7f8e3f6..a1b395831a 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IEmulator.cs @@ -4,10 +4,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 { public sealed partial class C64 : IEmulator { - [SaveState.DoNotSave] public IEmulatorServiceProvider ServiceProvider { get; private set; } - [SaveState.DoNotSave] public ControllerDefinition ControllerDefinition => C64ControllerDefinition; public void FrameAdvance(IController controller, bool render, bool rendersound) @@ -20,10 +18,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 while (_frameCycles != 0); } - [SaveState.DoNotSave] public int Frame => _frame; - [SaveState.DoNotSave] public string SystemId { get { return "C64"; } } public bool DeterministicEmulation => true; @@ -36,7 +32,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 _frameCycles = 0; } - [SaveState.DoNotSave] public CoreComm CoreComm { get; private set; } public void Dispose() diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IInputPollable.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IInputPollable.cs index 43e00a2e38..7eff97d92d 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IInputPollable.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IInputPollable.cs @@ -16,7 +16,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 set { _lagCount = value; } } - [SaveState.DoNotSave] public IInputCallbackSystem InputCallbacks { get; private set; } private bool _isLagFrame; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs index 4120c9ef9e..ed8ea1b718 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs @@ -148,8 +148,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 KernalRom = new Chip23128(); } - [SaveState.DoNotSave] public int ClockNumerator { get; private set; } - [SaveState.DoNotSave] public int ClockDenominator { get; private set; } + public int ClockNumerator { get; private set; } + public int ClockDenominator { get; private set; } // ----------------------------------------- diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.MotherboardInput.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.MotherboardInput.cs index d5715e6cd9..64b63cb5bf 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.MotherboardInput.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.MotherboardInput.cs @@ -21,7 +21,7 @@ new[] { "Key 1", "Key Left Arrow", "Key Control", "Key 2", "Key Space", "Key Commodore", "Key Q", "Key Run/Stop" } }; - [SaveState.DoNotSave] int _pollIndex; + private int _pollIndex; private bool _restorePressed; public void PollInput() diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs index fb47fcfdc7..a06dbff2a1 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs @@ -55,7 +55,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 } // IBoardInfo - [SaveState.DoNotSave] public string BoardName { get @@ -80,16 +79,12 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 } // IRegionable - [SaveState.DoNotSave] public DisplayType Region { get; private set; } - [SaveState.DoNotSave] private readonly int _cyclesPerFrame; - [SaveState.DoNotSave] public IEnumerable Roms { get; private set; } - [SaveState.DoNotSave] private static readonly ControllerDefinition C64ControllerDefinition = new ControllerDefinition { Name = "Commodore 64 Controller", @@ -112,7 +107,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 private int _frame; - [SaveState.DoNotSave] private ISoundProvider _soundProvider; private void DoCycle() diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs index ab6db85f92..478e84ffa7 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs @@ -138,14 +138,12 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge protected bool pinReset; - [SaveState.DoNotSave] protected bool validCartridge; public virtual void ExecutePhase() { } - [SaveState.DoNotSave] public bool ExRom { get @@ -154,7 +152,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge } } - [SaveState.DoNotSave] public bool Game { get @@ -170,7 +167,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge pinReset = true; } - [SaveState.DoNotSave] public bool IRQ { get @@ -179,7 +175,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge } } - [SaveState.DoNotSave] public bool NMI { get @@ -244,7 +239,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge return ReadOpenBus(); } - [SaveState.DoNotSave] public bool Reset { get @@ -267,7 +261,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge ser.Sync("_driveLightOn", ref _driveLightOn); } - [SaveState.DoNotSave] public bool Valid { get diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgePort.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgePort.cs index 6bb41c28e1..89bad383d7 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgePort.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgePort.cs @@ -17,7 +17,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge Disconnect(); } - [SaveState.DoNotSave] internal string CartridgeType => _cartridgeDevice.GetType().Name; // ------------------------------------------ diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0000.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0000.cs index 4d7705ea34..7bcffb4ff6 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0000.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0000.cs @@ -6,14 +6,10 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { internal sealed class Mapper0000 : CartridgeDevice { - [SaveState.DoNotSave] private readonly int[] _romA; - private int _romAMask; - [SaveState.DoNotSave] private readonly int[] _romB; - private int _romBMask; // standard cartridge mapper (Commodore) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0001.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0001.cs index 6f95be2d3c..7ffc3fc6bd 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0001.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0001.cs @@ -10,7 +10,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge private int[] _ram = new int[0x2000]; private bool _ramEnabled; - [SaveState.DoNotSave] private readonly int[] _rom = new int[0x8000]; private int _romOffset; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0005.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0005.cs index 8d8a14da53..baf482bc60 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0005.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0005.cs @@ -7,23 +7,18 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { internal sealed class Mapper0005 : CartridgeDevice { - [SaveState.DoNotSave] private readonly int[][] _banksA; // 8000 - [SaveState.DoNotSave] private readonly int[][] _banksB = new int[0][]; // A000 private int _bankMask; private int _bankNumber; - [SaveState.DoNotSave] private int[] _currentBankA; - [SaveState.DoNotSave] private int[] _currentBankB; - [SaveState.DoNotSave] private readonly int[] _dummyBank; public Mapper0005(IList newAddresses, IList newBanks, IList newData) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000A.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000A.cs index 42c0f5e47c..f400330a5e 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000A.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000A.cs @@ -14,12 +14,10 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge internal class Mapper000A : CartridgeDevice { // This constant differs depending on whose research you reference. TODO: Verify. - [SaveState.DoNotSave] private const int RESET_CAPACITOR_CYCLES = 512; private int _capacitorCycles; - [SaveState.DoNotSave] private readonly int[] _rom; public Mapper000A(IList newData) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000B.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000B.cs index 969a37223c..3c863cfb28 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000B.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000B.cs @@ -13,7 +13,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge // and then disables once loaded. internal sealed class Mapper000B : CartridgeDevice { - [SaveState.DoNotSave] private readonly int[] _rom = new int[0x4000]; public Mapper000B(IList newAddresses, IList newData) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000F.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000F.cs index d70e93d901..238f9bbcc2 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000F.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper000F.cs @@ -13,11 +13,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge // to DE01. internal class Mapper000F : CartridgeDevice { - [SaveState.DoNotSave] private readonly int[][] _banks; // 8000 private int _bankMask; - private int _bankNumber; private int[] _currentBank; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0012.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0012.cs index 67aea2a31b..c8ad5f3996 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0012.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0012.cs @@ -7,10 +7,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { internal sealed class Mapper0012 : CartridgeDevice { - [SaveState.DoNotSave] private readonly int[] _bankMain; - [SaveState.DoNotSave] private readonly int[][] _bankHigh; private int[] _bankHighSelected; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0013.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0013.cs index 5381c66fb4..df994ca078 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0013.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0013.cs @@ -14,14 +14,11 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge // ROM in 8000-9FFF. internal sealed class Mapper0013 : CartridgeDevice { - [SaveState.DoNotSave] private readonly int[][] _banks; // 8000 private int _bankMask; - private int _bankNumber; - [SaveState.DoNotSave] private int[] _currentBank; private bool _romEnable; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0020.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0020.cs index a4dbf69c13..0de5096620 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0020.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0020.cs @@ -26,16 +26,10 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { private int _bankOffset = 63 << 13; - [SaveState.DoNotSave] private int[] _banksA = new int[64 << 13]; // 8000 - - [SaveState.DoNotSave] private int[] _banksB = new int[64 << 13]; // A000 - [SaveState.DoNotSave] private readonly int[] _originalMediaA; // 8000 - - [SaveState.DoNotSave] private readonly int[] _originalMediaB; // A000 private bool _boardLed; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper002B.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper002B.cs index 299c4fa770..8d733d9fcc 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper002B.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper002B.cs @@ -12,11 +12,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge // Thanks to VICE team for the info: http://vice-emu.sourceforge.net/vice_15.html internal class Mapper002B : CartridgeDevice { - [SaveState.DoNotSave] private readonly int[] _rom; private int _romOffset; - private bool _romEnabled; public Mapper002B(IList newAddresses, IList newBanks, IList newData) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cassette/CassettePort.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cassette/CassettePort.cs index c05506fc7e..32e873f7d6 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cassette/CassettePort.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cassette/CassettePort.cs @@ -5,9 +5,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cassette { public sealed class CassettePort { - [SaveState.DoNotSave] public Func ReadDataOutput = () => true; - [SaveState.DoNotSave] public Func ReadMotor = () => true; private CassettePortDevice _device; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Cassette/CassettePortDevice.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Cassette/CassettePortDevice.cs index a2d64f8d7e..e05825db1e 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Cassette/CassettePortDevice.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Cassette/CassettePortDevice.cs @@ -5,9 +5,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cassette { public abstract class CassettePortDevice { - [SaveState.DoNotSave] public Func ReadDataOutput; - [SaveState.DoNotSave] public Func ReadMotor; public virtual void ExecutePhase2() diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.IDebuggable.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.IDebuggable.cs index 7b4d8e24f9..7426fc0683 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.IDebuggable.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; + using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS @@ -144,21 +143,16 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS } } - [SaveState.DoNotSave] private int _jsrCount; - [SaveState.DoNotSave] + private const byte Jsr = 0x20; - [SaveState.DoNotSave] private const byte Rti = 0x40; - [SaveState.DoNotSave] private const byte Rts = 0x60; - [SaveState.DoNotSave] private const byte JsrSize = 3; - [SaveState.DoNotSave] private IMemoryCallbackSystem _memoryCallbacks = new MemoryCallbackSystem(); + private IMemoryCallbackSystem _memoryCallbacks = new MemoryCallbackSystem(); - [SaveState.DoNotSave] IMemoryCallbackSystem IDebuggable.MemoryCallbacks { get { return _memoryCallbacks; } } } } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs index 7528ab22df..3228d27c13 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; using BizHawk.Common; using BizHawk.Emulation.Cores.Components.M6502; @@ -107,7 +105,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS // ------------------------------------ - [SaveState.DoNotSave] public ushort Pc { get @@ -120,49 +117,37 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS } } - [SaveState.DoNotSave] public int A { get { return _cpu.A; } set { _cpu.A = unchecked((byte)value); } } - [SaveState.DoNotSave] public int X { get { return _cpu.X; } set { _cpu.X = unchecked((byte)value); } } - [SaveState.DoNotSave] public int Y { get { return _cpu.Y; } set { _cpu.Y = unchecked((byte)value); } } - [SaveState.DoNotSave] public int S { get { return _cpu.S; } set { _cpu.S = unchecked((byte)value); } } - [SaveState.DoNotSave] public bool FlagC { get { return _cpu.FlagC; } } - [SaveState.DoNotSave] public bool FlagZ { get { return _cpu.FlagZ; } } - [SaveState.DoNotSave] public bool FlagI { get { return _cpu.FlagI; } } - [SaveState.DoNotSave] public bool FlagD { get { return _cpu.FlagD; } } - [SaveState.DoNotSave] public bool FlagB { get { return _cpu.FlagB; } } - [SaveState.DoNotSave] public bool FlagV { get { return _cpu.FlagV; } } - [SaveState.DoNotSave] public bool FlagN { get { return _cpu.FlagN; } } - [SaveState.DoNotSave] public bool FlagT { get { return _cpu.FlagT; } } public int Peek(int addr) @@ -194,7 +179,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS } } - [SaveState.DoNotSave] public int PortData { get diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Port.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Port.cs index 5d511d732a..0128e5b510 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Port.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Port.cs @@ -28,10 +28,10 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS private sealed class JoystickKeyboardPort : IPort { - [SaveState.DoNotSave] private int _ret; - [SaveState.DoNotSave] private int _tst; - [SaveState.DoNotSave] private readonly Func _readJoyData; - [SaveState.DoNotSave] private readonly Func _readKeyData; + private int _ret; + private int _tst; + private readonly Func _readJoyData; + private readonly Func _readKeyData; public JoystickKeyboardPort(Func readJoyData, Func readKeyData) { diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Registers.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Registers.cs index a96d13d800..b0b46c7b85 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Registers.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Registers.cs @@ -261,37 +261,31 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS } } - [SaveState.DoNotSave] public int DdrA { get { return _ddra; } } - [SaveState.DoNotSave] public int DdrB { get { return _ddrb; } } - [SaveState.DoNotSave] public int PrA { get { return _pra; } } - [SaveState.DoNotSave] public int PrB { get { return _prb; } } - [SaveState.DoNotSave] public int EffectivePrA { get { return _pra | ~_ddra; } } - [SaveState.DoNotSave] public int EffectivePrB { get { return _prb | ~_ddrb; } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.cs index dfdce572af..3dc65ad1f8 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.cs @@ -71,14 +71,14 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS private int _newCra; private int _newCrb; private bool _flagLatch; - [SaveState.DoNotSave] private bool _flagInput; - [SaveState.DoNotSave] private bool _taUnderflow; + private bool _flagInput; + private bool _taUnderflow; private readonly IPort _port; - [SaveState.DoNotSave] private int _todlo; - [SaveState.DoNotSave] private int _todhi; - [SaveState.DoNotSave] private readonly int _todNum; - [SaveState.DoNotSave] private readonly int _todDen; + private int _todlo; + private int _todhi; + private readonly int _todNum; + private readonly int _todDen; private int _todCounter; private Cia(int todNum, int todDen) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Envelope.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Envelope.cs index bbf3bce84e..ac3c737cf1 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Envelope.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Envelope.cs @@ -6,9 +6,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { private sealed class Envelope { - [SaveState.DoNotSave] private const int StateAttack = 0; - [SaveState.DoNotSave] private const int StateDecay = 1; - [SaveState.DoNotSave] private const int StateRelease = 2; + private const int StateAttack = 0; + private const int StateDecay = 1; + private const int StateRelease = 2; private int _attack; private int _decay; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Voice.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Voice.cs index 392245d26f..f6e05770e2 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Voice.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Voice.cs @@ -28,10 +28,10 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS private int _shiftRegisterReset; private bool _sync; private bool _test; - [SaveState.DoNotSave] private int[] _wave; + private int[] _wave; private int _waveform; private int _waveformIndex; - [SaveState.DoNotSave] private readonly int[][] _waveTable; + private readonly int[][] _waveTable; public Voice(int[][] newWaveTable) { diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.cs index b83bccdac8..fc5726f6e7 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.cs @@ -29,9 +29,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS private int _envelopeOutput1; private int _envelopeOutput2; private readonly Envelope[] _envelopes; - [SaveState.DoNotSave] private readonly Envelope _envelope0; - [SaveState.DoNotSave] private readonly Envelope _envelope1; - [SaveState.DoNotSave] private readonly Envelope _envelope2; + private readonly Envelope _envelope0; + private readonly Envelope _envelope1; + private readonly Envelope _envelope2; private bool[] _filterEnable; private int _filterFrequency; private int _filterResonance; @@ -39,8 +39,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS private bool _filterSelectLoPass; private bool _filterSelectHiPass; private int _mixer; - [SaveState.DoNotSave] private readonly short[] _outputBuffer; - [SaveState.DoNotSave] private int _outputBufferIndex; + private readonly short[] _outputBuffer; + private int _outputBufferIndex; private int _potCounter; private int _potX; private int _potY; @@ -49,18 +49,18 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS private int _voiceOutput1; private int _voiceOutput2; private readonly Voice[] _voices; - [SaveState.DoNotSave] private readonly Voice _voice0; - [SaveState.DoNotSave] private readonly Voice _voice1; - [SaveState.DoNotSave] private readonly Voice _voice2; + private readonly Voice _voice0; + private readonly Voice _voice1; + private readonly Voice _voice2; private int _volume; public Func ReadPotX; public Func ReadPotY; - [SaveState.DoNotSave] private readonly int _cpuCyclesNum; - [SaveState.DoNotSave] private int _sampleCyclesNum; - [SaveState.DoNotSave] private readonly int _sampleCyclesDen; - [SaveState.DoNotSave] private readonly int _sampleRate; + private readonly int _cpuCyclesNum; + private int _sampleCyclesNum; + private readonly int _sampleCyclesDen; + private readonly int _sampleRate; public Sid(int[][] newWaveformTable, int sampleRate, int cyclesNum, int cyclesDen) { diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.Registers.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.Registers.cs index d6a3b0426a..5f0bdb0368 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.Registers.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.Registers.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS +namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { public sealed partial class Via { @@ -226,49 +221,41 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS } } - [SaveState.DoNotSave] public int DdrA { get { return _ddra; } } - [SaveState.DoNotSave] public int DdrB { get { return _ddrb; } } - [SaveState.DoNotSave] public int PrA { get { return _pra; } } - [SaveState.DoNotSave] public int PrB { get { return _prb; } } - [SaveState.DoNotSave] public int EffectivePrA { get { return _pra | ~_ddra; } } - [SaveState.DoNotSave] public int EffectivePrB { get { return _prb | ~_ddrb; } } - [SaveState.DoNotSave] public int ActualPrA { get { return _acrPaLatchEnable ? _paLatch : _port.ReadPra(_pra, _ddra); } } - [SaveState.DoNotSave] public int ActualPrB { get { return _acrPbLatchEnable ? _pbLatch : _port.ReadPrb(_prb, _ddrb); } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs index 6eb175f34d..f4d7737fba 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs @@ -9,30 +9,30 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { public sealed partial class Via { - [SaveState.DoNotSave] private const int PCR_INT_CONTROL_NEGATIVE_EDGE = 0x00; - [SaveState.DoNotSave] private const int PCR_INT_CONTROL_POSITIVE_EDGE = 0x01; - [SaveState.DoNotSave] private const int PCR_CONTROL_INPUT_NEGATIVE_ACTIVE_EDGE = 0x00; - [SaveState.DoNotSave] private const int PCR_CONTROL_INDEPENDENT_INTERRUPT_INPUT_NEGATIVE_EDGE = 0x02; - [SaveState.DoNotSave] private const int PCR_CONTROL_INPUT_POSITIVE_ACTIVE_EDGE = 0x04; - [SaveState.DoNotSave] private const int PCR_CONTROL_INDEPENDENT_INTERRUPT_INPUT_POSITIVE_EDGE = 0x06; - [SaveState.DoNotSave] private const int PCR_CONTROL_HANDSHAKE_OUTPUT = 0x08; - [SaveState.DoNotSave] private const int PCR_CONTROL_PULSE_OUTPUT = 0x0A; - [SaveState.DoNotSave] private const int PCR_CONTROL_LOW_OUTPUT = 0x0C; - [SaveState.DoNotSave] private const int PCR_CONTROL_HIGH_OUTPUT = 0x0E; - [SaveState.DoNotSave] private const int ACR_SR_CONTROL_DISABLED = 0x00; - [SaveState.DoNotSave] private const int ACR_SR_CONTROL_SHIFT_IN_T2_ONCE = 0x04; - [SaveState.DoNotSave] private const int ACR_SR_CONTROL_SHIFT_IN_PHI2 = 0x08; - [SaveState.DoNotSave] private const int ACR_SR_CONTROL_SHIFT_IN_CLOCK = 0x0C; - [SaveState.DoNotSave] private const int ACR_SR_CONTROL_SHIFT_OUT_T2 = 0x10; - [SaveState.DoNotSave] private const int ACR_SR_CONTROL_SHIFT_OUT_T2_ONCE = 0x14; - [SaveState.DoNotSave] private const int ACR_SR_CONTROL_SHIFT_OUT_PHI2 = 0x18; - [SaveState.DoNotSave] private const int ACR_SR_CONTROL_SHIFT_OUT_CLOCK = 0x1C; - [SaveState.DoNotSave] private const int ACR_T2_CONTROL_TIMED = 0x00; - [SaveState.DoNotSave] private const int ACR_T2_CONTROL_COUNT_ON_PB6 = 0x20; - [SaveState.DoNotSave] private const int ACR_T1_CONTROL_INTERRUPT_ON_LOAD = 0x00; - [SaveState.DoNotSave] private const int ACR_T1_CONTROL_CONTINUOUS_INTERRUPTS = 0x40; - [SaveState.DoNotSave] private const int ACR_T1_CONTROL_INTERRUPT_ON_LOAD_AND_ONESHOT_PB7 = 0x80; - [SaveState.DoNotSave] private const int ACR_T1_CONTROL_CONTINUOUS_INTERRUPTS_AND_OUTPUT_ON_PB7 = 0xC0; + private const int PCR_INT_CONTROL_NEGATIVE_EDGE = 0x00; + private const int PCR_INT_CONTROL_POSITIVE_EDGE = 0x01; + private const int PCR_CONTROL_INPUT_NEGATIVE_ACTIVE_EDGE = 0x00; + private const int PCR_CONTROL_INDEPENDENT_INTERRUPT_INPUT_NEGATIVE_EDGE = 0x02; + private const int PCR_CONTROL_INPUT_POSITIVE_ACTIVE_EDGE = 0x04; + private const int PCR_CONTROL_INDEPENDENT_INTERRUPT_INPUT_POSITIVE_EDGE = 0x06; + private const int PCR_CONTROL_HANDSHAKE_OUTPUT = 0x08; + private const int PCR_CONTROL_PULSE_OUTPUT = 0x0A; + private const int PCR_CONTROL_LOW_OUTPUT = 0x0C; + private const int PCR_CONTROL_HIGH_OUTPUT = 0x0E; + private const int ACR_SR_CONTROL_DISABLED = 0x00; + private const int ACR_SR_CONTROL_SHIFT_IN_T2_ONCE = 0x04; + private const int ACR_SR_CONTROL_SHIFT_IN_PHI2 = 0x08; + private const int ACR_SR_CONTROL_SHIFT_IN_CLOCK = 0x0C; + private const int ACR_SR_CONTROL_SHIFT_OUT_T2 = 0x10; + private const int ACR_SR_CONTROL_SHIFT_OUT_T2_ONCE = 0x14; + private const int ACR_SR_CONTROL_SHIFT_OUT_PHI2 = 0x18; + private const int ACR_SR_CONTROL_SHIFT_OUT_CLOCK = 0x1C; + private const int ACR_T2_CONTROL_TIMED = 0x00; + private const int ACR_T2_CONTROL_COUNT_ON_PB6 = 0x20; + private const int ACR_T1_CONTROL_INTERRUPT_ON_LOAD = 0x00; + private const int ACR_T1_CONTROL_CONTINUOUS_INTERRUPTS = 0x40; + private const int ACR_T1_CONTROL_INTERRUPT_ON_LOAD_AND_ONESHOT_PB7 = 0x80; + private const int ACR_T1_CONTROL_CONTINUOUS_INTERRUPTS_AND_OUTPUT_ON_PB7 = 0xC0; private int _pra; private int _ddra; @@ -102,7 +102,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS _ca1L = true; } - [SaveState.DoNotSave] public bool Irq { get { return (_ifr & 0x80) == 0; } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Parse.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Parse.cs index 75e5b75e62..217ff496fa 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Parse.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Parse.cs @@ -32,15 +32,15 @@ private const int AddressMaskEc = 0x39FF; private const int AddressMaskRefresh = 0x3F00; - [SaveState.DoNotSave] private int _parseAddr; - [SaveState.DoNotSave] private int _parseCycleBaSprite0; - [SaveState.DoNotSave] private int _parseCycleBaSprite1; - [SaveState.DoNotSave] private int _parseCycleBaSprite2; - [SaveState.DoNotSave] private int _parseCycleFetchSpriteIndex; - [SaveState.DoNotSave] private int _parseFetch; - [SaveState.DoNotSave] private int _parseFetchType; - [SaveState.DoNotSave] private int _parseBa; - [SaveState.DoNotSave] private int _parseAct; + private int _parseAddr; + private int _parseCycleBaSprite0; + private int _parseCycleBaSprite1; + private int _parseCycleBaSprite2; + private int _parseCycleFetchSpriteIndex; + private int _parseFetch; + private int _parseFetchType; + private int _parseBa; + private int _parseAct; private bool _parseIsSprCrunch; private void ParseCycle() diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Render.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Render.cs index c1f7f9ab9a..d90512cfec 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Render.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Render.cs @@ -2,38 +2,38 @@ { public sealed partial class Vic { - [SaveState.DoNotSave] private int _borderPixel; - [SaveState.DoNotSave] private int _bufferPixel; - [SaveState.DoNotSave] private int _ecmPixel; - [SaveState.DoNotSave] private int _pixel; - [SaveState.DoNotSave] private int _pixelCounter; - [SaveState.DoNotSave] private int _pixelData; - [SaveState.DoNotSave] private int _pixelOwner; - [SaveState.DoNotSave] private int _sprData; - [SaveState.DoNotSave] private int _sprIndex; - [SaveState.DoNotSave] private int _sprPixel; + private int _borderPixel; + private int _bufferPixel; + private int _ecmPixel; + private int _pixel; + private int _pixelCounter; + private int _pixelData; + private int _pixelOwner; + private int _sprData; + private int _sprIndex; + private int _sprPixel; private int _srSync; private int _srColorSync; private int _srColorIndexLatch; private int _videoMode; private int _borderOnShiftReg; - [SaveState.DoNotSave] private const int VideoMode000 = 0; - [SaveState.DoNotSave] private const int VideoMode001 = 1; - [SaveState.DoNotSave] private const int VideoMode010 = 2; - [SaveState.DoNotSave] private const int VideoMode011 = 3; - [SaveState.DoNotSave] private const int VideoMode100 = 4; - [SaveState.DoNotSave] private const int VideoModeInvalid = -1; + private const int VideoMode000 = 0; + private const int VideoMode001 = 1; + private const int VideoMode010 = 2; + private const int VideoMode011 = 3; + private const int VideoMode100 = 4; + private const int VideoModeInvalid = -1; - [SaveState.DoNotSave] private const int SrMask1 = 0x20000; - [SaveState.DoNotSave] private const int SrMask2 = SrMask1 << 1; - [SaveState.DoNotSave] private const int SrMask3 = SrMask1 | SrMask2; - [SaveState.DoNotSave] private const int SrColorMask = 0x8000; - [SaveState.DoNotSave] private const int SrSpriteMask = SrSpriteMask2; - [SaveState.DoNotSave] private const int SrSpriteMask1 = 0x400000; - [SaveState.DoNotSave] private const int SrSpriteMask2 = SrSpriteMask1 << 1; - [SaveState.DoNotSave] private const int SrSpriteMask3 = SrSpriteMask1 | SrSpriteMask2; - [SaveState.DoNotSave] private const int SrSpriteMaskMc = SrSpriteMask3; + private const int SrMask1 = 0x20000; + private const int SrMask2 = SrMask1 << 1; + private const int SrMask3 = SrMask1 | SrMask2; + private const int SrColorMask = 0x8000; + private const int SrSpriteMask = SrSpriteMask2; + private const int SrSpriteMask1 = 0x400000; + private const int SrSpriteMask2 = SrSpriteMask1 << 1; + private const int SrSpriteMask3 = SrSpriteMask1 | SrSpriteMask2; + private const int SrSpriteMaskMc = SrSpriteMask3; private void Render() { diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.State.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.State.cs index 9a72ed6c8e..85e1579112 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.State.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.State.cs @@ -36,7 +36,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS private bool _enableIntSpriteDataCollision; private bool _extraColorMode; private bool _extraColorModeBuffer; - [SaveState.DoNotSave] private bool _hblank; + private bool _hblank; private bool _idle; private bool _intLightPen; private bool _intRaster; @@ -63,19 +63,19 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS private bool _spriteSpriteCollisionClearPending; private int _spriteMulticolor0; private int _spriteMulticolor1; - [SaveState.DoNotSave] private readonly Sprite _sprite0; - [SaveState.DoNotSave] private readonly Sprite _sprite1; - [SaveState.DoNotSave] private readonly Sprite _sprite2; - [SaveState.DoNotSave] private readonly Sprite _sprite3; - [SaveState.DoNotSave] private readonly Sprite _sprite4; - [SaveState.DoNotSave] private readonly Sprite _sprite5; - [SaveState.DoNotSave] private readonly Sprite _sprite6; - [SaveState.DoNotSave] private readonly Sprite _sprite7; + private readonly Sprite _sprite0; + private readonly Sprite _sprite1; + private readonly Sprite _sprite2; + private readonly Sprite _sprite3; + private readonly Sprite _sprite4; + private readonly Sprite _sprite5; + private readonly Sprite _sprite6; + private readonly Sprite _sprite7; private readonly Sprite[] _sprites; private int _sr; - [SaveState.DoNotSave] private bool _vblank; - [SaveState.DoNotSave] private int _vblankEnd; - [SaveState.DoNotSave] private int _vblankStart; + private bool _vblank; + private int _vblankEnd; + private int _vblankStart; private int _vc; private int _vcbase; private int _vmli; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.TimingBuilder.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.TimingBuilder.cs index aeec0106d8..8db0ac30cd 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.TimingBuilder.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.TimingBuilder.cs @@ -1,26 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Collections.Generic; using System.Linq; -using System.Text; namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { public sealed partial class Vic { - [SaveState.DoNotSave] private const int BorderLeft38 = 0x023; - [SaveState.DoNotSave] private const int BorderLeft40 = 0x01C; - [SaveState.DoNotSave] private const int BorderRight38 = 0x153; - [SaveState.DoNotSave] private const int BorderRight40 = 0x15C; - [SaveState.DoNotSave] private const int BorderTop25 = 0x033; - [SaveState.DoNotSave] private const int BorderTop24 = 0x037; - [SaveState.DoNotSave] private const int BorderBottom25 = 0x0FB; - [SaveState.DoNotSave] private const int BorderBottom24 = 0x0F7; - [SaveState.DoNotSave] private const int FirstDmaLine = 0x030; - [SaveState.DoNotSave] private const int LastDmaLine = 0x0F7; + private const int BorderLeft38 = 0x023; + private const int BorderLeft40 = 0x01C; + private const int BorderRight38 = 0x153; + private const int BorderRight40 = 0x15C; + private const int BorderTop25 = 0x033; + private const int BorderTop24 = 0x037; + private const int BorderBottom25 = 0x0FB; + private const int BorderBottom24 = 0x0F7; + private const int FirstDmaLine = 0x030; + private const int LastDmaLine = 0x0F7; // The special actions taken by the Vic are in the same order and interval on all chips, just different offsets. - [SaveState.DoNotSave] private static readonly int[] TimingBuilderCycle14Act = { PipelineUpdateVc, 0, PipelineSpriteCrunch, 0, diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.VideoProvider.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.VideoProvider.cs index ea24e8bf69..5bd974e36e 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.VideoProvider.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.VideoProvider.cs @@ -7,21 +7,22 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { public sealed partial class Vic : IVideoProvider { - [SaveState.DoNotSave] private static readonly int BgColor = Colors.ARGB(0, 0, 0); - [SaveState.DoNotSave] private int[] _buf; - [SaveState.DoNotSave] private int _bufHeight; - [SaveState.DoNotSave] private int _bufLength; + private static readonly int BgColor = Colors.ARGB(0, 0, 0); + private int[] _buf; + private int _bufHeight; + private int _bufLength; private int _bufOffset; - [SaveState.DoNotSave] private int _bufWidth; - [SaveState.DoNotSave] private const int PixBufferSize = 24; - [SaveState.DoNotSave] private const int PixBorderBufferSize = 12; + private int _bufWidth; + + private const int PixBufferSize = 24; + private const int PixBorderBufferSize = 12; + private int[] _pixBuffer; private int _pixBufferIndex; private int[] _pixBorderBuffer; private int _pixBufferBorderIndex; // palette - [SaveState.DoNotSave] private static readonly int[] Palette = { Colors.ARGB(0x00, 0x00, 0x00), @@ -42,19 +43,16 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS Colors.ARGB(0x95, 0x95, 0x95) }; - [SaveState.DoNotSave] public int BackgroundColor { get { return BgColor; } } - [SaveState.DoNotSave] public int BufferHeight { get { return _bufHeight; } } - [SaveState.DoNotSave] public int BufferWidth { get { return _bufWidth; } @@ -65,16 +63,12 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS return _buf; } - [SaveState.DoNotSave] public int VirtualWidth { get; private set; } - [SaveState.DoNotSave] public int VirtualHeight { get; private set; } - [SaveState.DoNotSave] public int VsyncNumerator => CyclesPerSecond; - [SaveState.DoNotSave] public int VsyncDenominator => CyclesPerFrame; } } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs index 3a73a3d73a..12e42a64e2 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs @@ -30,20 +30,20 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS public bool ReadBa() { return _pinBa; } public bool ReadIrq() { return _pinIrq; } - [SaveState.DoNotSave] private readonly int _cyclesPerSec; - [SaveState.DoNotSave] private readonly int[] _rasterXPipeline; - [SaveState.DoNotSave] private readonly int[] _fetchPipeline; - [SaveState.DoNotSave] private readonly int[] _baPipeline; - [SaveState.DoNotSave] private readonly int[] _actPipeline; - [SaveState.DoNotSave] private readonly int _totalCycles; - [SaveState.DoNotSave] private readonly int _totalLines; + private readonly int _cyclesPerSec; + private readonly int[] _rasterXPipeline; + private readonly int[] _fetchPipeline; + private readonly int[] _baPipeline; + private readonly int[] _actPipeline; + private readonly int _totalCycles; + private readonly int _totalLines; private int _cyclesExecuted; - [SaveState.DoNotSave] private int _hblankStartCheckXRaster; - [SaveState.DoNotSave] private int _hblankEndCheckXRaster; + private int _hblankStartCheckXRaster; + private int _hblankEndCheckXRaster; - [SaveState.DoNotSave] private int _pixelRatioNum; - [SaveState.DoNotSave] private int _pixelRatioDen; + private int _pixelRatioNum; + private int _pixelRatioDen; public Vic(int newCycles, int newLines, IList newPipeline, int newCyclesPerSec, int hblankStart, int hblankEnd, int vblankStart, int vblankEnd, C64.BorderType borderType, int pixelRatioNum, int pixelRatioDen) { diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Disk.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Disk.cs index 31767e7616..28e85ef0ad 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Disk.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Disk.cs @@ -7,12 +7,12 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media { public sealed class Disk { - [SaveState.DoNotSave] public const int FluxBitsPerEntry = 32; - [SaveState.DoNotSave] public const int FluxBitsPerTrack = 16000000 / 5; - [SaveState.DoNotSave] public const int FluxEntriesPerTrack = FluxBitsPerTrack / FluxBitsPerEntry; - [SaveState.DoNotSave] private int[][] _tracks; - [SaveState.DoNotSave] private readonly int[] _originalMedia; - [SaveState.DoNotSave] public bool Valid; + public const int FluxBitsPerEntry = 32; + public const int FluxBitsPerTrack = 16000000 / 5; + public const int FluxEntriesPerTrack = FluxBitsPerTrack / FluxBitsPerEntry; + private int[][] _tracks; + private readonly int[] _originalMedia; + public bool Valid; public bool WriteProtected; /// diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Tape.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Tape.cs index 7c0c60c5ab..7a05f7f67d 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Tape.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Media/Tape.cs @@ -6,10 +6,10 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media { public class Tape { - [SaveState.DoNotSave] private readonly byte[] _tapeData; - [SaveState.DoNotSave] private readonly byte _version; - [SaveState.DoNotSave] private readonly int _start; - [SaveState.DoNotSave] private readonly int _end; + private readonly byte[] _tapeData; + private readonly byte _version; + private readonly int _start; + private readonly int _end; private int _pos; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/SaveState.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/SaveState.cs index 8a85b0a416..0e59066461 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/SaveState.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/SaveState.cs @@ -7,10 +7,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 { internal static class SaveState { - public class DoNotSave : Attribute - { - } - private static int[] GetDelta(IList source, IList data) { var length = Math.Min(source.Count, data.Count); diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.FluxTransitions.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.FluxTransitions.cs index 3756c15b31..7611149426 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.FluxTransitions.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.FluxTransitions.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using BizHawk.Emulation.Cores.Computers.Commodore64.Media; +using BizHawk.Emulation.Cores.Computers.Commodore64.Media; namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial { public sealed partial class Drive1541 { - [SaveState.DoNotSave] private const long LEHMER_RNG_PRIME = 48271; + private int _diskDensityCounter; // density .. 16 private int _diskSupplementaryCounter; // 0 .. 16 private bool _diskFluxReversalDetected; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.IDebuggable.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.IDebuggable.cs index 7d3de0bb17..0753c2c81b 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.IDebuggable.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; + using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial @@ -144,19 +143,13 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial } } - [SaveState.DoNotSave] private int _jsrCount; - [SaveState.DoNotSave] - private const byte Jsr = 0x20; - [SaveState.DoNotSave] - private const byte Rti = 0x40; - [SaveState.DoNotSave] - private const byte Rts = 0x60; - [SaveState.DoNotSave] + private const byte Jsr = 0x20; + private const byte Rti = 0x40; + private const byte Rts = 0x60; private const byte JsrSize = 3; - [SaveState.DoNotSave] public IMemoryCallbackSystem MemoryCallbacks { get; private set; } } } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.IDisassemblable.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.IDisassemblable.cs index 978177cdd0..fe6829b7d2 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.IDisassemblable.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.IDisassemblable.cs @@ -1,20 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial { public sealed partial class Drive1541 : IDisassemblable { - [SaveState.DoNotSave] IEnumerable IDisassemblable.AvailableCpus { get { yield return "Disk Drive 6502"; } } - [SaveState.DoNotSave] string IDisassemblable.Cpu { get { return "Disk Drive 6502"; } @@ -23,7 +18,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial } } - [SaveState.DoNotSave] string IDisassemblable.PCRegisterName { get { return "PC"; } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.Motor.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.Motor.cs index adc5663551..9a29872d91 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.Motor.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.Motor.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; - -namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial +namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial { public sealed partial class Drive1541 { - [SaveState.DoNotSave] private int _tempStep; - [SaveState.DoNotSave] private int _tempPrB1; + private int _tempStep; + private int _tempPrB1; private void ExecuteMotor() { diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs index f28fe1ee45..5cffe9c019 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs @@ -31,13 +31,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial private int _cpuClockNum; private int _ratioDifference; private int _driveLightOffTime; - [SaveState.DoNotSave] private int[] _trackImageData = new int[1]; - [SaveState.DoNotSave] public Func ReadIec = () => 0xFF; - [SaveState.DoNotSave] public Action DebuggerStep; - [SaveState.DoNotSave] public readonly Chip23128 DriveRom; public Drive1541(int clockNum, int clockDen) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/SerialPort.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/SerialPort.cs index 5dda8bf298..5c309e1aa6 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/SerialPort.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/SerialPort.cs @@ -7,11 +7,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial { public sealed class SerialPort : IDriveLight { - [SaveState.DoNotSave] public Func ReadMasterAtn = () => true; - [SaveState.DoNotSave] public Func ReadMasterClk = () => true; - [SaveState.DoNotSave] public Func ReadMasterData = () => true; private SerialPortDevice _device; @@ -77,11 +74,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial _device.ReadMasterData = () => ReadMasterData(); } - [SaveState.DoNotSave] public bool DriveLightEnabled { get { return true; } } - [SaveState.DoNotSave] public bool DriveLightOn { get { return ReadDeviceLight(); } } - [SaveState.DoNotSave] public bool IsConnected { get { return _connected; } } } } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/SerialPortDevice.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/SerialPortDevice.cs index b164ef47f4..657519f580 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/SerialPortDevice.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/SerialPortDevice.cs @@ -5,13 +5,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial { public abstract class SerialPortDevice { - [SaveState.DoNotSave] public Func ReadMasterAtn = () => true; - - [SaveState.DoNotSave] public Func ReadMasterClk = () => true; - - [SaveState.DoNotSave] public Func ReadMasterData = () => true; public virtual void ExecutePhase()