Files
ayozetr 498a37d24b Runtime: run the game's movbe on processors without MOVBE
The game's code was built for the PS4's CPU and has 987 movbe. AMD's FX
processors of the Piledriver generation have every other instruction the
game uses but not this one, so the game stopped with SIGILL (exit code 132)
at the first one, while reading a file header (#39).

The SIGILL handler now decodes the movbe at the faulting address, does the
load or store with its bytes swapped and resumes after it. On a processor
with MOVBE this never runs. The CPU check no longer refuses to start
without MOVBE and says in the log that the port runs them; the log also
counts them every 10 s (a few thousand a second while loading, about ten a
second while playing).

BB_MOVBE_TRAP=file turns the movbe listed by tools/movbe_sites.py into ud2,
so the emulation can be tested on any processor. tests/test_movbe.c checks
the forms the game uses.
2026-11-04 11:11:26 +00:00

61 KiB

Environment variables

The port reads a few hundred BB_* environment variables. Some are for players (upscaler, frame rate, controls); most are diagnostics and developer switches. The list below is every one the code reads, from the port's own registry (gpu/shim/bb_env_vars.def); tests/test_env_vars.py fails when the code and the registry disagree, so it stays complete. Everything from "Every BB_* variable" on is the output of python3 scripts/env_vars.py --doc (without its title); the sections above it are written by hand.

How to set them

In the launcher: Advanced → Developer → Extra variables (NAME=value, space-separated). The settings key is extra_env in the launcher's settings.json, read by game_environment() in launcher/bbport_launcher.py:

  • The field is split on whitespace, and each piece at its first =: BB_UPSCALER=fsr4 BB_AUDIO_GAIN=1.5 RADV_DEBUG=nohiz.
  • There is no quoting. A value cannot contain spaces, and quotes stay part of the value. Use separators the variable itself accepts, such as ; or ,.
  • A piece without = is ignored. If a name appears twice, the last one wins.
  • Any name is accepted, third-party ones included (RADV_DEBUG, MANGOHUD, VK_*, __GL_*).
  • The result goes to run.sh. Both the launcher's Play button and --play (a Steam shortcut, the Steam Deck's Game Mode) use it.

From a terminal (source checkout): BB_GAME_DIR=/path/to/CUSA03173 BB_FPS=60 bash run.sh. Without the launcher, nothing sets the launcher's variables. run.sh then uses its own defaults (game folder ../CUSA03173, uncapped frame rate, and so on).

From a terminal (AppImage): BB_UPSCALER=fsr4 ./Bloodborne-bbport-x86_64.AppImage --play starts the game with the launcher's saved settings. Mind the precedence below: the launcher's own settings replace a variable of the same name from the shell. Extra variables replace both. The AppImage keeps its data (bbport.ini, saves, logs) in BB_DATA_DIR, by default ~/.local/share/bbport.

bbport.ini: many graphics options live in bbport.ini and the in-game menu, not in the environment. A few variables override those keys at start: BB_UPSCALER, BB_UPSCALE_PRESET, BB_FSR_SHARPNESS, BB_JITTER, BB_REACTIVE* and BB_OBJECT_MOTION (gpu/shim/bbport_settings.cpp). Values set this way stay in force until the next start.

Precedence

The environment is built in this order; a later step wins:

  1. The environment the launcher (or the AppImage) was started with.
  2. The launcher's own settings (game_environment()): some are always written (the game folder, mods, languages, frame rate, fullscreen and the like) and replace a shell value; others only when the setting is on.
  3. The launcher's Extra variables.
  4. run.sh, which fills in what is still unset (the data folder, the online module, Discord).

Every BB_* variable the port reads, by kind, from gpu/shim/bb_env_vars.def (scripts/env_vars.py --doc). The game prints the variables set at its start (Environment: in the log) and warns about BB_* names it does not know.

=1: ... / =0: ... / =N: ... say what that value does; set: ... means any value turns it on (even 0).

Settings (107)

What players and the launchers set. The menu, bbport.ini and the launcher write most of them; set one by hand to override them.

Variable What it does
BB_ANISO =N: anisotropic filtering of scene textures (default 16)
BB_ASYNC_PIPELINES =0: new pipelines of passes drawn every frame compiled at once instead of skipping a draw for a frame or two
BB_ATLAS_ENABLED =1 / 0: Hunter's Atlas, the in-game map, on or off (the launcher's Map switch; unset: the map's own settings.ini)
BB_AUTO_RENDER_RES =1: render resolution picked from the measured frame rate
BB_BBSC =1: seamless co-op (BBSC), the launcher's co-op switch
BB_BBSC_LOCAL_SERVER =1 / auto (default) / 0: the BBSC game server on this PC (scripts/bbsc_gameserver)
BB_BUTTON_PROMPTS =0: the game's PlayStation button icons always
BB_CJK_FONT =path: a font file with Chinese characters for the menu in Simplified Chinese (default: fontconfig's choice for zh-cn)
BB_COMMUNITY_SERVER URL of the online pool server (default: the community server)
BB_CONFIG =path: the controls file (default bbport.ini)
BB_CONTENT_SKU =full / ...: the content profile run.py prepares
BB_CURSOR =0: the system's mouse cursor instead of the port's
BB_DECK_DESKTOP_INPUT =1: keep keyboard and mouse on a Steam Deck in game mode
BB_DISCORD =0: no Discord Rich Presence (the launcher's Discord switch)
BB_DISPLAY =N: the monitor to open the window on
BB_DLC_DIR =path: the dumped add-ons of this title, one folder each, linked as /addcont/