Validate unit placement
Jump to navigation
Jump to search
0017f6c4: 27bdffd0 addiu r29,r29,0xffd0 0017f6c8: afb1001c sw r17,0x001c(r29) 0017f6cc: 00808821 addu r17,r4,r0 0017f6d0: 001110c0 sll r2,r17,0x03 0017f6d4: 00511023 subu r2,r2,r17 0017f6d8: 00021180 sll r2,r2,0x06 0017f6dc: 3c038019 lui r3,0x8019 0017f6e0: 246308cc addiu r3,r3,0x08cc 0017f6e4: afb00018 sw r16,0x0018(r29) 0017f6e8: 00438021 addu r16,r2,r3 0017f6ec: afbf002c sw r31,0x002c(r29) 0017f6f0: afb40028 sw r20,0x0028(r29) 0017f6f4: afb30024 sw r19,0x0024(r29) 0017f6f8: afb20020 sw r18,0x0020(r29) 0017f6fc: 92130047 lbu r19,0x0047(r16) load X coordinate 0017f700: 96030048 lhu r3,0x0048(r16) load Y coordinate + more 0017f704: 3c02800e lui r2,0x800e 0017f708: 90424e9c lbu r2,0x4e9c(r2) load map max 0017f70c: 92120048 lbu r18,0x0048(r16) 0017f710: 0262102b sltu r2,r19,r2 0017f714: 1040003a beq r2,r0,0x0017f800 verify unit is on map 0017f718: 0003a3c2 srl r20,r3,0x0f 0017f71c: 3c02800e lui r2,0x800e 0017f720: 90424ea0 lbu r2,0x4ea0(r2) 0017f724: 00000000 nop 0017f728: 0242102b sltu r2,r18,r2 0017f72c: 10400053 beq r2,r0,0x0017f87c verify unit is on map 0017f730: 2402ffff addiu r2,r0,0xffff 0017f734: 0c060428 jal 0x001810a0 map location calculation 0017f738: 02002021 addu r4,r16,r0 0017f73c: 000210c0 sll r2,r2,0x03 0017f740: 3c038019 lui r3,0x8019 0017f744: 2463f8cc addiu r3,r3,0xf8cc 0017f748: 00431821 addu r3,r2,r3 0017f74c: 90620006 lbu r2,0x0006(r3) 0017f750: 00000000 nop 0017f754: 30420003 andi r2,r2,0x0003 0017f758: 14400048 bne r2,r0,0x0017f87c branch to end if unit's tile is unselectable via cursor 0017f75c: 2402ffff addiu r2,r0,0xffff return r2 = 0xff (fail) 0017f760: 90620003 lbu r2,0x0003(r3) load height halves + depth 0017f764: 00000000 nop 0017f768: 3042001f andi r2,r2,0x001f 0017f76c: 28420003 slti r2,r2,0x0003 0017f770: 10400042 beq r2,r0,0x0017f87c branch if height (halves) > 2 0017f774: 2402ffff addiu r2,r0,0xffff 0017f778: 92020094 lbu r2,0x0094(r16) load movement 0017f77c: 00000000 nop 0017f780: 30420010 andi r2,r2,0x0010 0017f784: 1040000b beq r2,r0,0x0017f7b4 branch if unit can enter water 0017f788: 00000000 nop 0017f78c: 90620003 lbu r2,0x0003(r3) 0017f790: 00000000 nop 0017f794: 304200e0 andi r2,r2,0x00e0 0017f798: 10400006 beq r2,r0,0x0017f7b4 branch if unit is not in water 0017f79c: 00000000 nop 0017f7a0: 92020095 lbu r2,0x0095(r16) load movement 0017f7a4: 00000000 nop 0017f7a8: 30420008 andi r2,r2,0x0008 0017f7ac: 10400033 beq r2,r0,0x0017f87c branch if unit is not float 0017f7b0: 2402ffff addiu r2,r0,0xffff return 0xffff (fail) 0017f7b4: 90620003 lbu r2,0x0003(r3) 0017f7b8: 00000000 nop 0017f7bc: 00021142 srl r2,r2,0x05 0017f7c0: 28420003 slti r2,r2,0x0003 0017f7c4: 14400006 bne r2,r0,0x0017f7e0 branch if in deep water? 0017f7c8: 00000000 nop 0017f7cc: 92020095 lbu r2,0x0095(r16) 0017f7d0: 00000000 nop 0017f7d4: 304200d8 andi r2,r2,0x00d8 0017f7d8: 10400028 beq r2,r0,0x0017f87c branch if not water-movement allowing supports equipped 0017f7dc: 2402ffff addiu r2,r0,0xffff return r2 = 0xff 0017f7e0: 90620000 lbu r2,0x0000(r3) 0017f7e4: 00000000 nop 0017f7e8: 3043003f andi r3,r2,0x003f 0017f7ec: 34020012 ori r2,r0,0x0012 0017f7f0: 10620003 beq r3,r2,0x0017f800 branch if tile = lava 0017f7f4: 3402001c ori r2,r0,0x001c 0017f7f8: 14620003 bne r3,r2,0x0017f808 branch if tile is not obstacle 0017f7fc: 00000000 nop 0017f800: 0805fe1f j 0x0017f87c 0017f804: 2402ffff addiu r2,r0,0xffff return r2 = 0xffff 0017f808: 1a20001b blez r17,0x0017f878 jump to end if preset value is less than zero 0017f80c: 00002821 addu r5,r0,r0 0017f810: 340800ff ori r8,r0,0x00ff 0017f814: 326700ff andi r7,r19,0x00ff 0017f818: 324600ff andi r6,r18,0x00ff 0017f81c: 328300ff andi r3,r20,0x00ff 0017f820: 3c048019 lui r4,0x8019 0017f824: 248408cc addiu r4,r4,0x08cc 0017f828: 90820001 lbu r2,0x0001(r4) load Unit ID 0017f82c: 00000000 nop 0017f830: 1048000e beq r2,r8,0x0017f86c branch if unit doesn't exist 0017f834: 24a50001 addiu r5,r5,0x0001 r5++ 0017f838: 90820047 lbu r2,0x0047(r4) load X 0017f83c: 00000000 nop 0017f840: 1447000b bne r2,r7,0x0017f870 0017f844: 00b1102a slt r2,r5,r17 0017f848: 90820048 lbu r2,0x0048(r4) 0017f84c: 00000000 nop 0017f850: 14460007 bne r2,r6,0x0017f870 0017f854: 00b1102a slt r2,r5,r17 0017f858: 94820048 lhu r2,0x0048(r4) 0017f85c: 00000000 nop 0017f860: 000213c2 srl r2,r2,0x0f 0017f864: 10430005 beq r2,r3,0x0017f87c 0017f868: 2402ffff addiu r2,r0,0xffff 0017f86c: 00b1102a slt r2,r5,r17 0017f870: 1440ffed bne r2,r0,0x0017f828 0017f874: 248401c0 addiu r4,r4,0x01c0 0017f878: 00001021 addu r2,r0,r0 0017f87c: 8fbf002c lw r31,0x002c(r29) 0017f880: 8fb40028 lw r20,0x0028(r29) 0017f884: 8fb30024 lw r19,0x0024(r29) 0017f888: 8fb20020 lw r18,0x0020(r29) 0017f88c: 8fb1001c lw r17,0x001c(r29) 0017f890: 8fb00018 lw r16,0x0018(r29) 0017f894: 27bd0030 addiu r29,r29,0x0030 0017f898: 03e00008 jr r31 0017f89c: 00000000 nop