Set Event Speed Inner

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: SET EVENT SPEED INNER
#       Set event speed inner routine.
#       Parameters:
#           r4 = (newEventSpeed) Event speed value
#               0x01: Normal speed
#               0x02: Slowed down

8008dee8: 2482ffff addiu r2,r4,-0x0001          #   newEventSpeed - 1
8008deec: 2c420002 sltiu r2,r2,0x0002
8008def0: 14400003 bne r2,r0,0x8008df00         
8008def4: 00001021 addu r2,r0,r0                #   0
                                                #   if ((newEventSpeed - 1) >= 2) {
8008def8: 080237c2 j 0x8008df08                 #       return -1;
8008defc: 2402ffff addiu r2,r0,-0x0001
                                                #   } else {
8008df00: 3c018004 lui r1,0x8004
8008df04: ac245980 sw r4,0x5980(r1)             #       *0x80045980 = newEventSpeed
                                                #       return 0;
                                                #   }
8008df08: 03e00008 jr r31
8008df0c: 00000000 nop