cecilarmitais e0f7191722 ApplyDamage: match the EU and JP builds
Follow-up to ff65ac0e, which decompiled the US branch only. One source now
matches all three regions:

  build/pmdsky.us/pmdsky.us.nds: OK
  build/pmdsky.eu/pmdsky.eu.nds: OK
  build/pmdsky.jp/pmdsky.jp.nds: OK

JAPAN, five source differences:
  - DefenderAbilityIsActive__0230A940 takes three arguments, not four, at six
    call sites. include/overlay_29_0230A994.h already declares this, so the JP
    build failed to compile rather than to match.
  - every message id is US - 0x2C1. Kept as region-conditional #defines at file
    scope, following src/dungeon_ai.c.
  - no UpdateStatusIconFlags call before the HP check.
  - no end_floor_no_death_check_flag guard on the revival-item path.
  - in the reviver-seed block, no ov29_022FBD24; instead ov29_02307DC0 after the
    curse handling.

EUROPE, one behavioural difference: the last arm of the defeat-message ladder
records a flag instead of logging, and the message is emitted later at three
points - the reviver-seed path, the revival-item path, and their else. The two
revival paths log from a different table.

That table is four bytes that exist only in the EUROPE branch of
asm/overlay_29_rodata_02352A6C.s, immediately after ov29_02353218 and carrying
no symbol; the extractor could only render both as raw addresses (0x02353E44 and
0x02353E40). This commit labels it. The label and .global add no bytes, and the
EU checksum is what confirms both references resolve where intended - had either
been wrong, pmdsky.eu.nds would not match.

The name ov29_02353E44 is keyed to the symbol's EUROPE address, which breaks the
file's convention of naming by US address. There is no US address to use: the
data does not exist in that build.

One change was needed for the EU register allocation and is byte-neutral for the
other two builds: `dmon` is now assigned after the wild-enemy test rather than
before it, with that test reading through defender->info. Introducing the
variable later flips which web the allocator colours first and unwinds a
whole-function rotation of three callee-saved registers.

Authored by Claude (Opus 5) under human direction. Confirmed by matching builds
of all three regions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 23:12:40 -07:00
2026-08-22 20:45:50 -04:00
…
2026-08-01 12:46:55 -04:00
2026-09-04 13:13:23 -07:00
2026-07-16 07:36:58 -07: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%