cecilarmitais ac3e23890e Decomp ten more dungeon-state accessors in overlay_29
Decompile from asm:

  IsMarowakTrainingMaze       ov29_022EAEFC
  FixedRoomIsSubstituteRoom   ov29_022EAF20
  IsSecretRoom                SetUnkMusicFlag
  IsDungeonEndReasonFailure   ov29_0234969C
  ChangeDungeonMusic          ov29_023496B0

All ten reach struct dungeon through DUNGEON_PTR and every offset lands on a
named field: id at 0x748, hidden_outlaw_defeated_message at 0x2, unk_music_flag
at 0x792, dungeon_music_playing_id and field_0x2cb00 at 0x2CB06 and 0x2CB00,
gen_info.fixed_room_id at 0x40DA, and fainted_monster_dungeon_end_reason at
0x2CA66. No new types.

The constants resolve to existing enumerators that corroborate the function
names rather than being chosen to fit them: FIXED_SUBSTITUTE_ROOM is 110 and
FIXED_SECRET_ROOM is 113, which is what FixedRoomIsSubstituteRoom and
IsSecretRoom compare against; DAMAGE_SOURCE_ESCAPE is 633, the 0x279 in
IsDungeonEndReasonFailure. IsMarowakTrainingMaze tests the range
DUNGEON_NORMAL_FLY_MAZE to DUNGEON_EXPLORER_MAZE inclusive, 180 to 190.

IsDungeonEndReasonFailure reads its union member through an explicit (s16) cast.
enum damage_source_non_move declares no negative enumerator, so under -enum min
it is unsigned and compiles to ldrh with an unsigned comparison, where the target
has ldrsh and a signed one. The cast is local and reversible; adding a sentinel
to a shared enum, as was done for monster_id earlier on this branch, would not
be.

Two of the ten merged into src/run_dungeon_1.c, which already declares
DUNGEON_PTR as an array and reaches it as DUNGEON_PTR[0]. They follow that file's
convention rather than introducing a second spelling; both forms were checked on
a scratch and produce identical bytes.

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>
2026-08-18 02:09:14 -07:00
…
2026-08-01 12:46:55 -04:00
2026-07-16 07:36:58 -07:00
…
…
…
…
…

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:

For contacts and other pret projects, see pret.github.io.

Description
Decompilation of Pokémon Mystery Dungeon: Explorers of Sky
Readme 335 MiB
Languages
Assembly 66.3%
C 18%
C++ 7.1%
Boogie 4.3%
sed 1.5%
Other 2.8%