Difference between revisions of "Walk To Event Instruction"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " # ROUTINE: WalkTo Event Instruction # Parameters: # r4 = (params) (Pointer to parameters for this instruction) 8013e5c0: 27bdffd0 addiu r29,r29,-0x0030...")
 
 
Line 10: Line 10:
 
  8013e5d4: afb00020 sw r16,0x0020(r29)
 
  8013e5d4: afb00020 sw r16,0x0020(r29)
 
  8013e5d8: 00021400 sll r2,r2,0x10                   
 
  8013e5d8: 00021400 sll r2,r2,0x10                   
  8013e5dc: 0c04cc56 jal 0x80133158                  #  MiscID = [[Get Misc ID]] (UnitID);
+
  8013e5dc: 0c04cc56 jal 0x80133158                  #  MiscID = [[Get misc ID]] (UnitID);
 
  8013e5e0: 00022403 sra r4,r2,0x10                  #  UnitID                   
 
  8013e5e0: 00022403 sra r4,r2,0x10                  #  UnitID                   
 
  8013e5e4: 00408021 addu r16,r2,r0                  #  MiscID
 
  8013e5e4: 00408021 addu r16,r2,r0                  #  MiscID

Latest revision as of 00:33, 8 January 2017

#   ROUTINE: WalkTo Event Instruction
#       Parameters:
#           r4 = (params) (Pointer to parameters for this instruction)

8013e5c0: 27bdffd0 addiu r29,r29,-0x0030
8013e5c4: afb10024 sw r17,0x0024(r29)               
8013e5c8: 00808821 addu r17,r4,r0                   #   params
8013e5cc: afbf0028 sw r31,0x0028(r29)
8013e5d0: 0c05181e jal 0x80146078                   #   UnitID = Load Halfword (&params.UnitID);
8013e5d4: afb00020 sw r16,0x0020(r29)
8013e5d8: 00021400 sll r2,r2,0x10                   
8013e5dc: 0c04cc56 jal 0x80133158                   #   MiscID = Get misc ID (UnitID);
8013e5e0: 00022403 sra r4,r2,0x10                   #   UnitID                   
8013e5e4: 00408021 addu r16,r2,r0                   #   MiscID
8013e5e8: 340207d0 ori r2,r0,0x07d0                 #   2000
8013e5ec: 12020015 beq r16,r2,0x8013e644            #   if (MiscID == 2000), return
8013e5f0: 26240005 addiu r4,r17,0x0005              #   &params.Speed
8013e5f4: 92220002 lbu r2,0x0002(r17)               #   params.X
8013e5f8: 00000000 nop
8013e5fc: a7a20018 sh r2,0x0018(r29)                #   coords[0] = params.X
8013e600: 92220003 lbu r2,0x0003(r17)               #   params.Y
8013e604: 00000000 nop
8013e608: a7a2001c sh r2,0x001c(r29)                #   coords[2] = params.Y
8013e60c: 92220004 lbu r2,0x0004(r17)               #   params.HigherElevation
8013e610: 0c05181e jal 0x80146078                   #   Speed = Load Halfword (&params.Speed);
8013e614: a7a2001a sh r2,0x001a(r29)                #   coords[1] = params.HigherElevation
8013e618: 02002021 addu r4,r16,r0                   #   MiscID
8013e61c: 00021400 sll r2,r2,0x10
8013e620: 92260007 lbu r6,0x0007(r17)               #   params.ElevationFlag
8013e624: 00021403 sra r2,r2,0x10
8013e628: afa20010 sw r2,0x0010(r29)                #   Speed
8013e62c: 34020100 ori r2,r0,0x0100                 #   256
8013e630: 27a50018 addiu r5,r29,0x0018              #   coords
8013e634: 34070003 ori r7,r0,0x0003                 #   3
8013e638: 00063200 sll r6,r6,0x08                   #   params.ElevationFlag * 256
8013e63c: 0c023199 jal 0x8008c664                   #   Walk To (MiscID, coords, ElevationAddend, 3, Speed);
8013e640: 00463023 subu r6,r2,r6                    #   ElevationAddend = 256 - (params.ElevationFlag * 256)
8013e644: 8fbf0028 lw r31,0x0028(r29)
8013e648: 8fb10024 lw r17,0x0024(r29)
8013e64c: 8fb00020 lw r16,0x0020(r29)
8013e650: 27bd0030 addiu r29,r29,0x0030
8013e654: 03e00008 jr r31
8013e658: 00000000 nop