cecilarmitais ac61cc341c Decomp five team-member index accessors
Decompile GetHeroMemberIdx, GetPartnerMemberIdx, GetMainCharacter1MemberIdx,
GetMainCharacter2MemberIdx and GetMainCharacter3MemberIdx from
asm/main_02054E4C.s. Each returns the index of a TEAM_MEMBER_TABLE_PTR->members
entry when that entry's is_valid bit is set, or -1 otherwise: hero is index 0,
partner index 1, and the GetMainCharacter functions choose the index by game
mode -- 2/3/4 during a special episode, 0/1/none otherwise. They are the index
returning counterparts of the pointer accessors in the previous commit and merge
into a new src/main_0205567C.c.

The return type is u32. This matters: with a signed int return, the compiler
recognises `valid ? 0 : -1` as the idiom -(!valid) and emits an arithmetic
negate, but the target uses a conditional-move select. Under u32, -1 is
0xFFFFFFFF, the negate idiom no longer applies, and the compiler emits the
select the target has. The distinction is only observable for hero, whose index
is the constant 0; for the others the index is non-zero or runtime, so both
signednesses produce the select. The whole family is typed u32 for consistency,
and sub_02065050, which calls two of these, was rebuilt to confirm the type
change leaves it byte-identical.

No new names are introduced. struct team_member_table, struct ground_monster and
TEAM_MEMBER_TABLE_PTR already exist in the tree, and the five function names were
already labelled; this commit only fills in bodies.

No comments are added to any pmd-sky file.

Authored by Claude (Opus 4.8) under human direction. Confirmed by a matching
build: build/pmdsky.us/pmdsky.us.nds: OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-16 13:45:13 -07:00
2026-04-08 09:53:43 +02:00
2024-04-17 23:52:39 -04:00
2026-07-31 18:03:24 -04:00
2023-11-20 17:24:08 -06:00
2024-06-23 16:59:48 -05:00
2023-08-13 23:03:51 -04:00
2024-12-28 02:25:07 -06:00
2026-08-01 12:46:55 -04:00
2023-06-28 23:35:19 -04:00
2023-06-28 23:35:19 -04:00
2023-06-28 23:35:19 -04:00
2023-06-28 23:35:19 -04:00
2026-07-16 07:36:58 -07:00
2025-06-10 23:35:01 -04:00
2023-08-20 22:43:00 -04:00
2023-08-14 00:17:21 -04:00
2023-11-01 18:44:19 -04:00
2024-04-17 23:52:39 -04:00
2023-08-28 00:09:02 -04:00
2024-04-17 23:52:40 -04:00
2023-08-08 00:17:03 -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%