Overview
The Configuration API allows you to programmatically configure all aspects of the Hydra emulator, including CPU backend, GPU renderer, audio settings, and paths. Configuration is managed through a singleton instance accessed viaConfig::GetInstance() in C++ or through the C API functions prefixed with hydra_config_.
Accessing Configuration
C++ API
C API
Configuration Functions
hydra_config_serialize
Saves the current configuration to disk.{app_data_path}/config.toml.
hydra_config_deserialize
Loads configuration from disk.hydra_config_get_app_data_path
Gets the application data directory path.Path to the application data directory
Backend Configuration
CPU Backend
The CPU backend determines which ARM64 CPU emulation engine to use.HydraCpuBackend Enum
Invalid/unset backend
Apple’s Hypervisor.framework for native ARM64 execution (macOS/iOS only)
Dynarmic JIT compiler (cross-platform)
hydra_config_get_cpu_backend
Gets a pointer to the CPU backend setting.Pointer to the CPU backend setting (HydraCpuBackend enum value)
GPU Renderer
The GPU renderer determines which graphics API to use.HydraGpuRenderer Enum
Invalid/unset renderer
Metal graphics API (macOS/iOS only)
Currently, only Metal is supported. Future versions may add Vulkan support.
hydra_config_get_gpu_renderer
Gets a pointer to the GPU renderer setting.Pointer to the GPU renderer setting (HydraGpuRenderer enum value)
Shader Backend
The shader backend determines how Nintendo Switch shaders are compiled.HydraShaderBackend Enum
Invalid/unset shader backend
Metal Shading Language - shaders compiled at runtime
Apple Intermediate Representation - pre-compiled shaders for better performance
hydra_config_get_shader_backend
Gets a pointer to the shader backend setting.Pointer to the shader backend setting (HydraShaderBackend enum value)
Audio Backend
The audio backend determines which audio output system to use.HydraAudioBackend Enum
Invalid/unset audio backend
No audio output (silent mode)
Cubeb cross-platform audio library
hydra_config_get_audio_backend
Gets a pointer to the audio backend setting.Pointer to the audio backend setting (HydraAudioBackend enum value)
Display Configuration
Resolution
The display resolution setting controls the output resolution of the emulator.HydraResolution Enum
Automatically scale to native Switch resolution (720p docked, variable handheld)
1280x720 resolution
1920x1080 resolution
2560x1440 resolution
3840x2160 resolution (4K)
7680x4320 resolution (8K)
Match exact native resolution without scaling
Use custom resolution specified by hydra_config_get_custom_display_resolution()
hydra_config_get_display_resolution
Gets a pointer to the display resolution setting.Pointer to the display resolution setting (HydraResolution enum value)
hydra_config_get_custom_display_resolution
Gets a pointer to the custom resolution setting.Pointer to custom resolution (width x, height y). Only used when display_resolution is HYDRA_RESOLUTION_CUSTOM.
Path Configuration
Firmware Path
hydra_config_get_firmware_path
Gets the firmware directory path.Path to the Nintendo Switch firmware directory
hydra_config_set_firmware_path
Sets the firmware directory path.Path to the firmware directory
SD Card Path
hydra_config_get_sd_card_path
Gets the virtual SD card directory path.Path to the virtual SD card directory (default:
{app_data}/sdmc)hydra_config_set_sd_card_path
Sets the virtual SD card directory path.Path to the SD card directory
Save Path
hydra_config_get_save_path
Gets the save data directory path.Path to the save data directory (default:
{app_data}/save)hydra_config_set_save_path
Sets the save data directory path.Path to the save data directory
Sysmodules Path
hydra_config_get_sysmodules_path
Gets the system modules directory path.Path to the sysmodules directory (default:
{app_data}/sysmodules)hydra_config_set_sysmodules_path
Sets the system modules directory path.Path to the sysmodules directory
Game and Plugin Configuration
hydra_config_get_game_paths
Gets the list of game library paths.Pointer to a string list containing game library paths
hydra_config_get_loader_plugins
Gets the list of loader plugins.Pointer to a loader plugin list
hydra_config_get_patch_paths
Gets the list of patch directories.Pointer to a string list containing patch directory paths
System Configuration
hydra_config_get_user_id
Gets the active user ID.Pointer to the 128-bit user ID
hydra_config_get_handheld_mode
Gets the handheld mode setting.Pointer to handheld mode flag. true for handheld mode, false for docked mode.
Debugging Configuration
Logging
hydra_config_get_log_output
Gets the log output destination.Pointer to log output setting (HydraLogOutput enum)
hydra_config_get_log_fs_access
Gets the filesystem access logging flag.Pointer to flag controlling filesystem access logging
hydra_config_get_debug_logging
Gets the debug logging flag.Pointer to flag enabling verbose debug logging
GDB Server
hydra_config_get_gdb_enabled
Gets the GDB server enabled flag.Pointer to flag enabling the GDB remote debugging server
hydra_config_get_gdb_port
Gets the GDB server port.Pointer to GDB server port number (default: 1234)
hydra_config_get_gdb_wait_for_client
Gets the GDB wait for client flag.Pointer to flag that makes emulator wait for GDB client connection before starting
C++ Config Class
The C++ API provides a more convenient interface through theConfig class:
src/common/config.hpp for the complete implementation.