headless: start from the real config defaults

Headless never loads a config file, so every setting it doesn't assign kept the
zero-initialized value instead of the default the ConfigSetting table declares.
140 settings were affected, and among them were ones that change how games run,
not just how they look: bFastMemory and bFuncReplacements are both "true" by
default and were false here, so headless was the only build compiling memory
accesses the slow way and running games without function replacements.

Call RestoreDefaults before the block that forces the values the tests want, so
those still win and the rest now match every other build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik Rydgård
2026-09-17 13:18:00 -06:00
co-authored by Claude Opus 5
parent 0207c6d04a
commit 5cfd859eae
+6
View File
@@ -752,6 +752,12 @@ int main(int argc, const char* argv[]) {
std::string error_string;
// Headless never loads a config file, so without this every setting not named below keeps the
// zero-initialized value instead of its real default, and headless runs games differently from
// every other build (bFastMemory and bFuncReplacements are both "true" defaults that came out
// false that way). Apply the defaults first, then force the values the tests want.
g_Config.RestoreDefaults(RestoreSettingsBits::SETTINGS, false);
// Force known values for deterministic test execution. This happens before
// ApplyToConfig() below, so a matching command line flag can still override any of it -
// ApplyToConfig() always has the final say on the settings in g_Config.