0x1474a4

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: ? 0x1474a4
#       Parameters:
#           r4 = (eventInstructionPtr) Pointer to event instruction?
#           r5 = (p2) Pointer to ?

801474a4: 27bdffd8 addiu r29,r29,-0x0028
801474a8: afb10014 sw r17,0x0014(r29)
801474ac: 00808821 addu r17,r4,r0                   #   r17ptr = eventInstructionPtr
801474b0: afb40020 sw r20,0x0020(r29)
801474b4: 00a0a021 addu r20,r5,r0                   #   ptr = p2
801474b8: afb3001c sw r19,0x001c(r29)
801474bc: afbf0024 sw r31,0x0024(r29)
801474c0: afb20018 sw r18,0x0018(r29)
801474c4: afb00010 sw r16,0x0010(r29)
801474c8: 9223000e lbu r3,0x000e(r17)               #   eventInstructionPtr.0x0e
801474cc: 34020038 ori r2,r0,0x0038                 #   0x38 = 56
801474d0: 14620002 bne r3,r2,0x801474dc
801474d4: 2633000f addiu r19,r17,0x000f             #   r19 = eventInstructionPtr + 0x0f
                                                    #   if (eventInstructionPtr.0x0e == 56) {
801474d8: 26330012 addiu r19,r17,0x0012             #       r19 = eventInstructionPtr + 0x12
                                                    #   }
801474dc: 00009021 addu r18,r0,r0                   #   count = 0
                                                    #   do {
801474e0: 8e900000 lw r16,0x0000(r20)               #       r16 = *p2
801474e4: 2a420003 slti r2,r18,0x0003
801474e8: 10400005 beq r2,r0,0x80147500             #       if (p2 < 3) {
801474ec: 00000000 nop
801474f0: 06010002 bgez r16,0x801474fc
801474f4: 02001021 addu r2,r16,r0                   #           value = r16
                                                    #           if (r16 < 0) {
801474f8: 260203ff addiu r2,r16,0x03ff              #               value = r16 + 0x3ff
                                                    #           }
801474fc: 00028283 sra r16,r2,0x0a                  #           r16 = value / 1024
                                                    #       }
80147500: 0c05181e jal 0x80146078                   #       param = Load Halfword (r17ptr);
80147504: 02202021 addu r4,r17,r0
80147508: 00021400 sll r2,r2,0x10
8014750c: 00021403 sra r2,r2,0x10
80147510: 34032710 ori r3,r0,0x2710                 
80147514: 14430003 bne r2,r3,0x80147524             #       if (param == 0x2710) {
80147518: 00000000 nop
8014751c: 08051d4e j 0x80147538
80147520: 34052710 ori r5,r0,0x2710                 #           r5 = 0x2710
                                                    #       } else {
80147524: 0c05181e jal 0x80146078                   #           param = Load Halfword (r17ptr);
80147528: 02202021 addu r4,r17,r0                   
8014752c: 00021400 sll r2,r2,0x10
80147530: 00021403 sra r2,r2,0x10
80147534: 02022821 addu r5,r16,r2                   #           r5 = r16 + param
                                                    #       }
80147538: 02602021 addu r4,r19,r0
8014753c: 00052c00 sll r5,r5,0x10
80147540: 0c051825 jal 0x80146094                   #       Store Halfword (r19, r5);
80147544: 00052c03 sra r5,r5,0x10
80147548: 26310002 addiu r17,r17,0x0002             #       r17ptr = r17ptr + 2
8014754c: 26730002 addiu r19,r19,0x0002             #       r19 = r19 + 2
80147550: 26520001 addiu r18,r18,0x0001             #       count = count + 1
80147554: 2a420007 slti r2,r18,0x0007
80147558: 1440ffe1 bne r2,r0,0x801474e0
8014755c: 26940004 addiu r20,r20,0x0004             #       ptr = ptr + 4
                                                    #   } while (count < 7);
80147560: 8fbf0024 lw r31,0x0024(r29)
80147564: 8fb40020 lw r20,0x0020(r29)
80147568: 8fb3001c lw r19,0x001c(r29)
8014756c: 8fb20018 lw r18,0x0018(r29)
80147570: 8fb10014 lw r17,0x0014(r29)
80147574: 8fb00010 lw r16,0x0010(r29)
80147578: 27bd0028 addiu r29,r29,0x0028
8014757c: 03e00008 jr r31
80147580: 00000000 nop