re: state 4's edges are selected by an event code -- 6 of 26 handled

Continuing Q6's last item: the condition on each edge.

sub_821C6458's third argument is an EVENT CODE, and state 4 -- reached
straight after the main menu is installed, so the input-waiting state --
dispatches on it through a second jump table at 0x821c6b7c, 26 cases.
Six are handled and twenty fall through changing nothing:

  event 0 -> state 0 (TITLE_SCREEN, back to the title)
  events 3, 5, 8, 25 -> state 8 (LOADING)
  event 10 -> state 5

So the edges I listed last iteration as "4 -> 0, 5, 8x4" are each now
attributed to a specific event, and the input state's graph is complete.

One thing I deliberately did NOT promote. The main menu has five items, B
returns to the title, and this table has one event to the title, four to
LOADING and one elsewhere. That is a tempting fit -- B plus four items
that load an external archive plus EXTRAS staying inside GP_TITLE -- and
it matches everything measured. It is also a count-match and nothing
more: the events are unnamed, nothing shows event 3 is a particular menu
row, and state 5 installs no named screen so the EXTRAS half has no
support at all. Written down as an observation with that said plainly,
because the same shape of reasoning already cost me DIFFICULTY and
EXTRA_MENU two iterations ago.

Still open: what the event numbers mean, the conditions on edges out of
the other states, and what states 1/3/5/6/7/9 do.
This commit is contained in:
Sylpheed RE agent
2026-08-28 20:00:49 +00:00
parent 0a8d2cd9d6
commit 91e9f07e40
3 changed files with 78 additions and 4 deletions

View File

@@ -48,8 +48,27 @@ TRANSITIONS -- every `li rX,N ; stw rX,136(r30)` in the function
8 2 0x821c7548
(state 9 stores nothing -- terminal within this function)
THE CONDITION ON STATE 4's EDGES -- decoded
sub_821C6458(this, ?, r5) takes an EVENT CODE in its third argument.
State 4 -- the input-waiting state -- dispatches on it:
821c6b5c cmplwi cr6, r27, 0x19 ; 26 events, 0..25
821c6b60 bgt cr6, <default>
821c6b68 addi r12, r12, 27516 ; table at 0x821c6b7c
821c6b78 bctr
Only 6 of the 26 are handled; the other 20 fall through with no state change.
event 0 -> block 0x821c6be4 -> state 0 (TITLE_SCREEN -- back to the title)
event 3 -> block 0x821c6e78 -> state 8 (LOADING)
event 5 -> block 0x821c6f84 -> state 8 (LOADING)
event 8 -> block 0x821c6f34 -> state 8 (LOADING)
event 10 -> block 0x821c6e28 -> state 5
event 25 -> block 0x821c6ed8 -> state 8 (LOADING)
WHAT IS NOT DECODED
* the CONDITION on each edge -- which input or event selects it;
* what the event NUMBERS mean -- button id, menu-item id or message id;
* the conditions on edges out of states other than 4;
* what states 1, 3, 5, 6, 7 and 9 do (they install no named screen);
* state 3 is never a destination here, so something outside this function
sets it.