コード例 #1
0
        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("Cpu");
            Cpu.SyncState(ser);
            ser.EndSection();

            ser.BeginSection("Pla");
            Pla.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();

            if (CartPort.IsConnected)
            {
                ser.BeginSection("CartPort");
                CartPort.SyncState(ser);
                ser.EndSection();
            }

            ser.BeginSection("Cassette");
            Cassette.SyncState(ser);
            ser.EndSection();

            ser.BeginSection("Serial");
            Serial.SyncState(ser);
            ser.EndSection();

            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");
            User.SyncState(ser);
            ser.EndSection();

            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);
            ser.Sync("Irq", ref Irq);
            ser.Sync("Nmi", ref Nmi);

            ser.Sync("_lastReadVicAddress", ref _lastReadVicAddress);
            ser.Sync("_lastReadVicData", ref _lastReadVicData);
            ser.Sync("_vicBank", ref _vicBank);

            ser.Sync("_joystickPressed", ref _joystickPressed, useNull: false);
            ser.Sync("_keyboardPressed", ref _keyboardPressed, useNull: false);
            ser.Sync("_restorePressed", ref _restorePressed);
        }
コード例 #2
0
ファイル: C64.Motherboard.cs プロジェクト: gocha/BizHawk
        public void SyncState(Serializer ser)
        {
            ser.BeginSection(nameof(Cia0));
            Cia0.SyncState(ser);
            ser.EndSection();

            ser.BeginSection(nameof(Cia1));
            Cia1.SyncState(ser);
            ser.EndSection();

            ser.BeginSection(nameof(ColorRam));
            ColorRam.SyncState(ser);
            ser.EndSection();

            ser.BeginSection(nameof(Cpu));
            Cpu.SyncState(ser);
            ser.EndSection();

            ser.BeginSection(nameof(Pla));
            Pla.SyncState(ser);
            ser.EndSection();

            ser.BeginSection(nameof(Ram));
            Ram.SyncState(ser);
            ser.EndSection();

            ser.BeginSection(nameof(Sid));
            Sid.SyncState(ser);
            ser.EndSection();

            ser.BeginSection(nameof(Vic));
            Vic.SyncState(ser);
            ser.EndSection();

            if (CartPort.IsConnected)
            {
                ser.BeginSection(nameof(CartPort));
                CartPort.SyncState(ser);
                ser.EndSection();
            }

            ser.BeginSection(nameof(Cassette));
            Cassette.SyncState(ser);
            ser.EndSection();

            ser.BeginSection(nameof(Serial));
            Serial.SyncState(ser);
            ser.EndSection();

            if (TapeDrive != null)             // TODO: a tape object is already in a nested class, is it the same reference? do we need this?
            {
                ser.BeginSection(nameof(TapeDrive));
                TapeDrive.SyncState(ser);
                ser.EndSection();
            }

            ser.BeginSection(nameof(User));
            User.SyncState(ser);
            ser.EndSection();

            if (DiskDrive != null)             // TODO: a disk object is already in a nested class, is it the same reference? do we need this?
            {
                ser.BeginSection(nameof(DiskDrive));
                DiskDrive.SyncState(ser);
                ser.EndSection();
            }

            ser.Sync(nameof(InputRead), ref InputRead);
            ser.Sync(nameof(Irq), ref Irq);
            ser.Sync(nameof(Nmi), ref Nmi);

            ser.Sync(nameof(_lastReadVicAddress), ref _lastReadVicAddress);
            ser.Sync(nameof(_lastReadVicData), ref _lastReadVicData);
            ser.Sync(nameof(_vicBank), ref _vicBank);

            ser.Sync(nameof(_joystickPressed), ref _joystickPressed, useNull: false);
            ser.Sync(nameof(_keyboardPressed), ref _keyboardPressed, useNull: false);
            ser.Sync(nameof(_restorePressed), ref _restorePressed);
        }