Virtu: Make savestates smaller.
This commit is contained in:
parent
46385174da
commit
e1075d1006
|
@ -8,9 +8,18 @@ namespace Jellyfish.Virtu
|
|||
{
|
||||
public sealed partial class Cpu : MachineComponent
|
||||
{
|
||||
public Cpu() { }
|
||||
public Cpu()
|
||||
{
|
||||
InitializeOpCodeDelegates();
|
||||
}
|
||||
|
||||
public Cpu(Machine machine) :
|
||||
base(machine)
|
||||
{
|
||||
InitializeOpCodeDelegates();
|
||||
}
|
||||
|
||||
private void InitializeOpCodeDelegates()
|
||||
{
|
||||
ExecuteOpCode65N02 = new Action[OpCodeCount]
|
||||
{
|
||||
|
@ -3434,7 +3443,6 @@ namespace Jellyfish.Virtu
|
|||
}
|
||||
#endregion
|
||||
|
||||
[JsonIgnore]
|
||||
public bool Is65C02 { get { return _is65C02; } set { _is65C02 = value; _executeOpCode = _is65C02 ? ExecuteOpCode65C02 : ExecuteOpCode65N02; } }
|
||||
public bool IsThrottled { get; set; }
|
||||
public int Multiplier { get; set; }
|
||||
|
@ -3452,7 +3460,9 @@ namespace Jellyfish.Virtu
|
|||
|
||||
private Memory _memory;
|
||||
|
||||
[JsonIgnore]
|
||||
private bool _is65C02;
|
||||
[JsonIgnore]
|
||||
private Action[] _executeOpCode;
|
||||
|
||||
[JsonIgnore]
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Jellyfish.Virtu
|
||||
{
|
||||
|
@ -6,7 +7,9 @@ namespace Jellyfish.Virtu
|
|||
{
|
||||
private const int OpCodeCount = 256;
|
||||
|
||||
[JsonIgnore]
|
||||
private Action[] ExecuteOpCode65N02;
|
||||
[JsonIgnore]
|
||||
private Action[] ExecuteOpCode65C02;
|
||||
|
||||
private const int PC = 0x01;
|
||||
|
|
|
@ -13,11 +13,20 @@ namespace Jellyfish.Virtu
|
|||
|
||||
public sealed partial class Memory : MachineComponent
|
||||
{
|
||||
public Memory() { }
|
||||
public Memory()
|
||||
{
|
||||
InitializeWriteDelegates();
|
||||
}
|
||||
|
||||
public Memory(Machine machine, byte[] appleIIe) :
|
||||
base(machine)
|
||||
{
|
||||
_appleIIe = appleIIe;
|
||||
InitializeWriteDelegates();
|
||||
}
|
||||
|
||||
private void InitializeWriteDelegates()
|
||||
{
|
||||
WriteRamModeBankRegion = new Action<int, byte>[Video.ModeCount][][];
|
||||
for (int mode = 0; mode < Video.ModeCount; mode++)
|
||||
{
|
||||
|
@ -26,7 +35,6 @@ namespace Jellyfish.Virtu
|
|||
new Action<int, byte>[RegionCount], new Action<int, byte>[RegionCount]
|
||||
};
|
||||
}
|
||||
|
||||
WriteRamModeBankRegion[Video.Mode0][BankMain][Region0407] = WriteRamMode0MainRegion0407;
|
||||
WriteRamModeBankRegion[Video.Mode0][BankMain][Region080B] = WriteRamMode0MainRegion080B;
|
||||
WriteRamModeBankRegion[Video.Mode1][BankMain][Region0407] = WriteRamMode1MainRegion0407;
|
||||
|
@ -2133,10 +2141,15 @@ namespace Jellyfish.Virtu
|
|||
public MonitorType Monitor { get; private set; }
|
||||
public int VideoMode { get { return StateVideoMode[_state & StateVideo]; } }
|
||||
|
||||
[JsonIgnore]
|
||||
private Action<int, byte> _writeIoRegionC0C0;
|
||||
[JsonIgnore]
|
||||
private Action<int, byte> _writeIoRegionC1C7;
|
||||
[JsonIgnore]
|
||||
private Action<int, byte> _writeIoRegionC3C3;
|
||||
[JsonIgnore]
|
||||
private Action<int, byte> _writeIoRegionC8CF;
|
||||
[JsonIgnore]
|
||||
private Action<int, byte> _writeRomRegionD0FF;
|
||||
|
||||
[JsonIgnore]
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Jellyfish.Virtu
|
||||
{
|
||||
|
@ -101,6 +102,7 @@ namespace Jellyfish.Virtu
|
|||
Video.ModeC, Video.ModeD, Video.Mode1, Video.Mode2, Video.ModeE, Video.ModeF, Video.Mode1, Video.Mode2
|
||||
};
|
||||
|
||||
[JsonIgnore]
|
||||
private Action<int, byte>[][][] WriteRamModeBankRegion;
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue