mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-28 05:07:58 -05:00
9b3650fe33bc77142837c2e4046f10bb5006a5bc
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>
Pokémon Mystery Dungeon: Explorers of Sky
This is a WIP disassembly of Pokémon Mystery Dungeon: Explorers of Sky. For instructions on how to set up the repository, please read INSTALL.md. For information on how to contribute changes, see CONTRIBUTING.md.
This repository builds the following ROMs:
- pmdsky.us.nds
sha1: 5fa96ca8d8dd6405d6cd2bad73ed68bc73a9d152 - pmdsky.eu.nds
sha1: c838a5adf1ed32d2da8454976e5b1a1aa189c139 - pmdsky.jp.nds
sha1: 7785138dd343b6f2d0f2c9cadc26b4aa927161d7
For contacts and other pret projects, see pret.github.io.
Description
Languages
Assembly
66.3%
C
18%
C++
7.1%
Boogie
4.3%
sed
1.5%
Other
2.8%