Difference between revisions of "Target's Status Affecting XA (Magical)"
Jump to navigation
Jump to search
(Rewrote the warning in intelligible English) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Target | + | No Parameters - Returns Nothing |
− | 00186460: 3c028019 lui r2,0x8019 | + | |
− | 00186464: 8c422d98 lw r2,0x2d98(r2) | + | Decreases Ability XA (-33%) if Target has Shell |
− | 00186468: 00000000 nop | + | Increases Ability XA (+50%) if Target has Frog or Chicken |
− | 0018646c: 9042005b lbu r2,0x005b(r2) | + | --------------------------------------------------------------------------------- |
− | 00186470: 00000000 nop | + | 00186460: 3c028019 lui r2,0x8019 | |
− | 00186474: 30420010 andi r2,r2,0x0010 | + | 00186464: 8c422d98 lw r2,0x2d98(r2) |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}} |
− | 00186478: 1040000b beq r2,r0,0x001864a8 | + | 00186468: 00000000 nop | |
− | 0018647c: 3c025555 lui r2,0x5555 | + | 0018646c: 9042005b lbu r2,0x005b(r2) |{{f/load|<nowiki>r2 = Target 4th set of Current statuses</nowiki>}} |
− | 00186480: 3c048019 lui r4,0x8019 | + | 00186470: 00000000 nop | |
− | 00186484: 248438ce addiu r4,r4,0x38ce | + | 00186474: 30420010 andi r2,r2,0x0010 |{{f/std|<nowiki>r2 = 0x10 if Target has Shell</nowiki>}} |
− | 00186488: 84830000 lh r3,0x0000(r4) | + | 00186478: 1040000b beq r2,r0,0x001864a8 {{f/Cond|If Target has Shell}} |
− | 0018648c: 34425556 ori r2,r2,0x5556 | + | 0018647c: 3c025555 lui r2,0x5555 | |
− | 00186490: 00031840 sll r3,r3,0x01 | + | 00186480: 3c048019 lui r4,0x8019 | |
− | 00186494: 00620018 mult r3,r2 | + | 00186484: 248438ce addiu r4,r4,0x38ce |{{f/adr|<nowiki>r4 = Current Ability XA pointer</nowiki>}} |
− | 00186498: 00031fc3 sra r3,r3,0x1f | + | 00186488: 84830000 lh r3,0x0000(r4) |{{f/load|<nowiki>r3 = Ability XA</nowiki>}} |
− | 0018649c: 00001010 mfhi r2 | + | 0018648c: 34425556 ori r2,r2,0x5556 |{{f/std|<nowiki>r2 = 0x55555556 (0,33 * 2^32)</nowiki>}} |
− | 001864a0: 00431023 subu r2,r2,r3 | + | 00186490: 00031840 sll r3,r3,0x01 |{{f/std|XA * 2}} |
− | 001864a4: a4820000 sh r2,0x0000(r4) | + | 00186494: 00620018 mult r3,r2 |{{f/std|XA * 2 / 3 * 2^32}} |
− | 001864a8: 3c028019 lui r2,0x8019 | + | 00186498: 00031fc3 sra r3,r3,0x1f |{{f/std|<nowiki>r3 = highest bit of r3 (should be 0x00 else 0x01)</nowiki>}} |
− | 001864ac: 8c422d98 lw r2,0x2d98(r2) | + | 0018649c: 00001010 mfhi r2 |{{f/std|<nowiki>r2 = XA *2/3</nowiki>}} |
− | 001864b0: 00000000 nop | + | 001864a0: 00431023 subu r2,r2,r3 |{{f/std|XA eventually down rounded}} |
− | 001864b4: 9042005a lbu r2,0x005a(r2) | + | 001864a4: a4820000 sh r2,0x0000(r4) |{{f/store|Store New XA (66% of initial XA)}} |
− | 001864b8: 00000000 nop | + | 001864a8: 3c028019 lui r2,0x8019 | |
− | 001864bc: 30420006 andi r2,r2,0x0006 | + | 001864ac: 8c422d98 lw r2,0x2d98(r2) |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}} |
− | 001864c0: 1040000b beq r2,r0,0x001864f0 | + | 001864b0: 00000000 nop | |
− | 001864c4: 00000000 nop | + | 001864b4: 9042005a lbu r2,0x005a(r2) |{{f/load|<nowiki>r2 = Target 3rd set of Current statuses</nowiki>}} |
− | 001864c8: 3c048019 lui r4,0x8019 | + | 001864b8: 00000000 nop | |
− | 001864cc: 248438ce addiu r4,r4,0x38ce | + | 001864bc: 30420006 andi r2,r2,0x0006 |{{f/std|r2 <> 0x00 if Target has frog or chicken}} |
− | 001864d0: 84830000 lh r3,0x0000(r4) | + | 001864c0: 1040000b beq r2,r0,0x001864f0 {{f/Cond|If the Target has Frog or Chicken }} |
− | 001864d4: 00000000 nop | + | 001864c4: 00000000 nop | |
− | 001864d8: 00031040 sll r2,r3,0x01 | + | 001864c8: 3c048019 lui r4,0x8019 | |
− | 001864dc: 00431021 addu r2,r2,r3 | + | 001864cc: 248438ce addiu r4,r4,0x38ce |{{f/adr|<nowiki>r4 = Current Ability XA pointer</nowiki>}} |
− | 001864e0: 00021fc2 srl r3,r2,0x1f | + | 001864d0: 84830000 lh r3,0x0000(r4) |{{f/load|<nowiki>r3 = Ability XA</nowiki>}} |
− | 001864e4: 00431021 addu r2,r2,r3 | + | 001864d4: 00000000 nop | |
− | 001864e8: 00021043 sra r2,r2,0x01 | + | 001864d8: 00031040 sll r2,r3,0x01 |{{f/std|XA * 2}} |
− | 001864ec: a4820000 sh r2,0x0000(r4) | + | 001864dc: 00431021 addu r2,r2,r3 |{{f/std|XA * 3}} |
− | 001864f0: 03e00008 jr r31 | + | 001864e0: 00021fc2 srl r3,r2,0x1f |{{f/std|<nowiki>r3 = highest bit of r3 (should be 0x00 else 0x01)</nowiki>}} |
+ | 001864e4: 00431021 addu r2,r2,r3 |{{f/std|XA eventually high rounded}} | ||
+ | 001864e8: 00021043 sra r2,r2,0x01 |{{f/std|XA * 3 / 2}} | ||
+ | 001864ec: a4820000 sh r2,0x0000(r4) |{{f/store|Store new XA (150% of initial XA)}} | ||
+ | 001864f0: 03e00008 jr r31 END | ||
001864f4: 00000000 nop | 001864f4: 00000000 nop | ||
− | + | '''Warning''' : This routine doesn't save its own program counter to r31 or push its own data to the stack. Make sure to take care of this if you want to jal from here. | |
− | == Return Locations == | + | === Return Locations === |
− | + | '''Battle.bin''' | |
− | + | 00188764: [[Magical Support/Status/Compat]] | |
− | + | 00189018: [[0E_Dmg_(Y)%25_Hit_F(MA%2BX)%25_100%25_Status_Hide_Status|Formula 0E - Dmg (Y)% Hit F(MA+X)% 100% Status Hide Status]] | |
− |
Latest revision as of 17:02, 21 June 2023
No Parameters - Returns Nothing Decreases Ability XA (-33%) if Target has Shell Increases Ability XA (+50%) if Target has Frog or Chicken --------------------------------------------------------------------------------- 00186460: 3c028019 lui r2,0x8019 | 00186464: 8c422d98 lw r2,0x2d98(r2) |r2 = Target data pointer 00186468: 00000000 nop | 0018646c: 9042005b lbu r2,0x005b(r2) |r2 = Target 4th set of Current statuses 00186470: 00000000 nop | 00186474: 30420010 andi r2,r2,0x0010 |r2 = 0x10 if Target has Shell 00186478: 1040000b beq r2,r0,0x001864a8 #If Target has Shell 0018647c: 3c025555 lui r2,0x5555 | 00186480: 3c048019 lui r4,0x8019 | 00186484: 248438ce addiu r4,r4,0x38ce |r4 = Current Ability XA pointer 00186488: 84830000 lh r3,0x0000(r4) |r3 = Ability XA 0018648c: 34425556 ori r2,r2,0x5556 |r2 = 0x55555556 (0,33 * 2^32) 00186490: 00031840 sll r3,r3,0x01 |XA * 2 00186494: 00620018 mult r3,r2 |XA * 2 / 3 * 2^32 00186498: 00031fc3 sra r3,r3,0x1f |r3 = highest bit of r3 (should be 0x00 else 0x01) 0018649c: 00001010 mfhi r2 |r2 = XA *2/3 001864a0: 00431023 subu r2,r2,r3 |XA eventually down rounded 001864a4: a4820000 sh r2,0x0000(r4) |Store New XA (66% of initial XA) 001864a8: 3c028019 lui r2,0x8019 | 001864ac: 8c422d98 lw r2,0x2d98(r2) |r2 = Target data pointer 001864b0: 00000000 nop | 001864b4: 9042005a lbu r2,0x005a(r2) |r2 = Target 3rd set of Current statuses 001864b8: 00000000 nop | 001864bc: 30420006 andi r2,r2,0x0006 |r2 <> 0x00 if Target has frog or chicken 001864c0: 1040000b beq r2,r0,0x001864f0 #If the Target has Frog or Chicken 001864c4: 00000000 nop | 001864c8: 3c048019 lui r4,0x8019 | 001864cc: 248438ce addiu r4,r4,0x38ce |r4 = Current Ability XA pointer 001864d0: 84830000 lh r3,0x0000(r4) |r3 = Ability XA 001864d4: 00000000 nop | 001864d8: 00031040 sll r2,r3,0x01 |XA * 2 001864dc: 00431021 addu r2,r2,r3 |XA * 3 001864e0: 00021fc2 srl r3,r2,0x1f |r3 = highest bit of r3 (should be 0x00 else 0x01) 001864e4: 00431021 addu r2,r2,r3 |XA eventually high rounded 001864e8: 00021043 sra r2,r2,0x01 |XA * 3 / 2 001864ec: a4820000 sh r2,0x0000(r4) |Store new XA (150% of initial XA) 001864f0: 03e00008 jr r31 END 001864f4: 00000000 nop
Warning : This routine doesn't save its own program counter to r31 or push its own data to the stack. Make sure to take care of this if you want to jal from here.
Return Locations
Battle.bin 00188764: Magical Support/Status/Compat 00189018: Formula 0E - Dmg (Y)% Hit F(MA+X)% 100% Status Hide Status