Config

From FEX-Emu Wiki
Jump to navigation Jump to search

FEX-Emu has a relatively complex configuration system. This is due to the fact that it is an overlay based configuration system and also it is technically two configuration systems in one.

Main application configuration

This is the primary configuration that is the bulk of the implementation. This falls under the "Config" section of the json configuration files.

Overlay system

This configuration system is based on layers that either override or merge with the layer under it.

Loadable layers

  • Meta layer (Top most)
    • This layer is the final merging of all the layers under it.
  • Environment variables
    • This layer loads options from the environment variable prefixed with FEX_
  • Arguments
    • This is for the options passed through FEXLoader. Mostly unused
  • User-writable app config
  • User-writable steam app id
  • Global installed app config
  • Global installed Steam App config
  • User-writable main config
  • Global main config

Environment variables

These come from environment variables prefixed with FEX_. Check the man page for FEX to know what environment variables correspond to which options.

FEXLoader arguments

This isn't usually set since FEXLoader is mostly a developer tool. FEXInterpreter is used instead.

User-writable app config

Just like the global app config file, this takes the form of <AppName>.json

This can be loaded from multiple paths highest priority to lowest priority

  • $XDG_CONFIG_HOME/.fex-emu/AppConfig/<AppName>.json
    • Depends on environment, not always set on all distributions
  • $FEX_APP_CONFIG_LOCATION/AppConfig/<AppName>.json
    • Usually not set
  • $HOME/.fex-emu/AppConfig/<AppName>.json
    • The regular config location

User-writable steam app id

Just like the global steam app config file, this takes the form of Steam_$SteamAppId_<AppName>.json

This can be loaded from multiple paths highest priority to lowest priority

  • $XDG_CONFIG_HOME/.fex-emu/AppConfig/Steam_$SteamAppId_<AppName>.json
    • Depends on environment, not always set on all distributions
  • $FEX_APP_CONFIG_LOCATION/AppConfig/Steam_$SteamAppId_<AppName>.json
    • Usually not set
  • $HOME/.fex-emu/AppConfig/Steam_$SteamAppId_<AppName>.json
    • The regular config location

Global installed app config

This file is loaded from /usr/share/fex-emu/AppConfig/<AppName>.json

  • Usually doesn't exist
  • FEX-Emu ships a handful of these

Global steam app config

This file is loaded from /usr/share/fex-emu/AppConfig/Steam_$SteamAppId_<AppName>.json

  • Usually doesn't exist

User-writable main config

This can come from a couple locations. From highest priority to lowest.

Will not fallback to loading later configs in the list if one fails.

  • $FEX_APP_CONFIG
    • Usually not set. Direct JSON filepath
  • $XDG_CONFIG_HOME/.fex-emu/Config.json
    • Depends on environment, not always set on all distributions
  • $FEX_APP_CONFIG_LOCATION/Config.json
    • Usually not set
  • $HOME/.fex-emu/Config.json
    • The regular config location

Global main config

This file is loaded from /usr/share/fex-emu/Config.json

  • Usually doesn't exist

Thunks configuration system

This system is disjoint from the other configuration system, but overlaps slightly as we will see. This system loads the ThunksDB section of the json configuration files.

This system is disjoint from the other configuration system because it only affects thunking configuration options.

Loadable Layers

The layers from highest priority to lowest priority. Higher priority layers can enable or disable options from the lower priority layers.

  • User-writable app config
  • User-writable steam app config
  • Global installed app config
  • Global installed Steam App config
  • FEX ThunkConfig option path
  • User-writable main config
  • Global main config

User-writable installed app config

  • Exactly the same as the above user-writable installed app config

User-writable steam app config

  • Exactly the same as the above user-writable installed steam app config

Global installed app config

  • Exactly the same as the above global installed app config

Global installed Steam App config

  • Exactly the same as the above global installed steam app config

FEX ThunkConfig Option path

ThunkConfig is an option in FEX's Config section. If this filepath exists then it is loaded.

  • This means it can be overridden with FEX_THUNKCONFIG environment variable, which is handy.

User-writable main config

  • Exactly the same as the above user-writable main config

Global main config

  • Exactly the same as the above Global main config