Coder Social home page Coder Social logo

kodi-game / controller-topology-project Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 15.0 113.12 MB

The Controller Topology Project models how controllers connect to and map to each other for all gaming history

License: Open Data Commons Open Database License v1.0

Python 99.16% Shell 0.84%
hacktoberfest hacktoberfest2021

controller-topology-project's People

Contributors

alwinesch avatar gade01 avatar garbear avatar kodiweblate avatar koprajs avatar lrusak avatar montellese avatar pkerling avatar quihico avatar thadavos avatar weblate avatar zach-morris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

controller-topology-project's Issues

Controllers not working with PSX emulators

Hey there,

For some reason, the PSX controllers are not working for me. When playing a GBA game, I get the GBA feature properly:

DEBUG: Feature [ down ] on game.controller.gba pressed
DEBUG: Feature [ down ] on game.controller.gba released

However, when playing a PlayStation game, the input seems to use Kodi's features (game.controller.default) instead of game.controller.ps:

19:48:04.798 T:140033625409280   DEBUG: Feature [ down ] on game.controller.default pressed
19:48:04.902 T:140033625409280   DEBUG: Feature [ down ] on game.controller.default released

I'm not sure where to look to find the faulty piece of code. The problem seems to happen both with PCSX and Mednafen PSX emulators, and happens with 2 different controllers, so it seems generally linked to game.controller.ps. What part of the code decides which feature to use?

Thanks!

[Feature Request] Default game controller mappings for analog and digital Gameport/MIDI joysticks supported via Necroware GamePort to USB Adapter (open source hardware/firmware project)?

Request you consider adding out-of-the-box default game controller profiles (mappings) to Kodi for the retro analogue and digital "game port" joysticks/gamepads that are supported and been tested with the open-source Necroware GamePort to USB Adapter.

Open-source hardware as featured on Hackaway.io and Adafruit's blog:

image

Necroware GamePort to USB Adapter (as in a game-port DB15 MIDI interface to USB-port converter) is fully open-source hardware. It has extremely low input lag latency and has been tested by the developer on Linux, Mac, Windows 98/XP/10, as well as on Android. All that is needed is Arduino drivers.

The project uses a very simple hardware design in combination with open-source software (C++ firmware for Arduino) for retro Gameport/MIDI analogue and digital joysticks and gamepads (as well as gaming steering wheels). Note! It uses the standard-density 2-row DB-15 / (female / DB15F) connector that is used as a game port for gamepad and joystick connections, not the high-density 3-row connectors used for VGA connections.

Using an open-source firmware written in pure C++ programming language it can be extended to support even more joysticks/gamepads by anyone with the needed programming skills, and as of January 2023 so far it features support for 14 specific popular retro game controllers + an unknown number of rebranded or unbranded retro game controllers and which use the same or generic game controller protocols.

The adapter can easily be a DIY build that you can very easily make yourself on a breadboard, or you can buy either PCB board/kit version or fully prebuilt/preassembled versions online from various resellers and sources, for example; Tindie and eBay.

Examples of resellers of prebuilt/preassembled versions of Necroware GamePort adapter (the USB-C variant recommendedd):

Note! It is not recommended to buy the Mini-USB variant of Arduino Pro Micro as its header is wider than USB-C and Micro-USB variants), and it is not recommended to buy the Micro-USB variant of Arduino Pro Micro as it is too easy to break the connector.

More links and information:

https://twitter.com/necro_ware/

