Difference between revisions of "Knockback"
Jump to navigation
Jump to search
(Created page with "<font face='Courier New'> 0018ae3c: 27bdffe8 addiu r29,r29,0xffe8 0018ae40: afbf0010 sw r31,0x0010(r29) 0018ae44: 0c062b7d jal 0x0018adf4 action data nulling 0018ae48:...") |
m (Nyzer moved page Knockback? to Knockback: Fucking question marks) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | Set Fall damage if any | |
− | + | Turn off the 0x80 flag of "post action byte" at 0x801938ed (which is mandatory to run in this routine from preformula routine) | |
− | 0018ae3c: 27bdffe8 addiu r29,r29,0xffe8 | + | ------------------------------------------------------------------------------------------------------------------------------- |
− | 0018ae40: afbf0010 sw r31,0x0010(r29) | + | 0018ae3c: 27bdffe8 addiu r29,r29,0xffe8 | |
− | 0018ae44: 0c062b7d jal 0x0018adf4 | + | 0018ae40: afbf0010 sw r31,0x0010(r29) | |
− | 0018ae48: 00000000 nop | + | 0018ae44: 0c062b7d jal 0x0018adf4 |{{f/jal|Action_data_nulling|<nowiki>Action_data_nulling</nowiki>}} {{f/std|(reset most of attacker and target current action flags)}} |
− | 0018ae4c: 3c068019 lui r6,0x8019 | + | 0018ae48: 00000000 nop | |
− | 0018ae50: 24c638ed addiu r6,r6,0x38ed | + | 0018ae4c: 3c068019 lui r6,0x8019 | |
− | 0018ae54: 90c20000 lbu r2,0x0000(r6) | + | 0018ae50: 24c638ed addiu r6,r6,0x38ed | |
− | 0018ae58: 00000000 nop | + | 0018ae54: 90c20000 lbu r2,0x0000(r6) |{{f/load|<nowiki>r2 = knockback/poach/ post action ? byte ( 0x801938ed )</nowiki>}} |
− | 0018ae5c: 3042007f andi r2,r2,0x007f | + | 0018ae58: 00000000 nop | |
− | 0018ae60: a0c20000 sb r2,0x0000(r6) | + | 0018ae5c: 3042007f andi r2,r2,0x007f |{{f/std|<nowiki>r2 = r2 without 0x80 (flagged as fall dmg not calculated)</nowiki>}} |
− | 0018ae64: 3c038019 lui r3,0x8019 | + | 0018ae60: a0c20000 sb r2,0x0000(r6) |{{f/store|<nowiki>store knockback/poach/ post action ? byte ( 0x801938ed ) with 0x80 removed?</nowiki>}} |
− | 0018ae68: 8c632d90 lw r3,0x2d90(r3) | + | 0018ae64: 3c038019 lui r3,0x8019 | |
− | 0018ae6c: 34020001 ori r2,r0,0x0001 | + | 0018ae68: 8c632d90 lw r3,0x2d90(r3) |{{f/adr|<nowiki>r3 = Target current action data pointer</nowiki>}} |
− | 0018ae70: a0620025 sb r2,0x0025(r3) | + | 0018ae6c: 34020001 ori r2,r0,0x0001 |{{f/std|<nowiki>r2 = 0x01</nowiki>}} |
− | 0018ae74: 3c058019 lui r5,0x8019 | + | 0018ae70: a0620025 sb r2,0x0025(r3) |{{f/store|<nowiki>Store target current action attack type = pseudo status</nowiki>}} |
− | 0018ae78: 8ca52d98 lw r5,0x2d98(r5) | + | 0018ae74: 3c058019 lui r5,0x8019 | |
− | 0018ae7c: 00000000 nop | + | 0018ae78: 8ca52d98 lw r5,0x2d98(r5) |{{f/adr|<nowiki>r5 = Target data pointer</nowiki>}} |
− | 0018ae80: 94a20058 lhu r2,0x0058(r5) | + | 0018ae7c: 00000000 nop | |
− | 0018ae84: 00000000 nop | + | 0018ae80: 94a20058 lhu r2,0x0058(r5) |{{f/load|<nowiki>load target current status set 1 and 2</nowiki>}} |
− | 0018ae88: 30428060 andi r2,r2,0x8060 | + | 0018ae84: 00000000 nop | |
− | 0018ae8c: 14400023 bne r2,r0,0x0018af1c | + | 0018ae88: 30428060 andi r2,r2,0x8060 |{{f/std|<nowiki>r2 <> 0x00 if target has petrify, crystal or death</nowiki>}} |
− | 0018ae90: 00002021 addu r4,r0,r0 | + | 0018ae8c: 14400023 bne r2,r0,0x0018af1c {{f/Cond|<nowiki>If target isn't dead, crystalized nor petrified</nowiki>}} /Else branch to {{f/loc|<nowiki>End</nowiki>}} |
− | 0018ae94: 90c30000 lbu r3,0x0000(r6) | + | 0018ae90: 00002021 addu r4,r0,r0 |{{f/std|<nowiki>r4 = 0x00 (will be fall damage if any)</nowiki>}} |
− | 0018ae98: 34020001 ori r2,r0,0x0001 | + | 0018ae94: 90c30000 lbu r3,0x0000(r6) |{{f/load|<nowiki>r3 = knockback/poach/ post action ? byte ( 0x801938ed )</nowiki>}} |
− | 0018ae9c: 14620017 bne r3,r2,0x0018aefc | + | 0018ae98: 34020001 ori r2,r0,0x0001 |{{f/std|<nowiki>r2 = 0x01</nowiki>}} |
− | 0018aea0: 00000000 nop | + | 0018ae9c: 14620017 bne r3,r2,0x0018aefc {{f/Cond|<nowiki>If post action byte is 0x01</nowiki>}} {{f/std|<nowiki>(non flying unit ?) /Else branch to store damage section (with r4 = 0x00)</nowiki>}} |
− | 0018aea4: 3c028019 lui r2,0x8019 | + | 0018aea0: 00000000 nop |{{f/std|<nowiki> </nowiki>}} |
− | 0018aea8: 904238ee lbu r2,0x38ee(r2) | + | 0018aea4: 3c028019 lui r2,0x8019 |{{f/std|<nowiki> </nowiki>}} |
− | 0018aeac: 90a3003b lbu r3,0x003b(r5) | + | 0018aea8: 904238ee lbu r2,0x38ee(r2) |{{f/load|<nowiki>r2 = fall distance*2?</nowiki>}} |
− | 0018aeb0: 00021042 srl r2,r2,0x01 | + | 0018aeac: 90a3003b lbu r3,0x003b(r5) |{{f/load|<nowiki>r3 = Target jump</nowiki>}} |
− | 0018aeb4: 00431823 subu r3,r2,r3 | + | 0018aeb0: 00021042 srl r2,r2,0x01 |{{f/std|<nowiki>r2 = r2/2 (nb of tiles fallen)</nowiki>}} |
− | 0018aeb8: 18600010 blez r3,0x0018aefc | + | 0018aeb4: 00431823 subu r3,r2,r3 |{{f/std|<nowiki>r3 = fallen height - jump</nowiki>}} |
− | 0018aebc: 00000000 nop | + | 0018aeb8: 18600010 blez r3,0x0018aefc {{f/Cond|<nowiki>If Fallen height > Target jump</nowiki>}} /Else branch to store damage section (with r4 = 0x00) |
− | 0018aec0: 94a2002a lhu r2,0x002a(r5) | + | 0018aebc: 00000000 nop |{{f/std|<nowiki> </nowiki>}} |
− | 0018aec4: 00000000 nop | + | 0018aec0: 94a2002a lhu r2,0x002a(r5) |{{f/load|<nowiki>r2 = Target max hp</nowiki>}} |
− | 0018aec8: 00620018 mult r3,r2 | + | 0018aec4: 00000000 nop | |
− | 0018aecc: 00001812 mflo r3 | + | 0018aec8: 00620018 mult r3,r2 | |
− | 0018aed0: 3c026666 lui r2,0x6666 | + | 0018aecc: 00001812 mflo r3 |{{f/std|<nowiki>r3 = Target max hp * (fallen height - jump)</nowiki>}} |
− | 0018aed4: 34426667 ori r2,r2,0x6667 | + | 0018aed0: 3c026666 lui r2,0x6666 | |
− | 0018aed8: 00620018 mult r3,r2 | + | 0018aed4: 34426667 ori r2,r2,0x6667 |{{f/std|<nowiki>r2 = 66666667 (it's 0,4 * 2^32)</nowiki>}} |
− | 0018aedc: 00031fc3 sra r3,r3,0x1f | + | 0018aed8: 00620018 mult r3,r2 | |
− | 0018aee0: 00001010 mfhi r2 | + | 0018aedc: 00031fc3 sra r3,r3,0x1f |{{f/std|<nowiki>r3 = 0x00 (in theory could be 0x01 if r3 is 2^32 …)</nowiki>}} |
− | 0018aee4: 00021083 sra r2,r2,0x02 | + | 0018aee0: 00001010 mfhi r2 |{{f/std|<nowiki>r2 = Target max hp * (fallen height - jump) * 0,4</nowiki>}} |
− | 0018aee8: 00432023 subu r4,r2,r3 | + | 0018aee4: 00021083 sra r2,r2,0x02 |{{f/std|<nowiki>r2 = Target max hp * (fallen height - jump) * 0,1 = Fall damage</nowiki>}} |
− | 0018aeec: 288203e8 slti r2,r4,0x03e8 | + | 0018aee8: 00432023 subu r4,r2,r3 |{{f/std|<nowiki>r4 = r2 (fall damage)</nowiki>}} |
− | 0018aef0: 14400002 bne r2,r0,0x0018aefc | + | 0018aeec: 288203e8 slti r2,r4,0x03e8 |{{f/std|<nowiki>r2 = 0x01 if fall damage < 1000</nowiki>}} |
− | 0018aef4: 00000000 nop | + | 0018aef0: 14400002 bne r2,r0,0x0018aefc {{f/Cond|<nowiki>if fall damage > 999</nowiki>}} |
− | 0018aef8: 340403e7 ori r4,r0,0x03e7 | + | 0018aef4: 00000000 nop |{{f/std|<nowiki> </nowiki>}} |
− | 0018aefc: 3c038019 lui r3,0x8019 | + | 0018aef8: 340403e7 ori r4,r0,0x03e7 |{{f/std|<nowiki>r4 = fall damage limited to 999</nowiki>}} |
− | 0018af00: 8c632d90 lw r3,0x2d90(r3) | + | 0018aefc: 3c038019 lui r3,0x8019 | |
− | 0018af04: 10800005 beq r4,r0,0x0018af1c | + | 0018af00: 8c632d90 lw r3,0x2d90(r3) |{{f/adr|<nowiki>r3 = Target current action data pointer</nowiki>}} |
− | 0018af08: a4640004 sh r4,0x0004(r3) | + | 0018af04: 10800005 beq r4,r0,0x0018af1c {{f/Cond|<nowiki>If there is any fall damage</nowiki>}} /Else branch to end |
− | 0018af0c: 90620025 lbu r2,0x0025(r3) | + | 0018af08: a4640004 sh r4,0x0004(r3) |{{f/store|<nowiki>store r4 as target current action HP damage</nowiki>}} |
− | 0018af10: 00000000 nop | + | 0018af0c: 90620025 lbu r2,0x0025(r3) |{{f/load|<nowiki>r2 = target current action attack type</nowiki>}} |
− | 0018af14: 34420080 ori r2,r2,0x0080 | + | 0018af10: 00000000 nop | |
− | 0018af18: a0620025 sb r2,0x0025(r3) | + | 0018af14: 34420080 ori r2,r2,0x0080 |{{f/std|<nowiki>r2 = r2 with 0x80 flag enabled</nowiki>}} |
− | 0018af1c: 8fbf0010 lw r31,0x0010(r29) | + | 0018af18: a0620025 sb r2,0x0025(r3) |{{f/store|<nowiki>store r2 as target current action attack type updated with HP damage</nowiki>}} |
− | 0018af20: 27bd0018 addiu r29,r29,0x0018 | + | 0018af1c: 8fbf0010 lw r31,0x0010(r29) |{{f/std|End}} |
− | 0018af24: 03e00008 jr r31 | + | 0018af20: 27bd0018 addiu r29,r29,0x0018 |
+ | 0018af24: 03e00008 jr r31 | ||
0018af28: 00000000 nop | 0018af28: 00000000 nop | ||
− | + | ||
+ | ==Retun location== | ||
+ | 0018b43c: [[Pre_Formula_Setup_(FDC)]] |
Latest revision as of 22:00, 22 December 2024
Set Fall damage if any Turn off the 0x80 flag of "post action byte" at 0x801938ed (which is mandatory to run in this routine from preformula routine) ------------------------------------------------------------------------------------------------------------------------------- 0018ae3c: 27bdffe8 addiu r29,r29,0xffe8 | 0018ae40: afbf0010 sw r31,0x0010(r29) | 0018ae44: 0c062b7d jal 0x0018adf4 |-->Action_data_nulling (reset most of attacker and target current action flags) 0018ae48: 00000000 nop | 0018ae4c: 3c068019 lui r6,0x8019 | 0018ae50: 24c638ed addiu r6,r6,0x38ed | 0018ae54: 90c20000 lbu r2,0x0000(r6) |r2 = knockback/poach/ post action ? byte ( 0x801938ed ) 0018ae58: 00000000 nop | 0018ae5c: 3042007f andi r2,r2,0x007f |r2 = r2 without 0x80 (flagged as fall dmg not calculated) 0018ae60: a0c20000 sb r2,0x0000(r6) |store knockback/poach/ post action ? byte ( 0x801938ed ) with 0x80 removed? 0018ae64: 3c038019 lui r3,0x8019 | 0018ae68: 8c632d90 lw r3,0x2d90(r3) |r3 = Target current action data pointer 0018ae6c: 34020001 ori r2,r0,0x0001 |r2 = 0x01 0018ae70: a0620025 sb r2,0x0025(r3) |Store target current action attack type = pseudo status 0018ae74: 3c058019 lui r5,0x8019 | 0018ae78: 8ca52d98 lw r5,0x2d98(r5) |r5 = Target data pointer 0018ae7c: 00000000 nop | 0018ae80: 94a20058 lhu r2,0x0058(r5) |load target current status set 1 and 2 0018ae84: 00000000 nop | 0018ae88: 30428060 andi r2,r2,0x8060 |r2 <> 0x00 if target has petrify, crystal or death 0018ae8c: 14400023 bne r2,r0,0x0018af1c #If target isn't dead, crystalized nor petrified /Else branch to End 0018ae90: 00002021 addu r4,r0,r0 |r4 = 0x00 (will be fall damage if any) 0018ae94: 90c30000 lbu r3,0x0000(r6) |r3 = knockback/poach/ post action ? byte ( 0x801938ed ) 0018ae98: 34020001 ori r2,r0,0x0001 |r2 = 0x01 0018ae9c: 14620017 bne r3,r2,0x0018aefc #If post action byte is 0x01 (non flying unit ?) /Else branch to store damage section (with r4 = 0x00) 0018aea0: 00000000 nop | 0018aea4: 3c028019 lui r2,0x8019 | 0018aea8: 904238ee lbu r2,0x38ee(r2) |r2 = fall distance*2? 0018aeac: 90a3003b lbu r3,0x003b(r5) |r3 = Target jump 0018aeb0: 00021042 srl r2,r2,0x01 |r2 = r2/2 (nb of tiles fallen) 0018aeb4: 00431823 subu r3,r2,r3 |r3 = fallen height - jump 0018aeb8: 18600010 blez r3,0x0018aefc #If Fallen height > Target jump /Else branch to store damage section (with r4 = 0x00) 0018aebc: 00000000 nop | 0018aec0: 94a2002a lhu r2,0x002a(r5) |r2 = Target max hp 0018aec4: 00000000 nop | 0018aec8: 00620018 mult r3,r2 | 0018aecc: 00001812 mflo r3 |r3 = Target max hp * (fallen height - jump) 0018aed0: 3c026666 lui r2,0x6666 | 0018aed4: 34426667 ori r2,r2,0x6667 |r2 = 66666667 (it's 0,4 * 2^32) 0018aed8: 00620018 mult r3,r2 | 0018aedc: 00031fc3 sra r3,r3,0x1f |r3 = 0x00 (in theory could be 0x01 if r3 is 2^32 …) 0018aee0: 00001010 mfhi r2 |r2 = Target max hp * (fallen height - jump) * 0,4 0018aee4: 00021083 sra r2,r2,0x02 |r2 = Target max hp * (fallen height - jump) * 0,1 = Fall damage 0018aee8: 00432023 subu r4,r2,r3 |r4 = r2 (fall damage) 0018aeec: 288203e8 slti r2,r4,0x03e8 |r2 = 0x01 if fall damage < 1000 0018aef0: 14400002 bne r2,r0,0x0018aefc #if fall damage > 999 0018aef4: 00000000 nop | 0018aef8: 340403e7 ori r4,r0,0x03e7 |r4 = fall damage limited to 999 0018aefc: 3c038019 lui r3,0x8019 | 0018af00: 8c632d90 lw r3,0x2d90(r3) |r3 = Target current action data pointer 0018af04: 10800005 beq r4,r0,0x0018af1c #If there is any fall damage /Else branch to end 0018af08: a4640004 sh r4,0x0004(r3) |store r4 as target current action HP damage 0018af0c: 90620025 lbu r2,0x0025(r3) |r2 = target current action attack type 0018af10: 00000000 nop | 0018af14: 34420080 ori r2,r2,0x0080 |r2 = r2 with 0x80 flag enabled 0018af18: a0620025 sb r2,0x0025(r3) |store r2 as target current action attack type updated with HP damage 0018af1c: 8fbf0010 lw r31,0x0010(r29) |End 0018af20: 27bd0018 addiu r29,r29,0x0018 0018af24: 03e00008 jr r31 0018af28: 00000000 nop
Retun location
0018b43c: Pre_Formula_Setup_(FDC)