Set Jump Ability Targeting
(Redirected from Set Ability Targeting)
Jump to navigation
Jump to search
00179dc8: 27bdfee0 addiu r29,r29,0xfee0 00179dcc: afb40108 sw r20,0x0108(r29) 00179dd0: 34140001 ori r20,r0,0x0001 00179dd4: 27a500d8 addiu r5,r29,0x00d8 r5 = stack + 0xd8 (points to unit ID in stack) 00179dd8: afbf0118 sw r31,0x0118(r29) 00179ddc: afb70114 sw r23,0x0114(r29) 00179de0: afb60110 sw r22,0x0110(r29) 00179de4: afb5010c sw r21,0x010c(r29) 00179de8: afb30104 sw r19,0x0104(r29) 00179dec: afb20100 sw r18,0x0100(r29) 00179df0: afb100fc sw r17,0x00fc(r29) 00179df4: 0c01788b jal 0x0005e22c Copy Byte Data (20 Bytes) 00179df8: afb000f8 sw r16,0x00f8(r29) I imagine the source is parsed from mother routine with r4. something tells me it's 0x016e from unit data. 00179dfc: 93a300d8 lbu r3,0x00d8(r29) load unit ID from stack 00179e00: 00000000 nop 00179e04: 000310c0 sll r2,r3,0x03 00179e08: 00431023 subu r2,r2,r3 00179e0c: 00021180 sll r2,r2,0x06 00179e10: 3c038019 lui r3,0x8019 00179e14: 246308cc addiu r3,r3,0x08cc 00179e18: 00432021 addu r4,r2,r3 r4= unit data 00179e1c: 90830003 lbu r3,0x0003(r4) load job 00179e20: 3402005d ori r2,r0,0x005d 00179e24: 14620003 bne r3,r2,0x00179e34 branch if not mime 00179e28: 34100002 ori r16,r0,0x0002 r16 = vertical 1 (if not mime) 00179e2c: 34140008 ori r20,r0,0x0008 r20 = 0x08 (if mime) 00179e30: 34100010 ori r16,r0,0x0010 r16 = vertical 8 (if mime) 00179e34: 0c060428 jal 0x001810a0 map location calculation 00179e38: 00000000 nop 00179e3c: 00409821 addu r19,r2,r0 r19 = tile ID 00179e40: 001318c0 sll r3,r19,0x03 00179e44: 3c028019 lui r2,0x8019 00179e48: 2442f8cc addiu r2,r2,0xf8cc 00179e4c: 00621021 addu r2,r3,r2 Tile's Tile ID pointer 00179e50: 90460002 lbu r6,0x0002(r2) load height (whole) 00179e54: 90430003 lbu r3,0x0003(r2) load height (halves + depth) 00179e58: 93a400d8 lbu r4,0x00d8(r29) load unit ID from stack 00179e5c: 93a500d9 lbu r5,0x00d9(r29) load primary skillset from stack 00179e60: 27a20060 addiu r2,r29,0x0060 00179e64: afa20010 sw r2,0x0010(r29) stack + 0x60 for CT 00179e68: 27a200a8 addiu r2,r29,0x00a8 00179e6c: afa20018 sw r2,0x0018(r29) stack + 0xa8 for silence/reflect checks 00179e70: 27a200c0 addiu r2,r29,0x00c0 00179e74: 27a70048 addiu r7,r29,0x0048 parse stack + 0x48 for MP costs 00179e78: afa00014 sw r0,0x0014(r29) 0x14 stack = 0 (so this really just isn't used?) 00179e7c: afa2001c sw r2,0x001c(r29) stack + 0xc0 for Turns to complete 00179e80: 3063001f andi r3,r3,0x001f get height half 00179e84: 00063040 sll r6,r6,0x01 height * 2 00179e88: 0066a821 addu r21,r3,r6 r21 = Height (whole + halves) 00179e8c: 0c0605f0 jal 0x001817c0 ability loading 00179e90: 27a60020 addiu r6,r29,0x0020 parse stack + 0x20 for ability IDs 00179e94: 00403821 addu r7,r2,r0 return # of abilities in skillset 00179e98: 18e00020 blez r7,0x00179f1c branch if 0 00179e9c: 00004021 addu r8,r0,r0 r8 = 0 00179ea0: 340afe76 ori r10,r0,0xfe76 -0x018a 00179ea4: 3c098006 lui r9,0x8006 00179ea8: 2529102c addiu r9,r9,0x102c jump ability table 00179eac: 27a60020 addiu r6,r29,0x0020 <Loop> do something for abilities 00179eb0: 94c30000 lhu r3,0x0000(r6) load ability 00179eb4: 00000000 nop 00179eb8: 006a1021 addu r2,r3,r10 ability + -0x018a 00179ebc: 3042ffff andi r2,r2,0xffff 00179ec0: 2c42000c sltiu r2,r2,0x000c 00179ec4: 10400011 beq r2,r0,0x00179f0c branch if not jump ability 00179ec8: 2462fe76 addiu r2,r3,0xfe76 Jump Ability 00179ecc: 3042ffff andi r2,r2,0xffff 00179ed0: 00021040 sll r2,r2,0x01 00179ed4: 00492021 addu r4,r2,r9 jump's table 00179ed8: 90830001 lbu r3,0x0001(r4) load Vertical 00179edc: 90820000 lbu r2,0x0000(r4) load Range 00179ee0: 00000000 nop 00179ee4: 0282102b sltu r2,r20,r2 8 < range? 00179ee8: 10400002 beq r2,r0,0x00179ef4 branch if not 00179eec: 00032840 sll r5,r3,0x01 vertical*2 00179ef0: 90940000 lbu r20,0x0000(r4) load range 00179ef4: 30a300ff andi r3,r5,0x00ff r3 = vertical*2 00179ef8: 320200ff andi r2,r16,0x00ff if mime, start at vertical 8. if not mime, start at vertical 1. 00179efc: 0043102b sltu r2,r2,r3 set if vertical is greater than previous 00179f00: 10400002 beq r2,r0,0x00179f0c branch if above is not true 00179f04: 00000000 nop 00179f08: 00a08021 addu r16,r5,r0 r16 = greatest vertical learnt 00179f0c: 25080001 addiu r8,r8,0x0001 counter + 1 00179f10: 0107102a slt r2,r8,r7 set if less than # of abilities 00179f14: 1440ffe6 bne r2,r0,0x00179eb0 repeat for all abilities 00179f18: 24c60002 addiu r6,r6,0x0002 ability list + 2 00179f1c: 320200ff andi r2,r16,0x00ff r2 = largest vertical known 00179f20: 02a21823 subu r3,r21,r2 r3 = tile height - Vertical 00179f24: 0060b021 addu r22,r3,r0 r22 = difference in tile height and jump vertical 00179f28: 02a21021 addu r2,r21,r2 r2 = tile height 00179f2c: 04610002 bgez r3,0x00179f38 branch if tile height is larger than vertical 00179f30: 0040b821 addu r23,r2,r0 r23 = tile height 00179f34: 0000b021 addu r22,r0,r0 r22 = 0 (if height - vertical is negative) 00179f38: 0c05f7b4 jal 0x0017ded0 clear panels? 00179f3c: 00000000 nop 00179f40: 2a620100 slti r2,r19,0x0100 set if tile ID is not on a second layer 00179f44: 14400002 bne r2,r0,0x00179f50 00179f48: 26710100 addiu r17,r19,0x0100 r17 = higher tile ID 00179f4c: 2671ff00 addiu r17,r19,0xff00 r17 = Lower tile ID 00179f50: 00131080 sll r2,r19,0x02 r2 = Tile ID * 4 00179f54: 00531021 addu r2,r2,r19 r2 = tile ID * 5 00179f58: 3c048019 lui r4,0x8019 00179f5c: 24842dd8 addiu r4,r4,0x2dd8 grid data 00179f60: 00449021 addu r18,r2,r4 r18 = tile's moveable/targetable data 00179f64: 26830001 addiu r3,r20,0x0001 range + 1 00179f68: 00111080 sll r2,r17,0x02 r2 = tile ID of above/below platform * 4 00179f6c: 00511021 addu r2,r2,r17 00179f70: 00448021 addu r16,r2,r4 alternative layer 00179f74: 2a620100 slti r2,r19,0x0100 set if Tile ID < second layer tiles 00179f78: a2430000 sb r3,0x0000(r18) store aoe on target tile 00179f7c: 10400004 beq r2,r0,0x00179f90 branch if tile ID IS second layer 00179f80: a2030000 sb r3,0x0000(r16) store aoe on lower/higher tile 00179f84: 34020001 ori r2,r0,0x0001 00179f88: 0805e7e6 j 0x00179f98 00179f8c: a2420001 sb r2,0x0001(r18) if panel isn't second layer, store green panel on target 00179f90: 34020001 ori r2,r0,0x0001 if tile ID is on the second layer, 00179f94: a2020001 sb r2,0x0001(r16) if panel is second layer, store green on lower level panel 00179f98: 02802021 addu r4,r20,r0 r4 = range 00179f9c: 0c05e546 jal 0x00179518 Calculate_Tiles_Hit_by_Ability 00179fa0: 00002821 addu r5,r0,r0 r5 = 0 00179fa4: 001118c0 sll r3,r17,0x03 alternative layer ID * 0x8 00179fa8: 3c028019 lui r2,0x8019 00179fac: 2442f8cc addiu r2,r2,0xf8cc tile data 00179fb0: 00621021 addu r2,r3,r2 00179fb4: a2400000 sb r0,0x0000(r18) 00179fb8: a2000000 sb r0,0x0000(r16) 00179fbc: 90440003 lbu r4,0x0003(r2) load height (halves) 00179fc0: 90430002 lbu r3,0x0002(r2) load height (full) 00179fc4: 90420006 lbu r2,0x0006(r2) load selectability 00179fc8: 3084001f andi r4,r4,0x001f 00179fcc: 00031840 sll r3,r3,0x01 whole height * 2 00179fd0: 30420001 andi r2,r2,0x0001 00179fd4: 14400004 bne r2,r0,0x00179fe8 branch if non-selectable tile 00179fd8: 00832021 addu r4,r4,r3 whole height + half height 00179fdc: 02a4102a slt r2,r21,r4 00179fe0: 14400056 bne r2,r0,0x0017a13c jump to end if alternate layer tile is lower than target tile 00179fe4: 00001021 addu r2,r0,r0 If alternate layer tile is higher than target tile: 00179fe8: 00005821 addu r11,r0,r0 r11 = 0 00179fec: 00004021 addu r8,r0,r0 r8 = 0 00179ff0: 3c0c8019 lui r12,0x8019 00179ff4: 258cf8cc addiu r12,r12,0xf8cc tile data 00179ff8: 258f0800 addiu r15,r12,0x0800 r15 = tile data + 0x800 (higher tile) 00179ffc: 00161400 sll r2,r22,0x10 r2 = vertical difference of target tile and attack vertical 0017a000: 00027403 sra r14,r2,0x10 r14 = that too, but in r14 0017a004: 02e06821 addu r13,r23,r0 r13 = target tile height 0017a008: 3c028019 lui r2,0x8019 0017a00c: 24422dd8 addiu r2,r2,0x2dd8 grid data 0017a010: 00404821 addu r9,r2,r0 grid data in r9 0017a014: 252a0500 addiu r10,r9,0x0500 grid data of higher tile in r10 0017a018: 000810c0 sll r2,r8,0x03 r2 = counter * 0x8 0017a01c: 004c2821 addu r5,r2,r12 r5 = counter + tile data 0017a020: 91230000 lbu r3,0x0000(r9) load aoe from lower tile 0017a024: 00000000 nop 0017a028: 10600006 beq r3,r0,0x0017a044 branch if aoe = 0 0017a02c: 004f3821 addu r7,r2,r15 r7 = counter + tile data of higher tile 0017a030: 90a20006 lbu r2,0x0006(r5) load selectability 0017a034: 00000000 nop 0017a038: 30420001 andi r2,r2,0x0001 0017a03c: 10400003 beq r2,r0,0x0017a04c branch if selectable tile? 0017a040: 00000000 nop 0017a044: 0805e818 j 0x0017a060 0017a048: 2406ffff addiu r6,r0,0xffff r6 = -0x1 (if unselectable lower target tile) 0017a04c: 90a30003 lbu r3,0x0003(r5) load height (halves) - lower tile 0017a050: 90a20002 lbu r2,0x0002(r5) load height (whole) - lower tile 0017a054: 3063001f andi r3,r3,0x001f 0017a058: 00021040 sll r2,r2,0x01 0017a05c: 00623021 addu r6,r3,r2 r6 = height whole + height half 0017a060: 91420000 lbu r2,0x0000(r10) load aoe of higher tile 0017a064: 00000000 nop 0017a068: 10400006 beq r2,r0,0x0017a084 branch if aoe = 0 0017a06c: 2404ffff addiu r4,r0,0xffff r4 = -0x1 0017a070: 90e20006 lbu r2,0x0006(r7) load selectability of higher tile 0017a074: 00000000 nop 0017a078: 30420001 andi r2,r2,0x0001 0017a07c: 10400003 beq r2,r0,0x0017a08c branch if selectable 0017a080: 00000000 nop 0017a084: 0805e829 j 0x0017a0a4 0017a088: 00061c00 sll r3,r6,0x10 r3 = height of target(lower) tile (times an absurdly large number. -1 if unselectable) 0017a08c: 90e30003 lbu r3,0x0003(r7) load height (half) of higher tile 0017a090: 90e20002 lbu r2,0x0002(r7) load height (whole) of higher tile 0017a094: 3063001f andi r3,r3,0x001f 0017a098: 00021040 sll r2,r2,0x01 0017a09c: 00622021 addu r4,r3,r2 height of higher tile (whole + half) 0017a0a0: 00061c00 sll r3,r6,0x10 r3 = height of target(lower) tile 0017a0a4: 00031c03 sra r3,r3,0x10 0017a0a8: 00041400 sll r2,r4,0x10 0017a0ac: 00021403 sra r2,r2,0x10 r2 = height of higher tile 0017a0b0: 0062182a slt r3,r3,r2 set if lower tile is below higher tile 0017a0b4: 10600004 beq r3,r0,0x0017a0c8 branch if lower tile is above higher tile 0017a0b8: 00a01021 addu r2,r5,r0 0017a0bc: 00803021 addu r6,r4,r0 r6 = height of higher (that is actually lower) tile 0017a0c0: 00e02821 addu r5,r7,r0 swap data pointers of higher and lower tile (okay) 0017a0c4: 00403821 addu r7,r2,r0 0017a0c8: 00061400 sll r2,r6,0x10 0017a0cc: 00021c03 sra r3,r2,0x10 r2 = height of lower tile 0017a0d0: 006e102a slt r2,r3,r14 set if lower tile is less than vertical of tile - vertical of (jump) attack 0017a0d4: 1440000c bne r2,r0,0x0017a108 branch if so 0017a0d8: 01a3102a slt r2,r13,r3 set if target tile height is less than attack vertical 0017a0dc: 1440000a bne r2,r0,0x0017a108 branch if so 0017a0e0: 00000000 nop 0017a0e4: 90a20006 lbu r2,0x0006(r5) load selectability (lower tile) 0017a0e8: 00000000 nop 0017a0ec: 30420002 andi r2,r2,0x0002 0017a0f0: 14400005 bne r2,r0,0x0017a108 branch if untargetable 0017a0f4: 00000000 nop 0017a0f8: 90a20005 lbu r2,0x0005(r5) load tile flags 0017a0fc: 256b0001 addiu r11,r11,0x0001 0017a100: 0805e845 j 0x0017a114 0017a104: 34420040 ori r2,r2,0x0040 add targetable flag 0017a108: 90a20005 lbu r2,0x0005(r5) load tile flags 0017a10c: 00000000 nop 0017a110: 304200bf andi r2,r2,0x00bf remove targetable flag 0017a114: a0a20005 sb r2,0x0005(r5) store 0017a118: 25290005 addiu r9,r9,0x0005 tile data + 5 0017a11c: 90e20005 lbu r2,0x0005(r7) load tile flags (higher tile) 0017a120: 25080001 addiu r8,r8,0x0001 counter + 1 0017a124: 304200bf andi r2,r2,0x00bf remove targetable flag 0017a128: a0e20005 sb r2,0x0005(r7) store 0017a12c: 29020100 slti r2,r8,0x0100 set if haven't checked all panels? 0017a130: 1440ffb9 bne r2,r0,0x0017a018 do for each panel 0017a134: 254a0005 addiu r10,r10,0x0005 tile data (higher) + 5 0017a138: 01601021 addu r2,r11,r0 r2 = return number of targetable tiles in aoe 0017a13c: 8fbf0118 lw r31,0x0118(r29) 0017a140: 8fb70114 lw r23,0x0114(r29) 0017a144: 8fb60110 lw r22,0x0110(r29) 0017a148: 8fb5010c lw r21,0x010c(r29) 0017a14c: 8fb40108 lw r20,0x0108(r29) 0017a150: 8fb30104 lw r19,0x0104(r29) 0017a154: 8fb20100 lw r18,0x0100(r29) 0017a158: 8fb100fc lw r17,0x00fc(r29) 0017a15c: 8fb000f8 lw r16,0x00f8(r29) 0017a160: 27bd0120 addiu r29,r29,0x0120 0017a164: 03e00008 jr r31 0017a168: 00000000 nop