ppsspp_reset
Reset the loaded PSP game to start fresh from the intro. Clears RAM and returns to game entry point, losing current state.
Instructions
PURPOSE: Reset the loaded PSP game — equivalent to soft-resetting the console. USAGE: Use to start fresh from the game's intro. To return to a specific point, set up a savestate via PPSSPP's UI and load it (savestate API is not in the WebSocket interface, so this must be done via PPSSPP's keybinds — typically F1-F8 for slots). BEHAVIOR: DESTRUCTIVE: RAM contents cleared, CPU returns to game entry point, framecount/game-state lost. The ISO/EBOOT stays loaded. RETURNS: Single line 'Game reset'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:508-511 (handler)Handler for ppsspp_reset: calls PPSSPP's 'game.reset' event via WebSocket and returns 'Game reset'.
case "ppsspp_reset": { await pp.call("game.reset"); return ok("Game reset"); } - src/tools.ts:308-316 (registration)Tool registration for ppsspp_reset in the TOOLS array with description and empty inputSchema.
{ name: "ppsspp_reset", description: "PURPOSE: Reset the loaded PSP game — equivalent to soft-resetting the console. " + "USAGE: Use to start fresh from the game's intro. To return to a specific point, set up a savestate via PPSSPP's UI and load it (savestate API is not in the WebSocket interface, so this must be done via PPSSPP's keybinds — typically F1-F8 for slots). " + "BEHAVIOR: DESTRUCTIVE: RAM contents cleared, CPU returns to game entry point, framecount/game-state lost. The ISO/EBOOT stays loaded. " + "RETURNS: Single line 'Game reset'.", inputSchema: { type: "object", properties: {} }, }, - src/tools.ts:405-412 (registration)registerTools function sets up ListToolsRequestSchema and CallToolRequestSchema handlers on the server.
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; - src/ppsspp.ts:226-260 (helper)PpssppClient.call() method sends a JSON-RPC request with a ticket and waits for a ticketed response from PPSSPP.
async call<T extends Record<string, unknown> = Record<string, unknown>>( event: string, params: Record<string, unknown> = {}, ): Promise<T> { // Auto-(re)connect on demand. PPSSPP can be launched, closed, relaunched // at any point during the MCP server's lifetime; ensureConnected() will // bring the socket back up (or throw a clear error if PPSSPP isn't // reachable). Without this, a single failed connect at MCP boot would // leave every subsequent tool call broken until MCP-client restart. await this.ensureConnected(); return new Promise<T>((resolve, reject) => { const ticket = `t${this.nextTicket++}`; const pending: PendingCmd = { ticket, resolve: (r) => resolve(r as T), reject, }; const timer = setTimeout(() => { this.inflight.delete(ticket); reject(new Error( `PPSSPP call "${event}" timed out (${this.timeoutMs}ms) — ` + `is PPSSPP running with "Allow remote debugger" enabled?`, )); }, this.timeoutMs); const origResolve = pending.resolve, origReject = pending.reject; pending.resolve = (r) => { clearTimeout(timer); origResolve(r); }; pending.reject = (e) => { clearTimeout(timer); origReject(e); }; this.inflight.set(ticket, pending); const msg = JSON.stringify({ event, ticket, ...params }); if (process.env.MCP_PPSSPP_DEBUG) { process.stderr.write(`[trace] TX: ${msg}\n`); } this.ws!.send(msg);