ppsspp_write8
Write a single byte value (0-255) to any physical address in PSP memory. Use for cheats, debug pokes, or game-state mutations.
Instructions
PURPOSE: Write an unsigned byte (0-255) to PSP memory at the given physical address. USAGE: Use for single-byte cheats, debug pokes, game-state mutations. For 16/32-bit use ppsspp_write16/write32; for spans use ppsspp_write_range. BEHAVIOR: DESTRUCTIVE: overwrites whatever was at address with no undo. Direct memory write — no hardware mediation. Returns an error if the address is outside valid memory or value > 255. 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 | Byte value (0-255). |
Implementation Reference
- src/tools.ts:146-162 (registration)Tool definition/schema for ppsspp_write8 — declares the tool name, description, input schema (address + value 0-255).
{ name: "ppsspp_write8", description: "PURPOSE: Write an unsigned byte (0-255) to PSP memory at the given physical address. " + "USAGE: Use for single-byte cheats, debug pokes, game-state mutations. For 16/32-bit use ppsspp_write16/write32; for spans use ppsspp_write_range. " + "BEHAVIOR: DESTRUCTIVE: overwrites whatever was at `address` with no undo. Direct memory write — no hardware mediation. Returns an error if the address is outside valid memory or value > 255. " + "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: 255, description: "Byte value (0-255)." }, }, additionalProperties: false, }, }, - src/tools.ts:457-460 (handler)Handler case for ppsspp_write8 — calls PPSSPP's memory.write_u8 with the address and value, then returns a confirmation string.
case "ppsspp_write8": { await pp.call("memory.write_u8", { address: a(), value: p.value }); return ok(`Wrote ${fmtHex(p.value)} → ${addrHex(a())}`); } - src/tools.ts:397-400 (helper)fmtHex helper used by the handler to format the written value as 'DEC (0xHEX)'.
function fmtHex(n: unknown): string { if (typeof n !== "number") return String(n); return `${n} (0x${n.toString(16).toUpperCase()})`; } - src/tools.ts:401-403 (helper)addrHex helper used by the handler to format the address as 0x-padded hex.
function addrHex(n: number): string { return `0x${n.toString(16).toUpperCase().padStart(8, "0")}`; } - src/tools.ts:394-396 (helper)ok helper that wraps a text string into MCP content response format.
function ok(text: string) { return { content: [{ type: "text" as const, text }] }; }