Esempio n. 1
0
        public C64()
        {
            MPU  = new PLA(this);
            CPU  = new CPU_6510("C64", MPU);
            SID  = new SID_OpenAL();
            IEC  = new IECBus();
            VIC  = new VIC_II(this);
            CIA  = new CIA(Keyboard);
            CIA2 = new CIA2();

            //Joystick1 = new NoJoystick();
            //Joystick1 = new JoystickKeypad(Keys.W, Keys.S, Keys.A, Keys.D, Keys.LControlKey);
            Joystick2 = new JoystickKeypad(Keys.NumPad8, Keys.NumPad5, Keys.NumPad4, Keys.NumPad6, Keys.ControlKey);
            // Joystick2 = new JoystickKeypad(Keys.Up, Keys.Down, Keys.Left, Keys.Right, Keys.ControlKey);

            CIA.SetJoystick(1, Joystick1);
            CIA.SetJoystick(2, Joystick2);

            Datasette = new DatasetteTAP();
            Floppy    = new C1541();

            // Form f = Floppy.GetControlForm();
            // f.Show();

            Reset();
        }
Esempio n. 2
0
        public void SwapJoysticks()
        {
            C64Joystick j = Joystick1;

            Joystick1 = Joystick2;
            Joystick2 = j;

            CIA.SetJoystick(1, Joystick1);
            CIA.SetJoystick(2, Joystick2);
        }
Esempio n. 3
0
        public override byte Read(int _fullAddress, bool _internal)
        {
            int adr = _fullAddress - BaseAddress;

            adr %= 16;

            switch (adr)
            {
            case 0:
            {
                byte data = 0;

                if (Keyboard != null)
                {
                    data |= Keyboard.ReadCol((byte)(~PRB));
                }

                C64Joystick joy = GetJoystick(2);
                if (joy != null)
                {
                    data |= joy.ReadInput();
                }
                return((byte)(~data));
            }

            case 1:
            {
                byte data = Keyboard.ReadRow((byte)(~PRA));

                C64Joystick joy = GetJoystick(1);
                if (joy != null)
                {
                    data |= joy.ReadInput();
                }

                return((byte)(~data));
            }
            }

            return(base.Read(_fullAddress, _internal));
        }
Esempio n. 4
0
 public void SetJoystick(int _port1or2, C64Joystick _joystick)
 {
     Joystick[_port1or2 - 1] = _joystick;
 }