Difference between revisions of "0007e9a8 - 0007eb88"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0007e9a8: 27bdffc0 addiu r29,r29,0xffc0 0007e9ac: afb00038 sw r16,0x0038(r29) 0007e9b0: 00808021 addu r16,r4,r0 0007e9b4: afbf003c sw r31,0x003...")
 
m
 
Line 3: Line 3:
 
  0007e9a8: 27bdffc0 addiu r29,r29,0xffc0
 
  0007e9a8: 27bdffc0 addiu r29,r29,0xffc0
 
  0007e9ac: afb00038 sw r16,0x0038(r29)
 
  0007e9ac: afb00038 sw r16,0x0038(r29)
  0007e9b0: 00808021 addu r16,r4,r0
+
  0007e9b0: 00808021 addu r16,r4,r0 #unit misc data pointer
 
  0007e9b4: afbf003c sw r31,0x003c(r29)
 
  0007e9b4: afbf003c sw r31,0x003c(r29)
 
  0007e9b8: 3c058006 lui r5,0x8006
 
  0007e9b8: 3c058006 lui r5,0x8006
  0007e9bc: 24a577f8 addiu r5,r5,0x77f8
+
  0007e9bc: 24a577f8 addiu r5,r5,0x77f8 #you really didn't need this whole table in the stack, you know that right?
 
  0007e9c0: 88a20003 lwl r2,0x0003(r5)
 
  0007e9c0: 88a20003 lwl r2,0x0003(r5)
 
  0007e9c4: 98a20000 lwr r2,0x0000(r5)
 
  0007e9c4: 98a20000 lwr r2,0x0000(r5)
Line 31: Line 31:
 
  0007ea18: aba40027 swl r4,0x0027(r29)
 
  0007ea18: aba40027 swl r4,0x0027(r29)
 
  0007ea1c: bba40024 swr r4,0x0024(r29)
 
  0007ea1c: bba40024 swr r4,0x0024(r29)
  0007ea20: 8e020144 lw r2,0x0144(r16)
+
  0007ea20: 8e020144 lw r2,0x0144(r16) #status flags 5, 6, blank + blank 2
 
  0007ea24: 00000000 nop
 
  0007ea24: 00000000 nop
  0007ea28: 30420240 andi r2,r2,0x0240
+
  0007ea28: 30420240 andi r2,r2,0x0240 #check for jump or...? (mounted? mount? maybe?)
  0007ea2c: 14400052 bne r2,r0,0x0007eb78
+
  0007ea2c: 14400052 bne r2,r0,0x0007eb78 #branch if either
 
  0007ea30: 27a60010 addiu r6,r29,0x0010
 
  0007ea30: 27a60010 addiu r6,r29,0x0010
  0007ea34: 8e020080 lw r2,0x0080(r16)
+
  0007ea34: 8e020080 lw r2,0x0080(r16) #load coords + movement flags
 
  0007ea38: 3c031000 lui r3,0x1000
 
  0007ea38: 3c031000 lui r3,0x1000
 
  0007ea3c: 00431024 and r2,r2,r3
 
  0007ea3c: 00431024 and r2,r2,r3
  0007ea40: 10400027 beq r2,r0,0x0007eae0
+
  0007ea40: 10400027 beq r2,r0,0x0007eae0 #branch if doesn't have float movement flag
 
  0007ea44: 34020015 ori r2,r0,0x0015
 
  0007ea44: 34020015 ori r2,r0,0x0015
  0007ea48: 86020074 lh r2,0x0074(r16)
+
  0007ea48: 86020074 lh r2,0x0074(r16) #target height difference? (difference to attacker?)
 
  0007ea4c: 00000000 nop
 
  0007ea4c: 00000000 nop
  0007ea50: 00401821 addu r3,r2,r0
+
  0007ea50: 00401821 addu r3,r2,r0 #sprite height
  0007ea54: 2842000c slti r2,r2,0x000c
+
  0007ea54: 2842000c slti r2,r2,0x000c #check if height difference < 0xc
  0007ea58: 10400007 beq r2,r0,0x0007ea78
