1
0
Fork
You've already forked embedded-game-controller
0
Game controller library for embedded devices
  • C 96.1%
  • Assembly 2.2%
  • CMake 1.7%
Find a file
2026年07月12日 11:28:48 -04:00
.github/workflows Port to libogc2 2026年07月12日 11:28:48 -04:00
cios-lib embedded-game-controller: new public and driver API 2025年05月26日 17:33:46 +03:00
embedded-game-controller Port to libogc2 2026年07月12日 11:28:48 -04:00
example Port to libogc2 2026年07月12日 11:28:48 -04:00
scripts CI: add a step for checking code formatting 2025年05月28日 10:48:13 +09:00
.clang-format style: update clang-format 2026年04月06日 23:02:40 +03:00
.clang-format-ignore CI: add a step for checking code formatting 2025年05月28日 10:48:13 +09:00
.gitignore Add GitHub workflow CI 2023年10月20日 12:14:22 +02:00
.gitmodules build: do not use bt-embedded as a submodule 2026年05月07日 23:38:15 +03:00
AGENTS.md Create AGENTS.md 2026年05月29日 23:58:36 +03:00
CMakeLists.txt build: don't pass debug/release flags to cmake 2026年06月05日 23:10:36 +03:00
CMakePresets.json Add CMakePresets.json 2023年10月21日 12:07:24 +02:00
embedded-game-controller.pc.in build: install library 2026年04月20日 18:33:20 +03:00
LICENSE Change license to MIT 2026年05月08日 17:52:40 +03:00
README.md README: add Nintendo Wii instructions 2025年08月23日 09:35:11 +03:00

Embedded Game Controller library

A static library for embedded devices to interact with Game Controllers over USB (and, in the future, bluetooth). When Embedded Game Controller is too long to write, you are welcome to use the EGC acronym.

Features

Supported USB game controllers

Device Name Vendor Name Vendor ID Product ID
PlayStation 3 Controller Sony Corp. 054c 0268
DualShock 4 [CUH-ZCT1x] Sony Corp. 054c 05c4
DualShock 4 [CUH-ZCT2x] Sony Corp. 054c 09cc
Generic PC controller Dragonrise 0079 0006
  • DS3 and DS4 support includes LEDs, rumble, and the accelerometer
  • DS4's touchpad is used to emulate the Wiimote IR Camera pointer
  • Both controllers emulate a Wiimote with the Nunchuk and Classic Controller extensions connected. Press L1+L3 to switch between them
  • Three IR pointer emulation modes: direct (touchpad, only for DS4), analog axis relative (move the pointer with the right analog) and analog axis absolute (the pointer is moved proportionally to the right analog starting from the center). Press R1+R3 to switch between them

Supported target platforms

EGC can be built on the following platforms:

  • Nintendo Wii
  • Nintendo Wii's Starlet processor (cIOS)
  • Linux with libusb

Compilation

Nintendo Wii

1) Install devkitPPC
  • Download and install devkitPPC
  • Make sure to install the devkitppc-cmake package when using pacman
3) Build libembedded-game-controller.a
  1. mkdir build && cd build
  2. Configure it with CMake: cmake CMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/Wii.cmake" -DBUILD_EXAMPLE=ON ..
  3. make (or ninja if configured with -G Ninja)
  4. libembedded-game-controller.a will be generated

I recommend passing -DCMAKE_COLOR_DIAGNOSTICS:BOOL=TRUE, especially when using Ninja.

For the Wii's Starlet processor

1) Install devkitARM
  • Download and install devkitARM
  • Make sure to install the devkitarm-cmake package when using pacman
3) Build libembedded-game-controller.a
  1. mkdir build && cd build
  2. Configure it with CMake. Two options:
    a. arm-none-eabi-cmake ..
    b. cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$DEVKITPRO/cmake/devkitARM.cmake ..
  3. make (or ninja if configured with -G Ninja)
  4. libembedded-game-controller.a will be generated

I recommend passing -DCMAKE_COLOR_DIAGNOSTICS:BOOL=TRUE, especially when using Ninja.

Credits