Beispiel #1
0
 public void HardReset()
 {
     _cpu.NESSoftReset();
     _port = new LatchedPort
     {
         Direction = 0x00,
         Latch     = 0xFF
     };
 }
Beispiel #2
0
		public void HardReset()
		{
			_cpu.NESSoftReset();
		    _port = new LatchedPort
		    {
		        Direction = 0x00,
		        Latch = 0xFF
		    };
			_pinNmiLast = true;
		}
Beispiel #3
0
        public MOS6526_2(Region region)
        {
            a     = new CiaTimer(serialPortA, underFlowA);
            b     = new CiaTimer(serialPortB, underFlowB);
            portA = new LatchedPort();
            portB = new LatchedPort();
            switch (region)
            {
            case Region.NTSC:
                tod_period = 14318181 / 140;
                break;

            case Region.PAL:
                tod_period = 17734472 / 180;
                break;
            }
        }
Beispiel #4
0
		public void HardReset()
		{
			// configure CPU defaults
			cpu.Reset();
			cpu.FlagI = true;
			cpu.BCD_Enabled = true;
			if (ReadMemory != null)
				cpu.PC = (ushort)(ReadMemory(0x0FFFC) | (ReadMemory(0x0FFFD) << 8));

			// configure data port defaults
			port = new LatchedPort();
			port.Direction = 0x00;
			port.Latch = 0xFF;

			// NMI is high on startup (todo: verify)
			pinNMILast = true;
		}
Beispiel #5
0
        public void HardReset()
        {
            // configure CPU defaults
            cpu.Reset();
            cpu.FlagI       = true;
            cpu.BCD_Enabled = true;
            if (ReadMemory != null)
            {
                cpu.PC = (ushort)(ReadMemory(0x0FFFC) | (ReadMemory(0x0FFFD) << 8));
            }

            // configure data port defaults
            port           = new LatchedPort();
            port.Direction = 0x00;
            port.Latch     = 0xFF;

            // NMI is high on startup (todo: verify)
            pinNMILast = true;
        }
Beispiel #6
0
        // ------------------------------------

        public MOS6526(Region region)
        {
            chipRegion      = region;
            enableIntTimer  = new bool[2];
            intTimer        = new bool[2];
            timerDelay      = new int[2];
            timerInMode     = new InMode[2];
            timerOutMode    = new OutMode[2];
            timerPortEnable = new bool[2];
            timerPulse      = new bool[2];
            timerRunMode    = new RunMode[2];
            tod             = new byte[4];
            todAlarm        = new byte[4];
            SetTodIn(chipRegion);

            portA      = new LatchedPort();
            portB      = new LatchedPort();
            timer      = new int[2];
            timerLatch = new int[2];
            timerOn    = new bool[2];
            underflow  = new bool[2];

            pinSP = true;
        }
Beispiel #7
0
        // todStepsNum/todStepsDen is the number of clock cycles it takes the external clock source to advance one cycle
        // (50 or 60 Hz depending on AC frequency in use).
        // By default the CIA assumes 60 Hz and will thus count incorrectly when fed with 50 Hz.
        public MOS6526(int todStepsNum, int todStepsDen)
        {
            this.todStepsNum = todStepsNum;
            this.todStepsDen = todStepsDen;
            enableIntTimer   = new bool[2];
            intTimer         = new bool[2];
            timerDelay       = new int[2];
            timerInMode      = new InMode[2];
            timerOutMode     = new OutMode[2];
            timerPortEnable  = new bool[2];
            timerPulse       = new bool[2];
            timerRunMode     = new RunMode[2];
            tod      = new byte[4];
            todAlarm = new byte[4];

            portA      = new LatchedPort();
            portB      = new LatchedPort();
            timer      = new int[2];
            timerLatch = new int[2];
            timerOn    = new bool[2];
            underflow  = new bool[2];

            pinSP = true;
        }
Beispiel #8
0
		// todStepsNum/todStepsDen is the number of clock cycles it takes the external clock source to advance one cycle
		// (50 or 60 Hz depending on AC frequency in use).
		// By default the CIA assumes 60 Hz and will thus count incorrectly when fed with 50 Hz.
		public MOS6526(int todStepsNum, int todStepsDen)
		{
			this.todStepsNum = todStepsNum;
			this.todStepsDen = todStepsDen;
            enableIntTimer = new bool[2];
			intTimer = new bool[2];
			timerDelay = new int[2];
			timerInMode = new InMode[2];
			timerOutMode = new OutMode[2];
			timerPortEnable = new bool[2];
			timerPulse = new bool[2];
			timerRunMode = new RunMode[2];
			tod = new byte[4];
			todAlarm = new byte[4];

			portA = new LatchedPort();
			portB = new LatchedPort();
			timer = new int[2];
			timerLatch = new int[2];
			timerOn = new bool[2];
			underflow = new bool[2];

			pinSP = true;
		}
Beispiel #9
0
        // ------------------------------------
        public MOS6526(Region region)
        {
            chipRegion = region;
            enableIntTimer = new bool[2];
            intTimer = new bool[2];
            timerDelay = new int[2];
            timerInMode = new InMode[2];
            timerOutMode = new OutMode[2];
            timerPortEnable = new bool[2];
            timerPulse = new bool[2];
            timerRunMode = new RunMode[2];
            tod = new byte[4];
            todAlarm = new byte[4];
            SetTodIn(chipRegion);

            portA = new LatchedPort();
            portB = new LatchedPort();
            timer = new int[2];
            timerLatch = new int[2];
            timerOn = new bool[2];
            underflow = new bool[2];

            pinSP = true;
        }
Beispiel #10
0
		public MOS6526_2(Common.DisplayType region)
		{
			a = new CiaTimer(serialPortA, underFlowA);
			b = new CiaTimer(serialPortB, underFlowB);
			portA = new LatchedPort();
			portB = new LatchedPort();
			switch (region)
			{
				case Common.DisplayType.NTSC:
					tod_period = 14318181 / 140;
					break;
				case Common.DisplayType.PAL:
					tod_period = 17734472 / 180;
					break;
			}
		}