Skip to content

Debug and test flags

Dev builds (the default, -DBLUR_DEV=ON) read these flags. Release builds (tools/ci/build_mac.sh, -DBLUR_DEV=OFF) compile them out: dev_getenv() (src/common/dev_env.h) returns null, the dev command-line switches are not parsed, the default game/DLL/patch paths point nowhere (the app installer sets them), and tests and tools are not configured. The user-facing variables, which work in both builds, are in the README.

Variable Purpose
BLUR_FPS=1 log presents/s and renderer stats every second
BLUR_SHOT=<prefix>, BLUR_SHOT_AT=<s,...>, BLUR_SHOT_EVERY=<n> dump the backbuffer as PPM at those seconds / every n seconds (tools/modes/mdrive.py)
BLUR_KEYS=sec:vk[:holdms],... tap keys at given seconds (headless input)
BLUR_KEYFILE=<path> inject the virtual-key code written to the file (mdrive.py)
BLUR_KEYHOLD=..., BLUR_KEYHOLD_GO=<path> hold keys over time windows, clock starting when the file appears
BLUR_PADFILE=<path> virtual XInput pads from the file: lines <index> <wButtons> [<right trigger 0-255> [<left stick X -32768..32767>]] (mdrive.py, scripts/)
BLUR_TYPEFILE=<path> type the text written to the file (WM_CHAR)
BLUR_INPUT_LOG=1 DirectInput device/state logging
BLUR_LUA_DUMP=<dir> dump every Lua chunk the game loads
BLUR_TWEAK_DUMP=1 log the game’s tweak registry once scripts load
BLUR_TEX_DUMP=<dir> dump 2D textures of 256px or more as DDS (tools/trackcards)
BLUR_STATE_LOG=1 log every game-state change
BLUR_DNS=host=target,... add/override name lookups (host= removes one)
BLUR_NETTRACE=1 / 2 Winsock trace; 2 adds receives and hex payloads
BLUR_DWLOG=1 log every Demonware message, not only failures
BLUR_PORTMAP=from=to,... remap bound ports so a second instance runs on the same Mac
BLUR_ADAPTER_IP=<ip> report this adapter IP (second instance on one Mac)
BLUR_LANSIM=<k> instance k (1-20) of a LAN on one Mac over loopback (docs/multiplayer-lan.md)
BLUR_FILETRACE=1 kernel32 file API trace
BLUR_HEAPTRACE=1, BLUR_HEAPCHECK=1 log large heap allocs/frees; track live blocks to catch bad frees
BLUR_EVTRACE=1 SetEvent/wait trace with caller module
BLUR_STT_MAX_US=<us> cap of the SwitchToThread backoff sleep (default 100, 0 = yield only)
BLUR_TIME_SCALE=<x> scale the guest clock
BLUR_SURVIVE=1 kill a crashing non-main guest thread instead of the process
BLUR_NO_CRASH_HANDLER=1 leave crashes to the debugger
BLUR_D3D_TRACE=1 log every guest D3D9 call
BLUR_D3D_RCTRACE=<hex addr> AddRef/Release trace for one guest D3D object
BLUR_D3D_POISON=1 leak + fill released D3D wrappers with 0xDD so use-after-release crashes
BLUR_PRESENT_DELAY_MS=<ms> sleep in every Present (timing experiments)
BLUR_PROFILE=<s>, BLUR_PROFILE_FROM, BLUR_PROFILE_TID, BLUR_PROFILE_TBS, BLUR_CALLS_ALL guest EIP sampler and hot-call report
BLUR_HOSTPROF=<file>, BLUR_HOSTPROF_FROM, BLUR_HOSTPROF_SECS host SIGPROF sampler (tools/host/hostprof.py)
BLUR_DEBUG_EXPORTS=1, BLUR_TRACE_EXPORTS=substr,... PE export table dump; log calls to matching guest exports
BLUR_AUDIO_LOG=1 DirectSound logging
BLUR_INSTALL_DISC=<path> disc source for the installer’s second prompt (unattended tests)
D3D9M_LOG=1 one line per distinct unsupported draw
D3D9METAL_NO_CACHE=1 skip the shader cache in ~/Library/Caches/d3d9metal
D3D9METAL_PIPELINE_ARCHIVE=1 experimental Metal pipeline archive (serialize fails on some pipelines)

scripts/race.py single|split|lan runs a test race with a bot per racer; see its docstring. Each instance gets its own settings.xml (windowed 1280x720, graphical_detail 0, no MSAA, vsync off; --set key=val overrides), BLUR_STATE_WS, BLUR_PADFILE and BLUR_KEYFILE; LAN instances add BLUR_LANSIM and BLUR_PLAYER_NAME. python3 scripts/test_racelib.py checks the bot and helpers. The bot’s fire and reset buttons are BLUR_BOT_FIRE / BLUR_BOT_RESET (wButtons).

--headless, --exe <test.exe>, --max-seconds N, --exit-at-createdevice, --exit-at-present N, --abort-unresolved: ctest and tools/modes/mdrive.py use these.