Return Ability-use Error Message

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
00140ed4: 3c028017 lui r2,0x8017
00140ed8: 8c423cb8 lw r2,0x3cb8(r2)			pointer to menu data
00140edc: 27bdffd0 addiu r29,r29,0xffd0
00140ee0: afbf0028 sw r31,0x0028(r29)
00140ee4: afb50024 sw r21,0x0024(r29)
00140ee8: afb40020 sw r20,0x0020(r29)
00140eec: afb3001c sw r19,0x001c(r29)
00140ef0: afb20018 sw r18,0x0018(r29)
00140ef4: afb10014 sw r17,0x0014(r29)
00140ef8: afb00010 sw r16,0x0010(r29)
00140efc: 845000ec lh r16,0x00ec(r2)			load scroll counter?
00140f00: 0c0532f0 jal 0x0014cbc0			Get menu address
00140f04: 00000000 nop
00140f08: 0040a821 addu r21,r2,r0			r21 = menu address
00140f0c: 3c038017 lui r3,0x8017
00140f10: 8c634048 lw r3,0x4048(r3)			r3 = pointer to skillset ability data
00140f14: 3c028016 lui r2,0x8016
00140f18: 8c4269b0 lw r2,0x69b0(r2)			ability display flags
00140f1c: 00701821 addu r3,r3,r16			r3 = ability + counter
00140f20: 00108040 sll r16,r16,0x01
00140f24: 02028021 addu r16,r16,r2			ability display flags + Counter * 2
00140f28: 340200ff ori r2,r0,0x00ff
00140f2c: 90710334 lbu r17,0x0334(r3)			load No. turns to complete
00140f30: 86120000 lh r18,0x0000(r16)			load display flag
00140f34: 907301ec lbu r19,0x01ec(r3)			load MP cost/stock
00140f38: 16220002 bne r17,r2,0x00140f44		branch if No. turns to complete is not invalid
00140f3c: 00008021 addu r16,r0,r0			clear r16
00140f40: 00008821 addu r17,r0,r0			clear r17 (if invalid)
00140f44: 90620290 lbu r2,0x0290(r3)			silence/reflect
00140f48: 0c04b7d0 jal 0x0012df40			0012df40 - 0012df64 gets attacking unit's data pointer
00140f4c: 30540002 andi r20,r2,0x0002			silence check? (or... reflect? I forget)
00140f50: 3c038017 lui r3,0x8017
00140f54: 8c633c6c lw r3,0x3c6c(r3)			load action menu byte
00140f58: 00000000 nop
00140f5c: 1460000b bne r3,r0,0x00140f8c		branch if not default
00140f60: 00402021 addu r4,r2,r0			r4 = attacker data pointer
00140f64: 9482002c lhu r2,0x002c(r4)			load Mana
00140f68: 00000000 nop
00140f6c: 00531023 subu r2,r2,r19			subtract MP cost
00140f70: 04410006 bgez r2,0x00140f8c			branch if greater than 0
00140f74: 00000000 nop
00140f78: 16200004 bne r17,r0,0x00140f8c		branch if No. turns to complete <> 0
00140f7c: 3410800a ori r16,r0,0x800a			r16 = Battle nav message 0x0A (Not enough MP; recover MP before charging finishes)
00140f80: 34101008 ori r16,r0,0x1008			r16 = battle error message 0x08 (not enough MP, can't cast)
00140f84: 3c038017 lui r3,0x8017
00140f88: 8c633c6c lw r3,0x3c6c(r3)			action menu byte again
00140f8c: 34020006 ori r2,r0,0x0006			r2 = 6
00140f90: 3c018015 lui r1,0x8015
00140f94: ac31d320 sw r17,-0x2ce0(r1)			store No. turns to complete
00140f98: 10620003 beq r3,r2,0x00140fa8		branch if action menu = monster
00140f9c: 00000000 nop
00140fa0: 1460000b bne r3,r0,0x00140fd0		branch if action menu <> default
00140fa4: 00000000 nop
00140fa8: 12800009 beq r20,r0,0x00140fd0		branch if skill is not silenceable
00140fac: 00000000 nop
00140fb0: 90820059 lbu r2,0x0059(r4)			load current statuses
00140fb4: 00000000 nop
00140fb8: 30420008 andi r2,r2,0x0008			silence
00140fbc: 10400004 beq r2,r0,0x00140fd0		branch if not silenced
00140fc0: 00000000 nop
00140fc4: 16200002 bne r17,r0,0x00140fd0		branch if No. turns to complete <> 0
00140fc8: 34108013 ori r16,r0,0x8013			r16 = battle nav message 0x13 (silenced; cure silence before charging finishes)
00140fcc: 34101009 ori r16,r0,0x1009			r16 = battle error message 0x09 (silence; can't cast magic)
00140fd0: 3c038017 lui r3,0x8017
00140fd4: 8c633c6c lw r3,0x3c6c(r3)			action menu byte
00140fd8: 34020001 ori r2,r0,0x0001
00140fdc: 14620006 bne r3,r2,0x00140ff8		branch if action menu is not Item inventory
00140fe0: 00000000 nop
00140fe4: 12400005 beq r18,r0,0x00140ffc		branch if display flag = no issues?
00140fe8: 34020002 ori r2,r0,0x0002			r2 = 2
00140fec: 3410100b ori r16,r0,0x100b			r16 = battle error message 0xb (Can't use, none in stock)
00140ff0: 3c038017 lui r3,0x8017
00140ff4: 8c633c6c lw r3,0x3c6c(r3)
00140ff8: 34020002 ori r2,r0,0x0002
00140ffc: 14620004 bne r3,r2,0x00141010		branch if action menu is not weapon inventory
00141000: 00000000 nop
00141004: 12400002 beq r18,r0,0x00141010		branch if display flag = no issues?
00141008: 00000000 nop
0014100c: 3410100c ori r16,r0,0x100c			r16 = battle error message 0xc (can't throw, none in stock)
00141010: 3c038017 lui r3,0x8017
00141014: 8c633c6c lw r3,0x3c6c(r3)
00141018: 34020007 ori r2,r0,0x0007
0014101c: 14620004 bne r3,r2,0x00141030		branch if action menu is not katana inventory
00141020: 00000000 nop
00141024: 12400003 beq r18,r0,0x00141034		branch if display flag = no issues?
00141028: 2402fffc addiu r2,r0,0xfffc
0014102c: 3410100d ori r16,r0,0x100d			r16 = battle error message 0xd (can't release, none in stock (release = Draw out))
00141030: 2402fffc addiu r2,r0,0xfffc			r2 = 0xfffc
00141034: 3c018016 lui r1,0x8016
00141038: a4226ae4 sh r2,0x6ae4(r1)			store negative here
0014103c: 12000038 beq r16,r0,0x00141120		branch if no error message to display
00141040: 3c020001 lui r2,0x0001			r2 = 0x00010000
00141044: 3c038004 lui r3,0x8004			r3 = 0x80040000
00141048: 8c6373ac lw r3,0x73ac(r3)			load customized options
0014104c: 34428000 ori r2,r2,0x8000			r2 = 0x00018000
00141050: 00621824 and r3,r3,r2			check for navigation message or if display ability is on?
00141054: 34028000 ori r2,r0,0x8000			r2 = 0x00008000
00141058: 14620005 bne r3,r2,0x00141070		branch if display ability but not navigate message
0014105c: 34020001 ori r2,r0,0x0001			r2 = 1
00141060: 0c050260 jal 0x00140980
00141064: 00000000 nop
00141068: 0805043b j 0x001410ec
0014106c: 3402800a ori r2,r0,0x800a
00141070: 3c048017 lui r4,0x8017
00141074: 8c844038 lw r4,0x4038(r4)			oh no. thread management.
00141078: 3c018016 lui r1,0x8016
0014107c: a4225f74 sh r2,0x5f74(r1)
00141080: 3c028017 lui r2,0x8017
00141084: 8c423cb8 lw r2,0x3cb8(r2)
00141088: 3c058014 lui r5,0x8014
0014108c: 24a5b280 addiu r5,r5,0xb280
00141090: 3c018017 lui r1,0x8017
00141094: a420e42c sh r0,-0x1bd4(r1)
00141098: 2484ffff addiu r4,r4,0xffff
0014109c: 0c053228 jal 0x0014c8a0
001410a0: a4500850 sh r16,0x0850(r2)		store error message to return
001410a4: 00003021 addu r6,r0,r0
001410a8: 00003821 addu r7,r0,r0
001410ac: 3c048017 lui r4,0x8017
001410b0: 8c844038 lw r4,0x4038(r4)
001410b4: 3c058017 lui r5,0x8017
001410b8: 8ca53cb8 lw r5,0x3cb8(r5)
001410bc: 2484ffff addiu r4,r4,0xffff
001410c0: 0c05328e jal 0x0014ca38
001410c4: 24a50834 addiu r5,r5,0x0834
001410c8: 0c04b756 jal 0x0012dd58
001410cc: 00000000 nop
001410d0: 3c048017 lui r4,0x8017
001410d4: 8c844038 lw r4,0x4038(r4)
001410d8: 0c053274 jal 0x0014c9d0
001410dc: 2484ffff addiu r4,r4,0xffff
001410e0: 3c018016 lui r1,0x8016
001410e4: a4205f74 sh r0,0x5f74(r1)
001410e8: 3402800a ori r2,r0,0x800a
001410ec: 12020003 beq r16,r2,0x001410fc        Branch if error message was 0x800A (Not enough MP; recover MP before charging finishes)
001410f0: 34028013 ori r2,r0,0x8013
001410f4: 16020006 bne r16,r2,0x00141110        Branch if error message was not 0x8013 (silenced; cure silence before charging finishes)
001410f8: 2402ffff addiu r2,r0,0xffff
001410fc: 3c038017 lui r3,0x8017
00141100: 8463e42c lh r3,-0x1bd4(r3)
00141104: 2402ffff addiu r2,r0,0xffff
00141108: 14620007 bne r3,r2,0x00141128
0014110c: 2402ffff addiu r2,r0,0xffff
00141110: 3c018016 lui r1,0x8016
00141114: a4226ae4 sh r2,0x6ae4(r1)
00141118: 0805044a j 0x00141128
0014111c: 00000000 nop
00141120: 0c050260 jal 0x00140980
00141124: 00000000 nop
00141128: 0c050269 jal 0x001409a4
0014112c: 02a02021 addu r4,r21,r0
00141130: 0c053256 jal 0x0014c958
00141134: 00000000 nop
00141138: 8fbf0028 lw r31,0x0028(r29)
0014113c: 8fb50024 lw r21,0x0024(r29)
00141140: 8fb40020 lw r20,0x0020(r29)
00141144: 8fb3001c lw r19,0x001c(r29)
00141148: 8fb20018 lw r18,0x0018(r29)
0014114c: 8fb10014 lw r17,0x0014(r29)
00141150: 8fb00010 lw r16,0x0010(r29)
00141154: 27bd0030 addiu r29,r29,0x0030
00141158: 03e00008 jr r31
0014115c: 00000000 nop