ppsspp_query
Query PSP emulator state: game status, CPU registers, backtrace, threads, modules, and HLE function tracking via session-based actions.
Instructions
PURPOSE: Aggregate game-state queries — game_state, registers (all or one), backtrace, threads, modules, and function-list management (funcs/func_scan/func_add/func_remove).
USAGE: action + session_id; 'register' needs name; func_scan/func_remove need address; top_n defaults to 100 (pass 0 for the full list — hle.func.list can reach 700+KB).
BEHAVIOR: READ-ONLY. Lookups only — func_add/func_remove mutate the debugger function list. backtrace/threads/func_* REQUIRE the CPU paused (pause first, or use get_pc); RUNNING-state PC/isCurrent is LOW trust.
RETURNS: {action, data, trust_level} — data shape depends on the action.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Function name (func_add only; ignored by func_remove because PPSSPP's hle.func.remove protocol does not accept a name parameter). | |
| top_n | No | Limit the number of entries returned for 'funcs' / 'func_scan' actions (default 100). 0 = no limit — hle.func.list can reach 700+KB, pass 0 only when the full list is genuinely needed. | |
| action | Yes | Query action. Valid values: - 'game_state': PPSSPP game status (paused / game title). - 'registers': all CPU registers (GPR + FPU + VFPU). - 'register': single register by name (MIPS ABI name like 'a0'/'v0'/'t9', or 'pc'/'hi'/'lo'). - 'backtrace': HLE call stack (thread optional). - 'threads': PSP thread list (safe: stepping → query → resume). - 'modules': list all loaded HLE modules. - 'funcs': list registered HLE function tracking entries. - 'func_scan': scan HLE functions in a 64KB range starting at address (requires address; CPU must be stepping). - 'func_add': add HLE function tracking (name? and/or address?). - 'func_remove': remove HLE function tracking (address required; PPSSPP protocol only accepts address, no name). | |
| thread | No | Thread ID (backtrace action only; None = current). | |
| address | No | Function address as a hex string (e.g. '0x08804000'). Required for func_remove and func_scan. | 0x0 |
| session_id | Yes | Active session ID. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Raw result payload. | |
| text | Yes | Unified text representation. Populated for action='registers' with grouped '── GPR ──' / '── FPU ──' / '── VFPU ──' headers and ' name = 0xVAL' lines. Empty for other actions (use the structured `data` field). | |
| action | Yes | 'game_state' / 'registers' / 'backtrace' / 'threads' / 'modules' / 'funcs' / 'func_scan' / 'func_add' / 'func_remove'. | |
| trust_level | Yes | Trust annotation (threads + pc only). Lowercase enum value: 'high' (stepping-verified) / 'medium' / 'low'. |