/console-skill:console-controller init|check|gen|install|restore|presets|table [flags]from console-skill
Maps any controller (DualSense, Xbox, Switch Pro, keyboard, touch) to a DualShock 2 report for PS2Recomp. Reads a configurable mapping from console/controls.json and generates a drop-in replacement for ps2_pad.cpp.
Ships in console-skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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 |
data[0] = 0x01, data[1] = 0x73 (analog), buttons ACTIVE-LOW in data[2] (low byte) and
data[3] (high byte), so 0xFFFF means nothing pressed. Sticks: data[4] RX, data[5] RY,
data[6] LX, data[7] LY, 0x80 centre, 0x00 full left or up. Bits: SELECT 0x0001, L3 0x0002,
R3 0x0004, START 0x0008, UP 0x0010, RIGHT 0x0020, DOWN 0x0040, LEFT 0x0080, L2 0x0100, R2 0x0200,
L1 0x0400, R1 0x0800, TRIANGLE 0x1000, CIRCLE 0x2000, CROSS 0x4000, SQUARE 0x8000.
Kernel/Stubs/Pad.cpp copies bytes 2 to 7 into the game's pad buffer, sets the mode byte itself
(digital 0x41 until the game switches the pad to analog) and fills the pressure bytes as 0xFF or 0.
init --layout playstation|xbox|switch|switch-labels|keyboard.
raylib reports pads by POSITION: the bottom face button is Cross on every pad (Xbox A, Nintendo
B). switch-labels matches Nintendo's printed letters instead (A, on the right, is Cross).
Details and why some Switch Pro setups arrive already swapped: reference/controllers.md.controls.json: buttons overrides, keyboard keys,
deadzone (radial, default 0.15), invert_y (true means the right stick, the camera in most
games), stick_swap, trigger_threshold (reads L2/R2 from the analog trigger axes), players: 2
(port 2 gets the second pad), touch zones for Android. Keep it a mapping, never game code.padmap.py check. Fix every ERROR. Read the warnings out: Escape quits the game
(raylib's default exit key; the runtime never changes it) and F1 opens the debug panel on
desktop builds with the debug UI.padmap.py gen (add --replay when /console-tester will drive scripted runs).padmap.py install --repo <their PS2Recomp checkout> backs the stock file up to
console/backups/ps2_pad.cpp.orig and copies the new one in. Then the normal incremental build
(cmake --build <build dir>, the same command recorded in console/STATE.md). One .cpp
changes and no header does, so it is quick. Never clean the build for this.controls.json, gen, install, rebuild. Log the result in console/STATE.md.--replay): set PS2X_INPUT_RECORD=console/inputs/run1.txt,
play the bit you want to repeat, quit; that file replays with PS2X_INPUT_SCRIPT (which
/console-tester's run.py --input sets for you). The format is in
reference/controls-json.md. Frame numbers count the game's reads of
pad port 0, so a script stays in step with the game, not with the wall clock.| feature | status in this PS2Recomp checkout |
|---|---|
| Rumble | not wired: scePadSetActDirect and scePadSetActAlign in Kernel/Stubs/Pad.cpp return 1 and do nothing (scePadInfoAct reports two motors). Adding it is runtime C++ work for /console-backend, not a mapping |
| Pressure-sensitive buttons | digital: when a game turns pressure mode on, Pad.cpp reports 0xFF for a pressed button and 0 otherwise |
| Analog mode | the game switches it (scePadSetMainMode); sticks are always sent and the game ignores them in digital mode |
| Touch (Android) | ps2_android_runtime.cpp is only a TODO for an on-screen overlay, so the stock port has no touch controls. touch zones work as invisible areas; a Bluetooth controller is the better answer |
| Two players | the stock file feeds the same pad to both ports; the generated one gives port 2 its own pad with players: 2, or a released pad otherwise |
runner/*.cpp stay on your machine. A controls.json, a generated ps2_pad.cpp and replay
scripts you wrote are yours to share.install refuses a source it did not generate, never
overwrites the .orig backup, and touches only the checkout you name. Never edit headers
(ps2_pad.h included: a header change rebuilds every generated file) and never clean the build./console-tester to run the port with a replay script (run.py boot --input ...)./console-anywhere to build for the device the controller is for (Steam Deck, Android, Vita)./console-backend if the game needs rumble or a pad call the runtime does not implement yet.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
controller-mapping, ps2-recomp, input-remapping, gamepad, dual-shock-2
npx claudepluginhub jakeschincariol/console-skill --plugin console-skill11 skills in this plugin
/console-anywherePlay Anywhere. Builds the port for Windows, Mac, Linux, Steam Deck, Android and PS Vita and packages it without any game files inside. doctor checks this machine's tools for a target and prints the exact install command for anything missing; plan prints the build steps taken from PS2Recomp's own README, android/README.md and vita scripts; package makes a player folder in console/dist/ (the runner, its libraries, an empty game/ folder, PLAYERS.md, a launch script, .recomp.json) and refuses outright if a disc image, PS2 ELF, IRX module, recompiled runner source or other game data is inside; guard runs that check on any folder; recomp-json writes the project's optional .recomp.json. Use when the user says "put it on my Steam Deck", "build it for Android", "play it on my phone", "on my TV", "Vita build", "Mac build", "package it", "make a release folder", "is it safe to zip this", or after the port plays on the machine it was built on./console-backendBackend Engineer. Builds the engine room the recompiled game runs on: syscalls, kernel stubs, file and disc I/O, the IOP. Reads PS2Recomp runtime logs and turns every "Unimplemented PS2 stub", "[Syscall TODO]", missing function, unhandled IOP RPC, failed disc read and untranslated instruction into a ranked fix list: count, first PC and RA, and the exact fix tool (a TOML binding, the runtime .cpp file to implement it in, an entry point and a recompile, or a game override). With the user's PS2Recomp checkout it reads the real handler names and syscall numbers. Writes nothing into the checkout; prints a table for console/STATE.md. Use when the user says "unimplemented stub", "syscall TODO", "it crashes at boot", "fix the backend", "it can't find a file", "the IOP", "what is syscall 0x3C", or after /console-tester reports a stop./console-graphicsGraphics Artist. Rebuilds the graphics: dumps every texture, lets you repaint or replace them with your own art, finds the widescreen fix. Converts PS2 TIM2 textures (.tm2, 32/24/16-bit and 8/4-bit indexed) from the user's own extracted disc to PNG, rebuilds them from edited PNGs at the same size and format (GS registers kept, palettes refit or quantised), finds TIM2 blobs inside archives and puts edited ones back, and lists the 4:3 aspect and FOV constants in the ELF with 16:9 pnach lines to try in PCSX2. Reads the packets the game sends the GS from a RAM dump (DMA chains, VIF codes, GIF tags, every register write) and flags what breaks rendering. Writes to console/textures/ and console/patches/, never into the disc image. Use when the user says "dump the textures", "repaint", "replace this texture", "my own art", "HD textures", "make it widescreen", "16:9", "the picture is stretched", "black screen", "garbage textures", "nothing draws", or "how does the port draw"./console-levelsLevel Designer. Maps the disc's data files, unpacks the archives the levels live in, and swaps in your edits. Inventories an extracted PS2 disc (size, type by magic, entropy, a table-of-contents guess with a confidence score), unpacks CRI AFS archives and detected table-of-contents archives into a folder with an index.json, repacks them in the same order and alignment (keeping every offset when your edits fit), diffs two files or folders to show which bytes a change touched, lists strings, and reads the port's log to show which disc files a level loads. Writes under console/ and never modifies the original disc files. Use when the user says "where are the levels", "unpack this archive", "what's in DATA.BIN", "edit the level", "swap in my map", "what changed between these two files", "which files does stage 3 load", or before /console-graphics or /console-sound needs a file that sits inside an archive./console-modMod Maker. Describe any change in plain English and Claude builds it into the game: patches, cheats, new behaviour, as code that never touches the original files. Ports PCSX2 .pnach patches to the PS2Recomp port (code writes become ps2_recomp TOML instruction patches, data writes become a C++ game override that writes RDRAM at load or every frame, the rest are flagged for a manual port with the reason) and scaffolds game overrides that bind, replace or wrap a game function with the real PS2Recomp API. Writes to console/patches/, never to the game's files, the generated runner/*.cpp or headers. Use when the user says "mod this game", "add a cheat", "infinite health", "port this pnach", "make my gun do X", "change how X works", "game override", "turn this PCSX2 patch into the port", or once the port boots and they want to change it./console-physicsPhysics Tuner. Finds the numbers that decide how the game moves (speed, gravity, grip, jump height, frame rate) and tunes them. Scans the user's own game ELF for a float32 value stored in data or built in code (lui, ori or addiu, then mtc1), shows the instructions that read it, lists frame-timing candidates, and prints the exact pnach lines to test a new value in PCSX2 plus the PS2Recomp fix (TOML instruction patches or the data write /console-mod bakes in). Reads only; writes nothing. Use when the user says "make the car faster", "lower the gravity", "jump higher", "more grip", "change the damage", "wider camera", "unlock 60 fps", "find the speed value", or when /console-mod needs a number found.Other plugins' skills for the same job