Initialize Thread (WORLD.BIN)

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: INITIALIZE THREAD (WORLD.BIN)
#       This routine is an analog to Initialize Thread in BATTLE.BIN.
#       Parameters:
#           r4 = (threadID) Thread ID to initialize
#           r5 = (funcPtr) Function pointer for thread to run

800ffd70: 27bdffe0 addiu r29,r29,-0x0020
800ffd74: afb00010 sw r16,0x0010(r29)
800ffd78: 00808021 addu r16,r4,r0
800ffd7c: afb10014 sw r17,0x0014(r29)
800ffd80: afbf0018 sw r31,0x0018(r29)
800ffd84: 0c040021 jal 0x80100084
800ffd88: 00a08821 addu r17,r5,r0
800ffd8c: 3c038015 lui r3,0x8015
800ffd90: 8c63327c lw r3,0x327c(r3)
800ffd94: 00108280 sll r16,r16,0x0a
800ffd98: 02038021 addu r16,r16,r3
800ffd9c: ae020038 sw r2,0x0038(r16)
800ffda0: 260203f0 addiu r2,r16,0x03f0
800ffda4: ae02003c sw r2,0x003c(r16)
800ffda8: ae020040 sw r2,0x0040(r16)
800ffdac: 34020001 ori r2,r0,0x0001
800ffdb0: ae110044 sw r17,0x0044(r16)
800ffdb4: ae020048 sw r2,0x0048(r16)
800ffdb8: ae00004c sw r0,0x004c(r16)
800ffdbc: ae00000c sw r0,0x000c(r16)
800ffdc0: ae000050 sw r0,0x0050(r16)
800ffdc4: ae000054 sw r0,0x0054(r16)
800ffdc8: ae000058 sw r0,0x0058(r16)
800ffdcc: ae00005c sw r0,0x005c(r16)
800ffdd0: ae000060 sw r0,0x0060(r16)
800ffdd4: ae000064 sw r0,0x0064(r16)
800ffdd8: ae000068 sw r0,0x0068(r16)
800ffddc: 8fbf0018 lw r31,0x0018(r29)
800ffde0: 8fb10014 lw r17,0x0014(r29)
800ffde4: 8fb00010 lw r16,0x0010(r29)
800ffde8: 27bd0020 addiu r29,r29,0x0020
800ffdec: 03e00008 jr r31
800ffdf0: 00000000 nop