+
  0007ea58: 10400007 beq r2,r0,0x0007ea78 #branch if not
 
  0007ea5c: 34020001 ori r2,r0,0x0001
 
  0007ea5c: 34020001 ori r2,r0,0x0001
 
  0007ea60: 3c028004 lui r2,0x8004
 
  0007ea60: 3c028004 lui r2,0x8004
  0007ea64: 94425980 lhu r2,0x5980(r2)
+
  0007ea64: 94425980 lhu r2,0x5980(r2) #load animation speed?
 
  0007ea68: 00000000 nop
 
  0007ea68: 00000000 nop
  0007ea6c: 00621021 addu r2,r3,r2
+
  0007ea6c: 00621021 addu r2,r3,r2 #sprite height + animation speed
 
  0007ea70: 0801fad3 j 0x0007eb4c
 
  0007ea70: 0801fad3 j 0x0007eb4c
  0007ea74: a6020074 sh r2,0x0074(r16)
+
  0007ea74: a6020074 sh r2,0x0074(r16) #store new?
  0007ea78: 92030130 lbu r3,0x0130(r16)
+
 
 +
Jumping or...?
 +
  0007ea78: 92030130 lbu r3,0x0130(r16) #load rider/mount
 
  0007ea7c: 00000000 nop
 
  0007ea7c: 00000000 nop
  0007ea80: 10620031 beq r3,r2,0x0007eb48
+
  0007ea80: 10620031 beq r3,r2,0x0007eb48 #branch if neither (unit is jumping, but not mounted?)
  0007ea84: 3c05aaaa lui r5,0xaaaa
+
  0007ea84: 3c05aaaa lui r5,0xaaaa #if attacker unit is mounted:
  0007ea88: 96020078 lhu r2,0x0078(r16)
+
  0007ea88: 96020078 lhu r2,0x0078(r16) #?
 
  0007ea8c: 3c038004 lui r3,0x8004
 
  0007ea8c: 3c038004 lui r3,0x8004
  0007ea90: 94635980 lhu r3,0x5980(r3)
+
  0007ea90: 94635980 lhu r3,0x5980(r3) #animation speed
  0007ea94: 34a5aaab ori r5,r5,0xaaab
+
  0007ea94: 34a5aaab ori r5,r5,0xaaab #r5 = 2/3
  0007ea98: 00431021 addu r2,r2,r3
+
  0007ea98: 00431021 addu r2,r2,r3 #add together
 
  0007ea9c: 3044ffff andi r4,r2,0xffff
 
  0007ea9c: 3044ffff andi r4,r2,0xffff
  0007eaa0: 00850019 multu r4,r5
+
  0007eaa0: 00850019 multu r4,r5 #animation speed + ? * 2/3
  0007eaa4: a6020078 sh r2,0x0078(r16)
+
  0007eaa4: a6020078 sh r2,0x0078(r16) #save new ?
 
  0007eaa8: 00001810 mfhi r3
 
  0007eaa8: 00001810 mfhi r3
  0007eaac: 00031942 srl r3,r3,0x05
+
  0007eaac: 00031942 srl r3,r3,0x05 #animation speed + ? * 0x2/0x60 (rounds to 5 binary digits, or a nibble and a bit.)
  0007eab0: 00031040 sll r2,r3,0x01
+
  0007eab0: 00031040 sll r2,r3,0x01 #animation speed + ? * 0x2/0x30
  0007eab4: 00431021 addu r2,r2,r3
+
  0007eab4: 00431021 addu r2,r2,r3 #animation speed + ? * 0x1/0x10
  0007eab8: 00021100 sll r2,r2,0x04
+
  0007eab8: 00021100 sll r2,r2,0x04 #animation speed + ? * 0x1 (rounded to 5th binary place)
  0007eabc: 00822023 subu r4,r4,r2
+
  0007eabc: 00822023 subu r4,r4,r2 #obtains only the first 5 bits of animation speed + ? (which, already mostly falls into 5 bits anyway. I call obfuscation bullshit.)
  0007eac0: 00042042 srl r4,r4,0x01
