Difference between revisions of "Ability selected routine"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
Line 19: Line 19:
 
  00140d14: 00008821 addu r17,r0,r0
 
  00140d14: 00008821 addu r17,r0,r0
 
  00140d18: 0c04b7d0 jal 0x0012df40 get attackers data
 
  00140d18: 0c04b7d0 jal 0x0012df40 get attackers data
  00140d1c: 0040b021 addu r22,r2,r0
+
  00140d1c: 0040b021 addu r22,r2,r0 r22 = menu address
 
  00140d20: 12000014 beq r16,r0,0x00140d74 branch if not found
 
  00140d20: 12000014 beq r16,r0,0x00140d74 branch if not found
 
  00140d24: 00409821 addu r19,r2,r0
 
  00140d24: 00409821 addu r19,r2,r0
Line 107: Line 107:
 
  00140e74: 84329264 lh r18,-0x6d9c(r1) load ??
 
  00140e74: 84329264 lh r18,-0x6d9c(r1) load ??
 
  00140e78: 00000000 nop
 
  00140e78: 00000000 nop
  00140e7c: 06410008 bgez r18,0x00140ea0
+
  00140e7c: 06410008 bgez r18,0x00140ea0 branch if => 0 (this value is normally 3 or -3, so I guess if it's 3.)
 
  00140e80: 34020002 ori r2,r0,0x0002
 
  00140e80: 34020002 ori r2,r0,0x0002
 
  00140e84: 3c018016 lui r1,0x8016
 
  00140e84: 3c018016 lui r1,0x8016
  00140e88: a4326a34 sh r18,0x6a34(r1)
+
  00140e88: a4326a34 sh r18,0x6a34(r1) store in skillset data if 0xfffd
  00140e8c: 0c050269 jal 0x001409a4
+
  00140e8c: 0c050269 jal 0x001409a4 [[Disable Move/Act based on menu ID]]
  00140e90: 02c02021 addu r4,r22,r0
+
  00140e90: 02c02021 addu r4,r22,r0 r4 = menu address (overwritten in above.)
 
  00140e94: 0c053256 jal 0x0014c958 Elemental does not return from here?
 
  00140e94: 0c053256 jal 0x0014c958 Elemental does not return from here?
 
  00140e98: 00000000 nop
 
  00140e98: 00000000 nop
 
  00140e9c: 34020002 ori r2,r0,0x0002
 
  00140e9c: 34020002 ori r2,r0,0x0002
  00140ea0: 3c018015 lui r1,0x8015
+
  00140ea0: 3c018015 lui r1,0x8015 here if ?? = 3
 
  00140ea4: a022d325 sb r2,-0x2cdb(r1)
 
  00140ea4: a022d325 sb r2,-0x2cdb(r1)
 
  00140ea8: 8fbf002c lw r31,0x002c(r29)
 
  00140ea8: 8fbf002c lw r31,0x002c(r29)

Revision as of 10:12, 23 February 2022

00140cd4: 27bdffd0 addiu r29,r29,0xffd0
00140cd8: afb40020 sw r20,0x0020(r29)
00140cdc: 0080a021 addu r20,r4,r0
00140ce0: afb50024 sw r21,0x0024(r29)
00140ce4: 00a0a821 addu r21,r5,r0
00140ce8: afb00010 sw r16,0x0010(r29)
00140cec: afbf002c sw r31,0x002c(r29)
00140cf0: afb60028 sw r22,0x0028(r29)
00140cf4: afb3001c sw r19,0x001c(r29)
00140cf8: afb20018 sw r18,0x0018(r29)
00140cfc: afb10014 sw r17,0x0014(r29)
00140d00: 3c018017 lui r1,0x8017
00140d04: ac343c6c sw r20,0x3c6c(r1)			store action menu byte?
00140d08: 0c0532f0 jal 0x0014cbc0				get menu address?
00140d0c: 00c08021 addu r16,r6,r0
00140d10: 00009021 addu r18,r0,r0
00140d14: 00008821 addu r17,r0,r0
00140d18: 0c04b7d0 jal 0x0012df40				get attackers data
00140d1c: 0040b021 addu r22,r2,r0			r22 = menu address
00140d20: 12000014 beq r16,r0,0x00140d74		branch if not found
00140d24: 00409821 addu r19,r2,r0
00140d28: 0c0604c3 jal 0x0018130c				weapon guard usability
00140d2c: 02602021 addu r4,r19,r0
00140d30: 34030002 ori r3,r0,0x0002
00140d34: 14430003 bne r2,r3,0x00140d44			branch if ok?
00140d38: 34111003 ori r17,r0,0x1003
00140d3c: 0805035d j 0x00140d74
00140d40: 34120002 ori r18,r0,0x0002
00140d44: 9262005a lbu r2,0x005a(r19)			load status
00140d48: 00000000 nop
00140d4c: 30420002 andi r2,r2,0x0002
00140d50: 10400003 beq r2,r0,0x00140d60			branch if not frog
00140d54: 34111007 ori r17,r0,0x1007
00140d58: 0805035d j 0x00140d74
00140d5c: 34120002 ori r18,r0,0x0002
00140d60: 3c018017 lui r1,0x8017
00140d64: 00340821 addu r1,r1,r20
00140d68: 902292a4 lbu r2,-0x6d5c(r1)			1692a4
00140d6c: 34120002 ori r18,r0,0x0002
00140d70: 24511000 addiu r17,r2,0x1000
00140d74: 16200005 bne r17,r0,0x00140d8c
00140d78: 34020003 ori r2,r0,0x0003
00140d7c: 16820003 bne r20,r2,0x00140d8c
00140d80: 34028009 ori r2,r0,0x8009
00140d84: 00558823 subu r17,r2,r21
00140d88: 34120001 ori r18,r0,0x0001
00140d8c: 1240002e beq r18,r0,0x00140e48
00140d90: 3c030001 lui r3,0x0001
00140d94: 3c028004 lui r2,0x8004
00140d98: 8c4273ac lw r2,0x73ac(r2)				800473ac
00140d9c: 34638000 ori r3,r3,0x8000
00140da0: 00431824 and r3,r2,r3
00140da4: 34028000 ori r2,r0,0x8000
00140da8: 14620003 bne r3,r2,0x00140db8
00140dac: 3222ff00 andi r2,r17,0xff00
00140db0: 10430014 beq r2,r3,0x00140e04
00140db4: 34020002 ori r2,r0,0x0002
00140db8: 3c058014 lui r5,0x8014
00140dbc: 24a5b280 addiu r5,r5,0xb280				8013b280
00140dc0: 3c048017 lui r4,0x8017
00140dc4: 8c844038 lw r4,0x4038(r4)					load block #?
00140dc8: 3c028017 lui r2,0x8017
00140dcc: 8c423cb8 lw r2,0x3cb8(r2)					load menu data?
00140dd0: 2484ffff addiu r4,r4,0xffff
00140dd4: 0c053228 jal 0x0014c8a0
00140dd8: a4510850 sh r17,0x0850(r2)
00140ddc: 00003021 addu r6,r0,r0
00140de0: 00003821 addu r7,r0,r0
00140de4: 3c048017 lui r4,0x8017
00140de8: 8c844038 lw r4,0x4038(r4)				load block #
00140dec: 3c058017 lui r5,0x8017
00140df0: 8ca53cb8 lw r5,0x3cb8(r5)				load menu data
00140df4: 2484ffff addiu r4,r4,0xffff
00140df8: 0c05328e jal 0x0014ca38
00140dfc: 24a50834 addiu r5,r5,0x0834
00140e00: 34020002 ori r2,r0,0x0002
00140e04: 16420026 bne r18,r2,0x00140ea0
00140e08: 34020002 ori r2,r0,0x0002
00140e0c: 0c04b756 jal 0x0012dd58
00140e10: 00000000 nop
00140e14: 3c030001 lui r3,0x0001
00140e18: 3c028004 lui r2,0x8004
00140e1c: 8c4273ac lw r2,0x73ac(r2)
00140e20: 34638000 ori r3,r3,0x8000
00140e24: 00431024 and r2,r2,r3
00140e28: 1440001a bne r2,r0,0x00140e94
00140e2c: 00000000 nop
00140e30: 3c048017 lui r4,0x8017
00140e34: 8c844038 lw r4,0x4038(r4)
00140e38: 0c053274 jal 0x0014c9d0
00140e3c: 2484ffff addiu r4,r4,0xffff
00140e40: 080503a5 j 0x00140e94
00140e44: 00000000 nop
00140e48: 3c028017 lui r2,0x8017
00140e4c: 8c423cb8 lw r2,0x3cb8(r2)				load menu data
00140e50: 00000000 nop
00140e54: 84420128 lh r2,0x0128(r2)				load skillset selection
00140e58: 3c018017 lui r1,0x8017
00140e5c: 00220821 addu r1,r1,r2
00140e60: 9022404c lbu r2,0x404c(r1)			load action byte
00140e64: 00000000 nop
00140e68: 00021080 sll r2,r2,0x02
00140e6c: 3c018017 lui r1,0x8017
00140e70: 00220821 addu r1,r1,r2
00140e74: 84329264 lh r18,-0x6d9c(r1)			load ??
00140e78: 00000000 nop
00140e7c: 06410008 bgez r18,0x00140ea0			branch if => 0 (this value is normally 3 or -3, so I guess if it's 3.)
00140e80: 34020002 ori r2,r0,0x0002
00140e84: 3c018016 lui r1,0x8016
00140e88: a4326a34 sh r18,0x6a34(r1)			store in skillset data if 0xfffd
00140e8c: 0c050269 jal 0x001409a4			Disable Move/Act based on menu ID
00140e90: 02c02021 addu r4,r22,r0			r4 = menu address (overwritten in above.)
00140e94: 0c053256 jal 0x0014c958			Elemental does not return from here?
00140e98: 00000000 nop
00140e9c: 34020002 ori r2,r0,0x0002
00140ea0: 3c018015 lui r1,0x8015			here if ?? = 3
00140ea4: a022d325 sb r2,-0x2cdb(r1)
00140ea8: 8fbf002c lw r31,0x002c(r29)
00140eac: 8fb60028 lw r22,0x0028(r29)
00140eb0: 8fb50024 lw r21,0x0024(r29)
00140eb4: 8fb40020 lw r20,0x0020(r29)
00140eb8: 8fb3001c lw r19,0x001c(r29)
00140ebc: 8fb20018 lw r18,0x0018(r29)
00140ec0: 8fb10014 lw r17,0x0014(r29)
00140ec4: 8fb00010 lw r16,0x0010(r29)
00140ec8: 27bd0030 addiu r29,r29,0x0030
00140ecc: 03e00008 jr r31
00140ed0: 00000000 nop