From e60f308af082e41a07afcc1361d4e12baa9a6d95 Mon Sep 17 00:00:00 2001 From: saxxonpike Date: Mon, 3 Dec 2012 08:38:12 +0000 Subject: [PATCH] commodore64: savestate support for all chips + cartridge --- .../Computers/Commodore64/C64.Core.cs | 38 +++++- .../Computers/Commodore64/C64.Savestate.cs | 11 ++ .../Commodore64/Cartridges/Cartridge.cs | 10 ++ .../Commodore64/Cartridges/Mapper0005.cs | 9 ++ .../Commodore64/Cartridges/Mapper000F.cs | 9 ++ .../Commodore64/Cartridges/Mapper0012.cs | 13 +- .../Commodore64/Cartridges/Mapper0013.cs | 10 ++ .../Commodore64/Cartridges/Mapper0020.cs | 10 ++ .../Commodore64/MOS/CartridgePort.cs | 11 ++ .../Computers/Commodore64/MOS/Chip2114.cs | 6 + .../Computers/Commodore64/MOS/Chip23XX.cs | 6 + .../Computers/Commodore64/MOS/Chip4864.cs | 6 + .../Computers/Commodore64/MOS/MOS6510.cs | 19 +++ .../Computers/Commodore64/MOS/MOSPLA.cs | 26 +++- .../Computers/Commodore64/MOS/Sid.cs | 90 ++++++++++++++ .../Computers/Commodore64/MOS/Vic.cs | 113 +++++++++++++++++- 16 files changed, 377 insertions(+), 10 deletions(-) diff --git a/BizHawk.Emulation/Computers/Commodore64/C64.Core.cs b/BizHawk.Emulation/Computers/Commodore64/C64.Core.cs index 2acfcbd8c9..a00d12c398 100644 --- a/BizHawk.Emulation/Computers/Commodore64/C64.Core.cs +++ b/BizHawk.Emulation/Computers/Commodore64/C64.Core.cs @@ -199,9 +199,43 @@ namespace BizHawk.Emulation.Computers.Commodore64 vic.HardReset(); } - public void SyncState() + public void SyncState(Serializer ser) { - + ser.BeginSection("cia0"); + cia0.SyncState(ser); + ser.EndSection(); + + ser.BeginSection("cia1"); + cia1.SyncState(ser); + ser.EndSection(); + + ser.BeginSection("colorram"); + colorRam.SyncState(ser); + ser.EndSection(); + + ser.BeginSection("pla"); + pla.SyncState(ser); + ser.EndSection(); + + ser.BeginSection("cpu"); + cpu.SyncState(ser); + ser.EndSection(); + + ser.BeginSection("ram"); + ram.SyncState(ser); + ser.EndSection(); + + ser.BeginSection("sid"); + sid.SyncState(ser); + ser.EndSection(); + + ser.BeginSection("vic"); + vic.SyncState(ser); + ser.EndSection(); + + ser.BeginSection("cart"); + + ser.EndSection(); } } diff --git a/BizHawk.Emulation/Computers/Commodore64/C64.Savestate.cs b/BizHawk.Emulation/Computers/Commodore64/C64.Savestate.cs index 793cd10e38..3e42dc8414 100644 --- a/BizHawk.Emulation/Computers/Commodore64/C64.Savestate.cs +++ b/BizHawk.Emulation/Computers/Commodore64/C64.Savestate.cs @@ -55,6 +55,17 @@ namespace BizHawk.Emulation.Computers.Commodore64 void SyncState(Serializer ser) { + chips.SyncState(ser); + ser.BeginSection("core"); + ser.Sync("cyclesPerFrame", ref cyclesPerFrame); + ser.Sync("loadPrg", ref loadPrg); + for (uint i = 0; i < 2; i++) + for (uint j = 0; j < 5; j++) + ser.Sync("joystickPressed" + i.ToString() + j.ToString(), ref joystickPressed[i, j]); + for (uint i = 0; i < 8; i++) + for (uint j = 0; j < 8; j++) + ser.Sync("keyboardPressed" + i.ToString() + j.ToString(), ref keyboardPressed[i, j]); + ser.EndSection(); } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Cartridge.cs b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Cartridge.cs index b858490bed..bfce72b24a 100644 --- a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Cartridge.cs +++ b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Cartridge.cs @@ -236,6 +236,16 @@ namespace BizHawk.Emulation.Computers.Commodore64.Cartridges } } + public virtual void SyncState(Serializer ser) + { + ser.Sync("pinExRom", ref pinExRom); + ser.Sync("pinGame", ref pinGame); + ser.Sync("pinIRQ", ref pinIRQ); + ser.Sync("pinNMI", ref pinNMI); + ser.Sync("pinReset", ref pinReset); + ser.Sync("validCartridge", ref validCartridge); + } + public bool Valid { get diff --git a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0005.cs b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0005.cs index c2a48e2fd1..cf049cc392 100644 --- a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0005.cs +++ b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0005.cs @@ -148,5 +148,14 @@ namespace BizHawk.Emulation.Computers.Commodore64.Cartridges if (addr == 0x00) BankSet(val); } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("bankMask", ref bankMask); + ser.Sync("bankNumber", ref bankNumber); + if (ser.IsReader) + BankSet(bankNumber); + } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper000F.cs b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper000F.cs index 38702d0be7..cc422415eb 100644 --- a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper000F.cs +++ b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper000F.cs @@ -119,5 +119,14 @@ namespace BizHawk.Emulation.Computers.Commodore64.Cartridges { BankSet((uint)addr); } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("bankMask", ref bankMask); + ser.Sync("bankNumber", ref bankNumber); + if (ser.IsReader) + BankSet(bankNumber); + } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0012.cs b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0012.cs index 88c03ad45f..6d1fabd9ac 100644 --- a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0012.cs +++ b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0012.cs @@ -10,6 +10,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.Cartridges private byte[] bankMain; private byte[][] bankHigh; private byte[] bankHighSelected; + private uint bankIndex; private byte[] dummyBank; // Zaxxon and Super Zaxxon cartridges @@ -59,8 +60,8 @@ namespace BizHawk.Emulation.Computers.Commodore64.Cartridges public override byte Read8000(ushort addr) { - uint bank = (addr & (uint)0x1000) >> 12; - bankHighSelected = bankHigh[bank]; + bankIndex = (addr & (uint)0x1000) >> 12; + bankHighSelected = bankHigh[bankIndex]; return bankMain[addr]; } @@ -68,5 +69,13 @@ namespace BizHawk.Emulation.Computers.Commodore64.Cartridges { return bankHighSelected[addr]; } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("bankIndex", ref bankIndex); + if (ser.IsReader) + bankHighSelected = bankHigh[bankIndex]; + } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0013.cs b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0013.cs index 1f34f3b99f..e158478cdb 100644 --- a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0013.cs +++ b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0013.cs @@ -115,5 +115,15 @@ namespace BizHawk.Emulation.Computers.Commodore64.Cartridges if (addr == 0x00) BankSet(val); } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("bankMask", ref bankMask); + ser.Sync("bankNumber", ref bankNumber); + ser.Sync("romEnable", ref romEnable); + if (ser.IsReader) + BankSet(bankNumber | (uint)(romEnable ? 0x00 : 0x80)); + } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0020.cs b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0020.cs index 1eace7eef6..e2e1428723 100644 --- a/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0020.cs +++ b/BizHawk.Emulation/Computers/Commodore64/Cartridges/Mapper0020.cs @@ -165,5 +165,15 @@ namespace BizHawk.Emulation.Computers.Commodore64.Cartridges { ram[addr] = val; } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("bankNumber", ref bankNumber); + ser.Sync("boardLed", ref boardLed); + ser.Sync("ram", ref ram, false); + if (ser.IsReader) + UpdateState(); + } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/CartridgePort.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/CartridgePort.cs index 8abc9e3a4d..25fef37a24 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/CartridgePort.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/CartridgePort.cs @@ -103,5 +103,16 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS return true; //todo: hook this up to cartridge } } + + public void SyncState(Serializer ser) + { + ser.Sync("connected", ref connected); + if (connected) + { + ser.BeginSection("cartmapper"); + cart.SyncState(ser); + ser.EndSection(); + } + } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/Chip2114.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/Chip2114.cs index dc94d6aaf8..45c39fbead 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/Chip2114.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/Chip2114.cs @@ -46,6 +46,12 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS return (byte)(ram[addr & 0x3FF] | (bus & 0xF0)); } + public void SyncState(Serializer ser) + { + ByteBuffer buffer = new ByteBuffer(ram); + ser.Sync("ram", ref buffer); + } + public void Write(ushort addr, byte val) { ram[addr & 0x3FF] = (byte)(val & 0xF); diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/Chip23XX.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/Chip23XX.cs index 8d072685fe..85da4eb682 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/Chip23XX.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/Chip23XX.cs @@ -59,6 +59,12 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS return rom[addr & addrMask]; } + public void SyncState(Serializer ser) + { + ByteBuffer buffer = new ByteBuffer(rom); + ser.Sync("rom", ref buffer); + } + public void Write(ushort addr, byte val) { // do nothing (this is rom) diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/Chip4864.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/Chip4864.cs index 1a7a0b3b20..3a2322287e 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/Chip4864.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/Chip4864.cs @@ -48,6 +48,12 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS return ram[addr]; } + public void SyncState(Serializer ser) + { + ByteBuffer buffer = new ByteBuffer(ram); + ser.Sync("ram", ref buffer); + } + public void Write(ushort addr, byte val) { ram[addr] = val; diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs index c4198cd394..103be9723d 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs @@ -216,6 +216,25 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS SetPortData(PortData); } + public void SyncState(Serializer ser) + { + cpu.SyncState(ser); + ser.Sync("freezeCpu", ref freezeCpu); + ser.Sync("pinCassetteButton", ref pinCassetteButton); + ser.Sync("pinCassetteMotor", ref pinCassetteMotor); + ser.Sync("pinCassetteOutput", ref pinCassetteOutput); + ser.Sync("pinCharen", ref pinCharen); + ser.Sync("pinLoram", ref pinLoram); + ser.Sync("pinHiram", ref pinHiram); + ser.Sync("pinNMILast", ref pinNMILast); + ser.Sync("portDir", ref portDir); + ser.Sync("unusedPin0", ref unusedPin0); + ser.Sync("unusedPin1", ref unusedPin1); + ser.Sync("unusedPinTTL0", ref unusedPinTTL0); + ser.Sync("unusedPinTTL1", ref unusedPinTTL1); + ser.Sync("unusedPinTTLCycles", ref unusedPinTTLCycles); + } + // ------------------------------------ } } diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/MOSPLA.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/MOSPLA.cs index ee7e9c9ee0..f32867dfbd 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/MOSPLA.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/MOSPLA.cs @@ -82,11 +82,6 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS if ((ExRom != pinExRomLast) || (Game != pinGameLast) || (LoRam != pinLoRamLast) || (HiRam != pinHiRamLast) || (Charen != pinCharenLast)) { UpdateMap(); - pinExRomLast = ExRom; - pinGameLast = Game; - pinLoRamLast = LoRam; - pinHiRamLast = HiRam; - pinCharenLast = Charen; } } @@ -322,6 +317,12 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS { throw new Exception("Memory configuration missing from PLA, fix this!"); } + + pinExRomLast = ExRom; + pinGameLast = Game; + pinLoRamLast = LoRam; + pinHiRamLast = HiRam; + pinCharenLast = Charen; } // ------------------------------------ @@ -526,6 +527,21 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS } } + public void SyncState(Serializer ser) + { + ser.Sync("bus", ref bus); + ser.Sync("cia0portRead", ref cia0portRead); + ser.Sync("pinCharenLast", ref pinCharenLast); + ser.Sync("pinExRomLast", ref pinExRomLast); + ser.Sync("pinGameLast", ref pinGameLast); + ser.Sync("pinHiRamLast", ref pinHiRamLast); + ser.Sync("pinLoRamLast", ref pinLoRamLast); + ser.Sync("ultimax", ref ultimax); + ser.Sync("vicBank", ref vicBank); + + if (ser.IsReader) UpdateMap(); + } + private void UpdateVicBank() { switch (chips.cia1.ReadPort0() & 0x3) diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/Sid.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/Sid.cs index c8a24926b6..a869c71865 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/Sid.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/Sid.cs @@ -240,6 +240,25 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS } // ------------------------------------ + + public void SyncState(Serializer ser) + { + 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); + } + + // ------------------------------------ } private class Voice @@ -543,6 +562,34 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS return waveform; } } + + // ------------------------------------ + + public void SyncState(Serializer ser) + { + ser.Sync("accumulator", ref accumulator); + 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); + + if (ser.IsReader) + wave = waveTable[waveform]; + } } // ------------------------------------ @@ -872,5 +919,48 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS break; } } + + // ---------------------------------- + + public void SyncState(Serializer ser) + { + ser.BeginSection("env0"); + envelopes[0].SyncState(ser); + ser.EndSection(); + ser.BeginSection("wav0"); + voices[0].SyncState(ser); + ser.EndSection(); + ser.BeginSection("env1"); + envelopes[1].SyncState(ser); + ser.EndSection(); + ser.BeginSection("wav1"); + voices[1].SyncState(ser); + ser.EndSection(); + ser.BeginSection("env2"); + envelopes[2].SyncState(ser); + ser.EndSection(); + ser.BeginSection("wav2"); + voices[2].SyncState(ser); + ser.EndSection(); + ser.Sync("disableVoice3", ref disableVoice3); + ser.Sync("envelopeOutput0", ref envelopeOutput[0]); + ser.Sync("envelopeOutput1", ref envelopeOutput[1]); + ser.Sync("envelopeOutput2", ref envelopeOutput[2]); + ser.Sync("filterEnable0", ref filterEnable[0]); + ser.Sync("filterEnable1", ref filterEnable[1]); + ser.Sync("filterEnable2", ref filterEnable[2]); + ser.Sync("filterFrequency", ref filterFrequency); + ser.Sync("filterResonance", ref filterResonance); + ser.Sync("filterSelectBandPass", ref filterSelectBandPass); + ser.Sync("filterSelectLoPass", ref filterSelectLoPass); + ser.Sync("filterSelectHiPass", ref filterSelectHiPass); + ser.Sync("potCounter", ref potCounter); + ser.Sync("potX", ref potX); + ser.Sync("potY", ref potY); + ser.Sync("voiceOutput0", ref voiceOutput[0]); + ser.Sync("voiceOutput1", ref voiceOutput[1]); + ser.Sync("voiceOutput2", ref voiceOutput[2]); + ser.Sync("volume", ref volume); + } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/Vic.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/Vic.cs index 073b3859d6..1e688354af 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/Vic.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/Vic.cs @@ -44,6 +44,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS mc = 0; mcbase = 0; multicolor = false; + multicolorCrunch = false; pointer = 0; priority = false; shiftEnable = false; @@ -55,6 +56,30 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS yCrunch = false; yExpand = false; } + + public void SyncState(Serializer ser) + { + ser.Sync("collideData", ref collideData); + ser.Sync("collideSprite", ref collideSprite); + ser.Sync("color", ref color); + ser.Sync("display", ref display); + ser.Sync("dma", ref dma); + ser.Sync("enable", ref enable); + ser.Sync("mc", ref mc); + ser.Sync("mcbase", ref mcbase); + ser.Sync("multicolor", ref multicolor); + ser.Sync("multicolorCrunch", ref multicolorCrunch); + ser.Sync("pointer", ref pointer); + ser.Sync("priority", ref priority); + ser.Sync("shiftEnable", ref shiftEnable); + ser.Sync("sr", ref sr); + ser.Sync("x", ref x); + ser.Sync("xCrunch", ref xCrunch); + ser.Sync("xExpand", ref xExpand); + ser.Sync("y", ref y); + ser.Sync("yCrunch", ref yCrunch); + ser.Sync("yExpand", ref yExpand); + } } private Sprite[] sprites; @@ -687,7 +712,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS // border doesn't work with the background buffer if (borderOnMain || borderOnVertical) - pixel = borderColor; + pixel = borderColor; // store pixel in buffer pixelBuffer[pixelBufferIndex] = pixel; @@ -1323,5 +1348,91 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS break; } } + + // -------------------------- + + public void SyncState(Serializer ser) + { + for (uint i = 0; i < 8; i++) + { + ser.BeginSection("sprite" + i.ToString()); + sprites[i].SyncState(ser); + ser.EndSection(); + } + ser.Sync("backgroundColor0", ref backgroundColor0); + ser.Sync("backgroundColor1", ref backgroundColor1); + ser.Sync("backgroundColor2", ref backgroundColor2); + ser.Sync("backgroundColor3", ref backgroundColor3); + ser.Sync("baCount", ref baCount); + ser.Sync("badline", ref badline); + ser.Sync("badlineEnable", ref badlineEnable); + ser.Sync("bitmapColumn", ref bitmapColumn); + ser.Sync("bitmapMode", ref bitmapMode); + ser.Sync("borderB", ref borderB); + ser.Sync("borderCheckLEnable", ref borderCheckLEnable); + ser.Sync("borderCheckREnable", ref borderCheckREnable); + ser.Sync("borderColor", ref borderColor); + ser.Sync("borderL", ref borderL); + ser.Sync("borderOnMain", ref borderOnMain); + ser.Sync("borderOnVertical", ref borderOnVertical); + ser.Sync("borderR", ref borderR); + ser.Sync("borderT", ref borderT); + ser.Sync("bufferC", ref bufferC, false); + ser.Sync("bufferG", ref bufferG, false); + ser.Sync("bus", ref bus); + ser.Sync("columnSelect", ref columnSelect); + ser.Sync("cycle", ref cycle); + ser.Sync("cycleIndex", ref cycleIndex); + ser.Sync("dataC", ref dataC); + ser.Sync("dataG", ref dataG); + ser.Sync("displayC", ref displayC); + ser.Sync("displayEnable", ref displayEnable); + ser.Sync("displayIndex", ref displayIndex); + ser.Sync("enableIntLightPen", ref enableIntLightPen); + ser.Sync("enableIntRaster", ref enableIntRaster); + ser.Sync("enableIntSpriteCollision", ref enableIntSpriteCollision); + ser.Sync("enableIntSpriteDataCollision", ref enableIntSpriteDataCollision); + ser.Sync("extraColorMode", ref extraColorMode); + ser.Sync("idle", ref idle); + ser.Sync("intLightPen", ref intLightPen); + ser.Sync("intRaster", ref intRaster); + ser.Sync("intSpriteCollision", ref intSpriteCollision); + ser.Sync("intSpriteDataCollision", ref intSpriteDataCollision); + ser.Sync("lastRasterLine", ref lastRasterLine); + ser.Sync("lightPenX", ref lightPenX); + ser.Sync("lightPenY", ref lightPenY); + ser.Sync("multicolorMode", ref multicolorMode); + ser.Sync("pixelBuffer", ref pixelBuffer, false); + ser.Sync("pixelBufferDelay", ref pixelBufferDelay); + ser.Sync("pixelBufferIndex", ref pixelBufferIndex); + ser.Sync("pixelBackgroundBuffer", ref pixelBackgroundBuffer, false); + ser.Sync("pixelBackgroundBufferDelay", ref pixelBackgroundBufferDelay); + ser.Sync("pixelBackgroundBufferIndex", ref pixelBackgroundBufferIndex); + ser.Sync("pixelDataBuffer", ref pixelDataBuffer, false); + ser.Sync("pointerCB", ref pointerCB); + ser.Sync("pointerVM", ref pointerVM); + ser.Sync("rasterInterruptLine", ref rasterInterruptLine); + ser.Sync("rasterLine", ref rasterLine); + ser.Sync("rasterX", ref rasterX); + ser.Sync("rc", ref rc); + ser.Sync("refreshCounter", ref refreshCounter); + ser.Sync("rowSelect", ref rowSelect); + ser.Sync("spriteMulticolor0", ref spriteMulticolor0); + ser.Sync("spriteMulticolor1", ref spriteMulticolor1); + ser.Sync("sr", ref sr); + ser.Sync("vc", ref vc); + ser.Sync("vcbase", ref vcbase); + ser.Sync("vmli", ref vmli); + ser.Sync("xOffset", ref xOffset); + ser.Sync("xScroll", ref xScroll); + ser.Sync("yScroll", ref yScroll); + + ser.Sync("cyclesPerSec", ref cyclesPerSec); + ser.Sync("pinAEC", ref pinAEC); + ser.Sync("pinBA", ref pinBA); + ser.Sync("pinIRQ", ref pinIRQ); + ser.Sync("totalCycles", ref totalCycles); + ser.Sync("totalLines", ref totalLines); + } } }