Files
pmd-sky/include/main_0202B558.h
cecilarmitais 9b3650fe33 Decompile 26 more callees; clear six asm files entirely
Twenty-six functions across twelve groups, each group chosen so it clears a
.s file's head or the whole file, never splitting one:

  asm/overlay_29_0231EDFC.s  TryHurl
  asm/overlay_29_0230E064.s  TryRecruit
  asm/overlay_29_0234B130.s  ov29_0234B130, ov29_0234B1A4,
                             LogMessageByIdWithPopupCheckParticipants,
                             WaitUntilAlertBoxTextIsLoadedWrapper,
                             LogMessageByIdWithPopupCheckUser,
                             LogMessageWithPopupCheckUser, LogMessageByIdQuiet
  asm/overlay_29_0231B1B8.s  TryActivateBadDreams
  asm/overlay_29_02301D84.s  OtherMonsterAbilityIsActive
  asm/main_02050300.s        SetItemAcquired
  asm/overlay_29_0230F9A4.s  ov29_0230F9A4, TrySpawnEnemyItemDrop
  asm/main_02051504.s        RetrieveFromItemList1, IsForbiddenFloor
  asm/main_020251F0.s        sub_020251F0, StrncpySimpleNoPadSafe
  asm/main_020261F4.s        sub_020261F4, sub_02026204, DrawTextInWindow
  asm/main_0202B568.s        sub_0202B568, GetSimpleMenuResult__0202B870
  asm/main_020022C4.s        sub_020022C4, sub_020022D0, RandIntSafe

Fourteen are callees of the ten previously landed functions; the rest are the
neighbours that had to clear first to reach a file boundary. Six .s files are
consumed entirely, so main.lsf loses six asm objects and gains six tails.

Thirty-five call-site declarations are replaced by an include of the owning
header, across twenty-one files. Several were not duplicates but genuine
disagreements: GetSimpleMenuResult__0202B870 had five declarations, all giving
the window id as s8 against the definition's s32; two were K&R
`extern int ov29_0234B1A4();`. None of these can surface in a build, since two
declarations in two translation units never meet.

A declaration that disagrees is NOT automatically stale. src/overlay_13_0238BDA8.c
keeps its own `extern void DrawTextInWindow(s8 window_id, ...)`: that file's
DrawPersonalityTestDebug carries the window id in an s8 local, and against the
header's s32 the call needs a sign extension retail does not emit. Replacing it
broke OVY_13.sbin. Retail's translation units genuinely disagreed about this
prototype, so the per-TU declaration is evidence, not a defect to tidy away.

Three shared types change, all layout-preserving:
  * struct team_member's first byte, a 1+7 bitfield pair, becomes u8 flags.
    TryRecruit writes the whole byte in one strb and reads bit 0 through
    GetFlag(u8, u8), which takes a value a bitfield member cannot supply.
  * struct unk_02026130's field_0x4 grows from [4] to [0x118] (total 0x11C).
    DrawTextInWindow declares one as a local, so its size sets the frame.
  * alert_box_info::alert_box_window_id becomes s8; it holds -2, and seven
    ldrsb reads of offset 0xCEC corroborate the signedness.

sub_02026194 is corrected from one argument to three: sub_02020BC4 reads r1
and r2 (tst r1, #0x400; strh r1, [r4, #0x60]; str r2, [r4, #0x88]) and every
asm caller passes all three, so the wrapper was forwarding registers it never
named. Its pre-landing asm was recovered from git and both forms measured.

Authored by Claude (Opus 5) under human direction. Each function was measured
at decomp.me score 0 in all three regions and re-measured by an independent
verifier. Confirmed by matching builds of 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:38 -07:00

9 lines
198 B
C

#ifndef PMDSKY_MAIN_0202B558_H
#define PMDSKY_MAIN_0202B558_H
s32 GetSimpleMenuField0x1A4(s32 window_id);
s32 sub_0202B568(s32 window_id);
s32 GetSimpleMenuResult__0202B870(s32 window_id);
#endif