Difference between revisions of "Accelerate Unit to Destination"
Jump to navigation
Jump to search
m |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<font face='Courier New'> | <font face='Courier New'> | ||
− | + | ||
− | moves unit to destination. does so progressively if executing attack with target. used by rush. | + | moves unit to destination. does so progressively if executing attack with target. used by rush. r5 input is whether or not the animation is allowed to change height with the terrain. |
000898a0: 27bdffc0 addiu r29,r29,0xffc0 | 000898a0: 27bdffc0 addiu r29,r29,0xffc0 | ||
000898a4: afb00028 sw r16,0x0028(r29) | 000898a4: afb00028 sw r16,0x0028(r29) |
Latest revision as of 04:14, 9 August 2024
moves unit to destination. does so progressively if executing attack with target. used by rush. r5 input is whether or not the animation is allowed to change height with the terrain. 000898a0: 27bdffc0 addiu r29,r29,0xffc0 000898a4: afb00028 sw r16,0x0028(r29) 000898a8: 00808021 addu r16,r4,r0 000898ac: afb20030 sw r18,0x0030(r29) 000898b0: 00a09021 addu r18,r5,r0 000898b4: afbf0038 sw r31,0x0038(r29) 000898b8: afb30034 sw r19,0x0034(r29) 000898bc: afb1002c sw r17,0x002c(r29) 000898c0: 8e11008c lw r17,0x008c(r16) 000898c4: 8e130090 lw r19,0x0090(r16) 000898c8: 8e020028 lw r2,0x0028(r16) #X mod difference? 000898cc: 8e03002c lw r3,0x002c(r16) #Y mod difference? 000898d0: 8e040030 lw r4,0x0030(r16) #height mod difference? (all for types of motion) 000898d4: 8e050034 lw r5,0x0034(r16) 000898d8: afa20018 sw r2,0x0018(r29) 000898dc: afa3001c sw r3,0x001c(r29) 000898e0: afa40020 sw r4,0x0020(r29) #store height mod f 000898e4: afa50024 sw r5,0x0024(r29) #stores above to stack? 000898e8: 8e030088 lw r3,0x0088(r16) #load distort phase 000898ec: 00000000 nop 000898f0: 10600005 beq r3,r0,0x00089908 #branch if initialising 000898f4: 34020001 ori r2,r0,0x0001 000898f8: 10620080 beq r3,r2,0x00089afc #branch if executing 000898fc: 00000000 nop 00089900: 080226d4 j 0x00089b50 #otherwise skip 00089904: 00000000 nop
Initialising 00089908: 8e040134 lw r4,0x0134(r16) #load pointer to unit's battle data 0008990c: 00000000 nop 00089910: 10800078 beq r4,r0,0x00089af4 #branch if null 00089914: 34020034 ori r2,r0,0x0034 00089918: 3c038009 lui r3,0x8009 0008991c: 8c6360e4 lw r3,0x60e4(r3) #load type of display? (gameflow variable) 00089920: 00000000 nop 00089924: 14620016 bne r3,r2,0x00089980 #branch if current display != 0x34 00089928: 00000000 nop
if current display = 0x34 0008992c: 9203007c lbu r3,0x007c(r16) #load unit's X coordinate 00089930: 00000000 nop 00089934: 000310c0 sll r2,r3,0x03 00089938: 00431023 subu r2,r2,r3 0008993c: 00021080 sll r2,r2,0x02 #X coord * tile width 00089940: 2442000e addiu r2,r2,0x000e #x coord + 1 * tile width 00089944: 8e030018 lw r3,0x0018(r16) #load X mod 00089948: 00021300 sll r2,r2,0x0c #x coord -> x coord's x mod 0008994c: 00431023 subu r2,r2,r3 #find difference in adjacent tile's x mod to current tile's 00089950: afa20018 sw r2,0x0018(r29) #store 00089954: 9203007d lbu r3,0x007d(r16) #load unit's Y coordinate 00089958: 8e040020 lw r4,0x0020(r16) #load Y mod 0008995c: afa0001c sw r0,0x001c(r29) #clear height mod difference 00089960: 000310c0 sll r2,r3,0x03 00089964: 00431023 subu r2,r2,r3 00089968: 00021080 sll r2,r2,0x02 0008996c: 2442000e addiu r2,r2,0x000e 00089970: 00021300 sll r2,r2,0x0c 00089974: 00441023 subu r2,r2,r4 #find difference in adjacent tile's Y mod and current tile's 00089978: 080226a9 j 0x00089aa4 0008997c: afa20020 sw r2,0x0020(r29) #store height mod difference
if current display != 0x34 00089980: 9202018d lbu r2,0x018d(r16) #load targets hit counter 00089984: 00000000 nop 00089988: 10400014 beq r2,r0,0x000899dc #branch if none 0008998c: 00000000 nop 00089990: 9204018e lbu r4,0x018e(r16) #load target ID 00089994: 0c01e9c9 jal 0x0007a724 #Get_unit_misc_data_that_matches_r4_ID 00089998: 00000000 nop 0008999c: 8c430018 lw r3,0x0018(r2) #load target's X mod 000899a0: 8e040018 lw r4,0x0018(r16) #load attacker's X mod 000899a4: 00000000 nop 000899a8: 00641823 subu r3,r3,r4 #find difference 000899ac: afa30018 sw r3,0x0018(r29) #store difference of X mods 000899b0: 8c43001c lw r3,0x001c(r2) # 000899b4: 8e04001c lw r4,0x001c(r16) #Load height mods 000899b8: 00000000 nop 000899bc: 00641823 subu r3,r3,r4 000899c0: afa3001c sw r3,0x001c(r29) #store difference of height mods 000899c4: 8c420020 lw r2,0x0020(r2) 000899c8: 8e030020 lw r3,0x0020(r16) 000899cc: 00000000 nop 000899d0: 00431023 subu r2,r2,r3 000899d4: 080226a9 j 0x00089aa4 000899d8: afa20020 sw r2,0x0020(r29) #store difference of Y mods
if no targets: 000899dc: 8483017a lh r3,0x017a(r4) #load target's X coord 000899e0: 00000000 nop 000899e4: 000310c0 sll r2,r3,0x03 000899e8: 00431023 subu r2,r2,r3 000899ec: 86030040 lh r3,0x0040(r16) #loads X location on screen 000899f0: 00021080 sll r2,r2,0x02 #Target's X coord * tile width 000899f4: 2463fff2 addiu r3,r3,0xfff2 #X location - tile width 000899f8: 00431023 subu r2,r2,r3 #difference of target panel X coordinate and X location - E 000899fc: 00021300 sll r2,r2,0x0c #X modify 00089a00: afa20018 sw r2,0x0018(r29) #store 00089a04: 8e020134 lw r2,0x0134(r16) #load pointer to unit's data 00089a08: 00000000 nop 00089a0c: 8443017e lh r3,0x017e(r2) #Y panel for target 00089a10: 00000000 nop 00089a14: 000310c0 sll r2,r3,0x03 00089a18: 00431023 subu r2,r2,r3 00089a1c: 86030044 lh r3,0x0044(r16) #Y position on screen 00089a20: 00021080 sll r2,r2,0x02 00089a24: 2463fff2 addiu r3,r3,0xfff2 00089a28: 00431023 subu r2,r2,r3 00089a2c: 00021300 sll r2,r2,0x0c #find same difference as before 00089a30: afa20020 sw r2,0x0020(r29) #store Y mod difference 00089a34: 8e020134 lw r2,0x0134(r16) 00089a38: 00000000 nop 00089a3c: 8443017a lh r3,0x017a(r2) #load target's X panel 00089a40: 00000000 nop 00089a44: 000310c0 sll r2,r3,0x03 00089a48: 00431023 subu r2,r2,r3 00089a4c: 00021080 sll r2,r2,0x02 00089a50: 2442000e addiu r2,r2,0x000e 00089a54: a7a20010 sh r2,0x0010(r29) #store target's X mod 00089a58: 8e020134 lw r2,0x0134(r16) 00089a5c: 00000000 nop 00089a60: 8443017e lh r3,0x017e(r2) #load target's Y panel 00089a64: 00000000 nop 00089a68: 000310c0 sll r2,r3,0x03 00089a6c: 00431023 subu r2,r2,r3 00089a70: 00021080 sll r2,r2,0x02 00089a74: 2442000e addiu r2,r2,0x000e 00089a78: a7a20014 sh r2,0x0014(r29) #store target's Y mod 00089a7c: 8e020134 lw r2,0x0134(r16) 00089a80: 00000000 nop 00089a84: 8445017c lh r5,0x017c(r2) #parse map level 00089a88: 0c01f203 jal 0x0007c80c Slope_Calculations 00089a8c: 27a40010 addiu r4,r29,0x0010 #stack pointer 00089a90: 86030042 lh r3,0x0042(r16) #load height mod 00089a94: 00000000 nop 00089a98: 00431023 subu r2,r2,r3 #find difference between current height and slope height at centre? 00089a9c: 00021300 sll r2,r2,0x0c #mod 00089aa0: afa2001c sw r2,0x001c(r29) #store 00089aa4: 8fa40018 lw r4,0x0018(r29) #load x mod difference 00089aa8: 00000000 nop 00089aac: 0091001a div r4,r17 00089ab0: 00002012 mflo r4 #divide by distortion variable 00089ab4: 8fa3001c lw r3,0x001c(r29) 00089ab8: 00000000 nop 00089abc: 0071001a div r3,r17 00089ac0: 00001812 mflo r3 #divide height difference by distortion variable 00089ac4: 8fa20020 lw r2,0x0020(r29) 00089ac8: 00000000 nop 00089acc: 0051001a div r2,r17 00089ad0: 00001012 mflo r2 #divide y difference by distortion variable 00089ad4: afa40018 sw r4,0x0018(r29) 00089ad8: afa3001c sw r3,0x001c(r29) 00089adc: afa20020 sw r2,0x0020(r29) #store all again 00089ae0: 8e020088 lw r2,0x0088(r16) #load phase 00089ae4: 00000000 nop 00089ae8: 24420001 addiu r2,r2,0x0001 00089aec: 080226bf j 0x00089afc 00089af0: ae020088 sw r2,0x0088(r16) #store phase as 1
if attacking unit has no battle data 00089af4: 080226d4 j 0x00089b50 00089af8: a2000087 sb r0,0x0087(r16) #if unit is erroneous, allow animation to continue
if phase is executing 00089afc: 1a200012 blez r17,0x00089b48 #if distortion variable = 0, unit has already arrived at new destination 00089b00: 00000000 nop 00089b04: 8e020018 lw r2,0x0018(r16) #load X mod 00089b08: 8fa30018 lw r3,0x0018(r29) #load X mod difference 00089b0c: 00000000 nop 00089b10: 00431021 addu r2,r2,r3 #move unit immediately towards new X. if instead attack with no targets, move unit slightly towards new X 00089b14: 12400006 beq r18,r0,0x00089b30 #branch if input 2 = 0 (no height change?) 00089b18: ae020018 sw r2,0x0018(r16) 00089b1c: 8e02001c lw r2,0x001c(r16) 00089b20: 8fa3001c lw r3,0x001c(r29) #load height mod and height mod difference/ distortion 00089b24: 00000000 nop 00089b28: 00431021 addu r2,r2,r3 00089b2c: ae02001c sw r2,0x001c(r16) #move unit to new height 00089b30: 8e020020 lw r2,0x0020(r16) 00089b34: 8fa30020 lw r3,0x0020(r29) 00089b38: 00000000 nop 00089b3c: 00431021 addu r2,r2,r3 00089b40: 080226d3 j 0x00089b4c 00089b44: ae020020 sw r2,0x0020(r16) #move unit to new Y 00089b48: a2000087 sb r0,0x0087(r16) 00089b4c: 2631ffff addiu r17,r17,0xffff #distortion variable - 1 (movement speeds up over time, until it abruptly stops at destination) 00089b50: 8fa20018 lw r2,0x0018(r29) 00089b54: 8fa3001c lw r3,0x001c(r29) 00089b58: 8fa40020 lw r4,0x0020(r29) 00089b5c: 8fa50024 lw r5,0x0024(r29) 00089b60: ae020028 sw r2,0x0028(r16) 00089b64: ae03002c sw r3,0x002c(r16) 00089b68: ae040030 sw r4,0x0030(r16) 00089b6c: ae050034 sw r5,0x0034(r16) #store all differences(?) back into unit data 00089b70: 0c02255f jal 0x0008957c #0008957c - 000895c0 00089b74: 02002021 addu r4,r16,r0 00089b78: ae11008c sw r17,0x008c(r16) 00089b7c: ae130090 sw r19,0x0090(r16) 00089b80: 8fbf0038 lw r31,0x0038(r29) 00089b84: 8fb30034 lw r19,0x0034(r29) 00089b88: 8fb20030 lw r18,0x0030(r29) 00089b8c: 8fb1002c lw r17,0x002c(r29) 00089b90: 8fb00028 lw r16,0x0028(r29) 00089b94: 27bd0040 addiu r29,r29,0x0040 00089b98: 03e00008 jr r31 00089b9c: 00000000 nop