Exemplo n.º 1
0
        public RAM6116(DeserializationContext input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            input.CheckVersion(1);
            RAM = input.ReadExpectedBytes(0x800);
        }
Exemplo n.º 2
0
        public RAM6116(DeserializationContext input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            input.CheckVersion(1);
            RAM = input.ReadExpectedBytes(0x800);
        }
Exemplo n.º 3
0
        public Bios7800(DeserializationContext input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            input.CheckVersion(1);
            ROM = input.ReadExpectedBytes(4096, 16384);

            Mask = (ushort)ROM.Length;
            Mask--;
        }
Exemplo n.º 4
0
        public HSC7800(DeserializationContext input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            input.CheckVersion(1);
            ROM = input.ReadExpectedBytes(4096);
            SRAM = input.ReadRAM6116();
 
            Size = Mask = (ushort)ROM.Length;
            Mask--;
        }
Exemplo n.º 5
0
        public TIASound(DeserializationContext input, MachineBase m, int cpuClocksPerSample) : this(m, cpuClocksPerSample)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            input.CheckVersion(1);
            Bit9               = input.ReadExpectedBytes(511);
            P4                 = input.ReadIntegers(2);
            P5                 = input.ReadIntegers(2);
            P9                 = input.ReadIntegers(2);
            DivByNCounter      = input.ReadIntegers(2);
            DivByNMaximum      = input.ReadIntegers(2);
            AUDC               = input.ReadExpectedBytes(2);
            AUDF               = input.ReadExpectedBytes(2);
            AUDV               = input.ReadExpectedBytes(2);
            OutputVol          = input.ReadExpectedBytes(2);
            LastUpdateCPUClock = input.ReadUInt64();
            BufferIndex        = input.ReadInt32();
        }
Exemplo n.º 6
0
        public Bios7800(DeserializationContext input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            input.CheckVersion(1);
            ROM = input.ReadExpectedBytes(4096, 16384);

            Mask = (ushort)ROM.Length;
            Mask--;
        }
Exemplo n.º 7
0
        public HSC7800(DeserializationContext input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            input.CheckVersion(1);
            ROM  = input.ReadExpectedBytes(4096);
            SRAM = input.ReadRAM6116();

            Size = Mask = (ushort)ROM.Length;
            Mask--;
        }
Exemplo n.º 8
0
        public PIA(DeserializationContext input, MachineBase m) : this(m)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            var version = input.CheckVersion(1, 2);
            RAM          = input.ReadExpectedBytes(0x80);
            TimerTarget  = input.ReadUInt64();
            TimerShift   = input.ReadInt32();
            IRQEnabled   = input.ReadBoolean();
            IRQTriggered = input.ReadBoolean();
            DDRA         = input.ReadByte();
            WrittenPortA = input.ReadByte();
            if (version > 1)
            {
                DDRB         = input.ReadByte();
                WrittenPortB = input.ReadByte();
            }
        }
Exemplo n.º 9
0
        public TIA(DeserializationContext input, MachineBase m) : this()
        {
            if (input == null)
                throw new ArgumentNullException("input");
            if (m == null)
                throw new ArgumentNullException("m");

            M = m;
            TIASound = input.ReadTIASound(M, CPU_TICKS_PER_AUDIO_SAMPLE);

            input.CheckVersion(2);
            RegW = input.ReadExpectedBytes(0x40);
            HSync = input.ReadInt32();
            HMoveCounter = input.ReadInt32();
            ScanLine = input.ReadInt32();
            FrameBufferIndex = input.ReadInt32();
            //FrameBufferElement = input.ReadBufferElement();
            StartHMOVEClock = input.ReadUInt64();
            HMoveLatch = input.ReadBoolean();
            StartClock = input.ReadUInt64();
            P0 = input.ReadInt32();
            P0mmr = input.ReadBoolean();
            EffGRP0 = input.ReadByte();
            OldGRP0 = input.ReadByte();
            P0type = input.ReadInt32();
            P0suppress = input.ReadInt32();
            P1 = input.ReadInt32();
            P1mmr = input.ReadBoolean();
            EffGRP1 = input.ReadByte();
            OldGRP1 = input.ReadByte();
            P1type = input.ReadInt32();
            P1suppress = input.ReadInt32();
            M0 = input.ReadInt32();
            M0mmr = input.ReadBoolean();
            M0type = input.ReadInt32();
            M0size = input.ReadInt32();
            m0on = input.ReadBoolean();
            M1 = input.ReadInt32();
            M1mmr = input.ReadBoolean();
            M1type = input.ReadInt32();
            M1size = input.ReadInt32();
            m1on = input.ReadBoolean();
            BL = input.ReadInt32();
            BLmmr = input.ReadBoolean();
            OldENABL = input.ReadBoolean();
            BLsize = input.ReadInt32();
            blon = input.ReadBoolean();
            PF210 = input.ReadUInt32();
            PFReflectionState = input.ReadInt32();
            colubk = input.ReadByte();
            colupf = input.ReadByte();
            colup0 = input.ReadByte();
            colup1 = input.ReadByte();
            vblankon = input.ReadBoolean();
            scoreon = input.ReadBoolean();
            pfpriority = input.ReadBoolean();
            DumpEnabled = input.ReadBoolean();
            DumpDisabledCycle = input.ReadUInt64();
            Collisions = (TIACxPairFlags)input.ReadInt32();
            WSYNCDelayClocks = input.ReadInt32();
            EndOfFrame = input.ReadBoolean();
        }
