/console-skill:console-physics scan <ELF> --value N | fps <ELF> | patch <ELF> --addr 0x.. --float Nfrom console-skill
Scans PS2 game ELF files to find and tune float32 physics constants (speed, gravity, jump height, frame rate). Reads data words and lui/ori/mtc1 code patterns, prints pnach lines for PCSX2 and TOML patches for PS2Recomp.
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 Physics Tuner finds the constants behind how a game feels and changes
them. PS2 games do their physics in single-precision floats (the EE's FPU has
no doubles), so a top speed, a gravity or a jump impulse is a 32-bit float
somewhere: in the ELF's data, or built straight into the code by two
instructions. The tool finds the candidates; PCSX2 tells you which one is the
real one; /console-mod builds the winner into the port.
Honest limits: a value the game computes while it runs (from a car's stats file, a level script, a menu setting) is not in the ELF. Then you find it in RAM while playing and change the code or the file that sets it. Units are rarely obvious: 9.8 may be stored as 980, 0.163 (per frame) or 588 (per second squared at 60 fps). And frame-rate unlocks are often more than one number.
${CLAUDE_SKILL_DIR} below is this skill's folder (where this SKILL.md lives).
python3 "${CLAUDE_SKILL_DIR}/tune.py" scan SLUS_203.12 --value 9.8 # data floats + lui/ori/mtc1 constants
python3 "${CLAUDE_SKILL_DIR}/tune.py" scan SLUS_203.12 --value 9.8 --tol 0.05 # a wider net
python3 "${CLAUDE_SKILL_DIR}/tune.py" fps SLUS_203.12 # 1/60, 1/30, 60, 30, PAL 50/25
python3 "${CLAUDE_SKILL_DIR}/tune.py" patch SLUS_203.12 --addr 0x0034A2C0 --float 12.5
Flags: --json on all three, --limit N, --place 0|1|2 (pnach place; the
default is 0 for data, 1 for code), --exact (refuse rather than round when a
lone lui cannot hold the new value).
| file | what |
|---|---|
| the game's main ELF | read only: data words, code, sections, $gp |
| stdout | hits, the instructions around them, pnach lines, TOML blocks, the override write |
| nothing else | the user (or /console-mod) puts the lines where they belong |
| form | looks like | scan reports | patch prints |
|---|---|---|---|
a word in data (.data, .rodata, .lit4, .sdata) | 0x411CCCCD = 9.8 | DATA, plus the lwc1/lw that read it (through lui or $gp) | one pnach line and the override write /console-mod bakes in at load |
| built in code | lui $v0, 0x411C + ori $v0, $v0, 0xCCCD + mtc1 $v0, $f12 | CODE with the instructions around it | two pnach lines (new lui and ori words) and two TOML instruction patches |
lui + addiu | the low half is sign-extended | CODE | the high half is adjusted for the carry |
a lone lui | values with a zero low half (1.0, 0.5, 12.5, 60.0) | CODE | one word; a value needing a low half is rounded to the nearest one it can hold (said plainly, exit 1) |
| set at run time | zero-filled BSS, heap | nothing in the ELF | a place 1 pnach line and the /console-mod frame-hook route |
Float encodings, unit tricks and the Ghidra and PCSX2 steps are in reference/float-hunting.md.
tune.py scan <ELF> --value N. Too many hits: narrow by section
(physics constants live in .rodata/.lit4 or in code next to mtc1),
by the readers (one lwc1 in a function Ghidra calls UpdateCar beats 40
readers), or by a second related value nearby. None: widen --tol, try
other units, or go to step 3./console-reverse) ask for the function's xrefs and decompile it.tune.py patch <ELF> --addr ... --float ...
prints the pnach lines. Put them in the game's pnach (/console-mod
pnach.py crc names the file), enable, play. One value at a time, write
down what changed./console-mod: code constants go in the game's TOML
(patch prints the [[patches.instructions]] blocks; re-run ps2_recomp),
data constants go in a game override (pnach.py override on the pnach, or
paste the printed Ps2FastWrite32 line into an override.py module)./console-tester, then play the part of the game it
touches. A shared constant (patch warns when several instructions read
it) changes everything that reads it.| feel | look for | note |
|---|---|---|
| top speed, acceleration | the max-speed clamp and the per-frame add | often per frame: divide km/h by the frame rate |
| gravity, jump height | a negative per-frame velocity add, the jump impulse | jump height grows with the square of the impulse |
| grip, friction | a multiplier just under 1.0 (0.95, 0.98) applied every frame | small changes are large |
| damage | integers more often than floats: find them in RAM, see /console-mod | tables live in data |
| camera FOV | a float near 0.75 to 1.3, or a focal length near 1.0 to 2.0 | /console-graphics widescreen.py scans the aspect ones |
| frame rate | tune.py fps; the vsync wait count in the main loop | read the caveat below |
Frame rate, plainly: fps lists candidates, not answers. Many games pace
frames with a vsync count (wait 2 vsyncs for 30 fps), an integer the scan
cannot see. A 60 fps unlock also needs the game's logic to scale by the frame
time: if movement, physics or animation are counted per frame, doubling the
frame rate doubles the game speed. Test in PCSX2 first.
runner/*.cpp./console-mod to bake a tested value into the port (TOML or override)./console-graphics for camera aspect and widescreen./console-tester to playtest the change and check nothing else broke.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ps2, elf-analysis, physics-tuning, pcsx2, ps2recomp, game-hacking
11 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.npx claudepluginhub jakeschincariol/console-skill --plugin console-skillOther plugins' skills for the same job