Files
pmd-sky/include/main_0203258C.h
cecilarmitais 75c76fa71f Decomp seven menu paging getters
Decompile from asm:

  GetSelectedItemOnPage  0x02032558
  GetCurrentPage         0x02032560
  GetPageStart           0x02032568
  GetTotalNumMenuItems   0x0203258C
  GetNumItemsOnPage      0x02032594
  GetMaxItemsOnPage      0x0203259C
  GetTotalNumPages       0x020325A4

Six read one word each from a struct with no existing type, introduced here as
struct unk_02032558 with placeholder fields at 0xBC through 0xD0. GetPageStart
multiplies two of them, current page by max items per page, which is consistent
with the names but is an observation about the arithmetic rather than something
the bytes label.

GetSelectedItemOnPage was declared provisionally in include/main_0202AAA8.h last
commit, taking void *, because it was still asm. That declaration is removed and
its caller now includes the real header. The argument reaching it there is a
void * offset by 4 from the window contents, which converts implicitly; the
caller's object is rebuilt here and still matches.

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 00:38:40 -07:00

12 lines
289 B
C

#ifndef PMDSKY_MAIN_0203258C_H
#define PMDSKY_MAIN_0203258C_H
#include "main_02032558.h"
s32 GetTotalNumMenuItems(struct unk_02032558* p);
s32 GetNumItemsOnPage(struct unk_02032558* p);
s32 GetMaxItemsOnPage(struct unk_02032558* p);
s32 GetTotalNumPages(struct unk_02032558* p);
#endif