+
  0007eac0: 00042042 srl r4,r4,0x01 #animation speed + ? / 2
  0007eac4: 00c42021 addu r4,r6,r4
+
  0007eac4: 00c42021 addu r4,r6,r4 #stack + anim speed + ? / 2 + stack
  0007eac8: 90820000 lbu r2,0x0000(r4)
+
  0007eac8: 90820000 lbu r2,0x0000(r4) #mount height?
 
  0007eacc: 00000000 nop
 
  0007eacc: 00000000 nop
 
  0007ead0: 00021600 sll r2,r2,0x18
 
  0007ead0: 00021600 sll r2,r2,0x18
  0007ead4: 00021603 sra r2,r2,0x18
+
  0007ead4: 00021603 sra r2,r2,0x18 #when you don't know how lb works.
 
  0007ead8: 0801fad3 j 0x0007eb4c
 
  0007ead8: 0801fad3 j 0x0007eb4c
  0007eadc: a6020076 sh r2,0x0076(r16)
+
  0007eadc: a6020076 sh r2,0x0076(r16) #store to "added to final height value" (mount height?)
 +
 
 +
Unit is not floating, not mounted:
 
  0007eae0: 3c038009 lui r3,0x8009
 
  0007eae0: 3c038009 lui r3,0x8009
  0007eae4: 8c6360e4 lw r3,0x60e4(r3)
+
  0007eae4: 8c6360e4 lw r3,0x60e4(r3) #load type of display?
 
  0007eae8: 00000000 nop
 
  0007eae8: 00000000 nop
  0007eaec: 10620017 beq r3,r2,0x0007eb4c
+
  0007eaec: 10620017 beq r3,r2,0x0007eb4c #end if free cursor
 
  0007eaf0: 00000000 nop
 
  0007eaf0: 00000000 nop
  0007eaf4: 86020074 lh r2,0x0074(r16)
+
  0007eaf4: 86020074 lh r2,0x0074(r16) #height difference?
 
  0007eaf8: 00000000 nop
 
  0007eaf8: 00000000 nop
  0007eafc: 10400012 beq r2,r0,0x0007eb48
+
  0007eafc: 10400012 beq r2,r0,0x0007eb48 #branch if none
 
  0007eb00: 00401821 addu r3,r2,r0
 
  0007eb00: 00401821 addu r3,r2,r0
 
  0007eb04: 3c028004 lui r2,0x8004
 
  0007eb04: 3c028004 lui r2,0x8004
  0007eb08: 94425980 lhu r2,0x5980(r2)
+
  0007eb08: 94425980 lhu r2,0x5980(r2) #animation speed?
 
  0007eb0c: 00000000 nop
 
  0007eb0c: 00000000 nop
 
  0007eb10: 00621023 subu r2,r3,r2
 
  0007eb10: 00621023 subu r2,r3,r2
  0007eb14: a6020074 sh r2,0x0074(r16)
+
  0007eb14: a6020074 sh r2,0x0074(r16) #store height diff - animation speed
 
  0007eb18: 00021400 sll r2,r2,0x10
 
  0007eb18: 00021400 sll r2,r2,0x10
 
  0007eb1c: 04410002 bgez r2,0x0007eb28
 
  0007eb1c: 04410002 bgez r2,0x0007eb28
 
  0007eb20: 00000000 nop
 
  0007eb20: 00000000 nop
  0007eb24: a6000074 sh r0,0x0074(r16)
+
  0007eb24: a6000074 sh r0,0x0074(r16) #if new height difference is negative, store 0.
  0007eb28: 0c01f4fd jal 0x0007d3f4
+
  0007eb28: 0c01f4fd jal 0x0007d3f4 #[[0007d3f4 - 0007d474]] - return height of unit being ridden (or just unit height if not mounted)
 
  0007eb2c: 02002021 addu r4,r16,r0
 
  0007eb2c: 02002021 addu r4,r16,r0
 
  0007eb30: 00402021 addu r4,r2,r0
 
  0007eb30: 00402021 addu r4,r2,r0
 
  0007eb34: 00041400 sll r2,r4,0x10
 
  0007eb34: 00041400 sll r2,r4,0x10
  0007eb38: 00021103 sra r2,r2,0x04
