C64 - remove the SaveState.DoNotSave attribute

This commit is contained in:
adelikat 2017-05-13 13:04:02 -05:00
parent 8ae05f2d01
commit caf9802412
47 changed files with 157 additions and 308 deletions

View File

@ -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<IDebuggable> 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;
}
}

View File

@ -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<IDisassemblable> 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<string> AvailableCpus
{
get { return GetAvailableDisassemblables().SelectMany(d => d.AvailableCpus); }

View File

@ -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()

View File

@ -16,7 +16,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
set { _lagCount = value; }
}
[SaveState.DoNotSave]
public IInputCallbackSystem InputCallbacks { get; private set; }
private bool _isLagFrame;

View File

@ -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; }
// -----------------------------------------

View File

@ -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()

View File

@ -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<byte[]> 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()

View File

@ -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

View File

@ -17,7 +17,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge
Disconnect();
}
[SaveState.DoNotSave]
internal string CartridgeType => _cartridgeDevice.GetType().Name;
// ------------------------------------------

View File

@ -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)

View File

@ -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;

View File

@ -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<int> newAddresses, IList<int> newBanks, IList<int[]> newData)

View File

@ -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<int[]> newData)

View File

@ -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<int> newAddresses, IList<int[]> newData)

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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<int> newAddresses, IList<int> newBanks, IList<int[]> newData)

View File

@ -5,9 +5,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cassette
{
public sealed class CassettePort
{
[SaveState.DoNotSave]
public Func<bool> ReadDataOutput = () => true;
[SaveState.DoNotSave]
public Func<bool> ReadMotor = () => true;
private CassettePortDevice _device;

View File

@ -5,9 +5,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cassette
{
public abstract class CassettePortDevice
{
[SaveState.DoNotSave]
public Func<bool> ReadDataOutput;
[SaveState.DoNotSave]
public Func<bool> ReadMotor;
public virtual void ExecutePhase2()

View File

@ -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; } }
}
}

View File

@ -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

View File

@ -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<bool[]> _readJoyData;
[SaveState.DoNotSave] private readonly Func<bool[]> _readKeyData;
private int _ret;
private int _tst;
private readonly Func<bool[]> _readJoyData;
private readonly Func<bool[]> _readKeyData;
public JoystickKeyboardPort(Func<bool[]> readJoyData, Func<bool[]> readKeyData)
{

View File

@ -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; }

View File

@ -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)

View File

@ -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;

View File

@ -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)
{

View File

@ -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<int> ReadPotX;
public Func<int> 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)
{

View File

@ -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); }

View File

@ -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; }

View File

@ -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()

View File

@ -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()
{

View File

@ -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;

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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<int[]> newPipeline, int newCyclesPerSec, int hblankStart, int hblankEnd, int vblankStart, int vblankEnd, C64.BorderType borderType, int pixelRatioNum, int pixelRatioDen)
{

View File

@ -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;
/// <summary>

View File

@ -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;

View File

@ -7,10 +7,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
{
internal static class SaveState
{
public class DoNotSave : Attribute
{
}
private static int[] GetDelta(IList<int> source, IList<int> data)
{
var length = Math.Min(source.Count, data.Count);

View File

@ -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;

View File

@ -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; }
}
}

View File

@ -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<string> 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"; }

View File

@ -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()
{

View File

@ -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<int> ReadIec = () => 0xFF;
[SaveState.DoNotSave]
public Action DebuggerStep;
[SaveState.DoNotSave]
public readonly Chip23128 DriveRom;
public Drive1541(int clockNum, int clockDen)

View File

@ -7,11 +7,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial
{
public sealed class SerialPort : IDriveLight
{
[SaveState.DoNotSave]
public Func<bool> ReadMasterAtn = () => true;
[SaveState.DoNotSave]
public Func<bool> ReadMasterClk = () => true;
[SaveState.DoNotSave]
public Func<bool> 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; } }
}
}

View File

@ -5,13 +5,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial
{
public abstract class SerialPortDevice
{
[SaveState.DoNotSave]
public Func<bool> ReadMasterAtn = () => true;
[SaveState.DoNotSave]
public Func<bool> ReadMasterClk = () => true;
[SaveState.DoNotSave]
public Func<bool> ReadMasterData = () => true;
public virtual void ExecutePhase()