Float/Current Statuses/Status Immunities/Status CT

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Float/Current Statuses/Status Immunities/Status CT
0005d4d0: 27bdffe0 addiu r29,r29,0xffe0
0005d4d4: afb10014 sw r17,0x0014(r29)
0005d4d8: 00808821 addu r17,r4,r0		r17 = Unit's Data Pointer
0005d4dc: afbf001c sw r31,0x001c(r29)
0005d4e0: afb20018 sw r18,0x0018(r29)
0005d4e4: afb00010 sw r16,0x0010(r29)
0005d4e8: 92220095 lbu r2,0x0095(r17)		Load Unit's 3rd set of movements
0005d4ec: 00000000 nop
0005d4f0: 30420008 andi r2,r2,0x0008
0005d4f4: 10400005 beq r2,r0,0x0005d50c		Branch if Unit doesn't have Float
0005d4f8: 00008021 addu r16,r0,r0		Counter = 0
0005d4fc: 92220050 lbu r2,0x0050(r17)		Load Unit's Innate Statuses
0005d500: 00000000 nop
0005d504: 34420040 ori r2,r2,0x0040		Enable Float
0005d508: a2220050 sb r2,0x0050(r17)		Store New Innate Statuses
0005d50c: 02302821 addu r5,r17,r16		r5 = Unit's Data Pointer + Counter
0005d510: 26100001 addiu r16,r16,0x0001		Counter += 1
0005d514: 90a2004e lbu r2,0x004e(r5)		Load Unit's X set of innate Statuses
0005d518: 90a30053 lbu r3,0x0053(r5)		Load Unit's X set of status Immunities
0005d51c: 90a4004e lbu r4,0x004e(r5)		Load Unit's X set of Innate Statuses
0005d520: 90a601bb lbu r6,0x01bb(r5)		Load Unit's X set of inflicted Statuses
0005d524: 00021027 nor r2,r0,r2			r2 = statuses that aren't innate
0005d528: 00621824 and r3,r3,r2			r3 = statuses that can be prevented
0005d52c: 00862025 or r4,r4,r6			r4 = Combined Innate/Inflicted Statuses
0005d530: 2a02 0005 slti r2,r16,0x0005
0005d534: a0a30053 sb r3,0x0053(r5)		Store New Status Immunities
0005d538: 1440fff4 bne r2,r0,0x0005d50c		Branch if all statuses haven't been checked
0005d53c: a0a40058 sb r4,0x0058(r5)		Store New Current Statuses
0005d540: 34100018 ori r16,r0,0x0018		Counter = 0x18
0005d544: 34120080 ori r18,r0,0x0080		Status Check = 0x80
0005d548: 06010002 bgez r16,0x0005d554		Branch if Counter >= 0
0005d54c: 02001021 addu r2,r16,r0		r2 = Counter
0005d550: 26020007 addiu r2,r16,0x0007		r2 = Counter + 7
0005d554: 000210c3 sra r2,r2,0x03		Counter / 8
0005d558: 32030007 andi r3,r16,0x0007		r3 = Counter AND 7 (which bit to get)
0005d55c: 02221021 addu r2,r17,r2		r2 += Unit's Data Pointer
0005d560: 904201bb lbu r2,0x01bb(r2)		Load specific Inflicted Status
0005d564: 00721807 srav r3,r18,r3		r3 = Status Check / Counter
0005d568: 00431024 and r2,r2,r3			Inflicted Status AND Status Check / 2^(Counter / 8)
0005d56c: 10400008 beq r2,r0,0x0005d590		Branch if status is not present
0005d570: 02301021 addu r2,r17,r16		r2 = Unit's Data Pointer + Counter
0005d574: 90420045 lbu r2,0x0045(r2)		Load Status's CT
0005d578: 00000000 nop
0005d57c: 14400004 bne r2,r0,0x0005d590		Branch if there is still CT left
0005d580: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d584: 02002821 addu r5,r16,r0		r5 = Counter
0005d588: 0c0176dc jal 0x0005db70		Status CT Setting
0005d58c: 00003021 addu r6,r0,r0		r6 = 0 (Initialization?)
0005d590: 26100001 addiu r16,r16,0x0001		Counter += 1
0005d594: 2a020028 slti r2,r16,0x0028
0005d598: 1440ffeb bne r2,r0,0x0005d548		Branch if all statuses haven't been checked
0005d59c: 00000000 nop
0005d5a0: 8fbf001c lw r31,0x001c(r29)
0005d5a4: 8fb20018 lw r18,0x0018(r29)
0005d5a8: 8fb10014 lw r17,0x0014(r29)
0005d5ac: 8fb00010 lw r16,0x0010(r29)
0005d5b0: 27bd0020 addiu r29,r29,0x0020
0005d5b4: 03e00008 jr r31
0005d5b8: 00000000 nop


Return Locations

0005d454: Status Initialization
0005d768: Status Setting/Checking + Equip/R/S/M Stats