mgba_screenshot
Capture a PNG screenshot of the current emulator display. Optionally specify a file path; otherwise saves to the default screenshot directory and returns the filename.
Instructions
PURPOSE: Save a PNG screenshot of the current emulator display to a file. USAGE: Use to capture visible game state for inspection, comparison across savestates, or sequence documentation. The image captures whatever the emulator is currently rendering — to capture a specific game state, pause / advance frames / load state first to get the frame you want, then call this. Path is optional; omit it to let mGBA write to its default screenshot directory and report back the chosen filename. BEHAVIOR: DESTRUCTIVE TO TARGET FILE if path is supplied: overwrites the file at path if it exists, with no prompt or backup. Returns an error if path is supplied but the parent directory doesn't exist or isn't writable, or if the bridge's screenshot method is missing on this build. RETURNS: Single line 'Screenshot saved: PATH', where PATH is the file actually written (the value you passed, or mGBA's default-directory file name if path was omitted).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Optional absolute filesystem path to write the PNG to (e.g. C:/temp/snap.png on Windows, /tmp/snap.png on Linux/macOS). Parent directory must exist. File is overwritten without prompt if present. Omit to let mGBA pick a filename in its default screenshot directory and return that path. |