Files
pmd-sky/include/main_0201070C.h
cecilarmitais 152f6c7ea6 Decomp six shop and item helpers; split bag_items' filler
Decompile from asm:

  SetMoneyStored                            0x0201070C
  GetCurrentKecleonShop1ItemByIndex         0x02010898
  GetCurrentKecleonShop2ItemByIndex         0x02010BA4
  GetExclusiveItemOffset                    0x02010E40
  SwapShopFreeDoublePointer                 0x020114F8
  IsMonsterAffectedByGravelyrockGroundMode  0x02011830

The two Kecleon accessors index arrays hanging off pointers at 0x132C and
0x1370. Unlike the previous two extensions those offsets fall inside
fill2[0x1009] rather than past the struct's end, so the filler is split into
three runs with the two pointers between them. maybeMoney still lands at 0x1394
and nothing after it moves, which the rebuild of every struct bag_items user
confirms.

SetMoneyStored clamps to 0x0098967F, decimal 9999999, and to zero below.

GetExclusiveItemOffset returns zero unless the item is in
CATEGORY_EXCLUSIVE_ITEMS, which item.h already defines as 15, and otherwise the
item's distance from 0x1bc, narrowed to 16 bits.

IsMonsterAffectedByGravelyrockGroundMode normalises the species through
FemaleToMaleForm and compares against two ids, left as raw values because naming
them is not this commit's job. Its return is word-sized: bool8 appends
and r0, r0, #0xff, which the target does not have.

SwapShopFreeDoublePointer frees through two levels of indirection and clears the
outer pointer, returning early when it is already null.

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-16 17:37:04 -07:00

8 lines
129 B
C

#ifndef PMDSKY_MAIN_0201070C_H
#define PMDSKY_MAIN_0201070C_H
u32 GetMoneyStored(void);
void SetMoneyStored(s32 money);
#endif