Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generates a drop-in ps2_pad.cpp for PS2Recomp that maps any raylib-visible controller, keyboard or touch to DualShock 2 input.
23% 95%+73 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 5 of 22 without it.
3 of 3 safety checks passed
Not used yet
The recompiled game asks the runtime for the pad state many times a second through
PSPadBackend::readState(int port, int slot, uint8_t *data, size_t size) in
ps2xRuntime/src/lib/ps2_pad.cpp. The stock file maps raylib's gamepad 0 and a fixed keyboard
layout onto the 32-byte DualShock 2 report. This skill replaces that one file with a generated one
built from your console/controls.json, so any controller raylib can see becomes a DualShock 2,
mapped your way. Nothing else in the runtime changes, so the rebuild is incremental.
Honest limits: rumble is not wired in the runtime, pressure-sensitive buttons are reported as fully pressed or not pressed, and touch zones on Android are invisible (the runtime draws no overlay).
${CLAUDE_SKILL_DIR} below is this skill's folder (where this SKILL.md lives).
python3 "${CLAUDE_SKILL_DIR}/padmap.py" init --layout xbox # writes console/controls.json
python3 "${CLAUDE_SKILL_DIR}/padmap.py" check # every DS2 button bound, no clashes
python3 "${CLAUDE_SKILL_DIR}/padmap.py" gen --replay # writes console/ps2_pad.cpp
python3 "${CLAUDE_SKILL_DIR}/padmap.py" install --repo ~/PS2Recomp # backs up, then copies it in
python3 "${CLAUDE_SKILL_DIR}/padmap.py" restore --repo ~/PS2Recomp # puts the stock file back
python3 "${CLAUDE_SKILL_DIR}/padmap.py" presets switch-labels # playstation xbox switch switch-labels keyboard
python3 "${CLAUDE_SKILL_DIR}/padmap.py" table # the DS2 bit table
python3 "${CLAUDE_SKILL_DIR}/padmap.py" check --script console/inputs/menu.txt # validate a replay script
Flags: --config FILE (default console/controls.json; the preset alone is used if it is missing),
--layout NAME, --out FILE (- for stdout), --json, --strict (warnings fail check),
--backups DIR (default console/backups). Exit codes: 0 ok, 1 check found a problem, 2 bad input.
| file | what |
|---|---|
console/controls.json | your mapping: layout + overrides. Full format: reference/controls-json.md |
console/ps2_pad.cpp | the generated drop-in pad file (from gen) |
<PS2Recomp>/ps2xRuntime/src/lib/ps2_pad.cpp | replaced by install, only when you pass --repo |
console/backups/ps2_pad.cpp.orig | the stock file, saved once and never overwritten; later installs also keep a timestamped copy |
templates/menu-walk.txt | an example input replay script to copy and edit |
Next to this one in the catalogue, plus more from the same author.