+
  0007eb38: 00021103 sra r2,r2,0x04 #height: vector Modded
 
  0007eb3c: a6040042 sh r4,0x0042(r16)
 
  0007eb3c: a6040042 sh r4,0x0042(r16)
 
  0007eb40: 0801fad3 j 0x0007eb4c
 
  0007eb40: 0801fad3 j 0x0007eb4c
  0007eb44: ae02001c sw r2,0x001c(r16)
+
  0007eb44: ae02001c sw r2,0x001c(r16) #store new height mod in both places
  0007eb48: a6000076 sh r0,0x0076(r16)
+
 
  0007eb4c: 0c01f4fd jal 0x0007d3f4
+
no height difference between tar/cas from float/mount/jump?
 +
  0007eb48: a6000076 sh r0,0x0076(r16) #No extra height on unit?
 +
 
 +
Return
 +
  0007eb4c: 0c01f4fd jal 0x0007d3f4 #[[0007d3f4 - 0007d474]] - return height of unit being ridden (or just unit height if not mounted)
 
  0007eb50: 02002021 addu r4,r16,r0
 
  0007eb50: 02002021 addu r4,r16,r0
  0007eb54: 00402021 addu r4,r2,r0
+
  0007eb54: 00402021 addu r4,r2,r0 #unit/mount height mod in r4
  0007eb58: 86020042 lh r2,0x0042(r16)
+
  0007eb58: 86020042 lh r2,0x0042(r16) #load height mod of unit
 
  0007eb5c: 00041c00 sll r3,r4,0x10
 
  0007eb5c: 00041c00 sll r3,r4,0x10
 
  0007eb60: 00031c03 sra r3,r3,0x10
 
  0007eb60: 00031c03 sra r3,r3,0x10
  0007eb64: 0062102a slt r2,r3,r2
+
  0007eb64: 0062102a slt r2,r3,r2 #
  0007eb68: 10400003 beq r2,r0,0x0007eb78
+
  0007eb68: 10400003 beq r2,r0,0x0007eb78 #branch if height of mount =< current height of unit (height mods are always negative)
 
  0007eb6c: 00031300 sll r2,r3,0x0c
 
  0007eb6c: 00031300 sll r2,r3,0x0c
  0007eb70: a6040042 sh r4,0x0042(r16)
+
  0007eb70: a6040042 sh r4,0x0042(r16) #store height of mount in 0x42 height mod
  0007eb74: ae02001c sw r2,0x001c(r16)
+
  0007eb74: ae02001c sw r2,0x001c(r16) #store height of mount in 0x1c height mod
 
  0007eb78: 8fbf003c lw r31,0x003c(r29)
 
  0007eb78: 8fbf003c lw r31,0x003c(r29)
 
  0007eb7c: 8fb00038 lw r16,0x0038(r29)
 
  0007eb7c: 8fb00038 lw r16,0x0038(r29)

Latest revision as of 04:38, 16 November 2022

