Difference between revisions of "Call Inner Subroutine"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " # ROUTINE: CALL INNER SUBROUTINE # This routine acts as a wrapper for a call to another routine, and may use a different stack pointer, but doesn't run any extra cod...")
 
Line 54: Line 54:
 
  0014cf50: 03e00008 jr r31                          #  Return (exit the routine)
 
  0014cf50: 03e00008 jr r31                          #  Return (exit the routine)
 
  0014cf54: 00000000 nop
 
  0014cf54: 00000000 nop
 +
 +
 +
== Call Locations ==
 +
 +
00134de8: [[Display Projected Action Effect]] (Inner call is to [[Find Action Highest Order Status Effect]])
 +
00135148: [[Display Projected Action Effect]] (Inner call is to [[Find Action Highest Order Status Effect]])

Revision as of 12:25, 23 September 2016

#   ROUTINE: CALL INNER SUBROUTINE
#       This routine acts as a wrapper for a call to another routine, and may use a different stack pointer, but doesn't run any extra code...
#       This should essentially be the same as directly calling the specified routine. 
#       Perhaps there is some purpose to this routine related to debugging, or perhaps it contained some debugging code while in development?
#
#       Parameters:
#           Parameters for inner subroutine: r4 - r7 with additional parameters on the stack, as usual
#           RAM_WORD[0x80173ca8] = [Address of subroutine to call]
#
#       Returns:
#           r2 = [Result of inner subroutine]

0014ceb4: 3c018015 lui r1,0x8015
0014ceb8: 00200821 addu r1,r1,r0
0014cebc: ac3fcf5c sw r31,-0x30a4(r1)               #   Save return address to 0x8014cf5c
0014cec0: 3c018017 lui r1,0x8017
0014cec4: 00200821 addu r1,r1,r0
0014cec8: 8c284038 lw r8,0x4038(r1)                 #   RAM_WORD[0x80174038]
0014cecc: 00000000 nop
0014ced0: 11000015 beq r8,r0,0x0014cf28             #   if (RAM_WORD[0x80174038] != 0) {
0014ced4: 00000000 nop
0014ced8: 3c018016 lui r1,0x8016
0014cedc: 00200821 addu r1,r1,r0
0014cee0: 8c285f98 lw r8,0x5f98(r1)                 #       RAM_WORD[0x80165f98]
0014cee4: 00000000 nop
0014cee8: 8d08003c lw r8,0x003c(r8)                 #       [New stack pointer] = RAM_WORD[RAM_WORD[0x80165f98] + 0x3c]
0014ceec: 00000000 nop

0014cef0: 2108fff0 addi r8,r8,-0x0010               
0014cef4: ad1d0004 sw r29,0x0004(r8)                #       Save stack pointer
0014cef8: ad1f0008 sw r31,0x0008(r8)
0014cefc: 0100e821 addu r29,r8,r0                   #       [Stack pointer] = [New stack pointer]
0014cf00: 3c018017 lui r1,0x8017
0014cf04: 00200821 addu r1,r1,r0
0014cf08: 8c283ca8 lw r8,0x3ca8(r1)                 #       RAM_WORD[0x80173ca8]
0014cf0c: 00000000 nop
0014cf10: 0100f809 jalr r8,r31                      #       ROUTINE: Call subroutine at RAM_WORD[0x80173ca8]
0014cf14: 00000000 nop
0014cf18: 8fbf0008 lw r31,0x0008(r29)
0014cf1c: 8fbd0004 lw r29,0x0004(r29)               #       Load stack pointer back
0014cf20: 03e00008 jr r31                           #       Return (exit the routine)
0014cf24: 00000000 nop
                                                    #   }
0014cf28: 3c018017 lui r1,0x8017
0014cf2c: 00200821 addu r1,r1,r0
0014cf30: 8c283ca8 lw r8,0x3ca8(r1)                 #   RAM_WORD[0x80173ca8]
0014cf34: 00000000 nop
0014cf38: 0100f809 jalr r8,r31                      #   ROUTINE: Call routine at RAM_WORD[0x80173ca8]
0014cf3c: 00000000 nop
0014cf40: 3c018015 lui r1,0x8015
0014cf44: 00200821 addu r1,r1,r0
0014cf48: 8c3fcf5c lw r31,-0x30a4(r1)               #   Load return address from 0x8014cf5c
0014cf4c: 00000000 nop
0014cf50: 03e00008 jr r31                           #   Return (exit the routine)
0014cf54: 00000000 nop


Call Locations

00134de8: Display Projected Action Effect (Inner call is to Find Action Highest Order Status Effect)
00135148: Display Projected Action Effect (Inner call is to Find Action Highest Order Status Effect)