From 5cfd859eaea2f60ee3db0f98fb2bf3ffb1cb7d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 17 Sep 2026 13:18:00 -0600 Subject: [PATCH] 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) --- headless/Headless.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 1f58b1f87e..006a37700f 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -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.