0007e9a8: 27bdffc0 addiu r29,r29,0xffc0
0007e9ac: afb00038 sw r16,0x0038(r29)
0007e9b0: 00808021 addu r16,r4,r0				#unit misc data pointer
0007e9b4: afbf003c sw r31,0x003c(r29)
0007e9b8: 3c058006 lui r5,0x8006
0007e9bc: 24a577f8 addiu r5,r5,0x77f8				#you really didn't need this whole table in the stack, you know that right?
0007e9c0: 88a20003 lwl r2,0x0003(r5)
0007e9c4: 98a20000 lwr r2,0x0000(r5)
0007e9c8: 88a30007 lwl r3,0x0007(r5)
0007e9cc: 98a30004 lwr r3,0x0004(r5)
0007e9d0: 88a4000b lwl r4,0x000b(r5)
0007e9d4: 98a40008 lwr r4,0x0008(r5)
0007e9d8: aba20013 swl r2,0x0013(r29)
0007e9dc: bba20010 swr r2,0x0010(r29)
0007e9e0: aba30017 swl r3,0x0017(r29)
0007e9e4: bba30014 swr r3,0x0014(r29)
0007e9e8: aba4001b swl r4,0x001b(r29)
0007e9ec: bba40018 swr r4,0x0018(r29)
0007e9f0: 88a2000f lwl r2,0x000f(r5)
0007e9f4: 98a2000c lwr r2,0x000c(r5)
0007e9f8: 88a30013 lwl r3,0x0013(r5)
0007e9fc: 98a30010 lwr r3,0x0010(r5)
0007ea00: 88a40017 lwl r4,0x0017(r5)
0007ea04: 98a40014 lwr r4,0x0014(r5)
0007ea08: aba2001f swl r2,0x001f(r29)
0007ea0c: bba2001c swr r2,0x001c(r29)
0007ea10: aba30023 swl r3,0x0023(r29)
0007ea14: bba30020 swr r3,0x0020(r29)
0007ea18: aba40027 swl r4,0x0027(r29)
0007ea1c: bba40024 swr r4,0x0024(r29)
0007ea20: 8e020144 lw r2,0x0144(r16)				#status flags 5, 6, blank + blank 2
0007ea24: 00000000 nop
0007ea28: 30420240 andi r2,r2,0x0240				#check for jump or...? (mounted? mount? maybe?)
0007ea2c: 14400052 bne r2,r0,0x0007eb78			#branch if either
0007ea30: 27a60010 addiu r6,r29,0x0010
0007ea34: 8e020080 lw r2,0x0080(r16)				#load coords + movement flags
0007ea38: 3c031000 lui r3,0x1000
0007ea3c: 00431024 and r2,r2,r3
0007ea40: 10400027 beq r2,r0,0x0007eae0			#branch if doesn't have float movement flag
0007ea44: 34020015 ori r2,r0,0x0015
0007ea48: 86020074 lh r2,0x0074(r16)				#target height difference? (difference to attacker?)
0007ea4c: 00000000 nop
0007ea50: 00401821 addu r3,r2,r0				#sprite height
0007ea54: 2842000c slti r2,r2,0x000c				#check if height difference < 0xc
0007ea58: 10400007 beq r2,r0,0x0007ea78			#branch if not
0007ea5c: 34020001 ori r2,r0,0x0001
0007ea60: 3c028004 lui r2,0x8004
0007ea64: 94425980 lhu r2,0x5980(r2)				#load animation speed?
0007ea68: 00000000 nop
0007ea6c: 00621021 addu r2,r3,r2				#sprite height + animation speed
0007ea70: 0801fad3 j 0x0007eb4c
0007ea74: a6020074 sh r2,0x0074(r16)				#store new?

Jumping or...?

0007ea78: 92030130 lbu r3,0x0130(r16)				#load rider/mount
0007ea7c: 00000000 nop
0007ea80: 10620031 beq r3,r2,0x0007eb48			#branch if neither (unit is jumping, but not mounted?)
0007ea84: 3c05aaaa lui r5,0xaaaa				#if attacker unit is mounted:
0007ea88: 96020078 lhu r2,0x0078(r16)				#?
0007ea8c: 3c038004 lui r3,0x8004
0007ea90: 94635980 lhu r3,0x5980(r3)				#animation speed
0007ea94: 34a5aaab ori r5,r5,0xaaab				#r5 = 2/3
0007ea98: 00431021 addu r2,r2,r3				#add together
0007ea9c: 3044ffff andi r4,r2,0xffff
0007eaa0: 00850019 multu r4,r5					#animation speed + ? * 2/3
0007eaa4: a6020078 sh r2,0x0078(r16)				#save new ?
0007eaa8: 00001810 mfhi r3
0007eaac: 00031942 srl r3,r3,0x05				#animation speed + ? * 0x2/0x60 (rounds to 5 binary digits, or a nibble and a bit.)
0007eab0: 00031040 sll r2,r3,0x01				#animation speed + ? * 0x2/0x30
0007eab4: 00431021 addu r2,r2,r3				#animation speed + ? * 0x1/0x10
0007eab8: 00021100 sll r2,r2,0x04				#animation speed + ? * 0x1 (rounded to 5th binary place)
0007eabc: 00822023 subu r4,r4,r2				#obtains only the first 5 bits of animation speed + ? (which, already mostly falls into 5 bits anyway. I call obfuscation bullshit.)
0007eac0: 00042042 srl r4,r4,0x01				#animation speed + ? / 2
0007eac4: 00c42021 addu r4,r6,r4				#stack + anim speed + ? / 2 + stack
0007eac8: 90820000 lbu r2,0x0000(r4)				#mount height?
0007eacc: 00000000 nop
0007ead0: 00021600 sll r2,r2,0x18
0007ead4: 00021603 sra r2,r2,0x18				#when you don't know how lb works.
0007ead8: 0801fad3 j 0x0007eb4c
0007eadc: a6020076 sh r2,0x0076(r16)				#store to "added to final height value" (mount height?)

