Ejemplo n.º 1
0
        public Machine(byte[] appleIIe, byte[] diskIIRom)
        {
            Events   = new MachineEvents();
            Services = new MachineServices();

            Cpu         = new Cpu(this);
            Memory      = new Memory(this, appleIIe);
            Keyboard    = new Keyboard(this);
            GamePort    = new GamePort(this);
            Cassette    = new Cassette(this);
            Speaker     = new Speaker(this);
            Video       = new Video(this);
            NoSlotClock = new NoSlotClock(this);

            var emptySlot = new PeripheralCard(this);

            Slot1 = emptySlot;
            Slot2 = emptySlot;
            Slot3 = emptySlot;
            Slot4 = emptySlot;
            Slot5 = emptySlot;
            Slot6 = new DiskIIController(this, diskIIRom);
            Slot7 = emptySlot;

            Slots = new Collection <PeripheralCard> {
                null, Slot1, Slot2, Slot3, Slot4, Slot5, Slot6, Slot7
            };
            Components = new Collection <MachineComponent> {
                Cpu, Memory, Keyboard, GamePort, Cassette, Speaker, Video, NoSlotClock, Slot1, Slot2, Slot3, Slot4, Slot5, Slot6, Slot7
            };

            BootDiskII = Slots.OfType <DiskIIController>().Last();

            //Thread = new Thread(Run) { Name = "Machine" };
        }
Ejemplo n.º 2
0
		public Machine(byte[] appleIIe, byte[] diskIIRom)
		{
			Events = new MachineEvents();

			Cpu = new Cpu(this);
			Memory = new Memory(this, appleIIe);
			Keyboard = new Keyboard(this);
			GamePort = new GamePort(this);
			Cassette = new Cassette(this);
			Speaker = new Speaker(this);
			Video = new Video(this);
			NoSlotClock = new NoSlotClock(this);

			var emptySlot = new PeripheralCard(this);
			Slot1 = emptySlot;
			Slot2 = emptySlot;
			Slot3 = emptySlot;
			Slot4 = emptySlot;
			Slot5 = emptySlot;
			Slot6 = new DiskIIController(this, diskIIRom);
			Slot7 = emptySlot;

			Slots = new List<PeripheralCard> { null, Slot1, Slot2, Slot3, Slot4, Slot5, Slot6, Slot7 };
			Components = new List<MachineComponent> { Cpu, Memory, Keyboard, GamePort, Cassette, Speaker, Video, NoSlotClock, Slot1, Slot2, Slot3, Slot4, Slot5, Slot6, Slot7 };

			BootDiskII = Slots.OfType<DiskIIController>().Last();
		}
Ejemplo n.º 3
0
        private bool[] _isCellDirty = new bool[Height * CellColumns + 1];         // includes sentinel

        public Video(MachineEvents events, IMemoryBus memory)
        {
            _events = events;
            _memory = memory;

            _events.AddEventDelegate(EventCallbacks.FlushRow, FlushRowEvent);
            _events.AddEventDelegate(EventCallbacks.InverseText, InverseTextEvent);
            _events.AddEventDelegate(EventCallbacks.LeaveVBlank, LeaveVBlankEvent);
            _events.AddEventDelegate(EventCallbacks.ResetVsync, ResetVSyncEvent);

            _flushRowMode = new Action <int>[]
            {
                FlushRowMode0, FlushRowMode1, FlushRowMode2, FlushRowMode3, FlushRowMode4, FlushRowMode5, FlushRowMode6, FlushRowMode7,
                FlushRowMode8, FlushRowMode9, FlushRowModeA, FlushRowModeB, FlushRowModeC, FlushRowModeD, FlushRowModeE, FlushRowModeF
            };

            unchecked
            {
                _colorBlack      = (int)0xFF000000;            // BGRA
                _colorDarkBlue   = (int)0xFF000099;
                _colorDarkGreen  = (int)0xFF117722;
                _colorMediumBlue = (int)0xFF0000FF;
                _colorBrown      = (int)0xFF885500;
                _colorLightGrey  = (int)0xFF99AAAA;
                _colorGreen      = (int)0xFF00EE11;
                _colorAquamarine = (int)0xFF55FFAA;
                _colorDeepRed    = (int)0xFFFF1111;
                _colorPurple     = (int)0xFFDD00DD;
                _colorDarkGrey   = (int)0xFF445555;
                _colorLightBlue  = (int)0xFF33AAFF;
                _colorOrange     = (int)0xFFFF4411;
                _colorPink       = (int)0xFFFF9988;
                _colorYellow     = (int)0xFFFFFF11;
                _colorWhite      = (int)0xFFFFFFFF;
                _colorMonochrome = (int)0xFF00AA00;
            }

            SetPalette();

            IsMonochrome   = false;
            ScannerOptions = ScannerOptions.None;

            _isVBlank = true;

            _events.AddEvent(_cyclesPerVBlankPreset, EventCallbacks.LeaveVBlank);             // align flush events with scanner; assumes vcount preset at start of frame [3-15, 3-16]
            _events.AddEvent(_cyclesPerVSync, EventCallbacks.ResetVsync);
            _events.AddEvent(_cyclesPerFlash, EventCallbacks.InverseText);
        }