loadSnapshot
Load a saved Commodore 64 emulator state to restore memory, registers, and peripheral configurations from a snapshot file.
Instructions
Load a previously saved machine state from a file.
Restores complete machine state including memory, registers, and peripheral states.
Warning: This completely replaces the current state!
Related tools: saveSnapshot
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Filename of the snapshot to load |
Implementation Reference
- src/index.ts:983-995 (handler)MCP tool handler for loadSnapshot. Parses args, calls ViceClient.loadSnapshot(filename), formats success/error response with meta state.async (args) => { try { await client.loadSnapshot(args.filename); return formatResponse({ success: true, filename: args.filename, message: `Snapshot loaded from ${args.filename}`, hint: "Machine state restored. Use getRegisters() to verify state.", }); } catch (error) { return formatError(error as ViceError); } }
- src/index.ts:979-981 (schema)Zod input schema for loadSnapshot tool: requires 'filename' string.inputSchema: z.object({ filename: z.string().describe("Filename of the snapshot to load"), }),
- src/index.ts:968-996 (registration)Registration of 'loadSnapshot' MCP tool using server.registerTool, including description, input schema, and handler.// Tool: loadSnapshot - Load machine state server.registerTool( "loadSnapshot", { description: `Load a previously saved machine state from a file. Restores complete machine state including memory, registers, and peripheral states. Warning: This completely replaces the current state! Related tools: saveSnapshot`, inputSchema: z.object({ filename: z.string().describe("Filename of the snapshot to load"), }), }, async (args) => { try { await client.loadSnapshot(args.filename); return formatResponse({ success: true, filename: args.filename, message: `Snapshot loaded from ${args.filename}`, hint: "Machine state restored. Use getRegisters() to verify state.", }); } catch (error) { return formatError(error as ViceError); } } );
- src/protocol/client.ts:661-667 (helper)ViceClient.loadSnapshot method: encodes filename and sends VICE Undump command via binary monitor protocol to load snapshot.async loadSnapshot(filename: string): Promise<void> { const filenameBuffer = Buffer.from(filename, "utf8"); const body = Buffer.alloc(1 + filenameBuffer.length); body[0] = filenameBuffer.length; filenameBuffer.copy(body, 1); await this.sendCommand(Command.Undump, body); }