mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-28 05:07:58 -05:00
92774e8a2b304d18fde0729676f7a1fd36eb2ad5
Five functions, the head of asm/overlay_11_023090DC.s, all merging into src/overlay_11_02307334.c beside their only caller ov11_02307334: ov11_023090DC 809 insn (NA/EU), 807 (JAPAN) ov11_02309DAC 18 ov11_02309DF8 10 ov11_02309E24 8 ov11_02309E48 39 ov11_023090DC is the largest function landed on this branch. It reached STRUCT 0 -- every instruction, immediate and branch target correct -- while a single register permutation over 35 rows held it at score 230. The rule that closed it: MWCC colours the locals living across a call in case-scope declaration order, lowest free register first, and a local assigned only inside a loop body does not join that group from case scope. Four qualifying locals therefore reach only r4-r7; the target needs one on r8, so a fifth member has to exist. Hoisting e, move_id, k and q into the case's declaration list supplies it. No statement moved and no type changed. struct unk_02324D90 gains 22 offsets, replacing padding. Size and every pre-existing offset are unchanged in all three regions, checked by compiling sizeof/offsetof comparisons against the previous layout with the real compiler and reading the folded constant back out. The parent-menu tables are typed from their data rather than from the weakest prototype that accepted them. asm/overlay_11_022ECD24_data.s shows each as a run of 8-byte entries -- u16 string id, 2 bytes padding, s32 value -- i.e. struct unk_0202A5CC, which include/main_0202A66C.h already declares and which CreateParentMenuFromStringIds already takes. Four were declared extern s32 as scalars (hence the & at every call site), one duplicated the struct under a second name, and this file carried its own void*-taking prototype that let all of it compile. Seven globals are now struct unk_0202A5CC[], the duplicate struct unk_02322D38 is gone, the local prototype yields to the header, and five redundant & are dropped. Byte-neutral: &scalar and array yield the same address. Authored by Claude (Opus 5) under human direction. All five measured at decomp.me score 0 in all three regions and re-measured independently. 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%