cecilarmitais c356d53c74 Decomp the bank and key-bend track events; restore stripped label addresses
Decompile from asm:

  DseTrackEvent_SetBank     0x02071B60
  DseTrackEvent_SetBankMsb  0x02071B8C
  DseTrackEvent_SetKeyBend  0x02072184

All three assemble a 16-bit value from the event stream and hand it to a
DseChannel_ setter, following DseTrackEvent_SetBankLsb in
lib/DSE/src/main_02071BF4.c. SetBankLsb replaces the low byte of swd_id;
SetBankMsb is its mirror and replaces the high byte, which is why its operands
read (*ptr_next_byte << 8) + (channel->swd_id & 0xFF). Written the other way
round the addition is emitted in the wrong order and scores 30.

SetBank and SetKeyBend take both bytes from the stream. They differ only in the
width cast the target applies before the call -- lsr for the unsigned bank,
asr for the signed bend -- which is what types each callee's second parameter.

DseChannel_SetBank and DseChannel_SetKeyBend are still asm. Their prototypes are
provisional and declared in the new headers. Note DseChannel_SetBank is now
declared in two places: here and in lib/DSE/src/main_02071BF4.c, which declared
it from its own call site earlier. They agree, but nothing in the build checks
that, and the duplicate should collapse into one header when the callee lands.

This commit also restores four `; 0xADDRESS` label comments in
lib/DSE/asm/main_02071AE0.s that a previous precommit run stripped. The addresses
came from the pre-split file at 00d4d642. Nothing was mismatched by their
absence -- the ROM built fine without them -- but extract_function.py finds a
function by searching its label line for `; 0x`, so SetBank and SetBankMsb could
not be extracted until they were back. precommit.py now keeps that form.

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-16 15:39:34 -07:00
2026-04-08 09:53:43 +02:00
2024-06-23 16:59:48 -05:00
2024-12-28 02:25:07 -06:00
2026-08-01 12:46:55 -04:00
2026-07-16 07:36:58 -07:00
2025-06-10 23:35:01 -04: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%