Difference between revisions of "Knockback 2"
Jump to navigation
Jump to search
(Created page with " (r5 = TX, r6 = TY) 00184610: 27bdffd8 addiu r29,r29,0xffd8 00184614: afb20018 sw r18,0x0018(r29) 00184618: 00a09021 addu r18,r5,r0 r18 = TX 0018461c: afb3001c sw r19,0x0...") |
|||
Line 156: | Line 156: | ||
00184878: 02402021 addu r4,r18,r0 | 00184878: 02402021 addu r4,r18,r0 | ||
0018487c: 02602821 addu r5,r19,r0 | 0018487c: 02602821 addu r5,r19,r0 | ||
− | 00184880: 0c05f722 jal 0x0017dc88 | + | 00184880: 0c05f722 jal 0x0017dc88 Get ID of unit if tile is targetable |
00184884: 02203021 addu r6,r17,r0 | 00184884: 02203021 addu r6,r17,r0 | ||
00184888: 2403ffff addiu r3,r0,0xffff | 00184888: 2403ffff addiu r3,r0,0xffff |
Revision as of 14:00, 27 November 2012
(r5 = TX, r6 = TY) 00184610: 27bdffd8 addiu r29,r29,0xffd8 00184614: afb20018 sw r18,0x0018(r29) 00184618: 00a09021 addu r18,r5,r0 r18 = TX 0018461c: afb3001c sw r19,0x001c(r29) 00184620: 00c09821 addu r19,r6,r0 r19 = TY 00184624: afbf0020 sw r31,0x0020(r29) 00184628: afb10014 sw r17,0x0014(r29) 0018462c: 064000a1 bltz r18,0x001848b4 Branch if TX is negative (off the map) 00184630: afb00010 sw r16,0x0010(r29) 00184634: 066000a0 bltz r19,0x001848b8 Branch if TY is negative (off the map) 00184638: 2402ffff addiu r2,r0,0xffff r2 = FFFF 0018463c: 3c02800e lui r2,0x800e 00184640: 90424e9c lbu r2,0x4e9c(r2) Load Map's Max X 00184644: 00000000 nop 00184648: 0242102a slt r2,r18,r2 0018464c: 1040009a beq r2,r0,0x001848b8 Branch if TX >= Max X (off the map) 00184650: 2402ffff addiu r2,r0,0xffff r2 = FFFF 00184654: 3c02800e lui r2,0x800e 00184658: 90424ea0 lbu r2,0x4ea0(r2) Load Map's Max Y 0018465c: 00000000 nop 00184660: 0262102a slt r2,r19,r2 00184664: 10400093 beq r2,r0,0x001848b4 Branch if TY >= Max Y (off the map) 00184668: 34020001 ori r2,r0,0x0001 r2 = 1 (Knocked Left) 0018466c: 10820012 beq r4,r2,0x001846b8 Branch if Target was Knocked Left 00184670: 28820002 slti r2,r4,0x0002 00184674: 10400005 beq r2,r0,0x0018468c Branch if Target was Knocked Up/Right 00184678: 00000000 nop 0018467c: 10800011 beq r4,r0,0x001846c4 Branch if Target was Knocked Down 00184680: 00000000 nop 00184684: 080611b3 j 0x001846cc (jump if value was negative?) 00184688: 00000000 nop 0018468c: 34020002 ori r2,r0,0x0002 r2 = 2 00184690: 10820006 beq r4,r2,0x001846ac Branch if Target was Knocked Up 00184694: 34020003 ori r2,r0,0x0003 r2 = 3 00184698: 1482000c bne r4,r2,0x001846cc Branch if Target was not Knocked Right 0018469c: 00000000 nop 001846a0: 00008021 addu r16,r0,r0 001846a4: 080611b3 j 0x001846cc Knocked Right, r16 = 0, r17 = 2 001846a8: 34110002 ori r17,r0,0x0002 001846ac: 34100006 ori r16,r0,0x0006 001846b0: 080611b3 j 0x001846cc Knocked Up, r16 = 6, r17 = 4 001846b4: 34110004 ori r17,r0,0x0004 001846b8: 34100002 ori r16,r0,0x0002 001846bc: 080611b3 j 0x001846cc Knocked Left, r16 = 2, r17 = 0 001846c0: 00008821 addu r17,r0,r0 001846c4: 34100004 ori r16,r0,0x0004 001846c8: 34110006 ori r17,r0,0x0006 Knocked Down, r16 = 4, r17 = 6 001846cc: 3c048019 lui r4,0x8019 001846d0: 8c842d98 lw r4,0x2d98(r4) Load Target's Data Pointer 001846d4: 0c060428 jal 0x001810a0 Map Location Calculation 001846d8: 00000000 nop 001846dc: 000210c0 sll r2,r2,0x03 Tile ID * 8 001846e0: 3c058019 lui r5,0x8019 001846e4: 24a5f8cc addiu r5,r5,0xf8cc 001846e8: 00451021 addu r2,r2,r5 001846ec: 90440003 lbu r4,0x0003(r2) Load Tile's Height (halves) + Depth 001846f0: 90430004 lbu r3,0x0004(r2) Load Tile's slope height? 001846f4: 3084001f andi r4,r4,0x001f r4 = Tile's Height (halves) 001846f8: 02031807 srav r3,r3,r16 Tile's Slope Height? / 4 OR 16 OR 64 (OR no change) 001846fc: 30630003 andi r3,r3,0x0003 Tile's Slope Mod? (0->3) 00184700: 00830018 mult r4,r3 Tile's Height (halves) * Slope Height? 00184704: 00002012 mflo r4 r4 = Tile's Height (halves) * Slope Height? 00184708: 3c03800e lui r3,0x800e 0018470c: 90634e9c lbu r3,0x4e9c(r3) Load Map's Max X 00184710: 00000000 nop 00184714: 02630018 mult r19,r3 TY * Max X 00184718: 90420002 lbu r2,0x0002(r2) Load Tile's Height 0018471c: 00000000 nop 00184720: 00021040 sll r2,r2,0x01 Height * 2 00184724: 00443021 addu r6,r2,r4 Height * 2 + Height (halves) * Slope Mod? (total height?) 00184728: 00001012 mflo r2 TY * Max X 0018472c: 00521021 addu r2,r2,r18 TY * Max X + TX 00184730: 24430100 addiu r3,r2,0x0100 TY * Max X + TX + 100h 00184734: 000210c0 sll r2,r2,0x03 (TY * Max X + TX) * 8 00184738: 00454021 addu r8,r2,r5 (TY * Max X + TX) * 8 + Current Tile Pointer 0018473c: 000318c0 sll r3,r3,0x03 (TY * Max X + TX + 100h) * 8 (new Tile ID) 00184740: 91020006 lbu r2,0x0006(r8) Load New Tile's Misc. Flags 00184744: 00000000 nop 00184748: 30420001 andi r2,r2,0x0001 0018474c: 10400003 beq r2,r0,0x0018475c Branch if tile is able to be selected 00184750: 00653821 addu r7,r3,r5 (TY * Max X + TX + 100h) * 8 + Current Tile Pointer 00184754: 080611e2 j 0x00184788 00184758: 340400ff ori r4,r0,0x00ff r4 = FF (Max Height) 0018475c: 91030003 lbu r3,0x0003(r8) Load New Tile's Height (halves) + Depth 00184760: 91020004 lbu r2,0x0004(r8) Load New Tile's Slope Height? 00184764: 3063001f andi r3,r3,0x001f Leave only Height (halves) 00184768: 02221007 srav r2,r2,r17 Slope Height? / 4 OR 16 OR 64 (OR no change) 0018476c: 30420003 andi r2,r2,0x0003 Slope Mod? (0->3) 00184770: 00620018 mult r3,r2 Height (halves) * Slope Mod? 00184774: 91020002 lbu r2,0x0002(r8) Load Height 00184778: 00000000 nop 0018477c: 00021040 sll r2,r2,0x01 Height * 2 00184780: 00001812 mflo r3 r3 = Height (halves) * Slope Mod? 00184784: 00432021 addu r4,r2,r3 Height * 2 + Height (halves) * Slope Mod? (total height?) 00184788: 90e20006 lbu r2,0x0006(r7) Load Higher Elevation Tile's Misc Flags 0018478c: 00000000 nop 00184790: 30420001 andi r2,r2,0x0001 00184794: 1440000c bne r2,r0,0x001847c8 Branch if tile is unable to be selected 00184798: 340300ff ori r3,r0,0x00ff r3 = FF (max Height) 0018479c: 90e30003 lbu r3,0x0003(r7) Load Higher Elevation Tile's Height (halves) + Depth 001847a0: 90e20004 lbu r2,0x0004(r7) Load Higher Elevation Tile's Slope Height? 001847a4: 3063001f andi r3,r3,0x001f 001847a8: 02221007 srav r2,r2,r17 Slope Height? / 4 OR 16 OR 64 (OR no change) 001847ac: 30420003 andi r2,r2,0x0003 Slope Mod? (0->3) 001847b0: 00620018 mult r3,r2 Height (halves) * Slope Mod? 001847b4: 90e20002 lbu r2,0x0002(r7) Load Height 001847b8: 00000000 nop 001847bc: 00021040 sll r2,r2,0x01 Height * 2 001847c0: 00001812 mflo r3 r3 = Height (halves) * Slope Mod? 001847c4: 00431821 addu r3,r2,r3 Height * 2 + Height (halves) * Slope Mod? (total height?) 001847c8: 00c4282a slt r5,r6,r4 001847cc: 10a00005 beq r5,r0,0x001847e4 Branch if Knockback Total Height >= Current Total Height 001847d0: 00c3102a slt r2,r6,r3 001847d4: 10400012 beq r2,r0,0x00184820 Branch if Higher KB Total Height >= Current Total Height 001847d8: 00c4102a slt r2,r6,r4 001847dc: 0806122e j 0x001848b8 001847e0: 2402ffff addiu r2,r0,0xffff r2 = FFF F 001847e4: 1040000d beq r2,r0,0x0018481c Branch if Higher KB Total Height >= Current Total Height 001847e8: 00000000 nop 001847ec: 14a0000e bne r5,r0,0x00184828 Branch if Knockback Total Height < Current Total Height 001847f0: 00000000 nop 001847f4: 90e20005 lbu r2,0x0005(r7) Load Higher Elevation's ? 001847f8: 00000000 nop 001847fc: 3042001f andi r2,r2,0x001f Leave only ? 00184800: 00621823 subu r3,r3,r2 Higher Elevation Total Height - ? 00184804: 24c20004 addiu r2,r6,0x0004 Current height + 4 00184808: 0062102a slt r2,r3,r2 0018480c: 1440002a bne r2,r0,0x001848b8 (to be continued) 00184810: 2402ffff addiu r2,r0,0xffff 00184814: 0806121a j 0x00184868 00184818: 00008821 addu r17,r0,r0 0018481c: 00c4102a slt r2,r6,r4 00184820: 1040000d beq r2,r0,0x00184858 00184824: 00c3102a slt r2,r6,r3 00184828: 1440000c bne r2,r0,0x0018485c 0018482c: 0083102a slt r2,r4,r3 00184830: 91020005 lbu r2,0x0005(r8) 00184834: 00000000 nop 00184838: 3042001f andi r2,r2,0x001f 0018483c: 00822023 subu r4,r4,r2 00184840: 24c20004 addiu r2,r6,0x0004 00184844: 0082102a slt r2,r4,r2 00184848: 1440001b bne r2,r0,0x001848b8 0018484c: 2402ffff addiu r2,r0,0xffff 00184850: 0806121c j 0x00184870 00184854: 34110001 ori r17,r0,0x0001 00184858: 0083102a slt r2,r4,r3 0018485c: 14400004 bne r2,r0,0x00184870 00184860: 34110001 ori r17,r0,0x0001 00184864: 00008821 addu r17,r0,r0 00184868: 0806121d j 0x00184874 0018486c: 00c48023 subu r16,r6,r4 00184870: 00c38023 subu r16,r6,r3 00184874: 0600000f bltz r16,0x001848b4 00184878: 02402021 addu r4,r18,r0 0018487c: 02602821 addu r5,r19,r0 00184880: 0c05f722 jal 0x0017dc88 Get ID of unit if tile is targetable 00184884: 02203021 addu r6,r17,r0 00184888: 2403ffff addiu r3,r0,0xffff 0018488c: 1443000a bne r2,r3,0x001848b8 00184890: 2402ffff addiu r2,r0,0xffff 00184894: 3c038019 lui r3,0x8019 00184898: 906338c1 lbu r3,0x38c1(r3) 0018489c: 3c018019 lui r1,0x8019 001848a0: a03038ee sb r16,0x38ee(r1) 001848a4: 3c018019 lui r1,0x8019 001848a8: a02338ef sb r3,0x38ef(r1) 001848ac: 0806122e j 0x001848b8 001848b0: 02201021 addu r2,r17,r0 001848b4: 2402ffff addiu r2,r0,0xffff 001848b8: 8fbf0020 lw r31,0x0020(r29) 001848bc: 8fb3001c lw r19,0x001c(r29) 001848c0: 8fb20018 lw r18,0x0018(r29) 001848c4: 8fb10014 lw r17,0x0014(r29) 001848c8: 8fb00010 lw r16,0x0010(r29) 001848cc: 27bd0028 addiu r29,r29,0x0028 001848d0: 03e00008 jr r31 001848d4: 00000000 nop