Exemplo n.º 10
0
        public TIA(DeserializationContext input, MachineBase m) : this()
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            if (m == null)
            {
                throw new ArgumentNullException("m");
            }

            M        = m;
            TIASound = input.ReadTIASound(M, CPU_TICKS_PER_AUDIO_SAMPLE);

            input.CheckVersion(2);
            RegW             = input.ReadExpectedBytes(0x40);
            HSync            = input.ReadInt32();
            HMoveCounter     = input.ReadInt32();
            ScanLine         = input.ReadInt32();
            FrameBufferIndex = input.ReadInt32();
            //FrameBufferElement = input.ReadBufferElement();
            StartHMOVEClock = input.ReadUInt64();
            HMoveLatch      = input.ReadBoolean();
            StartClock      = input.ReadUInt64();
            P0                = input.ReadInt32();
            P0mmr             = input.ReadBoolean();
            EffGRP0           = input.ReadByte();
            OldGRP0           = input.ReadByte();
            P0type            = input.ReadInt32();
            P0suppress        = input.ReadInt32();
            P1                = input.ReadInt32();
            P1mmr             = input.ReadBoolean();
            EffGRP1           = input.ReadByte();
            OldGRP1           = input.ReadByte();
            P1type            = input.ReadInt32();
            P1suppress        = input.ReadInt32();
            M0                = input.ReadInt32();
            M0mmr             = input.ReadBoolean();
            M0type            = input.ReadInt32();
            M0size            = input.ReadInt32();
            m0on              = input.ReadBoolean();
            M1                = input.ReadInt32();
            M1mmr             = input.ReadBoolean();
            M1type            = input.ReadInt32();
            M1size            = input.ReadInt32();
            m1on              = input.ReadBoolean();
            BL                = input.ReadInt32();
            BLmmr             = input.ReadBoolean();
            OldENABL          = input.ReadBoolean();
            BLsize            = input.ReadInt32();
            blon              = input.ReadBoolean();
            PF210             = input.ReadUInt32();
            PFReflectionState = input.ReadInt32();
            colubk            = input.ReadByte();
            colupf            = input.ReadByte();
            colup0            = input.ReadByte();
            colup1            = input.ReadByte();
            vblankon          = input.ReadBoolean();
            scoreon           = input.ReadBoolean();
            pfpriority        = input.ReadBoolean();
            DumpEnabled       = input.ReadBoolean();
            DumpDisabledCycle = input.ReadUInt64();
            Collisions        = (TIACxPairFlags)input.ReadInt32();
            WSYNCDelayClocks  = input.ReadInt32();
            EndOfFrame        = input.ReadBoolean();
        }
Exemplo n.º 11
0
        public PIA(DeserializationContext input, MachineBase m) : this(m)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            var version = input.CheckVersion(1, 2);
            RAM = input.ReadExpectedBytes(0x80);
            TimerTarget = input.ReadUInt64();
            TimerShift = input.ReadInt32();
            IRQEnabled = input.ReadBoolean();
            IRQTriggered = input.ReadBoolean();
            DDRA = input.ReadByte();
            WrittenPortA = input.ReadByte();
            if (version > 1)
            {
                DDRB = input.ReadByte();
                WrittenPortB = input.ReadByte();
            }
        }
