Load Next Event

From Final Fantasy Hacktics Wiki
Revision as of 18:04, 30 August 2020 by Glain (talk | contribs) (Created page with " # ROUTINE: LOAD NEXT EVENT # Returns: # r2 = (1, if event was loaded; 0, otherwise) 80145f78: 27bdffe0 addiu r29,r29,-0x0020 80145f7c: afb10014 sw r17...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#   ROUTINE: LOAD NEXT EVENT
#       Returns:
#           r2 = (1, if event was loaded; 0, otherwise)

80145f78: 27bdffe0 addiu r29,r29,-0x0020
80145f7c: afb10014 sw r17,0x0014(r29)
80145f80: 3411000f ori r17,r0,0x000f            #   15
80145f84: afbf0018 sw r31,0x0018(r29)
80145f88: afb00010 sw r16,0x0010(r29)
80145f8c: 0c0532a0 jal 0x8014ca80               #   Switch To Next Thread ();
80145f90: 34100004 ori r16,r0,0x0004            #   taskID = 4
                                                #   do {
80145f94: 0c05272f jal 0x80149cbc               #       taskThreadID = Get Thread Running Task (taskID);
80145f98: 02002021 addu r4,r16,r0
80145f9c: 14400005 bne r2,r0,0x80145fb4         #       if (taskThreadID == 0) {
80145fa0: 00000000 nop
80145fa4: 26100001 addiu r16,r16,0x0001         #           taskID = taskID + 1
80145fa8: 2a02000f slti r2,r16,0x000f
80145fac: 1440fff9 bne r2,r0,0x80145f94         #           if (taskID < 15) continue;
80145fb0: 00000000 nop                          #       }
80145fb4: 1611fff5 bne r16,r17,0x80145f8c       #   } while (taskID != 15);
80145fb8: 00000000 nop
80145fbc: 0c04ed64 jal 0x8013b590               #   eventID = Get Script Variable (0x27);
80145fc0: 34040027 ori r4,r0,0x0027
80145fc4: 3c038017 lui r3,0x8017
80145fc8: 8c6396fc lw r3,-0x6904(r3)            #   *0x801696fc
80145fcc: 00408021 addu r16,r2,r0               #   eventID
80145fd0: 12030006 beq r16,r3,0x80145fec        #   if (eventID == *0x801696fc)
80145fd4: 00001021 addu r2,r0,r0                #       return 0;
80145fd8: 0c04f270 jal 0x8013c9c0               #   Load Event (eventID);
80145fdc: 02002021 addu r4,r16,r0               #   eventID
80145fe0: 3c018017 lui r1,0x8017
80145fe4: ac3096fc sw r16,-0x6904(r1)           #   *0x801696fc = eventID
80145fe8: 34020001 ori r2,r0,0x0001             #   return 1;
80145fec: 8fbf0018 lw r31,0x0018(r29)
80145ff0: 8fb10014 lw r17,0x0014(r29)
80145ff4: 8fb00010 lw r16,0x0010(r29)
80145ff8: 27bd0020 addiu r29,r29,0x0020
80145ffc: 03e00008 jr r31
80146000: 00000000 nop