feat: controller/gamepad support (#350)

Adds `nesgamepad`, basically "diet-coke vimputti" for Nestri's microVM
needs here.

Comes with direct mapping for:
- Sony
  - DualShock 4 (v2), DualSense
- Microsoft
  - Xbox 360 pad, Xbox One S pad
- Nintendo
  - Pro Controller
- Generic pad for unknown controllers

---------

Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kristian Ollikainen
2026-09-27 17:50:02 +03:00
committed by GitHub
co-authored by DatCaptainHorse Claude Opus 5.5
parent 291fabd145
commit 451b495de6
24 changed files with 4528 additions and 41 deletions
+14
View File
@@ -14,6 +14,20 @@
# NTSYNC is a great improvement over fsync and esync approaches.
CONFIG_NTSYNC=y
# ── Controllers ──────────────────────────────────────────
# A controller of a family the box can rebuild is made here as the device
# itself, from the real one's descriptor, through uhid; hid-generic binds to
# it and gives it a hidraw node. That node is what Proton reads a controller through
# when it wants the device rather than a gamepad abstraction of it, and it is
# the only way a game that parses a controller's own reports -- to tell a
# DualShock from an Xbox pad, say, and show the right buttons -- can work.
#
# Two generic switches and no vendor drivers, on purpose: games read the
# hidraw node, not whatever a vendor driver would have made of the device, so
# no controller family needs a switch of its own. HID_GENERIC is already on.
CONFIG_UHID=y
CONFIG_HIDRAW=y
# ── Timers ───────────────────────────────────────────────
# The one that cost a day of silent audio. The guest has no sound hardware, so
# PipeWire drives its whole graph off a timerfd at a 2.67ms cycle, which a