cecilarmitais aade0cdfc8 Decomp GetWindow; retype overlay_31's window callbacks as ids
Decompile from asm:

  GetWindow  0x020275F8

It indexes WINDOW_LIST with a stride of 0xE0, so its argument is a window id
rather than a pointer, and its result is the address of one entry.

overlay_31_02382820.c declared it as taking a struct Window * and passed one,
which cannot be what the target computes: multiplying a pointer by 0xE0 and
adding it to WINDOW_LIST is meaningless. The value it passes is an id, and the
same value goes to DrawTextInWindow and UpdateWindow, so those take ids too.
This retypes the three window callbacks and both of those prototypes
accordingly, along with the callback type CreateTextBox stores.

That retyping is byte-neutral -- a pointer and an id both travel in r0 -- but
overlay_31_02382820.o was already matching, so it is rebuilt here to confirm
rather than assumed.

struct Window keeps its existing return type and gains padding to its real 0xE0
size, which is what lets &WINDOW_LIST[id] stride correctly. Its first seven
bytes are unchanged, so the width field overlay_31 reads is where it was. The
struct moves from the overlay's header into include/window.h, which already
exists and is where a main-binary function returning one can reach it; the
overlay includes it rather than the main binary including an overlay header.

No comments are added to any pmd-sky file.

Authored by Claude (Opus 5) under human direction. 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:09:00 -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 335 MiB
Languages
Assembly 66.3%
C 18%
C++ 7.1%
Boogie 4.3%
sed 1.5%
Other 2.8%