mgba_advance_frames
Advance emulator frames by a specified count for precise timing in tests. Avoids event loop interruption to maintain accuracy.
Instructions
Advance emulation by N frames without returning to the event loop. Useful for precise timing in tests.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of frames to advance (default 1) |
Implementation Reference
- src/tools.ts:183-192 (schema)Defines the input schema for mgba_advance_frames, accepting an optional 'count' integer (min 1, default 1).
{ name: "mgba_advance_frames", description: "Advance emulation by N frames without returning to the event loop. Useful for precise timing in tests.", inputSchema: { type: "object", properties: { count: { type: "integer", minimum: 1, default: 1, description: "Number of frames to advance (default 1)" }, }, }, }, - src/tools.ts:360-363 (handler)Handler that calls the mGBA bridge's 'advance_frames' RPC method with the count parameter and returns the resulting frame number.
case "mgba_advance_frames": { const frame = await mgba.call<number>("advance_frames", { count: p.count ?? 1 }); return ok(`Advanced ${p.count ?? 1} frame(s). Current frame: ${frame}`); } - src/tools.ts:258-259 (registration)Registration function that registers the tools list (which includes mgba_advance_frames) with the MCP server via ListToolsRequestSchema.
export function registerTools(server: Server, mgba: MgbaClient): void { server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));