2014-11-30 16:52:25 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
using BizHawk.Common;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk.Emulation.Cores.Calculators
|
|
|
|
|
{
|
create StateSerializer as a base implementation of IStatable (#1850)
* create StateSerializer, an ITextStatable implementation using the Serializer class, and wire it up to the TI83 core
* wire StateSerializer to A2600 core
* wire up StateSerializer to AmstradCPC, C64, and ZXS
* wire up StateSerializer to MSX, A27800, and Coleco
* wire up state serializer to ChannelF, Vectrex, Intellivision
* fix GambatteLink to implement ITextStatable, implement TextSerializer in O2
* StateSerializer - wire up a loadstate callback and implement StateSerializer for NesHawk, a bit of rework to subNesHawk as a result
* fix subneshawk text savestates
* StateSerializer - implement byte[] buffer storing (optionally), wire up to PCE
* implement StateSerializer to SMS, tweak GGLink accordingly
* implement StateSerializer in GBHawk, fix link cores accordingly
* StateSerializer - use Serializer static methods to create serializers
2020-02-16 18:05:57 +00:00
|
|
|
|
public partial class TI83
|
2014-11-30 16:52:25 +00:00
|
|
|
|
{
|
|
|
|
|
private void SyncState(Serializer ser)
|
|
|
|
|
{
|
2017-10-13 20:26:32 +00:00
|
|
|
|
if (ser.IsWriter)
|
|
|
|
|
{
|
|
|
|
|
var ms = new MemoryStream();
|
|
|
|
|
ms.Close();
|
2020-01-11 19:19:12 +00:00
|
|
|
|
ms.ToArray();
|
2017-10-13 20:26:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-03-28 03:18:58 +00:00
|
|
|
|
ser.BeginSection(nameof(TI83));
|
2020-02-16 19:33:47 +00:00
|
|
|
|
_cpu.SyncState(ser);
|
2015-02-07 14:46:02 +00:00
|
|
|
|
ser.Sync("RAM", ref _ram, false);
|
|
|
|
|
ser.Sync("romPageLow3Bits", ref _romPageLow3Bits);
|
|
|
|
|
ser.Sync("romPageHighBit", ref _romPageHighBit);
|
|
|
|
|
ser.Sync("disp_mode", ref _displayMode);
|
|
|
|
|
ser.Sync("disp_move", ref _displayMove);
|
|
|
|
|
ser.Sync("disp_x", ref _displayX);
|
|
|
|
|
ser.Sync("disp_y", ref _displayY);
|
|
|
|
|
ser.Sync("m_CursorMoved", ref _cursorMoved);
|
|
|
|
|
ser.Sync("maskOn", ref _maskOn);
|
|
|
|
|
ser.Sync("onPressed", ref _onPressed);
|
|
|
|
|
ser.Sync("keyboardMask", ref _keyboardMask);
|
2017-05-01 14:10:07 +00:00
|
|
|
|
ser.Sync("m_LinkOutput", ref _linkOutput);
|
2015-02-07 14:46:02 +00:00
|
|
|
|
ser.Sync("VRAM", ref _vram, false);
|
|
|
|
|
ser.Sync("Frame", ref _frame);
|
2014-11-30 23:50:07 +00:00
|
|
|
|
ser.Sync("LagCount", ref _lagCount);
|
|
|
|
|
ser.Sync("IsLag", ref _isLag);
|
2019-03-28 03:18:58 +00:00
|
|
|
|
ser.Sync(nameof(ON_key_int), ref ON_key_int);
|
|
|
|
|
ser.Sync(nameof(ON_key_int_EN), ref ON_key_int_EN);
|
|
|
|
|
ser.Sync(nameof(TIM_1_int), ref TIM_1_int);
|
|
|
|
|
ser.Sync(nameof(TIM_1_int_EN), ref TIM_1_int_EN);
|
|
|
|
|
ser.Sync(nameof(TIM_frq), ref TIM_frq);
|
|
|
|
|
ser.Sync(nameof(TIM_mult), ref TIM_mult);
|
|
|
|
|
ser.Sync(nameof(TIM_count), ref TIM_count);
|
|
|
|
|
ser.Sync(nameof(TIM_hit), ref TIM_hit);
|
2017-10-20 14:32:22 +00:00
|
|
|
|
|
2014-11-30 16:52:25 +00:00
|
|
|
|
ser.EndSection();
|
2016-08-22 18:56:50 +00:00
|
|
|
|
|
|
|
|
|
if (ser.IsReader)
|
|
|
|
|
{
|
|
|
|
|
SyncAllByteArrayDomains();
|
|
|
|
|
}
|
2014-11-30 16:52:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|