0x1210e8
Revision as of 19:15, 14 October 2024 by Nyzer (talk | contribs) (Nyzer moved page ? 0x1210e8 to 0x1210e8: Fucking question marks)
# ROUTINE: ? 0x1210e8 # Parameters: # r4 = (p1) ? (Sometimes 0) # r5 = (p2) (Sometimes 0x801cd5ec, start of formation screen unit pointer array) # r6 = (p3) ? (Sometimes 0) # Returns: # r2 = *0x801c8634 (halfword) 801210e8: 27bdfe10 addiu r29,r29,-0x01f0 801210ec: afb501e4 sw r21,0x01e4(r29) 801210f0: 00c0a821 addu r21,r6,r0 # p3 801210f4: afb101d4 sw r17,0x01d4(r29) 801210f8: 00008821 addu r17,r0,r0 # index = 0 801210fc: afb201d8 sw r18,0x01d8(r29) 80121100: 00009021 addu r18,r0,r0 # r18 = 0 80121104: afb401e0 sw r20,0x01e0(r29) 80121108: 309403ff andi r20,r4,0x03ff # p1 & 0x3ff 8012110c: afb301dc sw r19,0x01dc(r29) 80121110: 3c13801d lui r19,0x801d 80121114: 2673868c addiu r19,r19,-0x7974 # r19 = 0x801c868c 80121118: afb001d0 sw r16,0x01d0(r29) 8012111c: 00008021 addu r16,r0,r0 # r16 = 0 80121120: afbf01e8 sw r31,0x01e8(r29) 80121124: 27a40010 addiu r4,r29,0x0010 # local # for (partyUnitIndex = 0; partyUnitIndex < 20; partyUnitIndex++) { 80121128: 02202821 addu r5,r17,r0 # partyUnitIndex 8012112c: 0c016a35 jal 0x8005a8d4 # result = Initialize Unit's Job Data (local, partyUnitIndex, 1); 80121130: 34060001 ori r6,r0,0x0001 # 1 80121134: 1440004c bne r2,r0,0x80121268 # if (result != 0) continue; 80121138: 00000000 nop 8012113c: 0c0166bc jal 0x80059af0 # partyUnit = Get Party Data Pointer (partyUnitIndex); 80121140: 02202021 addu r4,r17,r0 80121144: 27a40010 addiu r4,r29,0x0010 # local 80121148: 3c05801d lui r5,0x801d 8012114c: 24a58638 addiu r5,r5,-0x79c8 # 0x801c8638 80121150: 02052821 addu r5,r16,r5 # r16 + 0x801c8638 80121154: 0c0482ec jal 0x80120bb0 # ? 0x120bb0 (local, r16 + 0x801c8638, partyUnit); 80121158: 00403021 addu r6,r2,r0 # partyUnit 8012115c: 34020001 ori r2,r0,0x0001 80121160: 16a2001b bne r21,r2,0x801211d0 # if (p3 == 1) { 80121164: 34020002 ori r2,r0,0x0002 80121168: 3c01801d lui r1,0x801d 8012116c: 00300821 addu r1,r1,r16 80121170: 90228757 lbu r2,-0x78a9(r1) 80121174: 00000000 nop 80121178: 1440003b bne r2,r0,0x80121268 8012117c: 00000000 nop 80121180: 3c01801d lui r1,0x801d 80121184: 00300821 addu r1,r1,r16 80121188: 902286a8 lbu r2,-0x7958(r1) 8012118c: 00000000 nop 80121190: 30420004 andi r2,r2,0x0004 80121194: 14400034 bne r2,r0,0x80121268 80121198: 00000000 nop 8012119c: 3c01801d lui r1,0x801d 801211a0: 00300821 addu r1,r1,r16 801211a4: 84228676 lh r2,-0x798a(r1) 801211a8: 00000000 nop 801211ac: 1440002e bne r2,r0,0x80121268 801211b0: 00000000 nop 801211b4: 3c01801d lui r1,0x801d 801211b8: 00300821 addu r1,r1,r16 801211bc: 8424865c lh r4,-0x79a4(r1) 801211c0: 0c0482e4 jal 0x80120b90 801211c4: 00000000 nop 801211c8: 08048482 j 0x80121208 801211cc: 00000000 nop 801211d0: 16a2000f bne r21,r2,0x80121210 # } else if (p3 == 2) { 801211d4: 00000000 nop 801211d8: 3c01801d lui r1,0x801d 801211dc: 00300821 addu r1,r1,r16 801211e0: 902286a8 lbu r2,-0x7958(r1) 801211e4: 00000000 nop 801211e8: 30420004 andi r2,r2,0x0004 801211ec: 1440001e bne r2,r0,0x80121268 801211f0: 00000000 nop 801211f4: 3c01801d lui r1,0x801d 801211f8: 00300821 addu r1,r1,r16 801211fc: 902286a8 lbu r2,-0x7958(r1) 80121200: 00000000 nop 80121204: 00021182 srl r2,r2,0x06 # } # if ((p3 == 1) or (p3 == 2)) { 80121208: 14400017 bne r2,r0,0x80121268 # if (r2 != 0) continue; 8012120c: 00000000 nop # } 80121210: 1a80000e blez r20,0x8012124c # if ((p1 & 0x3ff) > 0) { 80121214: 00002821 addu r5,r0,r0 80121218: 00002021 addu r4,r0,r0 8012121c: 02601821 addu r3,r19,r0 80121220: 94620000 lhu r2,0x0000(r3) 80121224: 00000000 nop 80121228: 14540002 bne r2,r20,0x80121234 8012122c: 24630002 addiu r3,r3,0x0002 80121230: 34050001 ori r5,r0,0x0001 80121234: 24840001 addiu r4,r4,0x0001 80121238: 28820005 slti r2,r4,0x0005 8012123c: 1440fff8 bne r2,r0,0x80121220 80121240: 00000000 nop 80121244: 10a00008 beq r5,r0,0x80121268 80121248: 00000000 nop # } 8012124c: 00121040 sll r2,r18,0x01 # r18 * 2 80121250: 3c01801d lui r1,0x801d 80121254: 00220821 addu r1,r1,r2 80121258: a4328608 sh r18,-0x79f8(r1) # *(0x801c8608 + (r18 * 2)) = r18 8012125c: 26730128 addiu r19,r19,0x0128 # r19 = r19 + 0x128 80121260: 26100128 addiu r16,r16,0x0128 # r16 = r16 + 0x128 80121264: 26520001 addiu r18,r18,0x0001 # r18 = r18 + 1 80121268: 26310001 addiu r17,r17,0x0001 8012126c: 2a220014 slti r2,r17,0x0014 80121270: 1440ffad bne r2,r0,0x80121128 80121274: 27a40010 addiu r4,r29,0x0010 # } 80121278: 3c01801d lui r1,0x801d 8012127c: a4328634 sh r18,-0x79cc(r1) # *0x801c8634 = r18 80121280: 0c048718 jal 0x80121c60 # ? 0x121c60 (0); 80121284: 00002021 addu r4,r0,r0 80121288: 3c02801d lui r2,0x801d 8012128c: 84428634 lh r2,-0x79cc(r2) # return *0x801c8634; 80121290: 8fbf01e8 lw r31,0x01e8(r29) 80121294: 8fb501e4 lw r21,0x01e4(r29) 80121298: 8fb401e0 lw r20,0x01e0(r29) 8012129c: 8fb301dc lw r19,0x01dc(r29) 801212a0: 8fb201d8 lw r18,0x01d8(r29) 801212a4: 8fb101d4 lw r17,0x01d4(r29) 801212a8: 8fb001d0 lw r16,0x01d0(r29) 801212ac: 27bd01f0 addiu r29,r29,0x01f0 801212b0: 03e00008 jr r31 801212b4: 00000000 nop