Exemple #1
0
        public void Send(Gamepad.GamepadOutput player)
        {
            if (!_isConnected)
            {
                if (_class.MDefine.GcmapiConnect != null)
                {
                    _class.MDefine.GcmapiConnect((ushort)_class.Write.DevId);
                }
                _isConnected = true;
            }

            if (_class.MDefine.GcmapiIsConnected(player.Index - 1) == 1)
            {
                //todo: assign active divice to each player. For now, just assign player number to device, also menu options for multiplayer
                _class.MDefine.GcmapiWrite(player.Index - 1, player.Output);
                //_class.MDefine.GcmapiWrite(_activeIndex, player.Output);

                if (!_class.System.UseRumble)
                {
                    return;
                }

                var report = new Define.GcmapiReport();

                if (_class.MDefine.GcmapiRead(player.Index - 1, ref report) != IntPtr.Zero)
                {
                    GamePad.SetState(player.PlayerIndex, report.Rumble[0], report.Rumble[1]);
                }
            }
            else
            {
                _class.System.Debug("titanone.log", "not connected to " + _activeDevice);
            }
        }
Exemple #2
0
        public void Send()
        {
            //_class.System.Debug("TOCheck.log", _activeDevice + " / " + _listDevices[_activeDevice]);
            if (!_isConnected)
            {
                if (_class.MDefine.GcmapiConnect != null) _class.MDefine.GcmapiConnect((ushort) _class.Write.DevId);
                _isConnected = true;
            }

            if (_class.MDefine.GcmapiIsConnected(_activeDevice) == 1)
            {
                _class.MDefine.GcmapiWrite(_activeDevice, _class.Gamepad.Output);

                if (!_class.System.UseRumble) return;

                var report = new Define.GcmapiReport();

                if (_class.MDefine.GcmapiRead(_activeDevice, ref report) != IntPtr.Zero)
                    GamePad.SetState(PlayerIndex.One, report.Rumble[0], report.Rumble[1]);
            }
            else
            {
                _class.System.Debug("titanone.log", "not connected to " + _activeDevice);
            }
        }
Exemple #3
0
        public void Send(Gamepad.GamepadOutput player)
        {
            if (!_isConnected)
            {
                if (_class.MDefine.GcmapiConnect != null) _class.MDefine.GcmapiConnect((ushort) _class.Write.DevId);
                _isConnected = true;
            }

            if (_class.MDefine.GcmapiIsConnected(player.Index - 1) == 1)
            {
                //todo: assign active divice to each player. For now, just assign player number to device, also menu options for multiplayer
                _class.MDefine.GcmapiWrite(player.Index - 1, player.Output);
                //_class.MDefine.GcmapiWrite(_activeIndex, player.Output);

                if (!_class.System.UseRumble) return;

                var report = new Define.GcmapiReport();

                if (_class.MDefine.GcmapiRead(player.Index - 1, ref report) != IntPtr.Zero)
                {
                    GamePad.SetState(player.PlayerIndex, report.Rumble[0], report.Rumble[1]);
                }
            }
            else
            {
                _class.System.Debug("titanone.log", "not connected to " + _activeDevice);
            }
        }