From ba149320c537fcbad92dd9e36b104ee2b3e5e99b Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Wed, 7 Dec 2016 10:55:25 -0500 Subject: [PATCH 1/2] INtellivision fill out save states --- .../CPUs/CP1610/CP1610.Execute.cs | 13 +------- BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs | 30 +++++++++++++++++-- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs index 177a83f2d0..8970964ae9 100644 --- a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs +++ b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs @@ -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) { diff --git a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs index dbfd709c56..1236cfc9ba 100644 --- a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs +++ b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs @@ -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) { From eda1b44238d1ec6dbad397800806d373d0cbfd63 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Wed, 7 Dec 2016 10:56:31 -0500 Subject: [PATCH 2/2] Intellivision fill out save states --- .../Consoles/Intellivision/Intellivision.IStatable.cs | 8 ++++++++ BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs | 4 +++- BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs | 8 +++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IStatable.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IStatable.cs index 38cc41545f..0ac1cd7fed 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IStatable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IStatable.cs @@ -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); diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs index d42729b89b..0df58f39f5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs @@ -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(); } diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs index 3ca7f4f0ba..e90fb0a03b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs @@ -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(); }