dolphin_set_wiimote_acceleration
Set the Wii Remote's accelerometer values (in g) for one frame, enabling raw motion input in games like Wii Sports bowling swings.
Instructions
PURPOSE: Set the Wii Remote's accelerometer reading on the given port. USAGE: Use for games that read raw accelerometer data — Wii Sports bowling/golf swings, Mario Galaxy's shake-to-spin, anything that doesn't go through the higher-level swing/shake/tilt helpers (deferred to a future release). Units are roughly g (Earth gravity ≈ 1.0); a Remote held still and pointing forward typically reads about (0, 1, 0). For a single-frame impulse, set the value then dolphin_frame_advance(1) then reset to neutral. BEHAVIOR: DESTRUCTIVE to accelerometer state for the addressed port. ClearOn::NextFrame semantics — set persists for one render frame only. RETURNS: 'Set Wii Remote port N accel to (x, y, z)'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Wii Remote port (0-3, default 0). | |
| x | Yes | Accel X (roughly g). | |
| y | Yes | Accel Y (roughly g; ~1.0 for level-and-still pointing forward). | |
| z | Yes | Accel Z (roughly g). |
Implementation Reference
- src/tools.ts:353-371 (registration)Tool schema and description registration in the TOOLS array. Defines name, purpose, input schema (port, x, y, z floats), and ClearOn::NextFrame behavior.
{ name: "dolphin_set_wiimote_acceleration", description: "PURPOSE: Set the Wii Remote's accelerometer reading on the given port. " + "USAGE: Use for games that read raw accelerometer data — Wii Sports bowling/golf swings, Mario Galaxy's shake-to-spin, anything that doesn't go through the higher-level swing/shake/tilt helpers (deferred to a future release). Units are roughly g (Earth gravity ≈ 1.0); a Remote held still and pointing forward typically reads about (0, 1, 0). For a single-frame impulse, set the value then dolphin_frame_advance(1) then reset to neutral. " + "BEHAVIOR: DESTRUCTIVE to accelerometer state for the addressed port. ClearOn::NextFrame semantics — set persists for one render frame only. " + "RETURNS: 'Set Wii Remote port N accel to (x, y, z)'.", inputSchema: { type: "object", required: ["x", "y", "z"], properties: { port: { type: "integer", minimum: 0, maximum: 3, description: "Wii Remote port (0-3, default 0)." }, x: { type: "number", description: "Accel X (roughly g)." }, y: { type: "number", description: "Accel Y (roughly g; ~1.0 for level-and-still pointing forward)." }, z: { type: "number", description: "Accel Z (roughly g)." }, }, additionalProperties: false, }, }, - src/tools.ts:568-573 (handler)Handler case in the CallToolRequestSchema switch. Extracts port/x/y/z from arguments, calls the Dolphin bridge via dol.call with the method 'controller.set_wiimote_acceleration', and returns a confirmation string.
case "dolphin_set_wiimote_acceleration": { const port = (p.port as number | undefined) ?? 0; const x = p.x as number, y = p.y as number, z = p.z as number; await dol.call("controller.set_wiimote_acceleration", [port, x, y, z]); return ok(`Set Wii Remote port ${port} accel to (${x}, ${y}, ${z})`); } - bridge/mcp_bridge.py:115-115 (helper)Python bridge helper function that unpacks the positional params (port, x, y, z) and calls Felk's controller.set_wiimote_acceleration API inside Dolphin.
def _set_wiimote_acceleration(p): controller.set_wiimote_acceleration(p[0], p[1], p[2], p[3]); return None - bridge/mcp_bridge.py:157-157 (registration)Maps the RPC method string 'controller.set_wiimote_acceleration' to the _set_wiimote_acceleration Python function in the HANDLERS dict.
"controller.set_wiimote_acceleration": _set_wiimote_acceleration, - src/tools.ts:360-371 (schema)Input schema definition for the tool requiring x, y, z as numbers and port as optional integer (0-3, default 0).
inputSchema: { type: "object", required: ["x", "y", "z"], properties: { port: { type: "integer", minimum: 0, maximum: 3, description: "Wii Remote port (0-3, default 0)." }, x: { type: "number", description: "Accel X (roughly g)." }, y: { type: "number", description: "Accel Y (roughly g; ~1.0 for level-and-still pointing forward)." }, z: { type: "number", description: "Accel Z (roughly g)." }, }, additionalProperties: false, }, },