diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs index 8afeed35bf..30bd0210e8 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs @@ -327,9 +327,21 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 Serial.SyncState(ser); ser.EndSection(); - ser.BeginSection("TapeDrive"); SaveState.SyncObject(ser, TapeDrive); ser.EndSection(); // TODO: only if tape + if (TapeDrive != null) // TODO: a tape object is already in a nested class, is it the same reference? do we need this? + { + ser.BeginSection("TapeDrive"); + TapeDrive.SyncState(ser); + ser.EndSection(); + } + ser.BeginSection("User"); SaveState.SyncObject(ser, User); ser.EndSection(); - ser.BeginSection("DiskDrive"); SaveState.SyncObject(ser, DiskDrive); ser.EndSection(); // TODO: only if disk + + if (DiskDrive != null) // TODO: a disk object is already in a nested class, is it the same reference? do we need this? + { + ser.BeginSection("DiskDrive"); + DiskDrive.SyncState(ser); + ser.EndSection(); + } ser.Sync("Bus", ref Bus); ser.Sync("InputRead", ref InputRead); diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs index 511a5f867e..4ca8a1d778 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs @@ -424,7 +424,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS _port.SyncState(ser); ser.EndSection(); - ser.Sync("PortLatchA", ref _paLatch); ser.Sync("PortLatchB", ref _pbLatch); ser.Sync("CA1InterruptControl", ref _pcrCa1IntControl);