Skip to main content
Glama
simen
by simen

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
NameRequiredDescriptionDefault
filenameYesFilename of the snapshot to load

Implementation Reference

  • 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); } }
  • 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); } } );
  • 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); }

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/simen/vice-mcp'

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