Files
pmd-sky/include/main_0202AB40.h
cecilarmitais 6f3ad6941c Decompile 48 more callees; clear four asm files entirely
Every function of four whole asm files now matches, so all four objects leave
main.lsf and the .s/.inc files go:

  asm/overlay_29_023055B0.s    4 functions
  asm/overlay_29_02314810.s    9 functions
  asm/overlay_29_022E7EC4.s   25 functions
  asm/main_0202AB94.s         10 functions

struct unk_0202AAA8 gains four members carved out of existing byte padding: a
u32 at 0x0, the third menu kind's flag word plus its initial selected index at
0xFC/0x100, a u8 * at 0x160, and a signed s32 at 0x1A8. Offsets and sizeof are
unchanged (0x1C8), proven by compiling one offsetof assertion per member with
mwccarm and reading the folded constant back; the check carries a negative
control that correctly fails, so "all as expected" is an outcome it could have
missed. Nothing in the tree read any of the four offsets.

struct struct_2 moves from include/overlay_31_02382820.h to include/window.h so
a src/main_* file can reach it. CreateSimpleMenuInternal copies it whole (0x98
bytes), so its size is load-bearing. It is a pure move; the name is pre-existing
and unchanged. window.h rather than main_0202AAA8.h because the latter drags
main_0202AB40.h's prototypes into overlay_31_02382820.c, where they collide with
that file's own declarations.

Four data symbols declared `extern s32` from a call site whose parameter was
void * are given their real types: _0209C85C and ov11_02322CC8 are
WindowTemplate (each measures exactly 0x10 to the next symbol, and
WindowTemplate is 16 bytes), _0209C86C and ov11_02322CF0 are
struct unk_0202A5CC[] (8-byte records, matching the element counts the call
sites pass). Each had exactly one user. The (s32) cast at
overlay_11_02307334.c's call site goes with them -- field_0x1c is already a
struct struct_2.

Region arms, all message ids: overlay_29_0230558C.c gains a JPN_MSG_OFFSET block
for five ids; move_orb_effects.c reuses its existing one and adds MESSAGE_ED0 /
MESSAGE_ED1 for the two that shift by -0x2BE rather than the file's flat -0x2C0;
overlay_29_02315118.c gains five named defines because it has no offset constant
of its own. Every other region delta in these four files is a header-driven
field displacement and needs nothing.

Nine call-site-derived declarations across six files are replaced by an include
of the owning header. Four declared void where the function returns bool8; two
declared an s8 return where it is s32; three took an s8 parameter where it is
s32. One was the fifth extern on a single physical line, which a line-oriented
grep does not see.

Authored by Claude (Opus 5) under human direction. Confirmed by matching builds
in all three regions: build/pmdsky.us/pmdsky.us.nds: OK,
build/pmdsky.eu/pmdsky.eu.nds: OK, build/pmdsky.jp/pmdsky.jp.nds: OK.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 23:13:39 -07:00

17 lines
450 B
C

#ifndef PMDSKY_MAIN_0202AB40_H
#define PMDSKY_MAIN_0202AB40_H
#include "util.h"
#include "window.h"
u32 IsParentMenuActive(s32 window_id);
bool8 CheckParentMenuField0x1A0(s32 window_id);
s32 GetWindowIdSelectedItemOnPage(s32 window_id);
void sub_0202AB94(s32 window_id, s32 a);
s32 GetSimpleMenuResult__0202AEA4(s32 window_id);
void UpdateParentMenu(struct Window *w);
void sub_0202AF78(struct Window *w);
void sub_0202B030(s32 window_id);
#endif