diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
index d48b2a2dbc..68a6eabce7 100644
--- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
+++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
@@ -95,6 +95,9 @@
TI83.cs
+
+ TI83.cs
+
@@ -208,14 +211,14 @@
- Atari7800.cs
+ Atari7800.cs
- Atari7800.cs
+ Atari7800.cs
- Atari7800.cs
+ Atari7800.cs
diff --git a/BizHawk.Emulation.Cores/Calculator/TI83.IStatable.cs b/BizHawk.Emulation.Cores/Calculator/TI83.IStatable.cs
new file mode 100644
index 0000000000..68a63e10ea
--- /dev/null
+++ b/BizHawk.Emulation.Cores/Calculator/TI83.IStatable.cs
@@ -0,0 +1,81 @@
+using System.IO;
+
+using BizHawk.Common;
+using BizHawk.Emulation.Common;
+
+namespace BizHawk.Emulation.Cores.Calculators
+{
+ public partial class TI83 : IStatable
+ {
+ private byte[] _stateBuffer;
+
+ public bool BinarySaveStatesPreferred
+ {
+ get { return false; }
+ }
+
+ public void SaveStateBinary(BinaryWriter bw)
+ {
+ SyncState(Serializer.CreateBinaryWriter(bw));
+ }
+
+ public void LoadStateBinary(BinaryReader br)
+ {
+ SyncState(Serializer.CreateBinaryReader(br));
+ }
+
+ public void SaveStateText(TextWriter tw)
+ {
+ SyncState(Serializer.CreateTextWriter(tw));
+ }
+
+ public void LoadStateText(TextReader tr)
+ {
+ SyncState(Serializer.CreateTextReader(tr));
+ }
+
+ public byte[] SaveStateBinary()
+ {
+ if (_stateBuffer == null)
+ {
+ var stream = new MemoryStream();
+ var writer = new BinaryWriter(stream);
+ SaveStateBinary(writer);
+ _stateBuffer = stream.ToArray();
+ writer.Close();
+ return _stateBuffer;
+ }
+ else
+ {
+ var stream = new MemoryStream(_stateBuffer);
+ var writer = new BinaryWriter(stream);
+ SaveStateBinary(writer);
+ writer.Close();
+ return _stateBuffer;
+ }
+ }
+
+ private void SyncState(Serializer ser)
+ {
+ ser.BeginSection("TI83");
+ cpu.SyncState(ser);
+ ser.Sync("RAM", ref ram, false);
+ ser.Sync("romPageLow3Bits", ref romPageLow3Bits);
+ ser.Sync("romPageHighBit", ref romPageHighBit);
+ ser.Sync("disp_mode", ref disp_mode);
+ ser.Sync("disp_move", ref disp_move);
+ ser.Sync("disp_x", ref disp_x);
+ ser.Sync("disp_y", ref disp_y);
+ ser.Sync("m_CursorMoved", ref m_CursorMoved);
+ ser.Sync("maskOn", ref maskOn);
+ ser.Sync("onPressed", ref onPressed);
+ ser.Sync("keyboardMask", ref keyboardMask);
+ ser.Sync("m_LinkOutput", ref m_LinkOutput);
+ ser.Sync("VRAM", ref vram, false);
+ ser.Sync("Frame", ref frame);
+ ser.Sync("LagCount", ref lagCount);
+ ser.Sync("IsLag", ref isLag);
+ ser.EndSection();
+ }
+ }
+}
diff --git a/BizHawk.Emulation.Cores/Calculator/TI83.cs b/BizHawk.Emulation.Cores/Calculator/TI83.cs
index 76c904436e..cc96f3e52e 100644
--- a/BizHawk.Emulation.Cores/Calculator/TI83.cs
+++ b/BizHawk.Emulation.Cores/Calculator/TI83.cs
@@ -524,57 +524,6 @@ namespace BizHawk.Emulation.Cores.Calculators
public bool DeterministicEmulation { get { return true; } }
- public bool BinarySaveStatesPreferred { get { return false; } }
- public void SaveStateBinary(BinaryWriter bw) { SyncState(Serializer.CreateBinaryWriter(bw)); }
- public void LoadStateBinary(BinaryReader br) { SyncState(Serializer.CreateBinaryReader(br)); }
- public void SaveStateText(TextWriter tw) { SyncState(Serializer.CreateTextWriter(tw)); }
- public void LoadStateText(TextReader tr) { SyncState(Serializer.CreateTextReader(tr)); }
-
- private void SyncState(Serializer ser)
- {
- ser.BeginSection("TI83");
- cpu.SyncState(ser);
- ser.Sync("RAM", ref ram, false);
- ser.Sync("romPageLow3Bits", ref romPageLow3Bits);
- ser.Sync("romPageHighBit", ref romPageHighBit);
- ser.Sync("disp_mode", ref disp_mode);
- ser.Sync("disp_move", ref disp_move);
- ser.Sync("disp_x", ref disp_x);
- ser.Sync("disp_y", ref disp_y);
- ser.Sync("m_CursorMoved", ref m_CursorMoved);
- ser.Sync("maskOn", ref maskOn);
- ser.Sync("onPressed", ref onPressed);
- ser.Sync("keyboardMask", ref keyboardMask);
- ser.Sync("m_LinkOutput", ref m_LinkOutput);
- ser.Sync("VRAM", ref vram, false);
- ser.Sync("Frame", ref frame);
- ser.Sync("LagCount", ref lagCount);
- ser.Sync("IsLag", ref isLag);
- ser.EndSection();
- }
-
- private byte[] stateBuffer;
- public byte[] SaveStateBinary()
- {
- if (stateBuffer == null)
- {
- var stream = new MemoryStream();
- var writer = new BinaryWriter(stream);
- SaveStateBinary(writer);
- stateBuffer = stream.ToArray();
- writer.Close();
- return stateBuffer;
- }
- else
- {
- var stream = new MemoryStream(stateBuffer);
- var writer = new BinaryWriter(stream);
- SaveStateBinary(writer);
- writer.Close();
- return stateBuffer;
- }
- }
-
public string SystemId { get { return "TI83"; } }
public string BoardName { get { return null; } }