Exemple #1
0
 public ClockEntryRep(C64Interfaces.IFile stateFile, ClockOpFactory factory)
     : base(stateFile, factory)
 {
     _length = stateFile.ReadByte();
     _cycle = stateFile.ReadByte();
 }
Exemple #2
0
        public void ReadDeviceState(C64Interfaces.IFile stateFile)
        {
            _systemRam.ReadDeviceState(stateFile);
            _systemCpu.ReadDeviceState(stateFile);
            _systemVic.ReadDeviceState(stateFile);
            _systemCias[0].ReadDeviceState(stateFile);
            _systemCias[1].ReadDeviceState(stateFile);
            _serial.ReadDeviceState(stateFile);
            _sDataConn.ReadDeviceState(stateFile);
            _sClockConn.ReadDeviceState(stateFile);

            CpuPort_OnMemoryMapChanged(stateFile.ReadByte());

            _systemClock.ReadDeviceState(stateFile);
        }
Exemple #3
0
        protected void ReadPhaseFromDeviceState(C64Interfaces.IFile stateFile, byte phase)
        {
            ClockEntry previousOp = null;
            byte opCount = stateFile.ReadByte();
            for (byte i = 0; i < opCount; i++)
            {
                ClockEntry op = stateFile.ReadByte() == 0 ? new ClockEntry(stateFile, _opFactory) : new ClockEntryRep(stateFile, _opFactory);

                if (previousOp == null)
                    _currentOps[phase] = op;
                else
                    previousOp.Next = op;

                previousOp = op;
            }
        }
Exemple #4
0
        public Clock.ClockOp CreateFromStateFile(C64Interfaces.IFile stateFile)
        {
            switch (stateFile.ReadByte())
            {
                case (byte)Ops.Stall:
                    return new Clock.StallOp();

                case (byte)Ops.DecodeOpcode:
                    return new DecodeOpcodeOp(_cpu);

                case (byte)Ops.DecodeAddressing:
                    return new DecodeAddressOp(_cpu, stateFile);

                case (byte)Ops.ExecuteOpcode:
                    return new ExecuteOpcodeOp(_cpu, stateFile);

                case (byte)Ops.WriteResult:
                    return new WriteResultOp(_cpu);

                case (byte)Ops.Interrupt:
                    return new InterruptOp(_cpu, stateFile);

                case (byte)Ops.Reset:
                    return new ResetOp(_cpu, stateFile);
            }

            return null;
        }
Exemple #5
0
 public ResetOp(MOS6502 cpu, C64Interfaces.IFile stateFile)
     : this(cpu)
 {
     _readBuffer = stateFile.ReadByte();
 }
Exemple #6
0
        public void ReadDeviceState(C64Interfaces.IFile stateFile)
        {
            byte trackCount = stateFile.ReadByte();

            for (int i = 0; i < _tracks.Length; i++)
            {
                ushort sectoirCount = stateFile.ReadWord();
                stateFile.ReadBytes(_tracks[i]);
            }
        }
Exemple #7
0
        public virtual void ReadDeviceState(C64Interfaces.IFile stateFile)
        {
            _state.A.Value = stateFile.ReadByte();
            _state.X.Value = stateFile.ReadByte();
            _state.Y.Value = stateFile.ReadByte();
            _state.PC.Value = stateFile.ReadWord();
            _state.S.Value = stateFile.ReadWord();
            _state.P.Value = stateFile.ReadByte();

            _opcode = stateFile.ReadByte();
            _result = stateFile.ReadByte();

            _target = TargetFactory.ReadTargetFromStateFile(this, stateFile);

            _irq.ReadDeviceState(stateFile);
            _nmi.ReadDeviceState(stateFile);
        }
        public static AddressedTarget ReadTargetFromStateFile(MOS6502 cpu, C64Interfaces.IFile stateFile)
        {
            switch (stateFile.ReadByte())
            {
                case (byte)TargetTypes.ReadableTarget:
                    return new ReadableTarget(cpu, stateFile);

                case (byte)TargetTypes.WritableTarget:
                    return new WritableTarget(cpu, stateFile);

                case (byte)TargetTypes.IndirectTarget:
                    return new IndirectTarget(cpu, stateFile);

                case (byte)TargetTypes.AccumulatorTarget:
                    return new AccAddressing.Target(cpu);

                case (byte)TargetTypes.ImmediateTarget:
                    return new ImmAddressing.Target(cpu, stateFile);
            }

            return null;
        }
Exemple #9
0
 public ExecuteOpcodeOp(MOS6502 cpu, C64Interfaces.IFile stateFile)
     : this(cpu, null, stateFile.ReadByte())
 {
     _instruction = DecodingTable.Opcodes[cpu.Opcode]._instruction;
 }
