mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-29 13:47:50 -05:00
5c895f8a1d50112502e2eeb0979c9bef9414ed5b
Decompile from asm: IsOutlawMonsterHouseFloor IsDestinationFloorWithMonster IsGoldenChamber MissionTargetEnemyIsDefeated IsJirachiChallengeFloor SetMissionTargetEnemyDefeated IsDestinationFloorWithFixedRoom IsDestinationFloorWithHiddenOutlaw GetMissionEnemyMinionGroup These are the functions the two previous commits could not land. The obstacle was the scratch context, not the C, and this commit is the result of replacing it. The context is now the real headers rather than a hand-written struct: mwccarm -E over a file including global.pch, dungeon.h and mission.h, with LM_LICENSE_FILE set, gives 14500 lines reproducing what the build actually sees. Two things that took finding. global.pch is required -- without it util.h fails at typedef s32 fx32_8, because s32 comes from nitro.h, which the build supplies through -prefix rather than through any include in dungeon.h. And -E consumes every macro, so TRUE, FALSE and NULL have to be restored by hand afterwards; their values are taken from lib/include/nitro/types.h, NULL being ((void *)0) on the C branch. Against that context the earlier verdicts change. All eight functions landed in the two previous commits still score 0, which is the check that the new oracle agrees with the build. Eight of the thirteen unlanded ones score 0 unchanged and are landed here as written. GetMissionEnemyMinionGroup does not: the real headers let the compiler fold the +1 of enemy_species[index + 1] into the load displacement, one instruction shorter than the target. Binding index + 1 to a local first blocks the fold and scores 0, which is what is landed. Four remain unmatched and are genuinely unmatched rather than mis-measured: IsCurrentMissionType and IsCurrentMissionTypeExact at 515, where the target branches to separate return blocks and every spelling tried so far produces predicated moves; GetItemToRetrieve at 665 and GetItemToDeliver at 1530. Their scores are identical under both contexts, so the context was never their problem. The mission_type arguments use the enumerators from mission.h -- ARREST_OUTLAW, EXPLORE_WITH_CLIENT, TAKE_ITEM_FROM_OUTLAW and CHALLENGE_REQUEST -- because the build rejects the implicit conversion from int. The values agree with the function names rather than being chosen to fit them. 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%