Prep for Initializing Unit's Job Data

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Prep for Initializing Unit's Job Data
0005b038: 27bdffe0 addiu r29,r29,0xffe0
0005b03c: afb00010 sw r16,0x0010(r29)
0005b040: 00808021 addu r16,r4,r0		r16 = Unit's Data Pointer
0005b044: afb10014 sw r17,0x0014(r29)
0005b048: 00a08821 addu r17,r5,r0		r17 = ENTD Data Pointer
0005b04c: afbf0018 sw r31,0x0018(r29)
0005b050: 92240000 lbu r4,0x0000(r17)		Load ENTD Sprite Set
0005b054: 0c0167e5 jal 0x00059f94		Find Unit's Party Data Location
0005b058: 00000000 nop
0005b05c: 00402821 addu r5,r2,r0		r5 = Party ID
0005b060: 2402ffff addiu r2,r0,0xffff		r2 = FFFF (Fail)
0005b064: 10a20014 beq r5,r2,0x0005b0b8		Branch if Unit doesn't exist
0005b068: 00000000 nop
0005b06c: 3c068006 lui r6,0x8006
0005b070: 8cc66200 lw r6,0x6200(r6)		Load Battle Initialization Flag? (Loaded just to store)
0005b074: 0c016a35 jal 0x0005a8d4		Initialize Unit's Job Data
0005b078: 02002021 addu r4,r16,r0		r4 = Unit's Data Pointer
0005b07c: 92030006 lbu r3,0x0006(r16)		Load Unit's Gender Byte
0005b080: 00000000 nop
0005b084: 306300ee andi r3,r3,0x00ee
0005b088: a2030006 sb r3,0x0006(r16)		Store Gender Byte without Join After Event/Save Formation
0005b08c: 92220001 lbu r2,0x0001(r17)		Load Unit's ENTD Gender Byte
0005b090: 00000000 nop
0005b094: 30420011 andi r2,r2,0x0011
0005b098: 00621825 or r3,r3,r2			Enable Unit's Join After Event/Save Formation Flags
0005b09c: a2030006 sb r3,0x0006(r16)		Store Unit's new Gender Byte
0005b0a0: 92220018 lbu r2,0x0018(r17)		Load Unit's ENTD Flags
0005b0a4: 00000000 nop
0005b0a8: a2020005 sb r2,0x0005(r16)		Store Unit's ENTD Flags
0005b0ac: 92230018 lbu r3,0x0018(r17)		Load Unit's ENTD Flags
0005b0b0: 00001021 addu r2,r0,r0		r2 = 0 (Success)
0005b0b4: a20301ba sb r3,0x01ba(r16)		Store Unit's Modified ENTD Flags
0005b0b8: 8fbf0018 lw r31,0x0018(r29)
0005b0bc: 8fb10014 lw r17,0x0014(r29)
0005b0c0: 8fb00010 lw r16,0x0010(r29)
0005b0c4: 27bd0020 addiu r29,r29,0x0020
0005b0c8: 03e00008 jr r31
0005b0cc: 00000000 nop


Return Locations

0005ac78:  ENTD Data Calculation
0005ad6c: ^^