From ad5270cfdd874917a1ad74203c91446350633216 Mon Sep 17 00:00:00 2001 From: Sylpheed RE agent Date: Thu, 27 Aug 2026 11:14:17 +0000 Subject: [PATCH] re: STAGENN_UNIT_MAX holds two per-stage caps, PLANE and VESSEL 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, looked up, and two ints land in the phase -- [phase+356] = PLANE (default 200) [phase+360] = VESSEL (default 20) with the defaults taken when a stage has no entry. Key strings are 0x820A8B14 "PLANE" and 0x820A8B1C "VESSEL"; section and both keys are the game's own names. Surrounding reads (GP_SCRIPT, SCRIPTS, Resource2D, TABLE) plus the pak census's 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 `