Files
pmd-sky/include/main_02011DF0.h
cecilarmitais 35134eced4 Decomp twelve game-state and recycle-shop accessors
Decompile from asm:

  AddMoneyStored                      0x02010758
  SetEggSpecies                       0x02010794
  SetUnkGameState0x13a6               0x020107C4
  SetEggHatchTimer                    0x020107F4
  DecrementEggHatchTimer              0x0201080C
  GetRecycleItemId                    0x02011DF0
  RecycleItemHasTradeTypePrizeTicket  0x02011DFC
  GetRecycleItemBonusOdds             0x02011E18
  ClearRecycleShopOffer               0x02011F14
  GetGameStateRecycleCount            0x02011F30
  GetRankForRecycleShop               0x02011F48
  GetRecycleOfferCooldown             0x0201227C

Nine of these reach BAG_ITEMS_PTR_MIRROR. Five are the setters matching getters
already landed; the other four use offsets past them, so struct bag_items gains
four more fields, up to 0x13B4. As with the previous extension they are appended
past the end, and the field at 0x13AC is left to align naturally rather than
declaring a byte at 0x13AB that nothing reads.

AddMoneyStored tail-calls SetMoneyStored, which is still asm; its prototype is
provisional. DecrementEggHatchTimer only decrements a non-zero timer, which the
target expresses with predicated subne/strneh rather than a branch.

The remaining three take a pointer to a pointer to a small struct with fields at
0x0, 0x4 and 0x12. No existing type matches that layout, so it is introduced as
struct unk_02011DF0, named for the lowest-addressed function that takes it, with
placeholder fields. The bytes between 0x8 and 0x12 are unexamined and left as
filler.

Every one of the twelve matched on the first candidate.

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:28:27 -07:00

19 lines
366 B
C

#ifndef PMDSKY_MAIN_02011DF0_H
#define PMDSKY_MAIN_02011DF0_H
#include "util.h"
struct unk_02011DF0 {
s16 field_0x0;
s32 field_0x4;
u8 field_0x8[0xA];
u16 field_0x12;
};
s16 GetRecycleItemId(struct unk_02011DF0** p);
bool8 RecycleItemHasTradeTypePrizeTicket(struct unk_02011DF0** p);
u16 GetRecycleItemBonusOdds(struct unk_02011DF0** p);
#endif