Switch To Next Thread Multiple Times

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: SWITCH TO NEXT THREAD MULTIPLE TIMES
#       Switches to the next thread (blocks) a specified number of times.
#       Parameters:
#           r4 = (p_Count) Number of times to switch to next thread (block)

8014c858: 27bdffd8 addiu r29,r29,-0x0028
8014c85c: afb1001c sw r17,0x001c(r29)
8014c860: 00808821 addu r17,r4,r0               #   p_Count
8014c864: afb00018 sw r16,0x0018(r29)
8014c868: 00008021 addu r16,r0,r0               #   count = 0
8014c86c: 1a200006 blez r17,0x8014c888
8014c870: afbf0020 sw r31,0x0020(r29)
                                                #   if (p_Count > 0) {
                                                #       do {
8014c874: 0c0532a0 jal 0x8014ca80               #           Switch To Next Thread ();
8014c878: 26100001 addiu r16,r16,0x0001         #           count = count + 1
8014c87c: 0211102a slt r2,r16,r17
8014c880: 1440fffc bne r2,r0,0x8014c874         #       } while (count < p_Count)
8014c884: 00000000 nop
                                                #   }
8014c888: 8fbf0020 lw r31,0x0020(r29)
8014c88c: 8fb1001c lw r17,0x001c(r29)
8014c890: 8fb00018 lw r16,0x0018(r29)
8014c894: 27bd0028 addiu r29,r29,0x0028
8014c898: 03e00008 jr r31
8014c89c: 00000000 nop