is_rom_loaded
Verify if a ROM is loaded in the GameBoy emulator using the MCP GameBoy Server to ensure proper game initialization and control.
Instructions
Check if a ROM is currently loaded in the emulator
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:80-103 (registration)Registration and inline handler for the 'is_rom_loaded' MCP tool. Executes the tool logic by checking emulatorService.isRomLoaded() and returning JSON response with loaded status and ROM path.server.tool( 'is_rom_loaded', 'Check if a ROM is currently loaded in the emulator', {}, async (): Promise<CallToolResult> => { const isLoaded = emulatorService.isRomLoaded(); const romPath = emulatorService.getRomPath(); const responseText: TextContent = { type: 'text', text: JSON.stringify({ romLoaded: isLoaded, romPath: romPath || null }) }; log.verbose('Checked ROM loaded status', JSON.stringify({ romLoaded: isLoaded, romPath: romPath || null })); return { content: [responseText] }; } );
- src/emulatorService.ts:23-25 (handler)Helper method in EmulatorService that delegates the ROM loaded check to the underlying GameBoyEmulator instance.isRomLoaded(): boolean { return this.emulator.isRomLoaded(); }
- src/gameboy.ts:117-119 (helper)Core implementation in GameBoyEmulator class that returns the internal romLoaded boolean flag set upon successful ROM loading.public isRomLoaded(): boolean { return this.romLoaded; }