ppsspp_send_analog
Send analog stick input to the PSP emulator for controlling character movement or camera angles. Accepts x and y values from -1 to 1 for precision.
Instructions
PURPOSE: Set the PSP analog stick state (one of left/right; the PSP only has one stick natively but PPSSPP exposes both for forward-compat). USAGE: Drive games that need analog input — character movement, camera control. X and Y are signed in [-1.0, 1.0]; (0, 0) = neutral, (1, 0) = full right, (0, -1) = full up. BEHAVIOR: Modifies emulator analog input. State persists until updated. RETURNS: Single line 'Set analog stick STICK to (X, Y)'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stick | Yes | Which analog stick to update. PSP only has 'left' natively; 'right' is reserved. | |
| x | Yes | Horizontal axis. -1 = full left, 0 = center, 1 = full right. | |
| y | Yes | Vertical axis. -1 = full down, 0 = center, 1 = full up. |
Implementation Reference
- src/tools.ts:260-277 (schema)Tool schema definition for 'ppsspp_send_analog' — declares name, description, inputSchema with required stick/x/y parameters (stick enum left/right, x and y in [-1,1]).
{ name: "ppsspp_send_analog", description: "PURPOSE: Set the PSP analog stick state (one of left/right; the PSP only has one stick natively but PPSSPP exposes both for forward-compat). " + "USAGE: Drive games that need analog input — character movement, camera control. X and Y are signed in [-1.0, 1.0]; (0, 0) = neutral, (1, 0) = full right, (0, -1) = full up. " + "BEHAVIOR: Modifies emulator analog input. State persists until updated. " + "RETURNS: Single line 'Set analog stick STICK to (X, Y)'.", inputSchema: { type: "object", required: ["stick", "x", "y"], properties: { stick: { type: "string", enum: ["left", "right"], description: "Which analog stick to update. PSP only has 'left' natively; 'right' is reserved." }, x: { type: "number", minimum: -1, maximum: 1, description: "Horizontal axis. -1 = full left, 0 = center, 1 = full right." }, y: { type: "number", minimum: -1, maximum: 1, description: "Vertical axis. -1 = full down, 0 = center, 1 = full up." }, }, additionalProperties: false, }, }, - src/tools.ts:486-489 (handler)Handler for 'ppsspp_send_analog' — calls PPSSPP's 'input.analog.send' RPC with the stick/x/y parameters and returns confirmation.
case "ppsspp_send_analog": { await pp.call("input.analog.send", { stick: p.stick, x: p.x, y: p.y }); return ok(`Set analog stick ${p.stick} to (${p.x}, ${p.y})`); } - src/tools.ts:405-412 (registration)Registration of all tools — the TOOLS array (including ppsspp_send_analog) is registered via ListToolsRequestSchema handler, and CallToolRequestSchema routes to the switch-case handler.
export function registerTools(server: Server, pp: PpssppClient): void { server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); server.setRequestHandler(CallToolRequestSchema, async (req) => { const { name, arguments: args = {} } = req.params; const p = args as Record<string, unknown>; const a = () => p.address as number;