mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-30 06:12:17 -05:00
Decompile from asm: GetItemAtIdx 0x0200F340 RemoveEmptyItemsInBag 0x0200F370 GetItemAtIdx returns a pointer into the active inventory, or null for a negative index. Its index parameter is s16, not s32: struct item is 6 bytes, and at 16-bit width the compiler folds the index scaling and the base into a single smlabb, which is what the target emits. An s32 index produces a separate multiply and add, at score 1100. RemoveEmptyItemsInBag tail-calls RemoveEmptyItems over the active inventory with INVENTORY_SIZE, which is already 50 in item.h and matches the 0x32 immediate. RemoveEmptyItems is still asm and was not declared anywhere in the tree, so its prototype is provisional and declared here. 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>
7 lines
133 B
C++
7 lines
133 B
C++
#pragma once
|
|
.public AreItemsEquivalent
|
|
.public BAG_ITEMS_PTR_MIRROR
|
|
.public ItemZInit
|
|
.public RemoveEmptyItems
|
|
.public sub_020582E0
|