cecilarmitais 4f46fed938 Decomp thirty adventure-log accessors
Decompile from asm, all of them accessors on ADVENTURE_LOG_PTR:

  SetAdventureLogStructLocation  SetAdventureLogCompleted   IncrementNbEvolutions
  SetAdventureLogDungeonFloor    GetAdventureLogCompleted   GetNbEvolutions
  GetAdventureLogDungeonFloor    IsAdventureLogNotEmpty     IncrementNbEggsHatched
  IncrementNbDungeonsCleared     GetNbDungeonsCleared       GetNbEggsHatched
  IncrementNbFriendRescues       GetNbFriendRescues         GetNbPokemonJoined
  GetNbMovesLearned              SetVictoriesOnOneFloor     GetVictoriesOnOneFloor
  GetNbPokemonBattled            IncrementNbBigTreasureWins SetNbBigTreasureWins
  GetNbBigTreasureWins           SetNbRecycled              GetNbRecycled
  IncrementNbSkyGiftsSent        SetNbSkyGiftsSent          GetNbSkyGiftsSent
  IncrementNbFainted             GetNbFainted               GetSentryDutyGamePoints

No new types. struct adventure_log already exists in include/adventure_log.h with
every field these touch named and offset-commented, and struct dungeon_floor_pair
in dungeon.h; every offset in the asm lands on a named field. That header is the
reason a batch this size was tractable: the only modelling needed was reading
which field each function touches.

Two orderings decided four of the thirty, both instances of the rule added to
MATCHING_TIPS in the previous commit. IsAdventureLogNotEmpty needed its loop
index declared before the pointer local, not after -- with the pointer first the
two land in swapped registers, at 35. The three Set functions needed the
completion-flag write placed before the clamp rather than after: written in the
obvious order the clamp is emitted ahead of the first pointer load and the two
literal-pool words come out reversed, at 250 each. Reordering the statement fixed
all three.

The counters clamp at 0x000F423F, decimal 999999, and each function sets one bit
of completion_flags[0]. The exact shape differs per function and is reproduced
rather than normalised: three increment then clamp, two clamp then increment, and
the three setters write the flag before storing the value. Those differences are
what the target does.

The clamp comparisons are signed even though the fields are u32, so each is
written with an explicit (s32) cast rather than retyping a shared struct.

ADVENTURE_LOG_PTR and _022AB69C move into adventure_log.h. src/main_0204FDFC.c
declared the pointer itself, from before any of this was decompiled; that line is
replaced by the header it already includes, and the object rebuilds unchanged.

Nine adventure-log functions remain in asm and are not in this commit:
ClearAdventureLogStruct, ComputeSpecialCounters, CopyLogTo, CopyLogFrom,
SetItemAcquired, GetNbItemAcquired, SetChallengeLetterCleared, SetPokemonBattled
and SetSentryDutyGamePoints.

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-17 23:05:26 -07:00
2026-08-17 23:05:26 -07:00
2026-08-17 23:05:26 -07:00
…
2026-08-01 12:46:55 -04:00
2026-07-16 07:36:58 -07:00
…
…
2026-08-17 23:05:26 -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%