cecilarmitais 30ea1f34f0 Replace the Window placeholder with its real layout
struct Window was landed two commits ago as mostly filler: the fields those
functions happened to touch, and padding to reach the 0xE0 stride GetWindow
indexes by. This replaces it with the full 0xE0 layout, supplied by the project
maintainer, together with the four types it is built from -- WindowTemplate,
WindowBlock, WindowTile and CursorParams, plus Point.

Four things the layout has to satisfy, and does:

  sizeof is 0xE0, the stride GetWindow multiplies by.
  is_active is an s8 at 0xB6, which is where DeleteWindow does ldrnesb.
  WindowTemplate.width is at 0x06, where the previous partial struct, inherited
    from overlay_31_02382820.h, already had width.
  x, y, width and height at 0x04 through 0x07 account for GetWindowRectangle
    exactly: it writes y*8, y*8 + height*8, x*8 and x*8 + width*8, so its output
    is top, bottom, left, right. That function is rewritten against the named
    fields rather than shifting anonymous bytes.

Three choices worth noting for review. The struct keeps its tag, so both
struct Window and Window resolve and no existing use changes. GetWindowContents
still returns void * rather than the u32 the field is typed as, because all 22
of its callers assign the result to a pointer; the cast is a no-op and avoids 22
integer-to-pointer conversions. And width moving inside the template means
overlay_31_02382820.c reads window2->template.width, the one source change the
layout forces.

The field names here are the maintainer's, not derived in this commit. The
offsets and widths are checkable against the asm; the names are not, and should
be read as supplied rather than proven.

No comments are added to any pmd-sky file.

Authored by Claude (Opus 5) under human direction, from a struct definition
supplied by the maintainer. Confirmed by a matching build with
overlay_31_02382820.o rebuilt: build/pmdsky.us/pmdsky.us.nds: OK.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 02:48:56 -07:00
…
2026-08-01 12:46:55 -04: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 333 MiB
Languages
Assembly 66.3%
C 18%
C++ 7.1%
Boogie 4.3%
sed 1.5%
Other 2.8%