mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-29 21:57:42 -05:00
019b4543a2e0daac4fa63c6c9965ff7d66c09487
Decompile from asm: DseTrackEvent_SetVolume 0x0207227C DseTrackEvent_VolumeDelta 0x02072310 DseTrackEvent_SetExpression 0x0207241C DseTrackEvent_SetPan 0x02072554 DseTrackEvent_PanDelta 0x020725D4 All five follow DseTrackEvent_SetTuning in lib/DSE/src/main_02071BF4.c, which was already landed and is a complete template for this shape: write the fade, recompute the final value, then mask interrupts through IME while walking channel->voice_list and setting an update_flags bit on every voice. The bit differs by what changed -- 0x20 for volume and expression, 0x40 for pan, where SetTuning uses 0x10. Offsets all resolve against existing dse.h types. struct dse_fade is 0x10, so the channel's bend, volume and pan fades sit at 0x1c, 0x2c and 0x3c, which is what the stores at 0x2c/0x34/0x38 and 0x3c/0x44/0x48 address. container is at 0xc4 and struct dse_synth puts pan at +7 and song_and_global_volume at +8, both of which the asm loads with ldrsb. The volume handlers scale by song_and_global_volume * volume * expression and divide by 127 * 127; the compiler reproduces the target's smull-based division by that constant, so the magic word 0x82061029 needs no special handling. Two details that were not obvious. The final pan is v + (container->pan - 0x40), not (v + container->pan) - 0x40: the target subtracts before adding, and the other grouping emits the two instructions in the opposite order. And the discarded read of IME before restoring it only survives if IME is declared through a volatile type; without volatile the compiler drops the load and the restore is all that remains. 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%