diff --git a/docs/re/BACKLOG.md b/docs/re/BACKLOG.md index bd55ee4..11a1bab 100644 --- a/docs/re/BACKLOG.md +++ b/docs/re/BACKLOG.md @@ -601,6 +601,32 @@ unknown, what evidence exists, and what the first step would be. Move an item in `sub_824480D0` / `sub_82448AA0`), and whether `Stage30`–`Stage33` exist on the disc at all — the table has 33 slots but only 28 scripts were extracted. +* ✅ **(2026-08-27) `STAGENN_UNIT_MAX` IS TWO PER-STAGE UNIT CAPS — `PLANE` and + `VESSEL`. [structures/isl-condition-builtins](structures/isl-condition-builtins.md).** + Reading `sub_82261F70` past the table lookup finishes the mechanism the stage + index feeds. The section name is built from the 0-based stage index, the section + is looked up, and two ints land in the phase: + **`[phase+356] = PLANE`** (default **200**) and **`[phase+360] = VESSEL`** + (default **20**), the defaults taken when a stage has no entry + (`stw r11(=20), 360(r21)` / `stw r10(=200), 356(r21)`). Key strings are + `0x820A8B14 = "PLANE"` and `0x820A8B1C = "VESSEL"`. All three names — the + section and both keys — are the game's own. So a stage declares how many + fighters and how many capital ships it may hold. + ✅ Surrounding reads name the config: `GP_SCRIPT`, `SCRIPTS`, `Resource2D`, + `TABLE`, and the pak census counts **40 ` [r31+84] +8226230C lwz r11, 152(r21) ; the 0-based stage index +8226231C lwzx r4, r11, r10 ; "STAGE(N+1)_UNIT_MAX" +82262320 bl 0x82448AA0 ; find that section +82262328 bc 4, eq, 0x82262340 ; found -> read two keys + ; NOT found — defaults: +82262334 stw r11(=20), 360(r21) +82262338 stw r10(=200), 356(r21) + ; found: +82262348 addi r4, r11, -29932 ; 0x820A8B14 = "PLANE" +82262360 stw r11, 356(r21) +8226235C addi r4, r10, -29924 ; 0x820A8B1C = "VESSEL" +82262368 stw r3, 360(r21) +``` + +| phase field | config key | default | +|---|---|---| +| `[phase+356]` | **`PLANE`** | **200** | +| `[phase+360]` | **`VESSEL`** | **20** | + +So the section is a per-stage pair of **unit caps** — planes (fighters) and +vessels (capital ships) — with the section name built from the stage index and +the whole thing falling back to 200/20 when a stage has no entry. All three names +are the game's own. + +The surrounding reads name the config itself: `GP_SCRIPT` (`0x820A8244`), +`SCRIPTS`, `Resource2D`, `TABLE`. The pak census counts **40 `