Exemplo n.º 12
0
        public TIASound(DeserializationContext input, MachineBase m, int cpuClocksPerSample) : this(m, cpuClocksPerSample)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            input.CheckVersion(1);
            Bit9 = input.ReadExpectedBytes(511);
            P4 = input.ReadIntegers(2);
            P5 = input.ReadIntegers(2);
            P9 = input.ReadIntegers(2);
            DivByNCounter = input.ReadIntegers(2);
            DivByNMaximum = input.ReadIntegers(2);
            AUDC = input.ReadExpectedBytes(2);
            AUDF = input.ReadExpectedBytes(2);
            AUDV = input.ReadExpectedBytes(2);
            OutputVol = input.ReadExpectedBytes(2);
            LastUpdateCPUClock = input.ReadUInt64();
            BufferIndex = input.ReadInt32();
        }
Exemplo n.º 13
0
        public Maria(DeserializationContext input, Machine7800 m, int scanlines)
        {
            if (input == null)
                throw new ArgumentNullException("input");
            if (m == null)
                throw new ArgumentNullException("m");

            M = m;
            InitializeVisibleScanlineValues(scanlines);
            TIASound = new TIASound(input, M, CPU_TICKS_PER_AUDIO_SAMPLE);

            var version = input.CheckVersion(1, 2);
            LineRAM = input.ReadExpectedBytes(512);
            if (version == 1)
            {
                // formerly persisted values, MariaPalette[8,4]
                for (var i = 0; i < 32; i++) 
                    input.ReadByte();
            }
            Registers = input.ReadExpectedBytes(0x40);
            if (version == 1)
            {
                // formerly persisted value, Scanline
                input.ReadInt32();
            }
            switch (version)
            {
                case 1:
                    WM = (input.ReadByte() != 0);
                    break;
                case 2:
                    WM = input.ReadBoolean();
                    break;
            }
            DLL = input.ReadUInt16();
            DL = input.ReadUInt16();
            Offset = input.ReadInt32();
            Holey = input.ReadInt32();
            Width = input.ReadInt32();
            HPOS = input.ReadByte();
            PaletteNo = input.ReadByte();
            INDMode = input.ReadBoolean();
            if (version == 1)
            {
                // formerly persisted value (DLI)
                input.ReadBoolean();
            }
            CtrlLock = input.ReadBoolean();
            if (version == 1)
            {
                // formerly persisted value (VBLANK)
                input.ReadByte();
            }
            DMAEnabled = input.ReadBoolean();
            if (version == 1)
            {
                // formerly persisted value (DMAOn)
                input.ReadBoolean();
            }
            ColorKill = input.ReadBoolean();
            CWidth = input.ReadBoolean();
            BCntl = input.ReadBoolean();
            Kangaroo = input.ReadBoolean();
            RM = input.ReadByte();
        }
Exemplo n.º 14
0
        public Maria(DeserializationContext input, Machine7800 m, int scanlines)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            if (m == null)
            {
                throw new ArgumentNullException("m");
            }

            M = m;
            InitializeVisibleScanlineValues(scanlines);
            TIASound = new TIASound(input, M, CPU_TICKS_PER_AUDIO_SAMPLE);

            var version = input.CheckVersion(1, 2);

            LineRAM = input.ReadExpectedBytes(512);
            if (version == 1)
            {
                // formerly persisted values, MariaPalette[8,4]
                for (var i = 0; i < 32; i++)
                {
                    input.ReadByte();
                }
            }
            Registers = input.ReadExpectedBytes(0x40);
            if (version == 1)
            {
                // formerly persisted value, Scanline
                input.ReadInt32();
            }
            switch (version)
            {
            case 1:
                WM = (input.ReadByte() != 0);
                break;

            case 2:
                WM = input.ReadBoolean();
                break;
            }
            DLL       = input.ReadUInt16();
            DL        = input.ReadUInt16();
            Offset    = input.ReadInt32();
            Holey     = input.ReadInt32();
            Width     = input.ReadInt32();
            HPOS      = input.ReadByte();
            PaletteNo = input.ReadByte();
            INDMode   = input.ReadBoolean();
            if (version == 1)
            {
                // formerly persisted value (DLI)
                input.ReadBoolean();
            }
            CtrlLock = input.ReadBoolean();
            if (version == 1)
            {
                // formerly persisted value (VBLANK)
                input.ReadByte();
            }
            DMAEnabled = input.ReadBoolean();
            if (version == 1)
            {
                // formerly persisted value (DMAOn)
                input.ReadBoolean();
            }
            ColorKill = input.ReadBoolean();
            CWidth    = input.ReadBoolean();
            BCntl     = input.ReadBoolean();
            Kangaroo  = input.ReadBoolean();
            RM        = input.ReadByte();
        }