ppsspp_write32
Write an unsigned 32-bit little-endian value to PSP memory for cheats, timestamps, large counters, or pointers. Overwrites four bytes without undo.
Instructions
PURPOSE: Write an unsigned 32-bit little-endian value to PSP memory. USAGE: Use for 32-bit cheats and pokes — timestamps, large counters, pointers. For 8/16-bit use ppsspp_write8/write16; for spans use ppsspp_write_range. BEHAVIOR: DESTRUCTIVE: overwrites four bytes with no undo. PSP is little-endian. Returns an error if address+4 exceeds valid memory or value > 4294967295. RETURNS: Single line 'Wrote VAL → ADDR_HEX'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | PSP physical address. PSP memory layout: user RAM starts at 0x08800000 (or 0x08000000 — varies by firmware allocation), kernel RAM at 0x08000000-0x087FFFFF, VRAM at 0x04000000-0x041FFFFF, scratchpad at 0x00010000-0x00013FFF, hardware regs at 0xBC000000+. Most game state lives in user RAM. Note PPSSPP may also accept 0x88xxxxxx kernel-mode mirrors of the same physical memory. | |
| value | Yes | 32-bit value (0-4294967295). |
Implementation Reference
- src/tools.ts:180-196 (schema)Tool definition schema for ppsspp_write32. Defines required parameters: address (unsigned integer) and value (0-4294967295). Part of the TOOLS array.
{ name: "ppsspp_write32", description: "PURPOSE: Write an unsigned 32-bit little-endian value to PSP memory. " + "USAGE: Use for 32-bit cheats and pokes — timestamps, large counters, pointers. For 8/16-bit use ppsspp_write8/write16; for spans use ppsspp_write_range. " + "BEHAVIOR: DESTRUCTIVE: overwrites four bytes with no undo. PSP is little-endian. Returns an error if address+4 exceeds valid memory or value > 4294967295. " + "RETURNS: Single line 'Wrote VAL → ADDR_HEX'.", inputSchema: { type: "object", required: ["address", "value"], properties: { address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC }, value: { type: "integer", minimum: 0, maximum: 4294967295, description: "32-bit value (0-4294967295)." }, }, additionalProperties: false, }, }, - src/tools.ts:465-468 (handler)Handler for ppsspp_write32. Calls PPSSPP's memory.write_u32 via the WebSocket client with the address and value, then returns success text 'Wrote VAL → ADDR_HEX'.
case "ppsspp_write32": { await pp.call("memory.write_u32", { address: a(), value: p.value }); return ok(`Wrote ${fmtHex(p.value)} → ${addrHex(a())}`); } - src/tools.ts:405-406 (registration)Registration function that registers all tools (including ppsspp_write32) from the TOOLS array via ListToolsRequestSchema, and handles dispatch via CallToolRequestSchema using a switch statement.
export function registerTools(server: Server, pp: PpssppClient): void { server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); - src/tools.ts:394-396 (helper)Helper function that formats success responses as text content blocks.
function ok(text: string) { return { content: [{ type: "text" as const, text }] }; } - src/tools.ts:397-403 (helper)Helper functions: addrHex formats an address as 0x-prefixed 8-digit hex; fmtHex formats a number as decimal + hex.
function fmtHex(n: unknown): string { if (typeof n !== "number") return String(n); return `${n} (0x${n.toString(16).toUpperCase()})`; } function addrHex(n: number): string { return `0x${n.toString(16).toUpperCase().padStart(8, "0")}`; }