mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-28 05:07:58 -05:00
33d90d0f8d12fb68b822d26c55435e7200cd0255
sub_02050EBC, SubFixedPoint, sub_02050F78, sub_02050FF8 and
BinToDecFixedPoint are the last five functions in asm/main_020504BC.s and
all operate on struct fixed_point (106 instructions). The next object in
main.lsf is src/number_util.o, which already holds their sibling
CeilFixedPoint, so extract_function.py merges rather than splits and
main.lsf is unchanged. They are landed in reverse address order so each
prepends above the last, leaving number_util.c in ascending address order
with CeilFixedPoint last.
sub_02050EBC and sub_02050F78 keep their sub_<addr> names - this is
decompilation, not identification.
A 4-byte struct fixed_point is passed and returned by value in r0, packed
as integer | fractional << 16. The stmdb sp!, {r0, r1, r2, r3} at entry is
MWCC giving the argument registers stack homes so a by-value struct
parameter can be addressed, and writing to the parameter reuses that home,
which is why SubFixedPoint and sub_02050EBC modify their first argument
and return it. The caller-side sub rX, sp, #4 idiom around these calls is
compiler-generated, not a source construct: src/dungeon_ai_movement.c
already emits it from a plain CeilFixedPoint(pokemon_info->belly).
None of the five blocks carries a region directive, so one source serves
all three regions.
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%