Check Thread Running Status

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: CHECK THREAD RUNNING STATUS
#       Find whether or not thread is running / in use
#       Parameters:
#           r4 = ThreadID
#       Returns:
#           r2 = thread.IsRunning

8014cc94: 00044280 sll r8,r4,0x0a           #   ThreadID * sizeof(thread)
8014cc98: 3c018016 lui r1,0x8016
8014cc9c: 00200821 addu r1,r1,r0
8014cca0: 8c295f98 lw r9,0x5f98(r1)         #   Base pointer for thread array
8014cca4: 00000000 nop
8014cca8: 01094021 addu r8,r8,r9            #   thread
8014ccac: 8d020048 lw r2,0x0048(r8)         #   return thread.IsRunning
8014ccb0: 03e00008 jr r31                   
8014ccb4: 00000000 nop