C64 - convert Sid object arrays to not use SyncObject

This commit is contained in:
adelikat 2017-05-13 09:00:28 -05:00
parent 0fc9ea7e14
commit 6640b4050a
3 changed files with 53 additions and 16 deletions

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BizHawk.Common;
using BizHawk.Common;
namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
{
@ -239,7 +234,19 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
public void SyncState(Serializer ser)
{
SaveState.SyncObject(ser, this);
ser.Sync("_attack", ref _attack);
ser.Sync("_decay", ref _decay);
ser.Sync("_delay", ref _delay);
ser.Sync("_envCounter", ref _envCounter);
ser.Sync("_expCounter", ref _expCounter);
ser.Sync("_expPeriod", ref _expPeriod);
ser.Sync("_freeze", ref _freeze);
ser.Sync("_lfsr", ref _lfsr);
ser.Sync("_gate", ref _gate);
ser.Sync("_rate", ref _rate);
ser.Sync("_release", ref _release);
ser.Sync("_state", ref _state);
ser.Sync("_sustain", ref _sustain);
}
// ------------------------------------

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BizHawk.Common;
using BizHawk.Common;
namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
{
@ -303,7 +298,31 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
public void SyncState(Serializer ser)
{
SaveState.SyncObject(ser, this);
ser.Sync("_accBits", ref _accBits);
ser.Sync("_accNext", ref _accNext);
ser.Sync("_accumulator", ref _accumulator);
ser.Sync("_controlTestPrev", ref _controlTestPrev);
ser.Sync("_controlWavePrev", ref _controlWavePrev);
ser.Sync("_delay", ref _delay);
ser.Sync("_floatOutputTtl", ref _floatOutputTtl);
ser.Sync("_frequency", ref _frequency);
ser.Sync("_msbRising", ref _msbRising);
ser.Sync("_noise", ref _noise);
ser.Sync("_noNoise", ref _noNoise);
ser.Sync("_noNoiseOrNoise", ref _noNoiseOrNoise);
ser.Sync("_noPulse", ref _noPulse);
ser.Sync("_output", ref _output);
ser.Sync("_pulse", ref _pulse);
ser.Sync("_pulseWidth", ref _pulseWidth);
ser.Sync("_ringMod", ref _ringMod);
ser.Sync("_ringMsbMask", ref _ringMsbMask);
ser.Sync("_shiftRegister", ref _shiftRegister);
ser.Sync("_shiftRegisterReset", ref _shiftRegisterReset);
ser.Sync("_sync", ref _sync);
ser.Sync("_test", ref _test);
ser.Sync("_waveform", ref _waveform);
ser.Sync("_waveformIndex", ref _waveformIndex);
_wave = _waveTable[_waveform & 0x07];
}
}

View File

@ -184,7 +184,12 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
ser.Sync("_envelopeOutput1", ref _envelopeOutput1);
ser.Sync("_envelopeOutput2", ref _envelopeOutput2);
ser.BeginSection("Envelopes"); SaveState.SyncObject(ser, _envelopes); ser.EndSection();
for (int i = 0; i < _envelopes.Length; i++)
{
ser.BeginSection("Envelope" + i);
_envelopes[i].SyncState(ser);
ser.EndSection();
}
ser.Sync("_filterEnable", ref _filterEnable, useNull: false);
ser.Sync("_filterFrequency", ref _filterFrequency);
@ -201,7 +206,13 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
ser.Sync("_voiceOutput1", ref _voiceOutput1);
ser.Sync("_voiceOutput2", ref _voiceOutput2);
ser.BeginSection("Voices"); SaveState.SyncObject(ser, _voices); ser.EndSection();
for (int i = 0; i < _voices.Length; i++)
{
ser.BeginSection("Voice" + i);
_voices[i].SyncState(ser);
ser.EndSection();
}
ser.Sync("_volume", ref _volume);
}
}