Unit is not floating, not mounted:

0007eae0: 3c038009 lui r3,0x8009
0007eae4: 8c6360e4 lw r3,0x60e4(r3)				#load type of display?
0007eae8: 00000000 nop
0007eaec: 10620017 beq r3,r2,0x0007eb4c			#end if free cursor
0007eaf0: 00000000 nop
0007eaf4: 86020074 lh r2,0x0074(r16)				#height difference?
0007eaf8: 00000000 nop
0007eafc: 10400012 beq r2,r0,0x0007eb48			#branch if none
0007eb00: 00401821 addu r3,r2,r0
0007eb04: 3c028004 lui r2,0x8004
0007eb08: 94425980 lhu r2,0x5980(r2)				#animation speed?
0007eb0c: 00000000 nop
0007eb10: 00621023 subu r2,r3,r2
0007eb14: a6020074 sh r2,0x0074(r16)				#store height diff - animation speed
0007eb18: 00021400 sll r2,r2,0x10
0007eb1c: 04410002 bgez r2,0x0007eb28
0007eb20: 00000000 nop
0007eb24: a6000074 sh r0,0x0074(r16)				#if new height difference is negative, store 0.
0007eb28: 0c01f4fd jal 0x0007d3f4				#0007d3f4 - 0007d474 - return height of unit being ridden (or just unit height if not mounted)
0007eb2c: 02002021 addu r4,r16,r0
0007eb30: 00402021 addu r4,r2,r0
0007eb34: 00041400 sll r2,r4,0x10
0007eb38: 00021103 sra r2,r2,0x04				#height: vector Modded
0007eb3c: a6040042 sh r4,0x0042(r16)
0007eb40: 0801fad3 j 0x0007eb4c
0007eb44: ae02001c sw r2,0x001c(r16)				#store new height mod in both places

no height difference between tar/cas from float/mount/jump?

0007eb48: a6000076 sh r0,0x0076(r16)				#No extra height on unit?

Return

0007eb4c: 0c01f4fd jal 0x0007d3f4				#0007d3f4 - 0007d474 - return height of unit being ridden (or just unit height if not mounted)
0007eb50: 02002021 addu r4,r16,r0
0007eb54: 00402021 addu r4,r2,r0				#unit/mount height mod in r4
0007eb58: 86020042 lh r2,0x0042(r16)				#load height mod of unit
0007eb5c: 00041c00 sll r3,r4,0x10
0007eb60: 00031c03 sra r3,r3,0x10
0007eb64: 0062102a slt r2,r3,r2				#
0007eb68: 10400003 beq r2,r0,0x0007eb78			#branch if height of mount =< current height of unit (height mods are always negative)
0007eb6c: 00031300 sll r2,r3,0x0c
0007eb70: a6040042 sh r4,0x0042(r16)				#store height of mount in 0x42 height mod
0007eb74: ae02001c sw r2,0x001c(r16)				#store height of mount in 0x1c height mod
0007eb78: 8fbf003c lw r31,0x003c(r29)
0007eb7c: 8fb00038 lw r16,0x0038(r29)
0007eb80: 27bd0040 addiu r29,r29,0x0040
0007eb84: 03e00008 jr r31
0007eb88: 00000000 nop