From b86c8c82bade29b32cae59c4e21bbefc36096ac2 Mon Sep 17 00:00:00 2001 From: Sylpheed RE agent Date: Thu, 27 Aug 2026 09:21:04 +0000 Subject: [PATCH] isl: rename built-ins 8/9/93 to stopwatch_start/_elapsed/_stop They are start / read / stop of one of 32 per-phase stopwatches, not flag operations. 123-127 keep timer_* -- that is the mission timer, five scalars at [phase+304..320], a different clock. Artefact check: 84 lines changed across 5 files and all 84 pair exactly with their old-name partners once column padding is normalised (0 removed lines without an old name, 0 added lines without a new one). data/isl-timers.txt reproduces the same 675/675, 11.2 % control, 82/1 and identical histograms, which is what shows the rename is cosmetic. Also withdraws a label from the previous commit: sub_8230C398 is NOT the message pump. It runs every frame but drains nothing -- a state machine on [0x828E1F8C] that only allocates, builds strings, looks up and PUSHES. And bus+8216 is weak evidence: sub_82254A08 is a generic map find with ~120 sites, and the key looked up is a pointer, not a tag. The open handle is now the ring buffer at bus+4, not bus+8216. --- docs/re/BACKLOG.md | 25 +++++ docs/re/data/isl-phase-guards-all.txt | 126 +++++++++++----------- docs/re/data/isl-stage02-conditions.txt | 20 ++-- docs/re/data/isl-stage02-phase-ends.txt | 2 +- docs/re/data/isl-stage02-phase-guards.txt | 12 +-- docs/re/data/isl-stage02.txt | 8 +- docs/re/data/isl-timers.txt | 14 +-- docs/re/structures/isl-mission-timer.md | 26 ++++- docs/re/structures/isl-timers.md | 17 +-- tools/re-capture/isl.py | 9 +- 10 files changed, 153 insertions(+), 106 deletions(-) diff --git a/docs/re/BACKLOG.md b/docs/re/BACKLOG.md index 0299518f..fea8d8c0 100644 --- a/docs/re/BACKLOG.md +++ b/docs/re/BACKLOG.md @@ -364,6 +364,31 @@ unknown, what evidence exists, and what the first step would be. Move an item in into `bus+8216` and with which key**. That path is unread, so **the item is NOT settled**: whether running out of time ends the mission is still unknown. +* ✅🔴 **(2026-08-27) THE STOPWATCH BUILT-INS ARE RENAMED — and my own "message + pump" label from the previous pass is WITHDRAWN.** + ✅ **Rename landed.** `isl.py` emits **`stopwatch_start` (8) / + `stopwatch_elapsed` (9) / `stopwatch_stop` (93)**; 123–127 keep `timer_*` for + the mission timer, which is five scalars rather than a 32-entry bank. Artefact + check: **84 lines changed across 5 files, and all 84 pair exactly** with their + old-name partners once column padding is normalised — 0 removed lines without + an old name, 0 added lines without a new one. `data/isl-timers.txt` regenerates + to the **same** 675/675, 11.2 % control, 82/1 and identical argument + histograms, which is the check that the rename is cosmetic. + 🔴 **WITHDRAWN: "`sub_8230C398` is the per-frame message pump."** It *is* + called every frame (`sub_821A6470` at `0x821A654C`, `sub_821AA1B0` at + `0x821AA7DC`, both with `dt`) but it **drains nothing** — its body is a state + machine on `[0x828E1F8C]`, and over 466 instructions it calls only an allocator + `sub_8230C160`, string building `sub_8217FA08`, the lookup `sub_823001E8` and a + *push* `sub_8225FEA0`. A boot/loading sequencer that POSTS messages. + 🔴 **And `bus+8216` is weaker evidence than I wrote.** `sub_82254A08` is a + generic map find with **~120 call sites image-wide**, and `+8216` is a common + offset (50+ `addi …, 8216` sites); worse, **the key `sub_823001E8` looks up is + a POINTER** (`lwz r4, 13780(r11)`, stored and passed by address), **not a + message tag** — so that map may not be the subscriber registry at all. + ▶️ **The item is still open and the handle is now different**: find what drains + the ring buffer at `bus+4` (capacity `+8`, head `+12`, count `+16`), not what + reads `bus+8216`. Whether running out of time ends the mission is unanswered. + ## ✅✅ SOLVED — the mission freeze was a modal sign-in dialog (2026-08-26) `XamShowSigninUI` opens a modal dialog and `xeXamDispatchDialog` blocks the diff --git a/docs/re/data/isl-phase-guards-all.txt b/docs/re/data/isl-phase-guards-all.txt index 901bf770..0a538b7e 100644 --- a/docs/re/data/isl-phase-guards-all.txt +++ b/docs/re/data/isl-phase-guards-all.txt @@ -30,7 +30,7 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x0033C8: 3 necessary condition(s) precond 0x002870 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x002BC4 hp_pct_test(ADT101, 0) != 1 - precond 0x0031D8 read_freg(0) < 600 + precond 0x0031D8 stopwatch_elapsed(0) < 600 ## phase 1 — FORCE_END_PHASE at 0x00E0B4: 0 necessary condition(s) @@ -40,7 +40,7 @@ fired by time passing, which is not a property of the graph. ## phase 2 — END_PHASE at 0x012714: 10 necessary condition(s) precond 0x011814 unit_hp_pct(TCN001, Character_Player_Test) != 0 - precond 0x011B70 read_freg(0) < 70 + precond 0x011B70 stopwatch_elapsed(0) < 70 precond 0x011BC4 hp_pct_test(ADT201, 0) != 1 precond 0x011C18 hp_pct_test(ADT202, 0) != 1 precond 0x011C6C hp_pct_test(ADT203, 0) != 1 @@ -52,8 +52,8 @@ fired by time passing, which is not a property of the graph. ## phase 2 — END_PHASE at 0x012964: 3 necessary condition(s) precond 0x011814 unit_hp_pct(TCN001, Character_Player_Test) != 0 - precond 0x011B70 read_freg(0) < 70 - precond 0x012774 read_freg(0) < 600 + precond 0x011B70 stopwatch_elapsed(0) < 70 + precond 0x012774 stopwatch_elapsed(0) < 600 ## phase 2 — FORCE_END_PHASE at 0x01B828: 0 necessary condition(s) @@ -87,7 +87,7 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x006010: 7 necessary condition(s) precond 0x004D70 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00523C hp_pct_test(TCN004, 0) != 1 - precond 0x005888 read_freg(0) <= 210 + precond 0x005888 stopwatch_elapsed(0) <= 210 precond 0x0058DC hp_pct_test(ADT102, 0) != 1 precond 0x005930 hp_pct_test(ADT107, 0) != 1 precond 0x005984 hp_pct_test(ADT113, 0) != 1 @@ -96,8 +96,8 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x006260: 4 necessary condition(s) precond 0x004D70 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00523C hp_pct_test(TCN004, 0) != 1 - precond 0x005888 read_freg(0) <= 210 - precond 0x006070 read_freg(0) < 1200 + precond 0x005888 stopwatch_elapsed(0) <= 210 + precond 0x006070 stopwatch_elapsed(0) < 1200 ## phase 1 — FORCE_END_PHASE at 0x01482C: 0 necessary condition(s) @@ -140,7 +140,7 @@ fired by time passing, which is not a property of the graph. precond 0x02B4F8 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x02B9C4 hp_pct_test(TCN004, 0) != 1 precond 0x02BFC8 global[112] < 4 - precond 0x02C240 read_freg(0) <= 300 + precond 0x02C240 stopwatch_elapsed(0) <= 300 precond 0x02C294 hp_pct_test(ADT301, 0) != 1 precond 0x02C2E8 hp_pct_test(ADT302, 0) != 1 precond 0x02C33C hp_pct_test(ADT303, 0) != 1 @@ -158,8 +158,8 @@ fired by time passing, which is not a property of the graph. precond 0x02B4F8 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x02B9C4 hp_pct_test(TCN004, 0) != 1 precond 0x02BFC8 global[112] < 4 - precond 0x02C240 read_freg(0) <= 300 - precond 0x02CFD4 read_freg(0) < 1200 + precond 0x02C240 stopwatch_elapsed(0) <= 300 + precond 0x02CFD4 stopwatch_elapsed(0) < 1200 ## phase 3 — FORCE_END_PHASE at 0x034A10: 0 necessary condition(s) @@ -193,7 +193,7 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x004688: 12 necessary condition(s) precond 0x0034B0 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00397C hp_pct_test(TCN004, 0) != 1 - precond 0x003FC8 read_freg(0) < 210 + precond 0x003FC8 stopwatch_elapsed(0) < 210 precond 0x00401C hp_pct_test(ADT101, 0) != 1 precond 0x004070 hp_pct_test(ADT102, 0) != 1 precond 0x0040C4 hp_pct_test(ADT103, 0) != 1 @@ -207,8 +207,8 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x0048D8: 4 necessary condition(s) precond 0x0034B0 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00397C hp_pct_test(TCN004, 0) != 1 - precond 0x003FC8 read_freg(0) < 210 - precond 0x0046E8 read_freg(0) < 600 + precond 0x003FC8 stopwatch_elapsed(0) < 210 + precond 0x0046E8 stopwatch_elapsed(0) < 600 ## phase 1 — FORCE_END_PHASE at 0x009FF4: 0 necessary condition(s) @@ -231,7 +231,7 @@ fired by time passing, which is not a property of the graph. precond 0x00E210 hp_pct_test(TCN004, 0) != 1 precond 0x00E814 global[44] != 3 precond 0x00EA28 global[56] != 0 - precond 0x00EB5C read_freg(0) < 420 + precond 0x00EB5C stopwatch_elapsed(0) < 420 precond 0x00EFC0 global[8] == 0 TRIGGER 0x00F098 global[8] != 2 TRIGGER 0x00F1E4 != 1 @@ -268,7 +268,7 @@ fired by time passing, which is not a property of the graph. precond 0x019690 hp_pct_test(TCN004, 0) != 1 precond 0x019C94 global[64] != 4 precond 0x019E9C global[76] != 2 - precond 0x01A70C read_freg(0) < 600 + precond 0x01A70C stopwatch_elapsed(0) < 600 TRIGGER 0x01A7E4 global[64] != 0 TRIGGER 0x01A994 global[44] != 0 TRIGGER 0x01AB10 global[8] == 0 @@ -310,13 +310,13 @@ fired by time passing, which is not a property of the graph. precond 0x0032B0 hp_pct_test(ADT103, 0) != 1 precond 0x003304 hp_pct_test(ADT106, 0) != 1 precond 0x003358 hp_pct_test(ADT107, 0) != 1 - TRIGGER 0x003478 read_freg(0, 0) >= 130 + TRIGGER 0x003478 stopwatch_elapsed(0, 0) >= 130 ## phase 1 — END_PHASE at 0x003A1C: 4 necessary condition(s) precond 0x002698 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x002B94 hp_pct_test(TCN004, 0) != 1 precond 0x003208 hp_pct_test(ADT101, 0) != 1 - precond 0x0037FC read_freg(0) < 600 + precond 0x0037FC stopwatch_elapsed(0) < 600 ## phase 1 — FORCE_END_PHASE at 0x0052A4: 0 necessary condition(s) @@ -343,7 +343,7 @@ fired by time passing, which is not a property of the graph. precond 0x008474 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x008970 hp_pct_test(TCN004, 0) != 1 precond 0x008FA4 global[16] != 1 - precond 0x0099A4 read_freg(0) < 600 + precond 0x0099A4 stopwatch_elapsed(0) < 600 ## phase 2 — FORCE_END_PHASE at 0x00C9CC: 0 necessary condition(s) @@ -367,14 +367,14 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x0037C0: 4 necessary condition(s) TRIGGER 0x002D84 unit_hp_pct(TCN001, Character_Player_Test) == 0 - TRIGGER 0x002F48 read_freg(0) < 600 + TRIGGER 0x002F48 stopwatch_elapsed(0) < 600 TRIGGER 0x00305C unit_hp_pct(TCN001, Character_Player_Test) != 0 TRIGGER 0x0033D4 hp_pct_test(TCN004, 0) != 1 ## phase 1 — END_PHASE at 0x003D94: 15 necessary condition(s) TRIGGER 0x002D84 unit_hp_pct(TCN001, Character_Player_Test) == 0 TRIGGER 0x002DD8 hp_pct_test(TCN004, 0) == 1 - precond 0x002E34 read_freg(0) < 600 + precond 0x002E34 stopwatch_elapsed(0) < 600 precond 0x0037D8 global[4] != 1 precond 0x00382C hp_pct_test(ADT101, 0) != 1 precond 0x003880 hp_pct_test(ADT102, 0) != 1 @@ -394,12 +394,12 @@ fired by time passing, which is not a property of the graph. TRIGGER 0x00964C unit_hp_pct(TCN001, Character_Player_Test) == 0 TRIGGER 0x009828 unit_hp_pct(TCN001, Character_Player_Test) != 0 TRIGGER 0x009BA0 hp_pct_test(TCN004, 0) != 1 - TRIGGER 0x009F20 read_freg(0) < 600 + TRIGGER 0x009F20 stopwatch_elapsed(0) < 600 ## phase 2 — END_PHASE at 0x00A410: 8 necessary condition(s) TRIGGER 0x00964C unit_hp_pct(TCN001, Character_Player_Test) == 0 TRIGGER 0x0096A0 hp_pct_test(TCN004, 0) == 1 - precond 0x0096FC read_freg(0) < 600 + precond 0x0096FC stopwatch_elapsed(0) < 600 precond 0x00A0A0 global[12] < 4 precond 0x00A0F4 hp_pct_test(ADT205, 0) != 1 precond 0x00A148 hp_pct_test(ADT206, 0) != 1 @@ -438,12 +438,12 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x00407C: 3 necessary condition(s) precond 0x0032D4 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x0037D8 hp_pct_test(TCN004, 0) != 1 - precond 0x003E5C read_freg(0) < 600 + precond 0x003E5C stopwatch_elapsed(0) < 600 ## phase 1 — END_PHASE at 0x0043A8: 5 necessary condition(s) precond 0x0032D4 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x0037D8 hp_pct_test(TCN004, 0) != 1 - precond 0x003E5C read_freg(0) < 600 + precond 0x003E5C stopwatch_elapsed(0) < 600 precond 0x00409C global[0] < 9 TRIGGER 0x00422C global[4] != 1 @@ -461,12 +461,12 @@ fired by time passing, which is not a property of the graph. ## phase 2 — END_PHASE at 0x00CED8: 3 necessary condition(s) precond 0x00C130 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00C634 hp_pct_test(TCN004, 0) != 1 - precond 0x00CCB8 read_freg(0) < 600 + precond 0x00CCB8 stopwatch_elapsed(0) < 600 ## phase 2 — END_PHASE at 0x00D8A8: 16 necessary condition(s) precond 0x00C130 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00C634 hp_pct_test(TCN004, 0) != 1 - precond 0x00CCB8 read_freg(0) < 600 + precond 0x00CCB8 stopwatch_elapsed(0) < 600 precond 0x00CF3C unit_state(ADT215) == 0 precond 0x00CF94 unit_state(ADT217) != 0 precond 0x00CFF0 hp_pct_test(ADT201, 0) != 1 @@ -505,7 +505,7 @@ fired by time passing, which is not a property of the graph. precond 0x013B28 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x014024 hp_pct_test(TCN004, 0) != 1 precond 0x014698 hp_pct_test(ADT301, 0) != 1 - precond 0x014F2C read_freg(0) < 1200 + precond 0x014F2C stopwatch_elapsed(0) < 1200 ## phase 3 — FORCE_END_PHASE at 0x01B31C: 0 necessary condition(s) @@ -545,15 +545,15 @@ fired by time passing, which is not a property of the graph. precond 0x002750 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x002B98 hp_pct_test(TCN004, 0) != 1 precond 0x003214 hp_pct_test(TCN012, 0) != 1 - precond 0x00349C read_freg(0) < 600 + precond 0x00349C stopwatch_elapsed(0) < 600 ## phase 1 — END_PHASE at 0x003B34: 7 necessary condition(s) precond 0x002750 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x002B98 hp_pct_test(TCN004, 0) != 1 precond 0x003214 hp_pct_test(TCN012, 0) != 1 - precond 0x00349C read_freg(0) < 600 + precond 0x00349C stopwatch_elapsed(0) < 600 precond 0x0036DC global[0] < 7 - TRIGGER 0x0037FC read_freg(0, 0) >= 300 + TRIGGER 0x0037FC stopwatch_elapsed(0, 0) >= 300 TRIGGER 0x0039B8 global[8] != 1 ## phase 1 — FORCE_END_PHASE at 0x00976C: 0 necessary condition(s) @@ -604,7 +604,7 @@ fired by time passing, which is not a property of the graph. precond 0x00D1C8 hp_pct_test(TCN004, 0) != 1 precond 0x00D844 hp_pct_test(TCT012, 0) != 1 precond 0x00DAC4 hp_pct_test(ADN201, 0) != 1 - precond 0x00ED40 read_freg(0) < 600 + precond 0x00ED40 stopwatch_elapsed(0) < 600 TRIGGER 0x00EF18 squad_survival_pct(TCN004, 99.9) != 0 TRIGGER 0x00F344 global[16] != 1 @@ -636,7 +636,7 @@ fired by time passing, which is not a property of the graph. TRIGGER 0x003594 unit_hp_pct(TCN001, Character_Player_Test) == 0 TRIGGER 0x0035E8 hp_pct_test(TCN104, 0) == 1 TRIGGER 0x00363C hp_pct_test(TCN012, 0) == 1 - precond 0x003698 read_freg(0) < 600 + precond 0x003698 stopwatch_elapsed(0) < 600 precond 0x00420C global[8] != 1 precond 0x004220 global[12] != 1 precond 0x004234 global[16] != 1 @@ -656,7 +656,7 @@ fired by time passing, which is not a property of the graph. TRIGGER 0x00EEB8 unit_hp_pct(TCN001, Character_Player_Test) == 0 TRIGGER 0x00EF0C hp_pct_test(TCN004, 0) == 1 TRIGGER 0x00EF60 hp_pct_test(TCN012, 0) == 1 - precond 0x00EFBC read_freg(0) < 600 + precond 0x00EFBC stopwatch_elapsed(0) < 600 precond 0x00FB70 hp_pct_test(ADN205, 0) != 1 precond 0x00FBC4 hp_pct_test(ADN206, 0) != 1 precond 0x00FC18 hp_pct_test(ADN207, 0) != 1 @@ -710,7 +710,7 @@ fired by time passing, which is not a property of the graph. precond 0x0039E8 hp_pct_test(TCN008, 0) != 1 precond 0x003C30 hp_pct_test(TCN104, 0) != 1 precond 0x004234 global[0] != 11 - TRIGGER 0x0043F4 read_freg(0, 0) >= 300 + TRIGGER 0x0043F4 stopwatch_elapsed(0, 0) >= 300 TRIGGER 0x004540 unit_state(TCN104) != 1 TRIGGER 0x004860 global[4] == 0 @@ -719,7 +719,7 @@ fired by time passing, which is not a property of the graph. precond 0x0039E8 hp_pct_test(TCN008, 0) != 1 precond 0x003C30 hp_pct_test(TCN104, 0) != 1 precond 0x004234 global[0] != 11 - precond 0x004A0C read_freg(0) < 600 + precond 0x004A0C stopwatch_elapsed(0) < 600 ## phase 1 — FORCE_END_PHASE at 0x007BF0: 0 necessary condition(s) @@ -780,7 +780,7 @@ fired by time passing, which is not a property of the graph. precond 0x012AD0 unit_state(ADS322) == 1 precond 0x012B28 unit_state(ADS323) == 1 TRIGGER 0x012DCC unit_state(TCN006) != 1 - TRIGGER 0x013010 read_freg(global[4]) >= 5 + TRIGGER 0x013010 stopwatch_elapsed(global[4]) >= 5 ## phase 3 — END_PHASE at 0x013680: 6 necessary condition(s) precond 0x011E4C unit_hp_pct(TCN001, Character_Player_Test) != 0 @@ -816,13 +816,13 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x001590: 2 necessary condition(s) precond 0x000FE4 unit_hp_pct(TCN001, Character_Player_Test) != 0 - precond 0x001370 read_freg(0) < 600 + precond 0x001370 stopwatch_elapsed(0) < 600 ## phase 1 — END_PHASE at 0x001BA8: 6 necessary condition(s) precond 0x000FE4 unit_hp_pct(TCN001, Character_Player_Test) != 0 - precond 0x001370 read_freg(0) < 600 + precond 0x001370 stopwatch_elapsed(0) < 600 precond 0x0015E8 hp_pct_test(ADT001, 0) != 1 - TRIGGER 0x001708 read_freg(0, 0) > 300 + TRIGGER 0x001708 stopwatch_elapsed(0, 0) > 300 TRIGGER 0x001918 hp_pct_test(TCN001, 99.9) != 0 TRIGGER 0x001A2C global[4] == 0 @@ -858,12 +858,12 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x0027C0: 3 necessary condition(s) precond 0x001AD4 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x001F1C hp_pct_test(TCN004, 0) != 1 - precond 0x0025A0 read_freg(0) < 600 + precond 0x0025A0 stopwatch_elapsed(0) < 600 ## phase 1 — END_PHASE at 0x002A00: 4 necessary condition(s) precond 0x001AD4 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x001F1C hp_pct_test(TCN004, 0) != 1 - precond 0x0025A0 read_freg(0) < 600 + precond 0x0025A0 stopwatch_elapsed(0) < 600 precond 0x0027E0 global[0] < 10 ## phase 1 — FORCE_END_PHASE at 0x00A684: 0 necessary condition(s) @@ -880,12 +880,12 @@ fired by time passing, which is not a property of the graph. ## phase 2 — END_PHASE at 0x00CD8C: 3 necessary condition(s) precond 0x00C0A0 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00C4E8 hp_pct_test(TCN004, 0) != 1 - precond 0x00CB6C read_freg(0) < 600 + precond 0x00CB6C stopwatch_elapsed(0) < 600 ## phase 2 — END_PHASE at 0x00D214: 6 necessary condition(s) precond 0x00C0A0 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00C4E8 hp_pct_test(TCN004, 0) != 1 - precond 0x00CB6C read_freg(0) < 600 + precond 0x00CB6C stopwatch_elapsed(0) < 600 precond 0x00CDAC global[8] < 6 TRIGGER 0x00CFA8 hp_pct_test(TCN004, 99.9) != 0 TRIGGER 0x00D098 global[4] != 1 @@ -919,7 +919,7 @@ fired by time passing, which is not a property of the graph. TRIGGER 0x003290 hp_pct_test(TCN004, 0) == 1 TRIGGER 0x0032E4 hp_pct_test(TCN006, 0) == 1 TRIGGER 0x003338 hp_pct_test(TCN008, 0) == 1 - precond 0x003394 read_freg(0) <= 1200 + precond 0x003394 stopwatch_elapsed(0) <= 1200 precond 0x004004 global[4] != 1 TRIGGER 0x0040E8 global[8] != 1 TRIGGER 0x0041DC != 1 @@ -993,18 +993,18 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x002B48: 2 necessary condition(s) precond 0x0024D8 unit_hp_pct(TCN001, Character_Player_Test) != 0 - precond 0x002928 read_freg(0) < 600 + precond 0x002928 stopwatch_elapsed(0) < 600 ## phase 1 — END_PHASE at 0x0031B0: 10 necessary condition(s) precond 0x0024D8 unit_hp_pct(TCN001, Character_Player_Test) != 0 - precond 0x002928 read_freg(0) < 600 + precond 0x002928 stopwatch_elapsed(0) < 600 precond 0x002BA8 hp_pct_test(ADT102, 0) != 1 precond 0x002BFC hp_pct_test(ADT103, 0) != 1 precond 0x002C50 hp_pct_test(ADT104, 0) != 1 precond 0x002CA4 hp_pct_test(ADT105, 0) != 1 precond 0x002CF8 hp_pct_test(ADT108, 0) != 1 precond 0x002D4C hp_pct_test(ADT114, 0) != 1 - TRIGGER 0x002E90 read_freg(0) > 300 + TRIGGER 0x002E90 stopwatch_elapsed(0) > 300 TRIGGER 0x003034 global[8] != 1 ## phase 1 — FORCE_END_PHASE at 0x0061D4: 0 necessary condition(s) @@ -1014,13 +1014,13 @@ fired by time passing, which is not a property of the graph. ## phase 2 — END_PHASE at 0x0085AC: 2 necessary condition(s) precond 0x007FC4 unit_hp_pct(TCN201, Character_Player_Test) != 0 - precond 0x00838C read_freg(0) < 600 + precond 0x00838C stopwatch_elapsed(0) < 600 ## phase 2 — END_PHASE at 0x008C24: 6 necessary condition(s) precond 0x007FC4 unit_hp_pct(TCN201, Character_Player_Test) != 0 - precond 0x00838C read_freg(0) < 600 + precond 0x00838C stopwatch_elapsed(0) < 600 precond 0x00860C hp_pct_test(ADT201, 0) != 1 - TRIGGER 0x008750 read_freg(0) >= 300 + TRIGGER 0x008750 stopwatch_elapsed(0) >= 300 TRIGGER 0x008974 hp_pct_test(TCN201, 99.9) != 0 TRIGGER 0x008AA8 global[8] != 1 @@ -1052,7 +1052,7 @@ fired by time passing, which is not a property of the graph. TRIGGER 0x003FFC unit_hp_pct(TCN001, Character_Player_Test) == 0 TRIGGER 0x004050 hp_pct_test(TCN004, 0) == 1 precond 0x0040A4 hp_pct_test(TCT006, 0) != 1 - TRIGGER 0x004B5C read_freg(0) >= 900 + TRIGGER 0x004B5C stopwatch_elapsed(0) >= 900 TRIGGER 0x00571C hp_pct_test(ADN101, 0) != 1 TRIGGER 0x00632C global[0] != 1 @@ -1066,7 +1066,7 @@ fired by time passing, which is not a property of the graph. TRIGGER 0x010388 unit_hp_pct(TCN001, Character_Player_Test) == 0 TRIGGER 0x0103DC hp_pct_test(TCN204, 0) == 1 TRIGGER 0x010430 hp_pct_test(TCN006, 0) == 1 - precond 0x01048C read_freg(0) < 1200 + precond 0x01048C stopwatch_elapsed(0) < 1200 precond 0x011040 hp_pct_test(ADT201, 0) != 1 precond 0x011094 hp_pct_test(ADT202, 0) != 1 TRIGGER 0x011190 global[12] != 1 @@ -1102,11 +1102,11 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x000CB0: 2 necessary condition(s) precond 0x0005A0 unit_hp_pct(TCN001, Character_Player_Test) != 0 - precond 0x0009F0 read_freg(0) < 600 + precond 0x0009F0 stopwatch_elapsed(0) < 600 ## phase 1 — END_PHASE at 0x001054: 4 necessary condition(s) precond 0x0005A0 unit_hp_pct(TCN001, Character_Player_Test) != 0 - precond 0x0009F0 read_freg(0) < 600 + precond 0x0009F0 stopwatch_elapsed(0) < 600 precond 0x000CF8 player_gauge0_test(0) != 1 TRIGGER 0x000D34 player_gauge1_test(0) != 1 @@ -1291,7 +1291,7 @@ fired by time passing, which is not a property of the graph. precond 0x006860 hp_pct_test(ADT101, 0) != 1 precond 0x0072CC unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x0076D8 hp_pct_test(TCN004, 0) != 1 - precond 0x007D84 read_freg(0) < 1800 + precond 0x007D84 stopwatch_elapsed(0) < 1800 ## phase 1 — FORCE_END_PHASE at 0x00C114: 0 necessary condition(s) @@ -1325,7 +1325,7 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x017E48: 4 necessary condition(s) precond 0x01705C unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x017454 hp_pct_test(TCN004, 0) != 1 - precond 0x017AB0 read_freg(0) < 1200 + precond 0x017AB0 stopwatch_elapsed(0) < 1200 TRIGGER 0x017BAC global[0] >= 100 ## phase 1 — FORCE_END_PHASE at 0x01C28C: 0 necessary condition(s) @@ -1366,7 +1366,7 @@ fired by time passing, which is not a property of the graph. precond 0x0039C8 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x003DD8 hp_pct_test(TCN004, 0) != 1 precond 0x0043DC global[0] != 8 - precond 0x00462C read_freg(0) < 900 + precond 0x00462C stopwatch_elapsed(0) < 900 TRIGGER 0x004828 global[0] != 0 ## phase 1 — FORCE_END_PHASE at 0x00FF5C: 0 necessary condition(s) @@ -1401,12 +1401,12 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x002D74: 3 necessary condition(s) precond 0x002128 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x002538 hp_pct_test(TCN004, 0) != 1 - precond 0x002B84 read_freg(0) < 1200 + precond 0x002B84 stopwatch_elapsed(0) < 1200 ## phase 1 — END_PHASE at 0x003850: 22 necessary condition(s) precond 0x002128 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x002538 hp_pct_test(TCN004, 0) != 1 - precond 0x002B84 read_freg(0) < 1200 + precond 0x002B84 stopwatch_elapsed(0) < 1200 precond 0x002DCC hp_pct_test(ADN113, 0) != 1 precond 0x002E20 hp_pct_test(ADN114, 0) != 1 precond 0x002E74 hp_pct_test(ADN115, 0) != 1 @@ -1455,12 +1455,12 @@ fired by time passing, which is not a property of the graph. precond 0x00218C unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x0024E0 hp_pct_test(TCN003, 0) != 1 precond 0x002534 hp_pct_test(TCN002, 0) != 1 - TRIGGER 0x0026E8 read_freg(0) > 420 + TRIGGER 0x0026E8 stopwatch_elapsed(0) > 420 ## phase 1 — END_PHASE at 0x002C2C: 4 necessary condition(s) precond 0x00218C unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x0024E0 hp_pct_test(TCN003, 0) != 1 - precond 0x002920 read_freg(0) < 1200 + precond 0x002920 stopwatch_elapsed(0) < 1200 TRIGGER 0x002A4C unit_hp_pct(TCN001, ELLEN) != 0 ## phase 1 — FORCE_END_PHASE at 0x006F24: 0 necessary condition(s) @@ -1505,14 +1505,14 @@ fired by time passing, which is not a property of the graph. precond 0x010548 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x010970 hp_pct_test(TCN004, 0) != 1 precond 0x010FCC hp_pct_test(TCT006, 0) != 1 - precond 0x011254 read_freg(0) < 1200 + precond 0x011254 stopwatch_elapsed(0) < 1200 ## phase 1 — END_PHASE at 0x011814: 7 necessary condition(s) precond 0x00CD3C global[56] == 1 precond 0x010548 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x010970 hp_pct_test(TCN004, 0) != 1 precond 0x010FCC hp_pct_test(TCT006, 0) != 1 - precond 0x011254 read_freg(0) < 1200 + precond 0x011254 stopwatch_elapsed(0) < 1200 precond 0x011534 global[52] < 14 precond 0x011554 global[60] != 1 diff --git a/docs/re/data/isl-stage02-conditions.txt b/docs/re/data/isl-stage02-conditions.txt index 34df3441..e8b2b1aa 100644 --- a/docs/re/data/isl-stage02-conditions.txt +++ b/docs/re/data/isl-stage02-conditions.txt @@ -21,7 +21,7 @@ block over its ACTUAL predecessors — not from a linear walk. builtin103 35 random 26 unit_hp_pct 9 - read_freg 9 + stopwatch_elapsed 9 builtin7 9 builtin99 1 @@ -41,7 +41,7 @@ block over its ACTUAL predecessors — not from a linear walk. 0x005768 if random(5) == 3 -> 0x552C 0x00577C if random(5) == 4 -> 0x55D4 0x005790 if random(5) == 5 -> 0x567C - 0x005888 if read_freg(0) <= 210 -> 0x6028 + 0x005888 if stopwatch_elapsed(0) <= 210 -> 0x6028 0x0058DC if hp_pct_test(ADT102, 0) != 1 -> 0x6028 0x005930 if hp_pct_test(ADT107, 0) != 1 -> 0x6028 0x005984 if hp_pct_test(ADT113, 0) != 1 -> 0x6028 @@ -57,7 +57,7 @@ block over its ACTUAL predecessors — not from a linear walk. 0x005E30 if hp_pct_test(ADN112, 0) != 1 -> 0x5F98 0x005E84 if hp_pct_test(ADN114, 0) != 1 -> 0x5F98 0x005ED8 if hp_pct_test(ADN115, 0) != 1 -> 0x5F98 - 0x006070 if read_freg(0) < 1200 -> 0x6278 + 0x006070 if stopwatch_elapsed(0) < 1200 -> 0x6278 0x0062C0 if unit_state(ADS151) != 2 -> 0x65A0 0x0062F8 if builtin105(ADS151) != 1 -> 0x6594 0x006330 if unit_alive(TCS151) != 1 -> 0x6594 @@ -300,7 +300,7 @@ block over its ACTUAL predecessors — not from a linear walk. 0x010BF8 if unit_state(ADS151) != 1 -> 0x10C64 0x010C50 if unit_state(TCS151) == 1 -> 0x10D24 0x010D7C if dist_lt(TCN001, ADS151, 4000) != 1 -> 0x10EA8 - 0x010EF0 if read_freg(8) <= 60 -> 0x11064 + 0x010EF0 if stopwatch_elapsed(8) <= 60 -> 0x11064 0x011094 if builtin103() != 0 -> 0x110B4 0x0110F8 if unit_state(TCS151) == 1 -> 0x11184 0x0111C4 if hp_pct_test(ADS151, 0) != 1 -> 0x112F0 @@ -476,7 +476,7 @@ block over its ACTUAL predecessors — not from a linear walk. 0x0195A8 if random(3) == 3 -> 0x194BC 0x019698 if hp_pct_test(TCT206, 0) != 1 -> 0x1994C 0x0199C8 if builtin7(TCT206, 1, Route_TCT206_p2S, 4294967295, 500) == 1 -> 0x19A38 - 0x019A24 if read_freg(0) <= 600 -> 0x19A44 + 0x019A24 if stopwatch_elapsed(0) <= 600 -> 0x19A44 0x019A8C if <= 240 -> 0x1A1E4 0x019AE0 if hp_pct_test(ADN201, 0) != 1 -> 0x1A1E4 0x019B34 if hp_pct_test(ADN202, 0) != 1 -> 0x1A1E4 @@ -519,7 +519,7 @@ block over its ACTUAL predecessors — not from a linear walk. 0x01A924 if hp_pct_test(TCT206, 89.9) != 0 -> 0x1AA38 0x01AA38 if global[104] != 0 -> 0x1AAEC 0x01AAF8 if global[4] == 0 -> 0x1ABCC - 0x01AB54 if read_freg(global[4]) >= 5 -> 0x1ABCC + 0x01AB54 if stopwatch_elapsed(global[4]) >= 5 -> 0x1ABCC 0x01AC98 if unit_alive(ADN201) != 1 -> 0x1AD68 0x01AD04 if dist_lt(TCT206, ADN201, 15000) != 1 -> 0x1AD68 0x01AD8C if unit_alive(ADN202) != 1 -> 0x1AE5C @@ -746,7 +746,7 @@ block over its ACTUAL predecessors — not from a linear walk. 0x023E40 if unit_state(ADS251) != 1 -> 0x23EAC 0x023E98 if unit_state(TCS251) == 1 -> 0x23F6C 0x023FC4 if dist_lt(TCN001, ADS251, 4000) != 1 -> 0x2402C - 0x024074 if read_freg(8) <= 60 -> 0x241E8 + 0x024074 if stopwatch_elapsed(8) <= 60 -> 0x241E8 0x024230 if unit_state(TCS251) == 1 -> 0x24328 0x024368 if hp_pct_test(ADS251, 0) != 1 -> 0x243F4 0x0243F8 if global[20] != 0 -> 0x24494 @@ -786,7 +786,7 @@ block over its ACTUAL predecessors — not from a linear walk. 0x02BF04 if random(5) == 4 -> 0x2BD5C 0x02BF18 if random(5) == 5 -> 0x2BE04 0x02BFC8 if global[112] < 4 -> 0x2C1F8 - 0x02C240 if read_freg(0) <= 300 -> 0x2CF8C + 0x02C240 if stopwatch_elapsed(0) <= 300 -> 0x2CF8C 0x02C294 if hp_pct_test(ADT301, 0) != 1 -> 0x2CF8C 0x02C2E8 if hp_pct_test(ADT302, 0) != 1 -> 0x2CF8C 0x02C33C if hp_pct_test(ADT303, 0) != 1 -> 0x2CF8C @@ -814,10 +814,10 @@ block over its ACTUAL predecessors — not from a linear walk. 0x02CB04 if hp_pct_test(ADS351, 0) != 1 -> 0x2CC0C 0x02CC0C if global[112] != 0 -> 0x2CD1C 0x02CDC8 if global[4] == 0 -> 0x2CE9C - 0x02CE24 if read_freg(global[4]) >= 5 -> 0x2CE9C + 0x02CE24 if stopwatch_elapsed(global[4]) >= 5 -> 0x2CE9C 0x02CE9C if global[112] != 0 -> 0x2CEFC 0x02CEDC if builtin99() == 0 -> 0x2CEFC - 0x02CFD4 if read_freg(0) < 1200 -> 0x2D1F4 + 0x02CFD4 if stopwatch_elapsed(0) < 1200 -> 0x2D1F4 0x02D238 if hp_pct_test(ADS351, 0) != 1 -> 0x2D2F4 0x02D270 if builtin105(ADS351) != 1 -> 0x2D2F4 0x02DF64 if hp_pct_test(ADT301, 0) != 1 -> 0x2DFA8 diff --git a/docs/re/data/isl-stage02-phase-ends.txt b/docs/re/data/isl-stage02-phase-ends.txt index f5de65fc..d98e77de 100644 --- a/docs/re/data/isl-stage02-phase-ends.txt +++ b/docs/re/data/isl-stage02-phase-ends.txt @@ -177,7 +177,7 @@ phase code bases: 0xe4 0x14aa8 0x24b4c ## phase 2 — builtin 6 (END_PHASE) at 0x1AC44 01AB74: 02030C00 set.i len=12 k=02,03 00000000 00000000 local[0] = special[0] - 01AB80: 00000C13 call len=12 k=00,00 00000009 000002A1 read_freg + 01AB80: 00000C13 call len=12 k=00,00 00000009 000002A1 stopwatch_elapsed 01AB8C: 02020C01 set.f len=12 k=02,02 00000001 00000000 special[1] = special[0] 01AB98: 01021001 set.f len=16 k=01,02 00000000 40140000 00000000 special[0] = imm 5 01ABA8: 02020C05 cmp.b len=12 k=02,02 00000000 00000001 diff --git a/docs/re/data/isl-stage02-phase-guards.txt b/docs/re/data/isl-stage02-phase-guards.txt index 09429b64..c4503097 100644 --- a/docs/re/data/isl-stage02-phase-guards.txt +++ b/docs/re/data/isl-stage02-phase-guards.txt @@ -26,7 +26,7 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x006010: 7 necessary condition(s) precond 0x004D70 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00523C hp_pct_test(TCN004, 0) != 1 - precond 0x005888 read_freg(0) <= 210 + precond 0x005888 stopwatch_elapsed(0) <= 210 precond 0x0058DC hp_pct_test(ADT102, 0) != 1 precond 0x005930 hp_pct_test(ADT107, 0) != 1 precond 0x005984 hp_pct_test(ADT113, 0) != 1 @@ -35,8 +35,8 @@ fired by time passing, which is not a property of the graph. ## phase 1 — END_PHASE at 0x006260: 4 necessary condition(s) precond 0x004D70 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x00523C hp_pct_test(TCN004, 0) != 1 - precond 0x005888 read_freg(0) <= 210 - precond 0x006070 read_freg(0) < 1200 + precond 0x005888 stopwatch_elapsed(0) <= 210 + precond 0x006070 stopwatch_elapsed(0) < 1200 ## phase 1 — FORCE_END_PHASE at 0x01482C: 0 necessary condition(s) @@ -79,7 +79,7 @@ fired by time passing, which is not a property of the graph. precond 0x02B4F8 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x02B9C4 hp_pct_test(TCN004, 0) != 1 precond 0x02BFC8 global[112] < 4 - precond 0x02C240 read_freg(0) <= 300 + precond 0x02C240 stopwatch_elapsed(0) <= 300 precond 0x02C294 hp_pct_test(ADT301, 0) != 1 precond 0x02C2E8 hp_pct_test(ADT302, 0) != 1 precond 0x02C33C hp_pct_test(ADT303, 0) != 1 @@ -97,7 +97,7 @@ fired by time passing, which is not a property of the graph. precond 0x02B4F8 unit_hp_pct(TCN001, Character_Player_Test) != 0 precond 0x02B9C4 hp_pct_test(TCN004, 0) != 1 precond 0x02BFC8 global[112] < 4 - precond 0x02C240 read_freg(0) <= 300 - precond 0x02CFD4 read_freg(0) < 1200 + precond 0x02C240 stopwatch_elapsed(0) <= 300 + precond 0x02CFD4 stopwatch_elapsed(0) < 1200 ## phase 3 — FORCE_END_PHASE at 0x034A10: 0 necessary condition(s) diff --git a/docs/re/data/isl-stage02.txt b/docs/re/data/isl-stage02.txt index b87a082e..2ce5b9c0 100644 --- a/docs/re/data/isl-stage02.txt +++ b/docs/re/data/isl-stage02.txt @@ -103,12 +103,12 @@ Generated by `tools/re-capture/isl_report.py calls`. 3 move_order 20 124 timer_stop 15 120 wait_cmds_drained 14 - 8 set_flag 12 + 8 stopwatch_start 12 100 reset_phase_threads 12 - 93 clear_flag 12 + 93 stopwatch_stop 12 59 fade_sound 12 6 END_PHASE 12 - 9 read_freg 12 + 9 stopwatch_elapsed 12 95 unit_hp_pct 9 115 named_event 9 48 squadron_escort 8 @@ -185,7 +185,7 @@ resync from 0x5058 00528C: 00000C13 call len=12 k=00,00 0000007C 00000256 timer_stop 005298: 01020C00 set.i len=12 k=01,02 00000000 FFFFFFFF special[0] = imm 0xFFFFFFFF 0052A4: 02030C00 set.i len=12 k=02,03 00000000 00000000 local[0] = special[0] -0052B0: 00000C13 call len=12 k=00,00 0000005D 00000257 clear_flag(0xFFFFFFFF) +0052B0: 00000C13 call len=12 k=00,00 0000005D 00000257 stopwatch_stop(0xFFFFFFFF) 0052BC: 00000C13 call len=12 k=00,00 00000076 00000258 builtin118 0052C8: 00000C13 call len=12 k=00,00 00000027 0000025A MARK_LAST_PHASE 0052D4: 00000C13 call len=12 k=00,00 00000052 0000025B banner_mission_failed diff --git a/docs/re/data/isl-timers.txt b/docs/re/data/isl-timers.txt index 9b61c60c..fd973398 100644 --- a/docs/re/data/isl-timers.txt +++ b/docs/re/data/isl-timers.txt @@ -1,12 +1,14 @@ -# The 32 per-phase stopwatches -- set_flag / read_freg / clear_flag vs the timeline +# The 32 per-phase stopwatches -- stopwatch_start / _elapsed / _stop vs the timeline Written by hand from tools/re-capture/isl.py; see docs/re/structures/isl-timers.md. +(Built-ins 8 / 9 / 93; the corpus called them set_flag / read_freg / clear_flag +until the reading below showed they are a stopwatch bank.) Claim under test: `[phase+88][i]` only advances while `[phase+120][i] == 1`, and built-in 8 is the only thing that sets that flag. So every timeline entry's `kind` must be an index its own phase starts, or the entry is dead. -file phase set_flag(i) started read_freg(i) timeline kinds +file phase stopwatch_start(i) stopwatch_elapsed(i) timeline kinds Stage01.ssb 1 [0, 5, 14] [0] {0: 27, 5: 3} Stage01.ssb 2 [0, 5, 14] [0] {0: 24, 5: 3} Stage02.ssb 1 [0, 5, 8] [0, 8] {0: 21, 5: 4} @@ -54,8 +56,8 @@ Stage29.ssb 1 [0, 5] [0] { timeline entries whose kind is started in the same phase : 675 / 675 = 100.0% entry-weighted control (a random index in 0..31) : 11.2% -read_freg indices started in the same phase : 82 yes / 1 no ['Stage06.ssb ph1 read_freg(15)'] +stopwatch_elapsed indices started in the same phase : 82 yes / 1 no ['Stage06.ssb ph1 stopwatch_elapsed(15)'] -set_flag argument histogram: {0: 44, 1: 10, 2: 1, 4: 2, 5: 38, 6: 2, 7: 2, 8: 5, 9: 2, 10: 4, 11: 2, 12: 1, 13: 1, 14: 21, 15: 24, 16: 1, 17: 3, 18: 3, 19: 2, 20: 2, 21: 2} -read_freg argument histogram: {0: 105, 1: 13, 2: 2, 4: 1, 6: 2, 7: 2, 8: 5, 9: 2, 10: 3, 11: 2, 12: 3, 13: 1, 14: 5, 15: 28, 16: 1, 17: 3, 18: 3, 19: 2, 20: 2, 21: 2, None: 31} -clear_flag argument histogram: {-1: 133} +stopwatch_start argument histogram: {0: 44, 1: 10, 2: 1, 4: 2, 5: 38, 6: 2, 7: 2, 8: 5, 9: 2, 10: 4, 11: 2, 12: 1, 13: 1, 14: 21, 15: 24, 16: 1, 17: 3, 18: 3, 19: 2, 20: 2, 21: 2} +stopwatch_elapsed argument histogram: {0: 105, 1: 13, 2: 2, 4: 1, 6: 2, 7: 2, 8: 5, 9: 2, 10: 3, 11: 2, 12: 3, 13: 1, 14: 5, 15: 28, 16: 1, 17: 3, 18: 3, 19: 2, 20: 2, 21: 2, None: 31} +stopwatch_stop argument histogram: {-1: 133} diff --git a/docs/re/structures/isl-mission-timer.md b/docs/re/structures/isl-mission-timer.md index fa72a9a1..344f8832 100644 --- a/docs/re/structures/isl-mission-timer.md +++ b/docs/re/structures/isl-mission-timer.md @@ -145,11 +145,27 @@ no table of subscribed tags to find either. ### 🟡 Where the subscriber actually lives — located, not read The bus object at `[0x828F35DC]` carries a **map at `+8216`**, looked up through -`sub_82254A08` from **`sub_823001E8`** — whose only caller is `sub_8230C398`, the -per-frame message pump (itself called from the frame loop `sub_821A6544` with the -frame `dt`). So dispatch is a **runtime registry keyed by the tag**, and the -question "does running out of time end the mission" reduces to: *what inserts into -`bus+8216`, and with which key.* That insert path is not read here. +`sub_82254A08` from **`sub_823001E8`** — whose only caller is `sub_8230C398`. + +🔴 **Correction to my own label from the previous pass.** I called +`sub_8230C398` "the per-frame message pump". It is *called* every frame (from +`sub_821A6470` at `0x821A654C` and from the mission loop `sub_821AA1B0` at +`0x821AA7DC`, both with the frame `dt`), but **it drains nothing**: its whole +body is a state machine on the counter at `[0x828E1F8C]`, and across 466 +instructions it calls only an allocator (`sub_8230C160`), string building +(`sub_8217FA08`), a map lookup (`sub_823001E8`) and a *push* (`sub_8225FEA0`). +It is a boot/loading sequencer that posts messages, not the consumer of them. + +Two further cautions the search turned up: + +* `sub_82254A08` is a **generic map find** with ~120 call sites image-wide, and + `+8216` is a common offset — the pair alone identifies nothing. +* The key `sub_823001E8` looks up is a **pointer** (`lwz r4, 13780(r11)` stored + and passed by address), **not a message tag**. So `bus+8216` may not be the + subscriber registry at all. + +**So the drain of the queue at `bus+4` is still unlocated**, and with it the +answer to whether running out of time ends the mission. ## 🟡 Not settled diff --git a/docs/re/structures/isl-timers.md b/docs/re/structures/isl-timers.md index 1309a0d0..8d1e6004 100644 --- a/docs/re/structures/isl-timers.md +++ b/docs/re/structures/isl-timers.md @@ -109,13 +109,16 @@ in a coherent block of stages) — checked before believing. ## 🟡 What this leaves -* The **naming**. `set_flag` / `read_freg` / `clear_flag` describe none of this. - ✅ The other timer is now read — [isl-mission-timer](isl-mission-timer.md) — - so the collision is understood: 123/124/125/126/127 act on five *scalar* - fields (`[phase+304…320]`), this family on a 32-entry *bank*. `stopwatch_start` - / `stopwatch_elapsed` / `stopwatch_stop` would separate them. Still not renamed - here, so every artefact regenerates byte-identical; the rename is its own - change and its own artefact diff. +* ~~The **naming**.~~ ✅ **RENAMED (2026-08-27).** `isl.py` now emits + **`stopwatch_start` (8) / `stopwatch_elapsed` (9) / `stopwatch_stop` (93)**; + built-ins 123–127 keep `timer_*` for the *other* clock + ([isl-mission-timer](isl-mission-timer.md)), which acts on five scalar fields + rather than a 32-entry bank. The rename touched **84 lines across 5 artefacts + and every one pairs exactly** with its old-name partner once column padding is + normalised — nothing but the three names changed, and this file's own artefact + reproduces the same 675/675, 11.2 %, 82/1 numbers under the new labels. + ⚠️ Older prose in the corpus still uses the old names where it is quoting what + was believed at the time; that is deliberate. * The **one exception**: `read_freg(15)` in Stage 06 phase 1 is not started by a `set_flag(15)` in that phase. Cross-phase carry-over or a start in the unreached code — not chased. diff --git a/tools/re-capture/isl.py b/tools/re-capture/isl.py index 1ef2aaea..0921f84c 100755 --- a/tools/re-capture/isl.py +++ b/tools/re-capture/isl.py @@ -86,7 +86,8 @@ KIND = {0: 'global', 1: 'imm', 2: 'special', 3: 'local'} # guess. See docs/re/structures/isl-builtins.md. BUILTIN = { 1: 'start_coroutine', 2: 'deploy_squadron', 3: 'move_order', 4: 'wait_s', - 5: 'kill_coroutine', 6: 'END_PHASE', 8: 'set_flag', 9: 'read_freg', + 5: 'kill_coroutine', 6: 'END_PHASE', 8: 'stopwatch_start', + 9: 'stopwatch_elapsed', 10: 'random', 11: 'end_coroutine', 12: 'activate_unit', 13: 'play_se', 14: 'play_bgm', 15: 'set_group_speed', @@ -108,7 +109,7 @@ BUILTIN = { 77: 'banner_mission_start', 78: 'banner_mission_complete', 81: 'banner_objective_update', 82: 'banner_mission_failed', 135: 'banner_mission_restart', - 93: 'clear_flag', 94: 'is_engaged', 95: 'unit_hp_pct', 100: 'reset_phase_threads', + 93: 'stopwatch_stop', 94: 'is_engaged', 95: 'unit_hp_pct', 100: 'reset_phase_threads', 102: 'prompt_yes_no', 108: 'deploy_squadron_ex', 109: 'set_unit_flags', 115: 'named_event', 120: 'wait_cmds_drained', 123: 'timer_resume', 124: 'timer_stop', @@ -174,7 +175,7 @@ def symbols(b, which): # makes the test discriminating -- plain range-checking cannot separate an index # from a bool, because every small integer is "in range". # -# It also refutes one tempting entry: `set_flag`'s slot 0 passes the range and +# It also refutes one tempting entry: `stopwatch_start`'s slot 0 passes the range and # spread tests but its maximum EXCEEDS the table (flag indices run 0..31 against # tables as small as 40), so it is excluded. Slots are only listed here when the # ratio stayed below 1.0. @@ -210,7 +211,7 @@ UNIT_SLOTS = {4: UNIT_ARG, 12: UNIT_ARG2, 20: UNIT_ARG3} # one taking a third; # * 24 built-ins have a slot 0 that is NOT the constant -- and every one of # them takes no symbol at slot 4 (`start_coroutine` a code offset, `wait_s` -# a double, `set_flag` an index). +# a double, `stopwatch_start` an index). # # The tag does NOT generalise to "every even slot is a tag": slot 8 is a bare # double for built-ins 4, 20, 24, 26, 28, 29, 90, 106 and 127, and built-in 75