Forum thread -> https://www.vogons.org/viewtopic.php?f=24&t=81547
(also see this other related forum thread about an older competing adapter -> http://descentbb.net/viewtopic.php?t=15526 )

https://github.com/necroware/gameport-adapter/blob/main/README.md

How does it work?

The adapter is built around Arduino Pro Micro development board (though you could alternativly also make a DIY build using Arduino Leonardo), which uses the same ATmega32U4 microcontroller as Leonardo. This microcontroller has built-in USB HID capabilities and can be used to build HID input devices, like joysticks.

The adapter itself is super simple, the main brainwork was invested into the software. Very much simplified, it reads the joystick states and sends the data, via USB, to the computer, which thinks that it is communicating with a USB joystick.

What is special about this one?

There are already plenty of gameport to USB adapters for basic analog joysticks and, as far as I know, there were some efforts to communicate with Sidewinder joysticks by Microsoft as well. But there is no universal adapter, which would work with different types of joysticks. This adapter implements multiple drivers for various analog and digital joysticks, with an option to add more, in the future.

Features overview:

  • Support for generic analog joysticks with 2/4 buttons and 2/4 axes
  • Four switches to select joystick type
  • Autodetection for various digital protocol joysticks
  • Auto-Calibration
  • Very low input lag

What is the difference between analog and digital joystick?

Many people call button-only joysticks or gamepads digital. This is kind of right, because a button is either pressed or not. You can't have an analog values in between. However by digital, in this case, we mean something different. A gameport contains 15 pins, 8 of which are used for joystick communication. 4 pins are for buttons and carry digital values in sense of on/off and 4 pins are for analog axes, which deliver voltage somewhere between 0V and 5V. Joysticks which were made in the early days used this pinout. They could have a maximum of 4 buttons and 4 axes and were DOS compatible. Later, in the time of Windows 95/98 many joysticks were made to be plugged into a gameport as well, but they were not limited to 4 buttons and 4 axes. They had a lot more exciting features, like hat switches and throttle controls. But how did this work? Well the manufacturers implemented their drivers to communicate with the joystick via gameport using a proprietary communication protocol. For example, by using one pin of the gameport as clock and another one as data, the possibilities were almost limitless. Such joysticks are called digital as well, because they used digital protocols to communicate with the PC. And suddenly, many features were possible, but the price of these features was the lost compatibility to DOS. You couldn't just plug such a joystick into the gameport and expect it to work in old DOS games. The plug was the same, but the signaling was completely different.

Which joysticks does this adapter support?

Currently, the following drivers are implemented. To select the right driver, you have to use four switches, as shown in the table. The switches may be changed or extended in the future, so please pay attention to the updates.

Joystick Model Buttons Axes Hat SW1-4 Comments
Generic Analog 2 2 0 0000
Generic Analog 4 2 0 1000
Generic Analog 4 3 0 0100 3rd Axis is throttle
Generic Analog 4 4 0 1100
CH FlightStick 4 4 1 0010 Analog, DOS-compatible
CH F16 Combat Stick 10 3 1 0110 Analog, DOS-compatible
ThrustMaster 4 3 1 1010 Analog, DOS-compatible
Sidewinder GamePad 10 2 0 1110 Digital protocol
Sidewinder 3D Pro 8 4 1 1110 Digital protocol
Sidewinder 3D Pro Plus 9 4 1 1110 First version of Precision Pro
Sidewinder Precision Pro 9 4 1 1110 Digital protocol
Sidewinder FFB Wheel 8 3 0 1110 Digital, FFB not yet implemented
Gravis GamePad Pro 10 2 0 0001 Digital protocol (GrIP)
Logitech WingMan Extreme 6 3 1 1001 Digital protocol (ADI)
Logitech CyberMan 2 8 6 0 1001 Digital proticol (ADI)

Remarks:

  • Please pay attention to how the same switches are used for different families of digital devices. This is possible due to fully digital communication. Using this method, the adapter implements autodetection as soon as it knows, that it is connected to a digital joystick.
  • Currently, only the drivers for the listed Sidewinder devices are implemented, since I have no other models at hand. The Precision Pro works natively on USB as well, but was still implemented, because we can.
  • Gravis used their GrIP protocol, which is currently implemented only for the Gravis GamePad Pro, but without daisy chaining possibility so far.
  • The implementation of the ADI protocol used by Logitech should work with all the devices which support that protocol. However only the listed Logitech devices were tested so far.

Which joysticks were tested?

Many joysticks in the wild are using the same digital protocol or are backwards compatible to the analog joysticks as they were used back in the days in DOS. Following list contains all the devices wich were reported by others as working so far:

  • Gravis Analog Pro (analog)
  • Gravis PC GamePad (analog)
  • Gravis GamePad Pro
  • QuickShot QS-123E "Warrior 5" (analog)
  • QuickShot QS-201 "Super Warrior" (analog)
  • QuickShot QS-203 "Avenger" (analog)
  • Sidewinder GamePad
  • Sidewinder 3D Pro
  • Sidewinder 3D Pro Plus
  • Sidewinder Precision Pro
  • Sidewinder ForceFeedBack Wheel
  • Logitech WingMan Extreme Digital
  • Logitech CyberMan 2
  • InterAct UltraRacer PC (analog)

Sidewinder 3D Pro can be switched between analog and digital mode and in analog mode it can emulate the ThrustMaster and CH FlightStick. That's why you see them in the table above. Unfortunately I don't possess those joysticks in reality, so it may be that the implementation is not quite correct.

[Feature Request] Steam Controller - Game Controller Addon

Requesting a dedicted game controller add-on for the "Steam Controller" from Valve.

https://kodi.tv/addons/matrix/category/controller-profiles

https://github.com/kodi-game/controller-topology-project/tree/master/addons

https://github.com/kodi-game/controller-topology-project/blob/master/Readme-Addons.md

Steam Controller already works via SDL2 driver but still missing a dedicated Game Controller addon.

xbmc/peripheral.joystick#155

For reference, Steam controller driver was also available as an old peripheral addon for Kodi:

https://github.com/kodi-game/peripheral.steamcontroller

Map keyboard keys and joypad buttons for the same controller

I am not even sure if this is the correct place, but I'm trying to use Atari 2600 emulator with an Atari 2600 controller. The problem: the emulator expects controller 1 has its 5 buttons PLUS the console buttons (select, reset, color etc.), but, as expected, the controller has only its 5 buttson (fire, up, down, right and left).

If I try to use keyboard keys to map console's keys, the emulator expects I use the keyboard for all (controller is ignored). If I configure the mapping using the controller, I only get 5 commands, and can't even start the games.

Isn't there a way to have both keyboard for some keys, controller for others, on the same joypad? Or is that a limitation on libretro?

[Feature Request] Default game controller mappings for Hardkernel's ODROID series of handheld gaming consoles (ODROID-Go Ultra, ODROID-Go Super, and ODROID-GO Advance)

Request game controller mappings for Hardkernel's ODROID-Go Ultra and ODROID-Go Super, (maybe also ODROID-GO Advance).

"OGU" and "OGS" (and "OGA") are Hardkernel's popular ARM-based handheld gaming consoles running Linux operating systems.

image

https://www.youtube.com/watch?v=RJmF2mKxgKs&ab_channel=ODROIDHardkernel

OGU, OGS, features same inputs while OGA Rev 1.1 is missing Analog joystick2, and OGA Rev 1.0 is also missing L2/R3 shoulder buttons:

  • ODROID-Go Ultra (OGU) Input Buttons = F1, F2, F3, F4, F5, F6, A, B, X, Y, Direction Pad (D-Pad Up. D-Pad Left, D-Pad Down, D-Pad Right), Left Shoulder (i.e. Left Trigger, a.k.a. L1), Right Shoulder (i.e. Right Trigger, a.k.a. R1), Left Shoulder2 (a.k.a. L2), Right Shoulder2 (a.k.a. R2), Analog joystick, Analog joystick2
  • ODROID-Go Super (OGS) Input Buttons = F1, F2, F3, F4, F5, F6, A, B, X, Y, Direction Pad (D-Pad Up. D-Pad Left, D-Pad Down, D-Pad Right), Left Shoulder (i.e. Left Trigger, a.k.a. L1), Right Shoulder (i.e. Right Trigger, a.k.a. R1), Left Shoulder2 (a.k.a. L2), Right Shoulder2 (a.k.a. R2), Analog joystick, Analog joystick2
  • ODROID-Go Advance (OGA) Revision 1.1 Input Buttons = F1, F2, F3, F4, F5, F6, A, B, X, Y, Direction Pad (D-Pad Up. D-Pad Left, D-Pad Down, D-Pad Right), Left Shoulder (i.e. Left Trigger, a.k.a. L1), Right Shoulder (i.e. Right Trigger, a.k.a. R1), Left Shoulder2 (a.k.a. L2), Right Shoulder2 (a.k.a. R2), Analog joystick
  • ODROID-Go Advance (OGA) Revision 1.0 Input Buttons = F1, F2, F3, F4, F5, F6, A, B, X, Y, Direction Pad (D-Pad Up. D-Pad Left, D-Pad Down, D-Pad Right), Left Shoulder (i.e. Left Trigger, a.k.a. L1), Right Shoulder (i.e. Right Trigger, a.k.a. R1), Analog joystick

They also feature multiple other functions buttons for stuff like; Menu, Speaker Select, Bightness+ and Brightness-, Volume+ and Volume- which could optionally be mapped to game controller stuff like; Quit Emulator, Menu, Select; Start, Save State and Load State when RetroPlayer is running?

Back story: Kodi and its RetroPlayer can technically already run on these based portable game consoles based on ARM(ARM64 (ARMv8) with GPU-accelerated OpenGL ES, but there are currently no default game controller mappings for their input (buttons and joystick). Today the OGU and OGS hardware ship preinstalled with more or less a standard Linux distribution (Ubuntu 20+ OS or Aarch64 ) and come with preconfigured/modified/custom version of EmulationStation (popular multi-emulator front-end GUI application with libretro), however, they also support running Lakka or EmuELEC (which are purposely built "just enough operating system" Linux distros for retro emulation gaming based featuring RetroArch as EmulationStation as front-ends respectively but both those Linux distros were initially on LibreELEC and CoreELEC, both those distributions also feature options to install Kodi).

https://wiki.odroid.com/odroid_go_ultra/

https://wiki.odroid.com/odroid_go_super/

https://wiki.odroid.com/odroid_go_advance/

@garbear FYI, odroid who is the forum site admin who works for Hardkernel have previously said that they are willing to send you and Team Kodi free hardware samples for development and if you are interested then you only contact them with a "brief porting plan" for default input mapping.

https://forum.odroid.com/viewtopic.php?f=187&t=42710&p=329999

PS: Check out this Kodi forum thread for other similar ARM-based handheld gaming consoles running Linux operating systems:

https://forum.kodi.tv/showthread.php?tid=357351

[Feature Request] Mouse and controller mappings for lightgun type game controllers for light gun shooter games?

Could the Controller Topology Project please also map mouse (X pointer) control + buttons from some of the now commonly available modern lightgun game controllers mapped to buttons on classic "light gun" game controllers for retro game emulation?

For reference, check out "Kodi Game" related community forum discussion -> https://forum.kodi.tv/showthread.php?tid=369577

Specifically would love it if you would consider adding peripheral add-ons and default controller profiles (mappings) to the Kodi Game platform for both modern and classic lightguns from the arcades and home video game consoles as well as a few of the newer and today commonly available light guns made-for-PC that use more modern technology which is compatible with LCD/OLED televisions and displays out-of-the-box.

With newer light guns available I am especially referring to the "Nintendo Wiimote" (Wii Remote with Wii Sensor Bar combination), as well as the new "Ultimarc Aimtrak Light Gun" and "Sinden Lightgun" that are both made-for-PC (or DIY arcades).

Some very nostalgic retro light gun accessories that are missing game controller addons with layout mappings are otherwise these; Wii Zapper for Nintendo Wii, NES Zapper, Super Scope (also known as the Nintendo Scope), Sega Light Phaser for Master System, Menacer for Sega Genesis / Sega Mega Drive, Dreamcast Gun for Sega Dreamcast, GunCon (a.k.a. G-Con) series of lightguns by Namco for the PlayStation 1/2/3, Sony PlayStation Move Sharp Shooter, Peacekeeper Revolver for Philips CD-i, Gamegun for 3DO Interactive Multiplayer, and the Atari XG-1, Trojan Light Phazer and Loriciel Phaser (West Phaser) light guns for the Atari ST, Actionware Phazerm and Golem light guns for the Commodore Amiga, as well as Magnum Light Phaser for Amstrad CPC which also had versions for the Sinclair ZX Spectrum, Commodore 64 and Commodore 128.

https://en.wikipedia.org/wiki/Light_gun

image image image image image image image image image image image

With lightguns, it would be possible to play some or all classic Lightgun Shooter games from both game consoles and the arcade.

https://en.wikipedia.org/wiki/Light_gun_shooter

https://en.wikipedia.org/wiki/List_of_gun_games

Lightgun video games have existed since the early 1980s, and today there are many lightgun-compatible games available to us.

Here is a short list of some of the most famous/popular "retro" Lightgun Shooter game classics titles that trigger a lot of nostalgia:

  • Duck Hunt
  • Wild Gunman
  • Hogan's Alley
  • Battle Clash
  • Super Scope 6
  • Yoshi's Safari
  • Resident Evil: The Darkside Chronicles / The Umbrella Chronicles / Dead Aim / Survivor 2 – Code: Veronica
  • Time Crisis 1/2/3
  • House Of The Dead 1/2/3/4/Overkill
  • Virtua Cop 1/2/3
  • Die Hard 2: Die Harder
  • Point Blank 1/2/3 (also known as "Gun Bullet" or "Gunvari", made by Namco)
  • Terminator 2 Arcade
  • Star Wars Trilogy
  • Jurassic Park: Lost World
  • Silent Scope / II / EX
  • Area 51 / Site 4 / Maximum Force Duo
  • The Maze Of The Kings (by Sega)
  • Operation Wolf
  • Lethal Enforcers / II: Gunfighters / 3
  • Big Buck Hunter / II Sportsman's Paradise / Pro / Pro Open Season / Shooter's Challenge
  • Mad Dog McCree / II: The Lost Gold
  • Ranger Mission (Atomisave)
  • Operation Thunderbolt (by Taito)
  • And many many more lightgun games from the arcades.

As you probably know, the Nintendo Wiimote + Wii Sensor Bar combination is a relatively popular hardware choice to achieve an inexpensive wireless lightgun for emulators on PC computers, as a bonus there are loads of different Zapper Gun holder accessories for the Nintendo Wiimote, though it should be noted that Wiimote is not as fast/good as a modern light gun when only combined with a standard Wii Sensor Bar.

https://www.instructables.com/Accurate-Wiimote-Light-Gun-on-Raspberry-PI/

Today there are also multiple other light guns options that were made for, and unlike classic lightguns which only works on CRT monitors these newer lightguns work with modern LCD/OLED displays by using some different technologies:

Check out for example; "Ultimarc Aimtrak Light Gun", "Sinden Lightgun", and "PDP Mars Lightgun" ("PDPMars) lightguns:

image

image

image

Tag a release

Could you please tag a release when you get a chance? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.