ppsspp_write_range
Write a contiguous byte sequence to PSP memory at a specified address. Use for installing cheat tables, patching code blocks, or seeding memory regions.
Instructions
PURPOSE: Write a contiguous byte sequence to PSP memory starting at the given address. USAGE: Use for installing cheat tables, patching code blocks, or seeding regions. Bytes are sent base64-encoded over the wire. BEHAVIOR: DESTRUCTIVE: overwrites N bytes with no undo. Direct memory write. Returns an error if address+N exceeds valid memory or any byte value is outside 0-255. RETURNS: Single line 'Wrote N bytes → 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. | |
| bytes | Yes | Byte values (each 0-255), written sequentially from `address`. |
Implementation Reference
- src/tools.ts:469-474 (handler)Handler for ppsspp_write_range: converts the 'bytes' array to a Buffer, base64-encodes it, sends a 'memory.write' call to PPSSPP via WebSocket, and returns a confirmation with byte count and address.
case "ppsspp_write_range": { const bytes = Buffer.from(p.bytes as number[]); const base64 = bytes.toString("base64"); await pp.call("memory.write", { address: a(), base64 }); return ok(`Wrote ${bytes.length} bytes → ${addrHex(a())}`); } - src/tools.ts:204-218 (schema)Input schema for ppsspp_write_range: requires 'address' (integer) and 'bytes' (array of integers 0-255, 1-65536 items).
inputSchema: { type: "object", required: ["address", "bytes"], properties: { address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC }, bytes: { type: "array", items: { type: "integer", minimum: 0, maximum: 255 }, minItems: 1, maxItems: 65536, description: "Byte values (each 0-255), written sequentially from `address`.", }, }, additionalProperties: false, }, - src/tools.ts:198-219 (registration)Tool registration entry for ppsspp_write_range in the TOOLS array, defining its name, description (PURPOSE/USAGE/BEHAVIOR/RETURNS), and input schema.
name: "ppsspp_write_range", description: "PURPOSE: Write a contiguous byte sequence to PSP memory starting at the given address. " + "USAGE: Use for installing cheat tables, patching code blocks, or seeding regions. Bytes are sent base64-encoded over the wire. " + "BEHAVIOR: DESTRUCTIVE: overwrites N bytes with no undo. Direct memory write. Returns an error if address+N exceeds valid memory or any byte value is outside 0-255. " + "RETURNS: Single line 'Wrote N bytes → ADDR_HEX'.", inputSchema: { type: "object", required: ["address", "bytes"], properties: { address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC }, bytes: { type: "array", items: { type: "integer", minimum: 0, maximum: 255 }, minItems: 1, maxItems: 65536, description: "Byte values (each 0-255), written sequentially from `address`.", }, }, additionalProperties: false, }, },