mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-30 06:12:17 -05:00
5ffad87a1b0d4bc220b1a6e20aa5269b245a75a1
Eleventh cleanup sweep. Five asm files and their includes removed: asm/main_0205B6CC.s sub_0205B6CC asm/main_0202C75C.s sub_0202C75C asm/overlay_29_0232CDA4.s DoMoveOneShot asm/overlay_29_0232A078.s DoMoveNightShade asm/overlay_29_023016D8.s DisplayRunAwayIfTriggered All five merged into an adjacent source rather than splitting one. None carries a region conditional, so US alone verifies this commit. sub_0205B6CC is a 64-bit unsigned >= 2 (cmp/cmpeq/movhs) on a value at offset 0xC. A u64 member sits there: MWCC aligns long long to 4, not 8. Rebuilding the value from two u32s scores 200, and `> 1` in place of `>= 2` scores 310. sub_0202C75C uses struct unk_0202C5E0, the collection-menu window struct its neighbours already use; GetWindowIdSelectedMenuItemIdx immediately before it already spells the same `GetWindowContents(window_id) + 4`. field_0x1AC[6] covered 0x1B0/0x1B1 and is split into three members. DoMoveOneShot and DoMoveNightShade are twins staging eleven arguments for CalcDamageFixedWrapper, which had no declaration in the tree. The only obstacle was the temporary holding GetMoveType's result: as enum type_id, -enum min sizes it to a byte and emits an and #0xff the target lacks (950); as s32, 0. DisplayRunAwayIfTriggered needs Min(999, max_hp), not Min(max_hp, 999) -- Min is a static inline, so the argument order is not free (200). That exact expression in that exact order already sat in the NONMATCHING block of AiMovement in dungeon_ai_movement.c; the guess was right and had never been confirmed. include/main_02042AF8.h's provisional `s32 sub_0202C75C(s8 a);` is retired in favour of the real header. It was written from the one call site, which passes an s8 field; the parameter is a window id. A sixth was prepared and not landed: FixedPoint64ToInt (asm/main_02001CB0.s) stands at 225. The target keeps an arithmetically redundant & 0xFFFF0000, and whether MWCC folds it away is decided by which side of the | the masked term is written on -- masked second folds it (735), masked first keeps it (225). Writing it first is also what makes it evaluate first, and the target needs it preserved but evaluated second; ten spellings found none that does both. Spelling it as a real 64-bit shift scores 1020. Authored by Claude (Opus 5) under human direction. All five verified at score 0. 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%