Status Setting/Checking + Equip/R/S/M Stats

From Final Fantasy Hacktics
Jump to: navigation, search
Status Setting/Checking + Equip/R/S/M Stats
0005d628: 27bdffc8 addiu r29,r29,0xffc8
0005d62c: afb10024 sw r17,0x0024(r29)
0005d630: 00808821 addu r17,r4,r0		r17 = Unit's Data Pointer
0005d634: afb20028 sw r18,0x0028(r29)
0005d638: 00a09021 addu r18,r5,r0		r18 = Initialization Flag?
0005d63c: afb3002c sw r19,0x002c(r29)
0005d640: afbf0034 sw r31,0x0034(r29)
0005d644: afb40030 sw r20,0x0030(r29)
0005d648: afb00020 sw r16,0x0020(r29)
0005d64c: 9234018a lbu r20,0x018a(r17)		Load Unit's ID
0005d650: 0c0179d1 jal 0x 0005e744		Store Current Statuses
0005d654: 00c09821 addu r19,r6,r0		r19 = Statuses Set Flag?
0005d658: 00008021 addu r16,r0,r0		Counter = 0
0005d65c: 27a50010 addiu r5,r29,0x0010		r5 = Pointer to temp. stored inflicted statuses
0005d660: 27a40018 addiu r4,r29,0x0018		r4 = Pointer to temp. stored statuses
0005d664: 02301821 addu r3,r17,r16		r3 = Unit's Data Pointer
0005d668: 90620058 lbu r2,0x0058(r3)		Load Unit's X set of Statuses
0005d66c: 26100001 addiu r16,r16,0x0001		Counter ++
0005d670: a0820000 sb r2,0x0000(r4)		Store Statuses Temorarily
0005d674: 906201bb lbu r2,0x01bb(r3)		Load Unit's X set of Inflicted Statuses
0005d678: 24840001 addiu r4,r4,0x0001		Temp Stored Status Pointer ++
0005d67c: a0a20000 sb r2,0x0000(r5)		Store inflicted Statuses temporarily
0005d680: 2a02 0005 slti r2,r16,0x 0005
0005d684: 1440fff7 bne r2,r0,0x 0005d664		Branch if all statuses haven't been stored
0005d688: 24a50001 addiu r5,r5,0x0001		Temp Stored Inflicted Status Pointer ++
0005d68c: 92220003 lbu r2,0x0003(r17)		Load Unit's Job ID
0005d690: 2625004a addiu r5,r17,0x004a		r5 = Unit's Data Pointer + 0x4a (Equippable Items)
0005d694: 00028040 sll r16,r2,0x01		Job ID * 2
0005d698: 02028021 addu r16,r16,r2		Job ID * 3
0005d69c: 3c028006 lui r2,0x8006
0005d6a0: 8c426194 lw r2,0x6194(r2)		Load Job Data Pointer
0005d6a4: 00108100 sll r16,r16,0x04		Job ID * 24
0005d6a8: 02028021 addu r16,r16,r2		Job ID * 24 + Job Data Pointer
0005d6ac: 92020017 lbu r2,0x0017(r16)		Load Job's Move
0005d6b0: 34060004 ori r6,r0,0x0004		Limit = 4 (all 4 equippable items)
0005d6b4: a222003a sb r2,0x003a(r17)		Store Job's Move into Unit's Move
0005d6b8: 92020018 lbu r2,0x0018(r16)		Load Job's Jump
0005d6bc: 26040009 addiu r4,r16,0x0009		r4 = Job Data Pointer (Equippable Items)
0005d6c0: 3042007f andi r2,r2,0x007f
0005d6c4: 0c017319 jal 0x 0005cc64		Store X into Y (Job's equippable items into Unit's)
0005d6c8: a222003b sb r2,0x003b(r17)		Store Job's Jump into Unit's Jump
0005d6cc: 2604001a addiu r4,r16,0x001a		r4 = Job's Data Pointer (Innate Statuses)
0005d6d0: 2625004e addiu r5,r17,0x004e		r5 = Unit's Data Pointer (Innate Statuses)
0005d6d4: 0c017319 jal 0x 0005cc64		Store X Into Y (Job's Statuses into Unit's)
0005d6d8: 3406000f ori r6,r0,0x000f		Limit = f (all three status groups)
0005d6dc: 26040029 addiu r4,r16,0x0029		r4 = Job's Data Pointer (Elemental Resistances)
0005d6e0: 2625006d addiu r5,r17,0x006d		r5 = Unit's Data Pointer (Elemental Resistances)
0005d6e4: 0c017319 jal 0x 0005cc64		Store X into Y (Job's Elemental Resistances into Unit's)
0005d6e8: 34060004 ori r6,r0,0x0004		Limit = 4 (all elemental resistances)
0005d6ec: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d6f0: 0c016de8 jal 0x 0005b7a0		Enable Unit's R/S/M Flags
0005d6f4: a2200071 sb r0,0x0071(r17)		Store Unit's Elements Strengthened = 0
0005d6f8: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d6fc: 0c01723b jal 0x 0005c8ec		Move/Jump +X Calculation
0005d700: 34050001 ori r5,r0,0x0001		r5 = 1 (Don't set Current HP/MP to Max)
0005d704: 0c0170e6 jal 0x 0005c398		Equipment Stat Setting
0005d708: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d70c: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d710: 0c017172 jal 0x 0005c5c8		Equipment Attribute Setting
0005d714: 00002821 addu r5,r0,r0		Level UP Check = 0 (No Level UP, just stat setting)
0005d718: 0c01709f jal 0x 0005c27c		Equippable item setting (Support/Female-only)
0005d71c: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d720: 27a40010 addiu r4,r29,0x0010		r4 = Pointer to temp. stored Inflicted Statuses
0005d724: 02201821 addu r3,r17,r0		r3 = Unit's Data Pointer
0005d728: 27a50015 addiu r5,r29,0x0015		r5 = Temp Stored Inflicted Status Limit (for loop)
0005d72c: 12600004 beq r19,r0,0x 0005d740	Branch if Statuses have been set?
0005d730: 00000000 nop
0005d734: 90620058 lbu r2,0x0058(r3)		Load Unit's X set of statuses
0005d738: 080175d3 j 0x 0005d74c			(Inflicted Statuses = Current Statuses)
0005d73c: a06201bb sb r2,0x01bb(r3)		Store X set of statuses in Unit's Inflicted Statuses
0005d740: 90820000 lbu r2,0x0000(r4)		Load X set of stored statuses
0005d744: 00000000 nop				(Inflicted Statuses = Inflicted Statuses)
0005d748: a06201bb sb r2,0x01bb(r3)		Store X set of statuses in Unit's Inflicted Statuses
0005d74c: 24840001 addiu r4,r4,0x0001		Pointer to Temp stored Inflicted Statuses += 1
0005d750: 0085102a slt r2,r4,r5
0005d754: 1440fff5 bne r2,r0,0x 0005d72c		Branch if all statuses haven't been stored
0005d758: 24630001 addiu r3,r3,0x0001		Unit's Data Pointer += 1
0005d75c: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d760: 92300002 lbu r16,0x0002(r17)		Load Unit's Party ID
0005d764: 340200ff ori r2,r0,0x00ff
0005d768: 0c017534 jal 0x 0005d4d0		Float/Current Statuses/Status Immunities/Status CT
0005d76c: a2220002 sb r2,0x0002(r17)		Store Party ID = FF
0005d770: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d774: 0c0179d1 jal 0x 0005e744		Store Current Statuses
0005d778: a2300002 sb r16,0x0002(r17)		Store Unit's Party ID
0005d77c: 16400037 bne r18,r0,0x 0005d85c	Branch if Initializing Data?
0005d780: 3c03cccc lui r3,0xcccc
0005d784: 9622002a lhu r2,0x002a(r17)		Load Unit's Max HP
0005d788: 3463cccd ori r3,r3,0xcccd
0005d78c: 00430019 multu r2,r3			Max HP * 0.8
0005d790: 96230028 lhu r3,0x0028(r17)		Load Unit's Current HP
0005d794: 00001010 mfhi r2			r2 = Max HP * 0.8
0005d798: 00021082 srl r2,r2,0x02		r2 = Max HP * 0.8 / 4 (or Max HP / 5)
0005d79c: 3042ffff andi r2,r2,0xffff
0005d7a0: 0043102b sltu r2,r2,r3
0005d7a4: 14400004 bne r2,r0,0x 0005d7b8		Branch if not in Critical
0005d7a8: 00000000 nop
0005d7ac: 922201bd lbu r2,0x01bd(r17)		Load Unit's 3rd set of Inflicted Statuses
0005d7b0: 080175f1 j 0x 0005d7c4
0005d7b4: 34420001 ori r2,r2,0x0001		Enable Critical
0005d7b8: 922201bd lbu r2,0x01bd(r17)		Load Unit's 3rd set of Inflicted Statuses
0005d7bc: 00000000 nop
0005d7c0: 304200fe andi r2,r2,0x00fe		Disable Critical
0005d7c4: a22201bd sb r2,0x01bd(r17)		Store Unit's New Inflicted Statuses
0005d7c8: 0c0179d1 jal 0x 0005e744		Store Current Statuses
0005d7cc: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d7d0: 00008021 addu r16,r0,r0		Counter = 0
0005d7d4: 34120001 ori r18,r0,0x0001		Counter2 = 1
0005d7d8: 06010002 bgez r16,0x 0005d7e4		Branch if Counter >= 0
0005d7dc: 02001021 addu r2,r16,r0		r2 = Counter
0005d7e0: 26020007 addiu r2,r16,0x0007		Counter += 7
0005d7e4: 000210c3 sra r2,r2,0x03		Counter / 8
0005d7e8: 32040007 andi r4,r16,0x0007
0005d7ec: 34030080 ori r3,r0,0x0080		Status Check = 80
0005d7f0: 00831807 srav r3,r3,r4		r3 = Status Check / Counter
0005d7f4: 03a22021 addu r4,r29,r2		r4 = Counter / 8 + Temp Current Statuses Pointer
0005d7f8: 02221021 addu r2,r17,r2		r2 = Unit's Data Pointer += Counter / 8
0005d7fc: 90840018 lbu r4,0x0018(r4)		Load Temp Stored Current Statuses
0005d800: 90420058 lbu r2,0x0058(r2)		Load Unit's Current Statuses
0005d804: 00832024 and r4,r4,r3
0005d808: 16600003 bne r19,r0,0x 0005d818	Branch if Statuses haven't been set yet?
0005d80c: 00431024 and r2,r2,r3
0005d810: 1082000e beq r4,r2,0x 0005d84c		Branch if Temp Stored Status is already present
0005d814: 00000000 nop
0005d818: 10400009 beq r2,r0,0x 0005d840		Branch if Status is not present
0005d81c: 02402021 addu r4,r18,r0		r4 = Counter2
0005d820: 12600004 beq r19,r0,0x 0005d834	Branch if Statuses have been set?
0005d824: 02202021 addu r4,r17,r0		r4 = Unit's Data Pointer
0005d828: 02002821 addu r5,r16,r0		r5 = Counter
0005d82c: 0c0176dc jal 0x 0005db70		Status CT Setting
0005d830: 00003021 addu r6,r0,r0		r6 = 0 (Not Initializing?)
0005d834: 02402021 addu r4,r18,r0		r4 = Counter2
0005d838: 08017611 j 0x 0005d844
0005d83c: 34050001 ori r5,r0,0x0001		r5 = 1 (Status Present)
0005d840: 00002821 addu r5,r0,r0		r5 = 0 (Status not Present)
0005d844: 0c063a6f jal 0x0018e9bc		Determine if Status Flags can be Enabled?
0005d848: 02803021 addu r6,r20,r0		r6 = Unit's ID
0005d84c: 26100001 addiu r16,r16,0x0001		Counter += 1
0005d850: 2a020028 slti r2,r16,0x0028
0005d854: 1440ffe0 bne r2,r0,0x 0005d7d8		Branch if all statuses haven't been checked
0005d858: 26520001 addiu r18,r18,0x0001		Counter2 += 1
0005d85c: 8fbf0034 lw r31,0x0034(r29)
0005d860: 8fb40030 lw r20,0x0030(r29)
0005d864: 8fb3002c lw r19,0x002c(r29)
0005d868: 8fb20028 lw r18,0x0028(r29)
0005d86c: 8fb10024 lw r17,0x0024(r29)
0005d870: 8fb00020 lw r16,0x0020(r29)
0005d874: 27bd0038 addiu r29,r29,0x0038
0005d878: 03e00008 jr r31
0005d87c: 00000000 nop


Return Locations

0005d5c8: Status Setting/Checking + Equip/R/S/M Stats Prep
0005d5ec: Status Setting/Checking + Equip/R/S/M Stats Prep 2
0005d610: Status Setting/Checking + Equip/R/S/M Stats Prep 3