Skip to content

03 02 Config global_variables

evets17 edited this page Mar 13, 2026 · 1 revision

03 02 Config global_variables

This page explains global_variables, which are shared values you define once and reuse across your config.

Why use global variables

Global variables are most useful for common folder paths.

Instead of repeating long paths many times, you define them once in one place, then reference them everywhere.

That means if a folder path changes later, you update one line instead of many.

Basic syntax

[global_variables]
assets_path = "{usb_mount}/boosted/.boost_assets"
assets_images = "{assets_path}/images"
assets_fonts = "{assets_path}/fonts"
log_dir = "{usb_mount}/boosted/.logs"

Each line is a reusable value with a name you choose.

Using a global variable

To use a global variable in another config section, reference it like this:

  • {gv.<name>}

Example:

[logging]
enabled = true
path = "{gv.log_dir}/{game_file}.log"

[display]
font_path = "{gv.assets_fonts}/immortal.ttf"

Built-in values (no gv. needed)

Sprint Boost also provides built-in values that feel like default globals.

Common built-ins include:

  • {usb_mount}
  • {game_folder}
  • {game_file}

What they mean:

  • {usb_mount}: the root mount path of your USB drive on Sprint.
  • {game_folder}: the folder path where the currently loaded game ROM is located.
  • {game_file}: the currently loaded game ROM filename without the extension.

Example:

  • If the ROM is /media/usb0/boosted/BurgerTime.int
    • {usb_mount} = /media/usb0
    • {game_folder} = /media/usb0/boosted
    • {game_file} = BurgerTime

You can use these directly without defining them in [global_variables], and without the gv. prefix.

Example:

[logging]
path = "{usb_mount}/boosted/.logs/{game_file}.log"

Think of it this way:

  • Built-ins are always provided by Sprint Boost
  • global_variables are your own custom names that you create

Default behavior if left out

global_variables is optional.

If you do not include it:

  • Sprint Boost still works
  • There are simply no custom global variable names to reference
  • Any {gv.<name>} reference to a name you did not define will not resolve as expected

So there is no fixed "default variable list"—you create the keys you need.

Where global variables can be used

Global variables are available in config processing for:

  • boost_mode = "basic"
  • boost_mode = "enhanced"

They are not relevant in pure passthrough behavior (boost_mode = "off").

Override behavior

[global_variables] follows normal config precedence:

  • More specific config files can replace an existing key value
  • New keys can be added at more specific levels

Example idea:

  • Folder-level: assets_path = "{usb_mount}/boosted/.boost_assets"
  • Game-level: assets_path = "{game_folder}/custom_assets"

Result:

  • That game uses the game-level assets_path
  • Other games continue using the folder-level assets_path

Practical pattern (recommended)

A clean pattern is:

  1. Define shared path variables at folder level
  2. Build logging/display/menu/play-stats paths from those variables
  3. Override only when one game truly needs a different path

Helpful notes

  • You can build one variable from another variable (as shown with assets_images from assets_path).
  • Keep variable names simple and descriptive (for example assets_images, log_dir, stats_dir).
  • If a referenced variable name is misspelled, the path will not resolve the way you expect.

Next step

Continue to:

Clone this wiki locally