007/GE Documentation/Actor-Specific Data and Ani.../Initialization/7F00625C - allocate and ini...

30 lines
778 B
Plaintext

7F00625C 3AD8C allocate and initialize 0x1E + A0 inventory entries for cur. player
accepts: A0= #additional inventory entries
LUI V0,8008
ADDIU V0,V0,A0B0
LW T7,0000 (V0) ;T7=cur.BONDdata
ADDIU SP,SP,FFE8
SW RA,0014 (SP)
ADDIU T6,A0,001E
SW T6,11E8 (T7) ;T6->BONDdata+11E8: max inventory items
LW T8,0000 (V0)
ADDIU A1,R0,0004 ;A1= bank 4
LW A0,11E8 (T8) ;A0=items.max
SLL T9,A0,0x2
ADDU T9,T9,A0
SLL T9,T9,0x2
ADDIU A0,T9,000F
ORI T0,A0,000F
JAL 70009720 ;V0=p->A0 bytes allocated in bank A1
XORI A0,T0,000F ;A0= 14*items.max
//7F0062A0: initialize player inventory
LUI T2,8008
LW T2,A0B0 (T2)
JAL 7F08BFF0 ;reinitialize player inventory
SW V0,11E4 (T2) ;V0->BONDdata+11E4: items.Pcur
//7F0062B0: return
LW RA,0014 (SP)
ADDIU SP,SP,0018
JR RA
NOP