cecilarmitais b6faa49387 Decomp NewWindowScreenCheck, SetScreenWindowsColor and the palette getter
Decompile from asm:

  NewWindowScreenCheck             0x02027648
  GetPaletteBaseAddress__020278A8  0x020278A8
  SetScreenWindowsColor            0x02027A80

NewWindowScreenCheck counts the active windows on each background before
delegating to NewWindow, and sets a flag when either screen has none. It reads
is_active as a signed byte at 0xB6 and bg_id at 0x8, both named by the Window
layout added in the previous commit, so the loop reads as what it does.

It walks with a cursor rather than indexing. Indexing WINDOW_LIST[i] emits an
mla per iteration; the target advances a pointer by 0xE0 at the bottom of the
loop. Its two counters also have to be assigned in the order sub then main --
declaration order alone was not enough, and every permutation of the four locals
left between 20 and 95.

SetScreenWindowsColor's colour parameter is s32, not u8, and that distinction is
not visible in its own bytes: both score 0 against it, because the store is a
strb either way. It is visible one level up. SetBothScreensWindowsColor, landed
matching in the previous commit, passes its argument straight through; a u8
parameter makes the compiler truncate at that call site, which changes an object
that already matched, changes the size of main.sbin, and shifts every overlay
after it. The first build of this batch failed 33 checksums for that reason,
with no compile error and nothing wrong in the function being added.

GetPaletteBaseAddress__020278A8 reads through _020AFC70, which include/
main_02064FFC.h already declares as u8 *. It is declared the same way here
rather than being given a second, differently typed declaration.

No comments are added to any pmd-sky file.

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>
2026-08-17 03:25:19 -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%