Stop Current Thread (WORLD.BIN)

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: STOP CURRENT THREAD (WORLD.BIN)
#       Mark current thread as not being in use, then switch threads
#       This routine is an analog to Stop Current Thread in BATTLE.BIN.

800ffe28: 3c02801d lui r2,0x801d
800ffe2c: 8c42d170 lw r2,-0x2e90(r2)                #   Current thread ID (*0x801cd170)
800ffe30: 3c038015 lui r3,0x8015
800ffe34: 8c63327c lw r3,0x327c(r3)                 #   Thread array base pointer (*0x8015327c)
800ffe38: 27bdffe8 addiu r29,r29,-0x0018
800ffe3c: afbf0010 sw r31,0x0010(r29)
800ffe40: 00021280 sll r2,r2,0x0a                   #   (Current thread ID) * sizeof(thread) (*0x801cd170 * 1024)
800ffe44: 00431021 addu r2,r2,r3                    #   thread = (Current thread ID) * sizeof(thread) + (Thread array base pointer)
800ffe48: ac400048 sw r0,0x0048(r2)                 #   thread.IsRunning = 0
800ffe4c: 0c03ffd4 jal 0x800fff50                   #   Switch To Next Thread (WORLD.BIN) ();
800ffe50: ac40004c sw r0,0x004c(r2)                 #   thread.TaskID = 0
800ffe54: 8fbf0010 lw r31,0x0010(r29)
800ffe58: 27bd0018 addiu r29,r29,0x0018
800ffe5c: 03e00008 jr r31
800ffe60: 00000000 nop