From 55c7411de0fa618b2b9e11ed1e36e2f931d6dd80 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 31 Oct 2026 21:17:12 +0800 Subject: [PATCH] Give the loader probe and the shader census the 1.1.1 values Three places still assumed the two older versions: - loader.c compared a 1.1.1 load against 1.2.1's expectations, so --probe-loader failed every time: main has 10,668 constructors against 1.2.1's 10,673, and its relocation kinds and totals differ. 1.1.1 has its own table; subsdk0 and sdk match 1.2.1 down to every count. - gfx_shader_probe.c looked for build/v121 and build/v143 only, so a census built for 1.1.1 was never found and --probe-shader failed on a checkout that has only that version. It looks for the running version first, then the other two. - layout.py put 1.1.1 first in SUPPORTED while steps.py took SUPPORTED[0] as the version of an install made before versions were recorded, and such an install is 1.2.1: updating one picked 1.1.1's hashes and invalidated its extraction. The tuple keeps 1.2.1 first and the fallback names 1.2.1 outright. --probe-loader now reports 0 failures on a 1.1.1 install. Co-authored-by: deepseek-v4.1-flash-1017 --- installer/layout.py | 2 +- installer/steps.py | 6 +++--- runtime/gfx_shader_probe.c | 8 +++++--- runtime/loader.c | 11 ++++++++--- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/installer/layout.py b/installer/layout.py index b46f38a9..7f31443e 100644 --- a/installer/layout.py +++ b/installer/layout.py @@ -36,7 +36,7 @@ from pathlib import Path WIN = os.name == 'nt' EXE = '.exe' if WIN else '' UCRT = Path(r'C:\msys64\ucrt64\bin') -SUPPORTED = ('1.1.1', '1.2.1', '1.4.3') # updates the installer builds; the check identifies the player's by hash +SUPPORTED = ('1.2.1', '1.4.3', '1.1.1') # updates the installer builds; the check identifies the player's by hash def version_tag(version): diff --git a/installer/steps.py b/installer/steps.py index b03a69f1..2a165641 100644 --- a/installer/steps.py +++ b/installer/steps.py @@ -168,9 +168,9 @@ def raise_if_damaged(error, name, path): def game_version(ctx): - """The update this install is built from: what the check identified, else the recorded one (an install made before - 1.4.3 support records none: 1.2.1).""" - return ctx.state.get('version', SUPPORTED[0]) + """The update this install is built from: what the check identified, else the recorded one. An install made before + 1.4.3 support records no version, and that install is 1.2.1: name it here rather than leaning on SUPPORTED's order.""" + return ctx.state.get('version', '1.2.1') def expected_update(ctx): diff --git a/runtime/gfx_shader_probe.c b/runtime/gfx_shader_probe.c index 8950d174..753353ed 100644 --- a/runtime/gfx_shader_probe.c +++ b/runtime/gfx_shader_probe.c @@ -50,11 +50,13 @@ static const char *str_field(const char *from, const char *to, const char *name, static int hexval(char c) { return c <= '9' ? c - '0' : (c | 32) - 'a' + 10; } // The shader census the probes translate (tools/shader_census.py --version ): build//shaders in the nearest -// parent of totk.exe that has one with a jobs.json, the running game version's first, then the other's (any census +// parent of totk.exe that has one with a jobs.json, the running game version's first, then the others' (any census // serves a probe). 1 with that folder in dir. int probe_census_dir(char *dir, size_t n) { - const char *const versions[2] = {RT_V143 ? "v143" : "v121", RT_V143 ? "v121" : "v143"}; - for (int v = 0; v < 2; v++) { + const char *const versions[3] = {RT_V111 ? "v111" : RT_V143 ? "v143" : "v121", + RT_V111 ? "v121" : RT_V143 ? "v121" : "v143", + RT_V111 ? "v143" : RT_V143 ? "v111" : "v111"}; + for (int v = 0; v < 3; v++) { char exe[PLAT_PATH_MAX * 2]; int len = plat_exe_path(exe, sizeof exe); if (!len || len >= sizeof exe) return 0; diff --git a/runtime/loader.c b/runtime/loader.c index 09f425ba..8bd482fe 100644 --- a/runtime/loader.c +++ b/runtime/loader.c @@ -552,8 +552,8 @@ uint64_t ldr_plt_stub(const char *module, const char *name) { } // ---- --probe-loader -// Expected values, measured on the 1.2.1 and 1.4.3 modules; the 1.4.3 relocation totals match the ones -// MacNativeGames' port notes give for that version. +// Expected values, measured on the 1.1.1, 1.2.1 and 1.4.3 modules; the 1.4.3 relocation totals match the ones +// MacNativeGames' port notes give for that version. 1.1.1 shares subsdk0 and sdk with 1.2.1 down to every count. typedef struct { const char *name; uint64_t kinds[K_COUNT], total, sym_import, sym_own; @@ -564,12 +564,17 @@ static const Expect expect_121[] = { {"subsdk0", {1623, 12820, 1030, 3924}, 19397, 6576, 11198, 667, {9, 0, 654}, 4, 0x30, 45}, {"sdk", {10917, 13976, 1207, 8932}, 35032, 16, 24099, 13, {8, 0, 0}, 5, 0x30, 116}, }; +static const Expect expect_111[] = { + {"main", {508604, 1412, 32, 639}, 510687, 2083, 0, 673, {0, 16, 645}, 12, 0x30, 10668}, + {"subsdk0", {1623, 12820, 1030, 3924}, 19397, 6576, 11198, 667, {9, 0, 654}, 4, 0x30, 45}, + {"sdk", {10917, 13976, 1207, 8932}, 35032, 16, 24099, 13, {8, 0, 0}, 5, 0x30, 116}, +}; static const Expect expect_143[] = { {"main", {499078, 1393, 28, 650}, 501149, 2071, 0, 680, {0, 16, 656}, 8, 0x10b4f10, 10717}, {"subsdk0", {3424, 10927, 905, 3817}, 19073, 6557, 9092, 663, {9, 0, 654}, 0, 0x20, 45}, {"sdk", {15013, 10135, 1079, 7832}, 34059, 10, 19036, 8, {8, 0, 0}, 0, 0x400, 83}, }; -#define expect (RT_V143 ? expect_143 : expect_121) +#define expect (RT_V143 ? expect_143 : RT_V111 ? expect_111 : expect_121) static int failures; #define CHECK(cond, ...) do { if (!(cond)) { failures++; printf(" FAIL: " __VA_ARGS__); putchar('\n'); } } while (0)