Files
pmd-sky/include/main_0202AAA8.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

47 lines
942 B
C

#ifndef PMDSKY_MAIN_0202AAA8_H
#define PMDSKY_MAIN_0202AAA8_H
#include "util.h"
#include "main_02028080.h"
struct unk_0202AAA8 {
u32 field_0x0;
u8 field_0x4[4];
u8 field_0x8;
u8 field_0x9[0x17];
u16 field_0x20;
u8 field_0x22[0x7E];
s32 field_0xA0;
u8 field_0xA4[0x54];
u32 field_0xF8;
u32 field_0xFC;
s32 field_0x100;
u32 field_0x104;
u8 field_0x108[0x58];
u8 *field_0x160;
u8 field_0x164[0x34];
void *field_0x198;
s32 field_0x19C;
u8 field_0x1A0;
u8 field_0x1A1;
u8 field_0x1A2[2];
s32 field_0x1A4;
s32 field_0x1A8;
s32 field_0x1AC;
s32 field_0x1B0;
u8 field_0x1B4[8];
s32 field_0x1BC;
u8 field_0x1C0[2];
u8 field_0x1C2;
u8 field_0x1C3;
u8 field_0x1C4;
};
void *GetWindowContents(s32 window_id);
void SetParentMenuState7(s32 window_id);
void CloseParentMenu(s32 window_id);
bool8 sub_0202AAE8(s32 window_id);
#endif