Get First Thread Parameter (WORLD.BIN)

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: GET FIRST THREAD PARAMETER (WORLD.BIN)
#       This routine is an analog to Get First Thread Parameter in BATTLE.BIN.
#       Returns:
#           r2 = First parameter of current thread

80100090: 3c01801d lui r1,0x801d
80100094: 00200821 addu r1,r1,r0
80100098: 8c28d170 lw r8,-0x2e90(r1)                    #   threadID
8010009c: 00000000 nop
801000a0: 00084280 sll r8,r8,0x0a                       #   threadID * sizeof(thread)
801000a4: 3c018015 lui r1,0x8015
801000a8: 00200821 addu r1,r1,r0
801000ac: 8c29327c lw r9,0x327c(r1)                     #   threads
801000b0: 00000000 nop
801000b4: 01094020 add r8,r8,r9                         #   threads[threadID]
801000b8: 8d020000 lw r2,0x0000(r8)                     #   return threads[threadID].funcParam1
801000bc: 03e00008 jr r31
801000c0: 00000000 nop