0013f900 - 0013f974

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
BATTLE.BIN - 0013f900 - 0013f974
---------------------------------------------------------------------------------------
Parameter : r4 = Unit ID

Returns : Nothing
Initialize Unit Menu data ( 8014d46c )
---------------------------------------------------------------------------------------
0013f900: 27bdffe8 addiu r29,r29,0xffe8     |
0013f904: afb00010 sw r16,0x0010(r29)       |
0013f908: afbf0014 sw r31,0x0014(r29)       |
0013f90c: 0c0602bf jal 0x00180afc           |-->Get_Unit%27s_Data_Pointer
0013f910: 00808021 addu r16,r4,r0           |Preserves Unit ID
0013f914: 00403021 addu r6,r2,r0            |Unit data pointer
0013f918: 340700ff ori r7,r0,0x00ff         |
0013f91c: 3c038015 lui r3,0x8015            |
0013f920: 2463d46c addiu r3,r3,-0x2b94      |Pointer to start of menu data
0013f924: 00101100 sll r2,r16,0x04          |unit ID*16
0013f928: 00502021 addu r4,r2,r16           |unit ID*17
0013f92c: 00831821 addu r3,r4,r3            |Pointer to Unit menu data
0013f930: 24650011 addiu r5,r3,0x0011       |Pointer + 0x11 (limit for below loop)
                                            @LOOP
0013f934: 90c201b8 lbu r2,0x01b8(r6)            |load AI/autobattle
0013f938: 00000000 nop                          |
0013f93c: 14400005 bne r2,r0,0x0013f954         #If No Auto Battle flags
0013f940: 00000000 nop                              |
0013f944: a0600000 sb r0,0x0000(r3)                 |Clear Byte
0013f948: 3c018015 lui r1,0x8015                    |
0013f94c: 00240821 addu r1,r1,r4                    |8015 + Unit ID * 17
0013f950: a027d46d sb r7,-0x2b93(r1)                |Store 0xff in Menu 0x01 8014d46c + 0x01  (17 Time….)
0013f954: 24630001 addiu r3,r3,0x0001           |Unit menu pointer +1
0013f958: 0065102a slt r2,r3,r5                 |Check limit
0013f95c: 1440fff5 bne r2,r0,0x0013f934     Λ Loop 0x11 Times
0013f960: 00000000 nop                          |
0013f964: 8fbf0014 lw r31,0x0014(r29)       END
0013f968: 8fb00010 lw r16,0x0010(r29)
0013f96c: 27bd0018 addiu r29,r29,0x0018
0013f970: 03e00008 jr r31
0013f974: 00000000 nop

Return location

00071080: