This commit is contained in:
adelikat 2016-12-07 12:33:47 -06:00
commit 6b02e9d551
5 changed files with 46 additions and 17 deletions

View File

@ -1,6 +1,4 @@
using System;
using BizHawk.Common;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Components.CP1610
@ -47,16 +45,7 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
Register[6],
Register[7])
};
}
public void SyncState(Serializer ser)
{
ser.BeginSection("CP1610");
// TODO
ser.EndSection();
}
}
private void Calc_FlagC(int result)
{

View File

@ -1,6 +1,6 @@
using System;
using System.IO;
using BizHawk.Common;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Components.CP1610
@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
private bool FlagS, FlagC, FlagZ, FlagO, FlagI, FlagD, IntRM, BusRq, BusAk, Interruptible, Interrupted;
//private bool MSync;
private readonly ushort[] Register = new ushort[8];
private ushort[] Register = new ushort[8];
private ushort RegisterSP { get { return Register[6]; } set { Register[6] = value; } }
private ushort RegisterPC { get { return Register[7]; } set { Register[7] = value; } }
@ -35,7 +35,31 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
private static bool Logging = true;
private static readonly StreamWriter Log;
static CP1610()
public void SyncState(Serializer ser)
{
ser.BeginSection("CP1610");
ser.Sync("Register", ref Register, false);
ser.Sync("FlagS", ref FlagS);
ser.Sync("FlagC", ref FlagC);
ser.Sync("FlagZ", ref FlagZ);
ser.Sync("FlagO", ref FlagO);
ser.Sync("FlagI", ref FlagI);
ser.Sync("FlagD", ref FlagD);
ser.Sync("IntRM", ref IntRM);
ser.Sync("BusRq", ref BusRq);
ser.Sync("BusAk", ref BusAk);
ser.Sync("BusRq", ref BusRq);
ser.Sync("Interruptible", ref Interruptible);
ser.Sync("Interrupted", ref Interrupted);
ser.Sync("Toal_executed_cycles", ref TotalExecutedCycles);
ser.Sync("Pending Cycles", ref PendingCycles);
ser.EndSection();
}
static CP1610()
{
if (Logging)
{

View File

@ -51,6 +51,14 @@ namespace BizHawk.Emulation.Cores.Intellivision
ser.Sync("version", ref version);
ser.Sync("Frame", ref _frame);
ser.Sync("ScratchpadRam", ref ScratchpadRam, false);
ser.Sync("SystemRam", ref SystemRam, false);
ser.Sync("ExecutiveRom", ref ExecutiveRom, false);
ser.Sync("GraphicsRom", ref GraphicsRom, false);
ser.Sync("GraphicsRam", ref GraphicsRam, false);
_cpu.SyncState(ser);
_stic.SyncState(ser);
_psg.SyncState(ser);

View File

@ -36,7 +36,9 @@ namespace BizHawk.Emulation.Cores.Intellivision
{
ser.BeginSection("PSG");
// TODO
ser.Sync("Register", ref Register, false);
ser.Sync("Toal_executed_cycles", ref TotalExecutedCycles);
ser.Sync("Pending Cycles", ref PendingCycles);
ser.EndSection();
}

View File

@ -29,7 +29,13 @@ namespace BizHawk.Emulation.Cores.Intellivision
{
ser.BeginSection("STIC");
// TODO
ser.Sync("Sr1", ref Sr1);
ser.Sync("Sr2", ref Sr2);
ser.Sync("Sst", ref Sst);
ser.Sync("Fgbg", ref Fgbg);
ser.Sync("Toal_executed_cycles", ref TotalExecutedCycles);
ser.Sync("Pending Cycles", ref PendingCycles);
ser.Sync("Registers", ref Register, false);
ser.EndSection();
}