webstation-broker
DeveloperPython referenceemulators

emulators.eden

Eden (Nintendo Switch) launcher: ROM resolution, qt-config.ini patching, and SIGTERM shutdown.

Eden (Nintendo Switch) launcher: ROM resolution, qt-config.ini patching, and SIGTERM shutdown.

Eden has no save states and no external control API. Persistence is the game's own save data, which the emulated game commits directly to host files under the virtual NAND (nand/user/save/...). Save paths are keyed by the Switch profile UUID, so the profile store (nand/system/save/8000000000000010) ships with the saves; that way a save archive restored into a fresh container brings its matching profile along and the paths line up. Exit restamps both so the delta dump takes each save unit whole rather than the few files the game happened to rewrite (see Eden.save_and_exit).

Declared imports (import_spec, place_import, validate_import_plan) take a NAND export as it sat: a save unit at nand/user/save/<space>/<user>/<title> and, for an account save, the profile store beside it. See docs/content/docs/api/imports.mdx for the shapes.

Shutdown: Eden's Qt frontend routes SIGTERM through the event loop into a normal window close (graceful emulation teardown). SIGINT is _exit(1) in Eden, so the broker never sends it. The close path pops a confirmation dialog unless the confirmStop UI setting is Ask_Never, so that is patched before every launch.

attributelog
= logging.getLogger(__name__)
attributeROM_ROOT
= Path(os.environ.get('ROM_ROOT', '/romm'))

Library root a resolved ROM must live under (env ROM_ROOT, default /romm).

attributeCONFIG_DIR
= xdg_config_dir('eden')

Eden's config directory, holding the qt-config.ini the broker patches.

Not configurable, and deliberately: nothing on Eden's command line names it, so an override would move only the copy the broker writes and leave Eden reading its own. launch exports the root this resolved to instead.

attributeDATA_DIR
= xdg_data_dir('eden')

Eden's data directory holding the virtual NAND, which is also the save root.

Not configurable, for the same reason as CONFIG_DIR, and with more at stake: an override here would point the save dump and restore at a tree Eden does not write to, which loses saves without reporting anything.

attributeINI_PATH
= CONFIG_DIR / 'qt-config.ini'

The qt-config.ini patched before every launch.

attributeEDEN_LOG_PATH
= Path(os.environ.get('EDEN_LOG_PATH', '/config/eden.log'))

The emulator log file (env EDEN_LOG_PATH, default /config/eden.log).

attributeSAVE_DIR
= DATA_DIR / 'nand' / 'user' / 'save'

The virtual NAND's user save tree, laid out <save space id>/<user id>/<title id>.

Account saves key the middle level by profile UUID; device saves use an all-zero one, and cache and bcat storage use their own names there. Every kind ends in a title id directory, which is the unit a save is dumped as.

attributePROFILE_STORE_DIR
= DATA_DIR / 'nand' / 'system' / 'save' / '8000000000000010'

The system save holding the Switch profile list.

attributeROM_EXTENSIONS
= ('.xci', '.nsp', '.nca', '.nro')

Formats Eden's loader boots directly, best first; a folder holding several picks by this order.