Order Unit Menu Processing
Jump to navigation
Jump to search
# ROUTINE: Order Unit Menu Processing 801200f8: 3c028019 lui r2,0x8019 801200fc: 8042bae8 lb r2,-0x4518(r2) # setValue = *0x8018bae8 80120100: 27bdffc8 addiu r29,r29,-0x0038 80120104: afbf0034 sw r31,0x0034(r29) 80120108: 1440002a bne r2,r0,0x801201b4 8012010c: afb00030 sw r16,0x0030(r29) # if (*0x8018bae8 == 0) { 80120110: 00002021 addu r4,r0,r0 80120114: 3c10801d lui r16,0x801d 80120118: 261085e4 addiu r16,r16,-0x7a1c # ptr = 0x801c85e4 8012011c: 0c0487f2 jal 0x80121fc8 # 0x121fc8 (0, ptr); // No discernable effect if removed 80120120: 02002821 addu r5,r16,r0 80120124: 00002021 addu r4,r0,r0 # count = 0 80120128: 27a30010 addiu r3,r29,0x0010 # destPtr = sp + 16 # do { 8012012c: 96020000 lhu r2,0x0000(r16) # value = *ptr 80120130: 26100002 addiu r16,r16,0x0002 # ptr = ptr + 2 80120134: 24840001 addiu r4,r4,0x0001 # count = count + 1 80120138: 2442000e addiu r2,r2,0x000e # value + 14 8012013c: a4620000 sh r2,0x0000(r3) # *destPtr = value + 14 80120140: 28820007 slti r2,r4,0x0007 80120144: 1440fff9 bne r2,r0,0x8012012c 80120148: 24630002 addiu r3,r3,0x0002 # destPtr = destPtr + 2 # } while (count < 7); 8012014c: 3c048019 lui r4,0x8019 80120150: 2484b670 addiu r4,r4,-0x4990 80120154: 3c05801d lui r5,0x801d 80120158: 24a5d558 addiu r5,r5,-0x2aa8 8012015c: 27a60010 addiu r6,r29,0x0010 80120160: 34070001 ori r7,r0,0x0001 80120164: 2402ffff addiu r2,r0,-0x0001 80120168: 0c04a932 jal 0x8012a4c8 # 0x12a4c8 (0x8018b670, 0x801cd558, sp + 0x10, 1); // Menu options don't re-order if removed 8012016c: a7a2001e sh r2,0x001e(r29) # sp.0x1e = -1 80120170: 3c028019 lui r2,0x8019 80120174: 9042ba27 lbu r2,-0x45d9(r2) # value = *0x8018ba27 80120178: 3c018019 lui r1,0x8019 8012017c: a020ba25 sb r0,-0x45db(r1) # *0x8018ba25 = 0 80120180: 3c018019 lui r1,0x8019 80120184: a020ba27 sb r0,-0x45d9(r1) # *0x8018ba27 = 0 80120188: 3c01801d lui r1,0x801d 8012018c: a02285fc sb r2,-0x7a04(r1) # *0x801c85fc = value 80120190: 0c04a966 jal 0x8012a598 # 0x12a598 (9); 80120194: 34040009 ori r4,r0,0x0009 80120198: 0c04a966 jal 0x8012a598 # 0x12a598 (12); 8012019c: 3404000c ori r4,r0,0x000c 801201a0: 34020001 ori r2,r0,0x0001 # setValue = 1 # } 801201a4: 3c018019 lui r1,0x8019 801201a8: a420d538 sh r0,-0x2ac8(r1) # *0x8018d538 = 0 801201ac: 3c018019 lui r1,0x8019 801201b0: a022bae8 sb r2,-0x4518(r1) # *0x8018bae8 = setValue 801201b4: 3c058019 lui r5,0x8019 801201b8: 24a5d500 addiu r5,r5,-0x2b00 801201bc: 0c04aade jal 0x8012ab78 # isRunning = Run Menu Thread (WORLD.BIN) (15, 0x8018d500); // Menu doesn't appear or function if removed (except for Select first entry) 801201c0: 3404000f ori r4,r0,0x000f 801201c4: 14400009 bne r2,r0,0x801201ec # if (isRunning == 0) { 801201c8: 00000000 nop 801201cc: 3c02801d lui r2,0x801d 801201d0: 904285fc lbu r2,-0x7a04(r2) # *0x801c85fc 801201d4: 3c018019 lui r1,0x8019 801201d8: a020bae8 sb r0,-0x4518(r1) # *0x8018bae8 = 0 801201dc: 3c018019 lui r1,0x8019 801201e0: ac20ba1c sw r0,-0x45e4(r1) # *0x8018ba1c = 0 801201e4: 3c018019 lui r1,0x8019 801201e8: a022ba27 sb r2,-0x45d9(r1) # *0x8018ba27 = *0x801c85fc # } 801201ec: 3c028019 lui r2,0x8019 801201f0: 8442d538 lh r2,-0x2ac8(r2) # *0x8018d538 801201f4: 3c06801d lui r6,0x801d 801201f8: 24c685e4 addiu r6,r6,-0x7a1c # 0x801c85e4 801201fc: 00021040 sll r2,r2,0x01 # *0x8018d538 * 2 80120200: 3c01801d lui r1,0x801d 80120204: 00220821 addu r1,r1,r2 80120208: 842285e4 lh r2,-0x7a1c(r1) # *(0x801c85e4 + (*0x8018d538 * 2)) 8012020c: 3c03801d lui r3,0x801d 80120210: 8463d73a lh r3,-0x28c6(r3) # *0x801cd73a 80120214: 2442103f addiu r2,r2,0x103f # *(0x801c85e4 + (*0x8018d538 * 2)) + 0x103f 80120218: 3c01801d lui r1,0x801d 8012021c: ac22d754 sw r2,-0x28ac(r1) # *0x801cd754 = *(0x801c85e4 + (*0x8018d538 * 2)) + 0x103f 80120220: 2402ffff addiu r2,r0,-0x0001 80120224: 10620030 beq r3,r2,0x801202e8 # if (*0x801cd73a == -1) return; 80120228: 00602021 addu r4,r3,r0 # *0x801cd73a 8012022c: 00041040 sll r2,r4,0x01 # *0x801cd73a * 2 80120230: 2484ffff addiu r4,r4,-0x0001 # iterations = *0x801cd73a - 1 80120234: 00461021 addu r2,r2,r6 # (*0x801cd73a * 2) + 0x801c85e4 80120238: 84470000 lh r7,0x0000(r2) # v7 = *((*0x801cd73a * 2) + 0x801c85e4) 8012023c: 0480000a bltz r4,0x80120268 80120240: 00041040 sll r2,r4,0x01 # (*0x801cd73a - 1) * 2 # if ((*0x801cd73a - 1) >= 0) { 80120244: 24c30002 addiu r3,r6,0x0002 # 0x801c85e4 + 2 80120248: 00432821 addu r5,r2,r3 # destPtr = ((*0x801cd73a - 1) * 2) + 0x801c85e4 + 2 8012024c: 00461821 addu r3,r2,r6 # ptr = ((*0x801cd73a - 1) * 2) + 0x801c85e4 # do { 80120250: 94620000 lhu r2,0x0000(r3) # value = *ptr 80120254: 2463fffe addiu r3,r3,-0x0002 # ptr = ptr - 2 80120258: 2484ffff addiu r4,r4,-0x0001 # iterations = iterations - 1 8012025c: a4a20000 sh r2,0x0000(r5) # *destPtr = value 80120260: 0481fffb bgez r4,0x80120250 80120264: 24a5fffe addiu r5,r5,-0x0002 # destPtr = destPtr - 2 # } while (iterations >= 0); # } 80120268: 3c10801d lui r16,0x801d 8012026c: 261085e4 addiu r16,r16,-0x7a1c # ptr = 0x801c85e4 80120270: 0c045022 jal 0x80114088 # 0x114088 (); // Continuously re-orders if removed once option is selected, sometimes with multiple parameters. Top option stops, bottom does all! 80120274: a6070000 sh r7,0x0000(r16) # *0x801c85e4 = v7 80120278: 00002021 addu r4,r0,r0 # count = 0 8012027c: 27a30010 addiu r3,r29,0x0010 # destPtr = sp + 16 # do { 80120280: 96020000 lhu r2,0x0000(r16) # value = *ptr 80120284: 26100002 addiu r16,r16,0x0002 # ptr = ptr + 2 80120288: 24840001 addiu r4,r4,0x0001 # count = count + 1 8012028c: 2442000e addiu r2,r2,0x000e # value + 14 80120290: a4620000 sh r2,0x0000(r3) # *destPtr = value + 14 80120294: 28820007 slti r2,r4,0x0007 80120298: 1440fff9 bne r2,r0,0x80120280 8012029c: 24630002 addiu r3,r3,0x0002 # destPtr = destPtr + 2 # } while (count < 7); 801202a0: 3c048019 lui r4,0x8019 801202a4: 2484b670 addiu r4,r4,-0x4990 801202a8: 3c05801d lui r5,0x801d 801202ac: 24a5d558 addiu r5,r5,-0x2aa8 801202b0: 27a60010 addiu r6,r29,0x0010 801202b4: 34070001 ori r7,r0,0x0001 801202b8: 2402ffff addiu r2,r0,-0x0001 801202bc: 0c04a932 jal 0x8012a4c8 # 0x12a4c8 (0x8018b670, 0x801cd558, sp + 16, 1); // Menu options don't re-order if removed 801202c0: a7a2001e sh r2,0x001e(r29) # sp.0x1e = -1 801202c4: 3c05801d lui r5,0x801d 801202c8: 24a585e4 addiu r5,r5,-0x7a1c 801202cc: 34020001 ori r2,r0,0x0001 801202d0: 3c018019 lui r1,0x8019 801202d4: a422e0b0 sh r2,-0x1f50(r1) # *0x8018e0b0 = 1 801202d8: 0c048808 jal 0x80122020 # 0x122020 (0, 0x801c85e4); // Unit re-ordering doesn't work if removed 801202dc: 00002021 addu r4,r0,r0 801202e0: 0c048718 jal 0x80121c60 # 0x121c60 (0); // Unit re-ordering works, but doesn't re-draw units until exiting out of menu if removed 801202e4: 00002021 addu r4,r0,r0 801202e8: 8fbf0034 lw r31,0x0034(r29) 801202ec: 8fb00030 lw r16,0x0030(r29) 801202f0: 27bd0038 addiu r29,r29,0x0038 801202f4: 03e00008 jr r31 801202f8: 00000000 nop