Difference between revisions of "Formula 01 - 06 Aftermath"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Corrects and fills in gaps to previous rendition of notes on this page)
m
Line 72: Line 72:
 
  00187db8: 1040003a beq r2,r0,0x00187ea4 Branch if Job ID is 5D or lower or  if Job ID is over 8D
 
  00187db8: 1040003a beq r2,r0,0x00187ea4 Branch if Job ID is 5D or lower or  if Job ID is over 8D
 
  00187dbc: 00000000 nop
 
  00187dbc: 00000000 nop
  00187dc0: 0c062f4d jal 0x0018bd34 [[?Nullify steal item?]]
+
  00187dc0: 0c062f4d jal 0x0018bd34 [[Remove_Knockback_Flag]]  (ex :[[?Nullify steal item?]])
 
  00187dc4: 00000000 nop
 
  00187dc4: 00000000 nop
 
  00187dc8: 0c062f3c jal 0x0018bcf0 [[Called by Nullify Action]]
 
  00187dc8: 0c062f3c jal 0x0018bcf0 [[Called by Nullify Action]]

Revision as of 21:09, 9 March 2021

Formula 01 - 06 Aftermath (Contains Poach and Secret Hunt)
00187ca0: 3c068019 lui r6,0x8019		
00187ca4: 8cc62d90 lw r6,0x2d90(r6)		Load Target Current Action Data Pointer
00187ca8: 27bdffe8 addiu r29,r29,0xffe8		
00187cac: afbf0010 sw r31,0x0010(r29)		
00187cb0: 90c20025 lbu r2,0x0025(r6)		Load Attack Flag
00187cb4: 00000000 nop				
00187cb8: 30420080 andi r2,r2,0x0080		If Attack Flag contains 'HP Damage,' return true
00187cbc: 10400079 beq r2,r0,0x00187ea4		Branch if Attack Flag is HP Damage
00187cc0: 00000000 nop				
00187cc4: 3c058019 lui r5,0x8019		
00187cc8: 8ca52d98 lw r5,0x2d98(r5)		Load Target Statistics Data Pointer
00187ccc: 84c20004 lh r2,0x0004(r6)		Load HP Damage
00187cd0: 94a30028 lhu r3,0x0028(r5)		Load Defender's Current HP
00187cd4: 84c40006 lh r4,0x0006(r6)		Load HP Recovery
00187cd8: 00621823 subu r3,r3,r2		New HP = Current HP - HP Damage
00187cdc: 90a20006 lbu r2,0x0006(r5)		Load Gender of Target
00187ce0: 00000000 nop				
00187ce4: 304200c0 andi r2,r2,0x00c0		If Male or Female, return true
00187ce8: 1440006e bne r2,r0,0x00187ea4		Branch if unit is not 'Male/Female'
00187cec: 00642021 addu r4,r3,r4		Final HP = New HP + HP recovery
00187cf0: 90a201ba lbu r2,0x01ba(r5)		Load Target Team (could load from r6 + 0x2e)
00187cf4: 00000000 nop				
00187cf8: 30420030 andi r2,r2,0x0030		If target team = green, return 0x30; Light blue, 0x20, Red, 0x10, Blue, 0x0
00187cfc: 000210c2 srl r2,r2,0x03		Green r2 = 0x6, LB = 0x4, R = 0x2, B = 0x0
00187d00: 3c018019 lui r1,0x8019		
00187d04: 00220821 addu r1,r1,r2	        Loads Location (+0x0a0c) of Team's respective Golem HP
00187d08: 9422f5f4 lhu r2,-0x0a0c(r1)		Loads Golem HP
00187d0c: 00000000 nop				
00187d10: 10400007 beq r2,r0,0x00187d30		Branch if Golem HP = 0
00187d14: 00000000 nop				
00187d18: 3c028019 lui r2,0x8019		
00187d1c: 904238f5 lbu r2,0x38f5(r2)		Load 3rd set of Ability Flags
00187d20: 00000000 nop				
00187d24: 30420008 andi r2,r2,0x0008	 	Checks if Attack can be absorbed by golem (Normal Attack flag)
00187d28: 1440005e bne r2,r0,0x00187ea4		Branch if 'Normal Attack' Flag is active
00187d2c: 00000000 nop				
00187d30: 94a20058 lhu r2,0x0058(r5)		Load 1st set of Target Current Status
00187d34: 00000000 nop
00187d38: 30428020 andi r2,r2,0x8020		
00187d3c: 14400059 bne r2,r0,0x00187ea4		Branches if target is already dead
00187d40: 00000000 nop
00187d44: 90a2005b lbu r2,0x005b(r5)		Load 4th set of Target Current Status
00187d48: 00000000 nop				
00187d4c: 30420001 andi r2,r2,0x0001		Checks for wall; Effectively never returns true
00187d50: 14400054 bne r2,r0,0x00187ea4		Branch if Unit already has Wall
00187d54: 00000000 nop				
00187d58: 18800006 blez r4,0x00187d74			Branch if Final HP <= 0
00187d5c: 00000000 nop				
00187d60: 90c2001b lbu r2,0x001b(r6)		Load 1st set of Status Infliction
00187d64: 00000000 nop				
00187d68: 30420020 andi r2,r2,0x0020		
00187d6c: 10400021 beq r2,r0,0x00187df4		Branch if unit is not dead after attack
00187d70: 00000000 nop				
00187d74: 3c028019 lui r2,0x8019		
00187d78: 8c422d94 lw r2,0x2d94(r2)		Load Attacker Statistics Data pointer
00187d7c: 00000000 nop				
00187d80: 90420091 lbu r2,0x0091(r2)		Load 3rd set of Support
00187d84: 00000000 nop				
00187d88: 30420040 andi r2,r2,0x0040	 	
00187d8c: 10400019 beq r2,r0,0x00187df4		Branch if support is not 'Secret  Hunt'
00187d90: 00000000 nop				
00187d94: 90a20005 lbu r2,0x0005(r5)		Load Target Team
00187d98: 00000000 nop				
00187d9c: 30420004 andi r2,r2,0x0004		
00187da0: 14400014 bne r2,r0,0x00187df4		Branch if unit has 'Immortal' Flag
00187da4: 00000000 nop				
00187da8: 90a20003 lbu r2,0x0003(r5)		Load Job ID
00187dac: 00000000 nop				
00187db0: 2442ffa2 addiu r2,r2,0xffa2		Job ID - 5D
00187db4: 2c420030 sltiu r2,r2,0x0030	 	
00187db8: 1040003a beq r2,r0,0x00187ea4		Branch if Job ID is 5D or lower or  if Job ID is over 8D
00187dbc: 00000000 nop				
00187dc0: 0c062f4d jal 0x0018bd34		Remove_Knockback_Flag  (ex :?Nullify steal item?)
00187dc4: 00000000 nop				
00187dc8: 0c062f3c jal 0x0018bcf0		Called by Nullify Action
00187dcc: 00000000 nop				
00187dd0: 3c028019 lui r2,0x8019		
00187dd4: 8c422d90 lw r2,0x2d90(r2)		Load Target Current Action Data Pointer
00187dd8: 00000000 nop				
00187ddc: 94430010 lhu r3,0x0010(r2)		Load 1st set of Special Flags inflicted
00187de0: 00000000 nop				
00187de4: 34630020 ori r3,r3,0x0020		Adds poached to special flags
00187de8: a4430010 sh r3,0x0010(r2)		Stores new special flag
00187dec: 08061fa7 j 0x00187e9c			
00187df0: 34020006 ori r2,r0,0x0006		R2 = 0x6
00187df4: 1880002b blez r4,0x00187ea4			Branch if Final HP <= 0
00187df8: 3c03cccc lui r3,0xcccc		prepares Critical Health Check
00187dfc: 3c028019 lui r2,0x8019		
00187e00: 8c422d98 lw r2,0x2d98(r2)		Load Target Statistics Data Pointer
00187e04: 00000000 nop				
00187e08: 9442002a lhu r2,0x002a(r2)		Load Target Max HP
00187e0c: 3463cccd ori r3,r3,0xcccd		R3 = 0xcccccccd (effectively 4/5 in this routine)
00187e10: 00430019 multu r2,r3			Multiplies Target Max HP by 4/5 (part 1. this gives 0x0000#### in the HI register, where #### is max health multiplied by 4/5, and 0xccccccc$ in LO, more often than not, $ has no particular meaning)
00187e14: 00001010 mfhi r2			Max HP * 4/5
00187e18: 00021082 srl r2,r2,0x02		Max HP * 1/5
00187e1c: 3042ffff andi r2,r2,0xffff		Removes stray data from final 4 bytes
00187e20: 0044102a slt r2,r2,r4			If Final health is less than Critical health, return true
00187e24: 1440001f bne r2,r0,0x00187ea4		Branches if final health is not less than critical
00187e28: 00000000 nop				
00187e2c: 3c028019 lui r2,0x8019		
00187e30: 8c422d94 lw r2,0x2d94(r2)		Load Attacker Statistics Data Pointer
00187e34: 00000000 nop				
00187e38: 90420091 lbu r2,0x0091(r2)		Load 3rd set of Attacker Support
00187e3c: 00000000 nop				
00187e40: 30420080 andi r2,r2,0x0080		
00187e44: 10400017 beq r2,r0,0x00187ea4		Branch if train not equipped
00187e48: 00002021 addu r4,r0,r0		r4 = 0x0
00187e4c: 3c038019 lui r3,0x8019
00187e50: 8c632d90 lw r3,0x2d90(r3)		Loads Target Current Action Data Pointer
00187e54: 00000000 nop
00187e58: 9062001c lbu r2,0x001c(r3)		Loads Status Infliction on target
00187e5c: 00000000 nop
00187e60: 34420040 ori r2,r2,0x0040		Adds Invite to list of Statuses
00187e64: 0c0612c9 jal 0x00184b24		Validate Status Changes
00187e68: a062001c sb r2,0x001c(r3)		Saves new value of inflicted statuses
00187e6c: 1040000d beq r2,r0,0x00187ea4		Branch if Status change not valid
00187e70: 00000000 nop
00187e74: 3c048019 lui r4,0x8019
00187e78: 8c842d90 lw r4,0x2d90(r4)		Loads Target Current Action Data Pointer
00187e7c: 00000000 nop
00187e80: 94820010 lhu r2,0x0010(r4)		loads Special Flags Inflicted on Target
00187e84: 90830025 lbu r3,0x0025(r4)		Loads Attack Type
00187e88: 34420040 ori r2,r2,0x0040		Adds switch team to Special Flags Inflicted
00187e8c: 34630008 ori r3,r3,0x0008		Adds Status Change to Attack Type
00187e90: a4820010 sh r2,0x0010(r4)		Saves new Special flag
00187e94: 34020009 ori r2,r0,0x0009		r2 = 0x9
00187e98: a0830025 sb r3,0x0025(r4)		Saves new attack type
00187e9c: 3c018019 lui r1,0x8019
00187ea0: a022390e sb r2,0x390e(r1)		Store 0x6 (if poached)/Store 0x9 (if Trained) at Location 0x8019390e (AI flag?)
00187ea4: 8fbf0010 lw r31,0x0010(r29)
00187ea8: 27bd0018 addiu r29,r29,0x0018
00187eac: 03e00008 jr r31
00187eb0: 00000000 nop