mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-27 12:47:39 -05:00
27c9ec9af6ab78a7b8736daa117d915d40c8a8ca
Decompile from asm: GetMoneyStored 0x0201070C GetEggSpecies 0x0201077C GetUnkGameState0x13a6 0x020107AC GetEggHatchTimer 0x020107DC Each dereferences BAG_ITEMS_PTR_MIRROR and reads one field. struct bag_items in include/item.h ended at 0x13A0, immediately before every offset these four use, so it gains four fields: a word at 0x13A0, a signed halfword at 0x13A4 and halfwords at 0x13A6 and 0x13A8. The widths come from the loads -- GetEggSpecies uses ldrsh where the other two halfword readers use ldrh. The fields are placeholders rather than named after their accessors. The function names are suggestive, and a later pmdsky-debug sync can name them; the offsets and widths are facts read off the asm, which is all this commit claims. Extending a shared struct is the risk here, so it was checked rather than assumed. The four fields are appended past the end, after maybeMoney, so no existing member moves. All four translation units that use struct bag_items -- dungeon_ai_items.c, main_0200ECFC.c, main_0200EDC0.c and overlay_31_02383478.c -- are rebuilt by this commit's build and the ROM still matches. The two constants the target splits the offset into differ per function (0x1300 + 0xa8 against 0x1000 + 0x3a0) because each is a valid ARM immediate encoding of the same address; the compiler reproduces the choice from the field offset alone. 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%