mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-28 21:31:17 -05:00
59c4a95e444f0ee5f050bd9cc0ff52ed6f17f009
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>
…
…
…
…
…
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%