Skip to main content
Glama
dmang-dev

mcp-dolphin

dolphin_write32

Write a 32-bit big-endian value to PowerPC memory at a specified absolute address. Used for modifying game state and cheats in GameCube/Wii games.

Instructions

PURPOSE: Write an unsigned 32-bit big-endian value to PowerPC memory at the given absolute address. USAGE: The workhorse for cheats — most game state is 32-bit. For 8/16-bit values use dolphin_write8/write16; for true 64-bit fields use dolphin_write64 (atomic, vs two non-atomic write32s). For floats, reinterpret the IEEE-754 bits as an integer first. BEHAVIOR: DESTRUCTIVE: overwrites four bytes with no undo. Address MUST be 4-byte aligned. Writes to read-only regions are silently dropped.

GameCube + Wii main address space landmarks (PowerPC, big-endian): 0x80000000-0x817FFFFF MEM1 main RAM (24 MiB) — GameCube + Wii game code & data GameCube games stay entirely within MEM1. Wii games use MEM1 for code and frequently-accessed data. 0x80000020 OS_GLOBALS — game-info struct (disc ID, FST, etc.) 0x80000034 OS_ARENA_LO (start of free MEM1 heap) 0x80003100 OS_REPORT (developer-console mirror, varies by SDK) 0x90000000-0x93FFFFFF MEM2 (64 MiB) — Wii ONLY. Larger texture/asset data, IOS work areas. Reading MEM2 on a GameCube game returns garbage / FAIL. 0xCC000000-0xCC00FFFF Hollywood I/O (Wii) / Flipper I/O (GameCube) — DMA, GPU FIFO, AI, EXI registers. Reads are usually safe, writes can wedge the emulator. Avoid. 0xCD000000-0xCD007FFF Wii-only Hollywood registers.

Notes: • All multi-byte values are BIG-ENDIAN on the real hardware. Felk's memory.read_u*/write_u* helpers handle the byte swap for you — the value you see is the value the game sees as a u32. • Addresses are 32-bit; Felk truncates the high bits of any u64 address argument. • Pointers in MEM1 are often stored as 4-byte addresses with the high bit set (e.g. 0x81234567). Dereferencing them requires no masking — pass the raw value back into memory.read_*.

RETURNS: 'Wrote VAL_DEC (0xVAL_HEX) → ADDR_HEX'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesAbsolute PowerPC virtual address (0x80000000-0x9FFFFFFF). Pass as a number; hex literals like 0x80001000 are fine. Reads 4 consecutive bytes starting here and interprets them as a big-endian value. MUST be 4-byte aligned (address % 4 === 0). PowerPC raises an alignment exception on misaligned access in hardware, but Dolphin's emulated bus is forgiving and silently returns the aligned-down word — i.e. you get the bytes from address & ~3, not what you asked for. For unaligned multi-byte reads use dolphin_read_range and assemble client-side. Useful ranges: 0x80000000-0x817FFFFF for MEM1 (GC + Wii), 0x90000000-0x93FFFFFF for MEM2 (Wii only).
valueYes32-bit value (0-4294967295 / 0x00000000-0xFFFFFFFF). For signed, encode as two's complement. For floats, reinterpret the IEEE-754 bits as an integer first.

Implementation Reference

  • Tool definition (name, description, inputSchema) for dolphin_write32 — declares the tool with address (integer, 4-byte aligned) and value (unsigned 32-bit integer 0-4294967295).
      name: "dolphin_write32",
      description:
        "PURPOSE: Write an unsigned 32-bit big-endian value to PowerPC memory at the given absolute address. " +
        "USAGE: The workhorse for cheats — most game state is 32-bit. For 8/16-bit values use dolphin_write8/write16; for true 64-bit fields use dolphin_write64 (atomic, vs two non-atomic write32s). For floats, reinterpret the IEEE-754 bits as an integer first. " +
        "BEHAVIOR: DESTRUCTIVE: overwrites four bytes with no undo. Address MUST be 4-byte aligned. Writes to read-only regions are silently dropped.\n\n" +
        GC_WII_MEMORY_MAP + "\n\n" +
        "RETURNS: 'Wrote VAL_DEC (0xVAL_HEX) → ADDR_HEX'.",
      inputSchema: {
        type: "object",
        required: ["address", "value"],
        properties: {
          address: { type: "integer", minimum: 0, description: addrParamDesc(4) },
          value: {
            type: "integer",
            minimum: 0,
            maximum: 4294967295,
            description: "32-bit value (0-4294967295 / 0x00000000-0xFFFFFFFF). For signed, encode as two's complement. For floats, reinterpret the IEEE-754 bits as an integer first.",
          },
        },
        additionalProperties: false,
      },
    },
  • Handler for dolphin_write32 — calls Dolphin bridge method 'memory.write_u32' with the address and value, returns success message with formatted hex.
    case "dolphin_write32": {
      await dol.call("memory.write_u32", [a(), p.value as number]);
      return ok(`Wrote ${fmtHex(p.value as number)} → ${addrHex(a())}`);
    }
  • src/tools.ts:488-489 (registration)
    Tool registration — registerTools() sets up ListToolsRequestSchema handler that exposes TOOLS array (which includes dolphin_write32) and CallToolRequestSchema handler that dispatches to the switch case.
    export function registerTools(server: Server, dol: DolphinClient): void {
      server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
  • Python bridge handler for memory.write_u32 — calls Felk's memory.write_u32(address, value) on the emulator side, returns None.
    def _write_u32(p):  memory.write_u32(p[0], p[1]); return None
  • Route mapping in the bridge dispatch table — maps the string 'memory.write_u32' to the _write_u32 function.
    "memory.write_u32":               _write_u32,
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations, so description fully shoulders behavioral disclosure. Labels as DESTRUCTIVE, states no undo, alignment requirement (4-byte), silent drops on read-only regions, big-endian byte swapping, and 32-bit address truncation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Structured with clear sections (PURPOSE, USAGE, BEHAVIOR, RETURNS). Though lengthy, every sentence adds value. Slight redundancy in address range descriptions, but overall well-organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Comprehensive: includes return format, memory region landmarks (MEM1, MEM2, I/O), endianness, pointer handling, and alignment behavior. No gaps given no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Even with 100% schema coverage, description adds significant value beyond schema: clarifies address alignment details, value range for signed/floats, and big-endian interpretation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool writes a 32-bit unsigned big-endian value to PowerPC memory. Distinguishes from siblings by explicitly mentioning alternatives for 8/16/64-bit writes and floats.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use and when-not-to-use guidance: references dolphin_write8/write16 for smaller values, dolphin_write64 for atomic 64-bit writes, and suggests reinterpreting floats. Also notes alignment and address ranges.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dmang-dev/mcp-dolphin'

If you have feedback or need assistance with the MCP directory API, please join our Discord server