Repository navigation
Native games: rsos-gamepad, the built-in controls as one SDL gamepad - #15
Open
KurdtNervanna wants to merge 3 commits into
Open
KurdtNervanna wants to merge 3 commits into
KurdtNervanna wants to merge 3 commits into
Conversation
…ator The system "native" (Native games, roms/native): one launch script per game (.sh), run by /bin/sh in its own folder and its own process group (host_launch_native), with the display, sound and pads handed over as for a libretro game. HOME on /data (the root is read-only), SDL_VIDEODRIVER kmsdrm, SDL_AUDIODRIVER alsa, RSOS_GAME_DIR, RSOS_LANG; output to game.log. Select+Start held 1 s quits it (SIGTERM to the group, SIGKILL after HANG_KILL_MS); sleep stops the group and turns the backlight off; a power-off sends SIGTERM; the idle power-off waits while it runs (no save state); an error exit is shown. SDL2 (KMS/DRM, GLES2, ALSA) in the RetroStone2 configs. docs/native-games.md; check-frontend 2a-2c (the launch and environment, an error exit, the menu stopping: the group goes too). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check-transfer: sysmap.c lists every system of systems.c. Its alias is "nativegames", not "ports": RetroPie's port scripts start RetroPie's own emulators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The RetroStone2's buttons, shoulder buttons and optional analog stick are three input devices, and many SDL games read one game controller only (SDL does not take the stick for a joystick at all). rsos-gamepad merges them into one standard uinput gamepad, "RetroStoneOS Gamepad": positional buttons, the D-pad as hat 0, the stick as the left stick (centred while not fitted). A game's launch script starts it in the game's process group and gives SDL its mapping (--print-mapping). The kernel gets CONFIG_INPUT_UINPUT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The next feature after #14, as one PR (#11): rsos-gamepad, the RetroStone2's built-in controls as one SDL game controller for native games.
Depends on #14. This branch sits on top of #14's branch, so until #14 is merged the diff also shows its two commits. The change for review is the last commit, 4bd2608.
Why
The built-in controls are three input devices: the buttons, the shoulder buttons and the optional analog stick. Many SDL games read only one game controller, so they see only part of the controls. SDL doesn't take the stick for a joystick at all.
What it adds
rsos-gamepad(board/retrostone2/tools/rsos-gamepad.c, built inpost-build.shwith-Wall -Wextra -Werror) reads the three devices and writes one standard virtual gamepad through uinput, named "RetroStoneOS Gamepad":It doesn't grab the devices, so the menu still sees Select+Start.
A launch script starts it in the game's process group, so the menu stops it with the game. The script gives SDL the mapping and tells SDL to ignore the raw button device:
Kernel:
CONFIG_INPUT_UINPUT=yin the RetroStone2 kernel fragment.Docs:
docs/native-games.mdgets a section on the built-in controls.Tests
-Wall -Wextra -Werror.--print-mappingprints the SDL mapping line.check-defconfigsandcheck-modespass. shellcheck isn't installed here.On hardware
Tested on a RetroStone2 Pro with fork builds 0.1.4.18 to 0.1.5.19, which ship this tool. Two SDL2 games built on a PC from the user's own ROMs use it for all their controls:
Buttons, triggers, D-pad and stick all reach the game. The menu stops the tool together with the game. No game or game data is part of this PR.
🤖 Generated with Claude Code