mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-28 21:31:17 -05:00
26611d6672cd104f3f1beb527b63231ae5ad150f
Decompile from asm, all reaching UNK_STORAGE_STRUCT_0X14: sub_02043148 sub_0204329C sub_020433E0 ClearStorageSelectedItemTable sub_0204316C sub_02043380 sub_02043400 CountSelectedStorageItems sub_02043218 sub_02043398 sub_02043434 GetFirstSelectedStorageItemIndex sub_0204322C sub_020433C0 sub_02043468 sub_0204323C sub_02043254 struct unk_020AFEE0 was introduced two dozen commits ago holding only the pointer at 0x8 and filler before it. Its first eight bytes are now split into what these functions read: halfwords at 0x0 and 0x2 and a pointer at 0x4, with a word at 0x10 added past the existing end. Nothing that already used field_0x8 moves. The object behind that pointer is new, and its size is derived rather than guessed. Its s16 array at 0x4 is bounded by 0x3e8 in three separate loops, which is 1000 entries and ends at 0x7D3; the signed byte the collection-menu wrappers read sits at 0x7D4, immediately after it. Two further fields at 0x910 and 0x18BC come from sub_020430F4. Filling the gaps brings the struct to exactly 0x18C0, which is the size in upstream's own name for its allocator, InitUnkStorageStruct0x18c0. That agreement is the reason the layout is worth trusting; the field names remain placeholders because nothing here establishes meaning. Fourteen of the seventeen matched on the first candidate. The other three are loops whose index and pointer landed in swapped registers, with every instruction otherwise correct, and all three were closed by reordering the local declarations -- the same effect recorded in the previous two commits. All orderings were enumerated rather than guessed: two locals for sub_02043254 and GetFirstSelectedStorageItemIndex, three for CountSelectedStorageItems. Eight callees remain asm and their prototypes are provisional, declared in the shared header rather than repeated per file. None of them was declared anywhere else in the tree. Two are typed from evidence rather than convention: IsCollectionMenuActive and IsCollectionMenuState3 return bool8 because both callers mask with and r0, r0, #0xff. sub_020430F4 was attempted and is not included. It reaches the same struct and its two extra fields are what sized it, but it stands at 495 after correcting sub_0202C654 to the four arguments the target passes -- the fourth is a zero in r3 that the first reading missed. Left in asm rather than landed as a near-match. No comments are added to any pmd-sky file. Authored by Claude (Opus 5) under human direction. Confirmed by a matching build: build/pmdsky.us/pmdsky.us.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%