Main Reaction subroutine - ENTD/ID stuff

From Final Fantasy Hacktics Wiki
Revision as of 13:05, 25 November 2022 by Orkney (talk | contribs) (→‎Retun location)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Parameters : r4 = unit data pointer

Returns nothing

Check if Jp gain unlocks new Jobs or increase Job Lv
Set 0x8019390d to 0x01 if Job Lv is increased
----------------------------------------------------------------------------------------------
0018dff8: 27bdffd8 addiu r29,r29,-0x0028    |
0018dffc: afb00018 sw r16,0x0018(r29)       |
0018e000: 00808021 addu r16,r4,r0           |r16 = Unit data pointer
0018e004: 27a60010 addiu r6,r29,0x0010      |r6 = Stack 0x0010
0018e008: afbf0024 sw r31,0x0024(r29)       |
0018e00c: afb20020 sw r18,0x0020(r29)       |
0018e010: afb1001c sw r17,0x001c(r29)       |
0018e014: 92120003 lbu r18,0x0003(r16)      |r18 = Unit current Job ID
0018e018: 9211018a lbu r17,0x018a(r16)      |17 = Unit raw ID (without FF check)
0018e01c: 0c05fa8a jal 0x0017ea28           |-->Load_Job_Level returns r2 = Unit current job Lv
0018e020: 02402821 addu r5,r18,r0           |r5 = Unit current Job
0018e024: 02202021 addu r4,r17,r0           |r4 = Unit ID
0018e028: 00408821 addu r17,r2,r0           |r17 = Unit current job Lv
0018e02c: 920601ba lbu r6,0x01ba(r16)       |r6 = Unit ENTD modified flags
0018e030: 920501b5 lbu r5,0x01b5(r16)       |r5 = Unit gained Jp
0018e034: 8fa70010 lw r7,0x0010(r29)        |r7 = Unit Current generic job ID
0018e038: 0c05faa0 jal 0x0017ea80           |-->Store_JP;_Calculate_Unlocked_Jobs
0018e03c: 30c60030 andi r6,r6,0x0030        |r6 = Unit Team
0018e040: 02002021 addu r4,r16,r0           |r4 = Unit data pointer
0018e044: 02402821 addu r5,r18,r0           |r5 = Unit current Job ID
0018e048: 0c05fa8a jal 0x0017ea28           |-->Load_Job_Level returns r2 = Unit current job Lv
0018e04c: 27a60010 addiu r6,r29,0x0010      |r6 = Stack 0x0010
0018e050: 10510003 beq r2,r17,0x0018e060    #If Unit gained a job Lv
0018e054: 34020001 ori r2,r0,0x0001             |r2 = 0x01
0018e058: 3c018019 lui r1,0x8019                |
0018e05c: a022390d sb r2,0x390d(r1)             |Store 0x01 at 0x8019390d  0x8019390d / 8019390d
0018e060: 8fbf0024 lw r31,0x0024(r29)       END
0018e064: 8fb20020 lw r18,0x0020(r29)
0018e068: 8fb1001c lw r17,0x001c(r29)
0018e06c: 8fb00018 lw r16,0x0018(r29)
0018e070: 27bd0028 addiu r29,r29,0x0028
0018e074: 03e00008 jr r31
0018e078: 00000000 nop

Retun location

Battle.bin
0018c23c: Attack_Finalisation_&_Reaction_Flagging