cecilarmitais 59c4a95e44 Decomp the volume and pan fade track events
Decompile from asm:

  DseTrackEvent_VolumeFade  0x020723C0
  DseTrackEvent_PanFade     0x02072668

Both were deferred near-matches. Each reads a signed byte as the fade target and
a little-endian pair as its duration in ticks, writes the target, and then either
snaps current to it when the duration is zero, zeroes the duration when there is
nothing to travel, or divides the distance by the duration to get the per-tick
delta. The two differ only in which struct dse_fade they address -- volume at
0x2c, pan at 0x3c -- both of which already exist in dse.h.

What closed them was declaration order, and in the opposite direction to the
obvious one. The target loads ptr_next_byte[2] first, then [0] and [1]; writing
the target expression first, so that its load comes first in the source, leaves
the loads in ascending address order at score 620. Declaring ticks first and the
target second emits them in the target's order and scores 0. So for this
scheduler the later-declared expression's loads are issued first, and the fix is
to write the declarations in the reverse of the order the asm reads them.

Seven other spellings of the same two statements were tried -- explicit locals
for each byte in the target's load order, s8/s16/s32 intermediates, an inline
cast, and a pointer-cast subscript -- and every one of them stayed at 620. Only
the declaration swap moves it.

The lib/DSE headers extract_function.py generates do not include dse.h, so both
were given it; every other header in that directory already does.

Three deferred DSE functions remain, and this commit does not close them.
DseTrackEvent_TuningFade is the same family with a bend fade plus the SetTuning
tail; hoisting container out of channel before the flag test takes it from 935 to
760, which is progress and not a match. DseTrackEvent_SetupKeyBendLfo is
unchanged in substance: its instructions have matched for some time and only
register assignment differs. All 120 orderings of its five byte locals were tried
this time, along with eleven structural variants, and the best is 55 rather than
the 65 it sat at; the earlier note suggested exhaustive permutation as the untried
move, and it has now been tried and does not close it.

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 15:48:24 -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%