dolphin_press_gc_buttons
Set GameCube controller state for one frame. Specify buttons and axes to press; omitted inputs are released. Use with frame advance for TAS sequences.
Instructions
PURPOSE: Set GameCube controller state on a given port for one frame's worth of input. USAGE: Buttons supported: A, B, X, Y, Z, Start, L, R, Up, Down, Left, Right. Analog axes: StickX, StickY, CStickX, CStickY, TriggerLeft, TriggerRight. To 'hold' a button across multiple frames, call repeatedly — Dolphin's input is per-frame, not edge-triggered, so a button you don't include in this call's state is implicitly released. For TAS-style frame-perfect sequences, alternate set + dolphin_frame_advance(1) calls. BEHAVIOR: DESTRUCTIVE to controller state for the addressed port. Overwrites all input — anything you don't include is released. Felk's set_gc_buttons accepts a partial dict; unspecified buttons are false, unspecified analog axes are at neutral (0 for both sticks and triggers). RETURNS: 'Set GC port N: '.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | GameCube controller port (0-3, defaults to 0 for port 1). Wii games sometimes accept GC controllers — try port 0 if unsure. | |
| state | Yes | Button/axis state object. Boolean keys for digital buttons (A, B, X, Y, Z, Start, L, R, Up, Down, Left, Right). Integer keys for analog axes — StickX/StickY/CStickX/CStickY accept -128..127 (0 = center), TriggerLeft/TriggerRight accept 0..255 (0 = released). Omit a key to leave it at neutral (false / 0). |
Implementation Reference
- src/tools.ts:547-553 (handler)The handler function for the 'dolphin_press_gc_buttons' tool. It reads the port (defaulting to 0), extracts the state object, calls the Dolphin bridge's 'controller.set_gc_buttons' method, and returns a summary string.
case "dolphin_press_gc_buttons": { const port = (p.port as number | undefined) ?? 0; const state = p.state as Record<string, unknown>; await dol.call("controller.set_gc_buttons", [port, state]); const keys = Object.keys(state).join(",") || "(empty)"; return ok(`Set GC port ${port}: ${keys}`); } - src/tools.ts:274-303 (schema)Input schema for the 'dolphin_press_gc_buttons' tool. Defines 'port' (integer 0-3, optional) and 'state' (object with boolean button names and integer analog axes) as input. Lists supported GC button names and analog axes.
{ name: "dolphin_press_gc_buttons", description: "PURPOSE: Set GameCube controller state on a given port for one frame's worth of input. " + `USAGE: Buttons supported: ${GC_BUTTON_NAMES}. Analog axes: ${GC_ANALOG_NAMES}. ` + "To 'hold' a button across multiple frames, call repeatedly — Dolphin's input is per-frame, not edge-triggered, so a button you don't include in this call's state is implicitly released. For TAS-style frame-perfect sequences, alternate set + dolphin_frame_advance(1) calls. " + "BEHAVIOR: DESTRUCTIVE to controller state for the addressed port. Overwrites all input — anything you don't include is released. Felk's set_gc_buttons accepts a partial dict; unspecified buttons are false, unspecified analog axes are at neutral (0 for both sticks and triggers). " + "RETURNS: 'Set GC port N: <state-summary>'.", inputSchema: { type: "object", required: ["state"], properties: { port: { type: "integer", minimum: 0, maximum: 3, description: "GameCube controller port (0-3, defaults to 0 for port 1). Wii games sometimes accept GC controllers — try port 0 if unsure.", }, state: { type: "object", additionalProperties: true, description: "Button/axis state object. Boolean keys for digital buttons (A, B, X, Y, Z, Start, L, R, Up, Down, Left, Right). " + "Integer keys for analog axes — StickX/StickY/CStickX/CStickY accept -128..127 (0 = center), " + "TriggerLeft/TriggerRight accept 0..255 (0 = released). Omit a key to leave it at neutral (false / 0).", }, }, additionalProperties: false, }, }, - src/tools.ts:62-62 (registration)The tool is registered as part of the TOOLS array (line 62) which is used to respond to ListToolsRequestSchema and CallToolRequestSchema. The entry at line 274-303 is one item in this array.
const TOOLS: Tool[] = [ - bridge/mcp_bridge.py:103-103 (helper)The Python bridge handler that calls Felk's dolphin.controller.set_gc_buttons(port, state) to actually set the GameCube controller buttons in Dolphin.
def _set_gc_buttons(p): controller.set_gc_buttons(p[0], p[1]); return None - bridge/mcp_bridge.py:151-151 (helper)Registration of 'controller.set_gc_buttons' method in the bridge's HANDLERS dict, mapping the RPC method name to the _set_gc_buttons helper function.
"controller.set_gc_buttons": _set_gc_buttons,