Exemple #10
0
 public IndirectTarget(MOS6502 cpu, C64Interfaces.IFile stateFile)
     : base(cpu, stateFile)
 {
     _tempAddress = stateFile.ReadWord();
     _tempPart = stateFile.ReadByte();
 }
Exemple #11
0
 public ReadableTarget(MOS6502 cpu, C64Interfaces.IFile stateFile)
     : this(cpu, stateFile.ReadWord())
 {
     _part = stateFile.ReadByte();
 }
Exemple #12
0
            public void ReadDeviceState(C64Interfaces.IFile stateFile)
            {
                _controlReg = stateFile.ReadByte();
                _active = stateFile.ReadBool();
                _mode = stateFile.ReadByte();
                _oneTime = stateFile.ReadBool();

                _output = stateFile.ReadBool();
                _pulsing = stateFile.ReadBool();
                _pulsed = stateFile.ReadBool();

                _current = stateFile.ReadWord();
                _latch = stateFile.ReadWord();
            }
Exemple #13
0
        public void ReadDeviceState(C64Interfaces.IFile stateFile)
        {
            _portA.ReadDeviceState(stateFile);
            _portB.ReadDeviceState(stateFile);

            _pcState = stateFile.ReadBool();
            _todPause = stateFile.ReadBool();
            _todLatch = stateFile.ReadBool();
            _todClkCnt = stateFile.ReadByte();
            stateFile.ReadBytes(_todLimits);

            for (int i = 0; i < _tod.GetLength(0); i++)
            {
                for (int j = 0; j < _tod.GetLength(1); j++)
                    _tod[i, j] = stateFile.ReadByte();
            }

            stateFile.ReadBytes(_interruptRegisters);
            _serialRegister = stateFile.ReadByte();
            _flag = stateFile.ReadBool();
            _cntState = stateFile.ReadBool();
            _cntEdge = stateFile.ReadBool();

            _timerA.ReadDeviceState(stateFile);
            _timerB.ReadDeviceState(stateFile);
        }
Exemple #14
0
        public void ReadDeviceState(C64Interfaces.IFile stateFile)
        {
            _portA.ReadDeviceState(stateFile);
            _portB.ReadDeviceState(stateFile);

            _latchPortA = stateFile.ReadBool();
            _latchedValueA = stateFile.ReadByte();
            _ca1 = stateFile.ReadBool();
            _ca2 = stateFile.ReadBool();
            _latchPortB = stateFile.ReadBool();
            _latchedValueB = stateFile.ReadByte();
            _cb1 = stateFile.ReadBool();
            _pulseCA2 = stateFile.ReadBool();
            _cb2 = stateFile.ReadBool();
            _pulseCB2 = stateFile.ReadBool();

            _t1Counter = stateFile.ReadWord();
            _t1Latch = stateFile.ReadWord();
            _t1Count = stateFile.ReadBool();
            _t1OutPB = stateFile.ReadBool();
            _t1FreeRun = stateFile.ReadBool();
            _t2Counter = stateFile.ReadWord();
            _t2Latch = stateFile.ReadByte();
            _t2Count = stateFile.ReadBool();
            _t2InPB = stateFile.ReadBool();

            _functionControlRegister = stateFile.ReadByte();
            _auxiliaryControlRegister = stateFile.ReadByte();
            _interruptFlagRegister = stateFile.ReadByte();
            _interruptEnabledRegister = stateFile.ReadByte();
        }
Exemple #15
0
 public void ReadDeviceState(C64Interfaces.IFile stateFile)
 {
     _stateOut = stateFile.ReadByte();
     _stateIn = stateFile.ReadByte();
     _direction = stateFile.ReadByte();
 }
Exemple #16
0
 public InterruptOp(MOS6502 cpu, C64Interfaces.IFile stateFile)
     : this(cpu, stateFile.ReadWord())
 {
     _readBuffer = stateFile.ReadByte();
 }
Exemple #17
0
 public void ReadDeviceState(C64Interfaces.IFile stateFile)
 {
     _state = stateFile.ReadByte();
 }
Exemple #18
0
 public void ReadDeviceState(C64Interfaces.IFile stateFile)
 {
     _headTrackPos = stateFile.ReadByte();
     _headSectorPos = stateFile.ReadWord();
     _lastHeadDirection = stateFile.ReadByte();
     _spinning = stateFile.ReadBool();
     _density = stateFile.ReadByte();
     _cycleCount = stateFile.ReadByte();
     _lastData = stateFile.ReadByte();
 }