Ejemplo n.º 1
0
        public Maria(Machine7800 m, int scanlines)
        {
            if (m == null)
            {
                throw new ArgumentNullException("m");
            }

            M = m;
            InitializeVisibleScanlineValues(scanlines);
            TIASound = new TIASound(M, CPU_TICKS_PER_AUDIO_SAMPLE);
        }
Ejemplo n.º 2
0
 public Maria ReadMaria(Machine7800 m, int scanlines)
 {
     var maria = new Maria(this, m, scanlines);
     return maria;
 }
        public Maria ReadMaria(Machine7800 m, int scanlines)
        {
            var maria = new Maria(this, m, scanlines);

            return(maria);
        }
Ejemplo n.º 4
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();
        }
Ejemplo n.º 5
0
        public Maria(Machine7800 m, int scanlines)
        {
            if (m == null)
                throw new ArgumentNullException("m");

            M = m;
            InitializeVisibleScanlineValues(scanlines);
            TIASound = new TIASound(M, CPU_TICKS_PER_AUDIO_SAMPLE);
        }
Ejemplo n.º 6
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();
        }