Unit Initialization

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Unit Initialization 
00059b18: 27bdfe20 addiu r29,r29,0xfe20		r4 = ENTD Data Pointer (0x1dc000 data)
00059b1c: afb101d4 sw r17,0x01d4(r29 )
00059b20: 00c08821 addu r17,r6,r0		r17 = 0 (not called with a  different value in-battle)
00059b24: 00051080 sll r2,r5,0x02		Counter * 4
00059b28: 00451021 addu r2,r2,r5		Counter * 5
00059b2c: 000210c0 sll r2,r2,0x03		Counter * 40
00059b30: 00822821 addu r5,r4,r2		ENTD Data Pointer + Counter * 40
00059b34: afbf01d8 sw r31,0x01d8(r29)
00059b38: afb001d0 sw r16,0x01d0(r29)
00059b3c: 3c018006 lui r1,0x8006
00059b40: ac256238 sw r5,0x6238(r1)		Store Current ENTD Data Pointer
00059b44: 90a20000 lbu r2,0x0000(r5)		Load Sprite Set
00059b48: 00000000 nop
00059b4c: 10400011 beq r2,r0,0x00059b94		Branch if Sprite Set = 0
00059b50: 00e03021 addu r6,r7,r0		r6 = r7 (r7 is 1 in this case)
00059b54: 27b00010 addiu r16,r29,0x0010		r16 = Temp Unit Data
00059b58: 02002021 addu r4,r16,r0		r4 = Temp Unit Data
00059b5c: 340300ff ori r3,r0,0x00ff		r3 = 0xFF
00059b60: 34020020 ori r2,r0,0x0020		r2 = 0x20
00059b64: a3a20011 sb r2,0x0011(r29)		Store Unit's Unit ID = 0x20 (?)
00059b68: 34020001 ori r2,r0,0x0001		r2 = 1
00059b6c: 00003821 addu r7,r0,r0		r7 = 0
00059b70: a3a3019a sb r3,0x019a(r29)		Store Unit's Unit ID = FF
00059b74: a3a20193 sb r2,0x0193(r29)		Store Unit's ? = 1 (Unit Exists?)
00059b78: 0c016a6d jal 0x0005a9b4		Unit Battle Initialization
00059b7c: a3a30012 sb r3,0x0012(r29)		Store Unit's Party ID = FF
00059b80: 02002021 addu r4,r16,r0		r4 = Temp Unit's Data Pointer
00059b84: 0c0166ec jal 0x00059bb0		Add Unit to Party/Store Unit's Party Data
00059b88: 02202821 addu r5,r17,r0		r5 = 0 (No new party members)
00059b8c: 080166e6 j 0x00059b98
00059b90: 00000000 nop
00059b94: 2402fffe addiu r2,r0,0xfffe		r2 = -2
00059b98: 8fbf01d8 lw r31,0x01d8(r29)
00059b9c: 8fb101d4 lw r17,0x01d4(r29)
00059ba0: 8fb001d0 lw r16,0x01d0(r29)
00059ba4: 27bd01e0 addiu r29,r29,0x01e0
00059ba8: 03e00008 jr r31
00059bac: 00000000 nop


Return Locations

000429a8: 00042930_-_00042a0c