Difference between revisions of "System function setup routine"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "0x0a - level up event")
 
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
0x0a - level up event
+
Parameters:
 +
r4 = 0x05 (Run spell quote routine, skip routine at 141b0c)
 +
  = 0x06 (Run routine at 141b0c with original parameter values)
 +
  = 0x07 (Clear r5, r7, and saved stack value, re-set r4 = 7?, then run routine at 141b0c)
 +
  = 0x08 (Run routine at 141b0c with original parameter values)
 +
  = else; Run routine at 141b0c with original parameter values
 +
 +
r5 = ? (see notes)
 +
r6 = some unit's ID? (see notes)
 +
r7 = ? (see notes)
 +
 +
 +
 +
001419b8: 27bdffd0 addiu r29,r29,0xffd0
 +
001419bc: afb00018 sw r16,0x0018(r29)
 +
001419c0: 00808021 addu r16,r4,r0 #r16 = PV1
 +
001419c4: afb20020 sw r18,0x0020(r29)
 +
001419c8: 00a09021 addu r18,r5,r0 #r18 = PV2
 +
001419cc: afb1001c sw r17,0x001c(r29)
 +
001419d0: 00c08821 addu r17,r6,r0 #r17 = PV3
 +
001419d4: afb30024 sw r19,0x0024(r29)
 +
001419d8: 00e09821 addu r19,r7,r0 #r19 = PV4
 +
001419dc: afb40028 sw r20,0x0028(r29)
 +
001419e0: 8fb40040 lw r20,0x0040(r29) #Load previously saved stack value?
 +
001419e4: 34020008 ori r2,r0,0x0008 #r2  = 0x08
 +
001419e8: 12020018 beq r16,r2,0x00141a4c #Branch if PV1 = 8
 +
001419ec: afbf002c sw r31,0x002c(r29)
 +
001419f0: 34020006 ori r2,r0,0x0006 #r2  = 0x06
 +
001419f4: 12020016 beq r16,r2,0x00141a50 #Branch if PV1 = 6
 +
001419f8: 02002021 addu r4,r16,r0 #Restore original parameter value
 +
001419fc: 0c0233b4 jal 0x0008ced0 #[[0008cdf0 - 0008cf10]] - Find Unit's Misc Data Pointer (+0x15c)
 +
00141a00: 02202021 addu r4,r17,r0 #r4  = Unit's ID
 +
00141a04: 00401821 addu r3,r2,r0 #r3  = Unit's Misc Data Pointer (+0x15c)
 +
00141a08: 34020005 ori r2,r0,0x0005 #r2  = 0x05
 +
00141a0c: 16020007 bne r16,r2,0x00141a2c #Branch if PV1 ≠ 5
 +
00141a10: 34020007 ori r2,r0,0x0007 #r2  = 0x07
 +
00141a14: 00602021 addu r4,r3,r0 #r4  = Unit's Misc Data Pointer (+0x15c)
 +
00141a18: 02202821 addu r5,r17,r0 #r5  = PV3 (unit ID)
 +
00141a1c: 0c0505d7 jal 0x0014175c #[[Spell Quote determination]] routine
 +
00141a20: 02803021 addu r6,r20,r0 #r6  = previously saved stack value?
 +
00141a24: 0805069a j 0x00141a68 #Jump to End
 +
00141a28: 00000000 nop
 +
 +
00141a2c: 16020008 bne r16,r2,0x00141a50 #Branch if PV1 ≠ 7
 +
00141a30: 02002021 addu r4,r16,r0 #Restore original parameter value
 +
00141a34: 34040007 ori r4,r0,0x0007 #r4  = 0x07
 +
00141a38: 00002821 addu r5,r0,r0 #r5  = 0x00
 +
00141a3c: 02203021 addu r6,r17,r0 #Restore original parameter value
 +
00141a40: 00003821 addu r7,r0,r0 #r7  = 0x00
 +
00141a44: 08050698 j 0x00141a60
 +
00141a48: afa00010 sw r0,0x0010(r29) #Clear previously saved stack value?
 +
 +
00141a4c: 02002021 addu r4,r16,r0 #Restore original parameter value
 +
00141a50: 02402821 addu r5,r18,r0 #Restore original parameter value
 +
00141a54: 02203021 addu r6,r17,r0 #Restore original parameter value
 +
00141a58: 02603821 addu r7,r19,r0 #Restore original parameter value
 +
00141a5c: afb40010 sw r20,0x0010(r29) #Save previously saved stack value?
 +
 +
00141a60: 0c0506c3 jal 0x00141b0c #[[Routine at 141b0c]]
 +
00141a64: afa30014 sw r3,0x0014(r29) #Save r3 to stack
 +
 +
End:
 +
00141a68: 8fbf002c lw r31,0x002c(r29)
 +
00141a6c: 8fb40028 lw r20,0x0028(r29)
 +
00141a70: 8fb30024 lw r19,0x0024(r29)
 +
00141a74: 8fb20020 lw r18,0x0020(r29)
 +
00141a78: 8fb1001c lw r17,0x001c(r29)
 +
00141a7c: 8fb00018 lw r16,0x0018(r29)
 +
00141a80: 27bd0030 addiu r29,r29,0x0030
 +
00141a84: 03e00008 jr r31
 +
00141a88: 00000000 nop
 +
 +
 +
==Notes==
 +
 +
r4 = 0x01 - ability range? (ability selected) (Move Selected) - free cursor/selection message?
 +
*r5 = 1(range=3) or 0(range!=3) | r6 = ENTD ID | r7 = 0 -
 +
 
 +
r4 = 0x04 - movement RSM display? also ability range? (Execute window triggered)
 +
 
 +
r4 = 0x08 - focus on unit and open menu? (triggered when X is hit on empty panel)
 +
*r5 = 0 | r6 = unit ID | r7 = 0 | 0x01 stored on stack - set active turn
 +
*r5 = 1 | r6 = unit ID | r7 = 0 | 0x01 stored on stack - ability cast (2)
 +
*r5 = 2 | r6 = unit ID | r7 = 0 | 0x01 stored on stack - ability cast (1) [validation?]
 +
 
 +
r4 = 0x0a - job level up/level up event
 +
*r6 = attacker unit ID | r7 = defender unit ID | store 01 in 0x10(r29)
 +
*r6 = attacker unit ID | r7 = 0 | store 01 in 0x10(r29)
 +
*store 00 in 0x10(r29) - display fail?
 +
*r5 = 0x183f - level up event
 +
*r5 = 0x183e - job level up event
 +
*r5 = 0x1838 -
 +
*r5 = 0x1828 -
 +
*r5 = 0x1800 + post action message (for all post action messages)
 +
 
 +
r4 = 0x0b - learn on hit
 +
*r5 = learned ability ID? | r6 = ENTD ID | r7 = 00 | control check stored at 0x10(r29)
 +
 
 +
r4 = 0x0c - Post movement display - treasure/crystal
 +
*r5 = 0 | r6 = ENTD ID | 0 stored at 0x10(r29) | r7 = 0 - prep? and status changes
 +
*r5=r6= ENTD ID | 1 stored at 0x10(r29) | r7 = 0 - player unit or controlled unit display
 +
*r5=r6= ENTD ID | 0 stored at 0x10(r29) | r7 = 0 - Enemy units display
 +
 
 +
r4 = 0x0e - Trap
 +
*r5 = type of trap | r6 = unit ENTD ID | r7 = 0 | 1 stored at 0x10(r29)
 +
 
 +
r4 = 0x0f - move find item
 +
*r5 = item to display | r6 = unit ENTD ID | r7 = 0 | 1 stored at 0x10(r29) - player unit
 +
*r5 = item to display | r6 = unit ENTD ID | r7 = 0 | 0 stored at 0x10(r29) - enemy unit
 +
 
 +
r4 = 0x11 - set attack type stuff
 +
*r5 = attack type flags | r6 = unit ID | r7 = broken/stolen item | 1 stored on stack
 +
 
 +
 
 +
==Return Locations==
 +
 
 +
00073514: [[000734cc - 00073634]]
 +
000735e0: [[000734cc - 00073634]]

Latest revision as of 11:49, 13 May 2023

Parameters:
	r4 = 0x05 (Run spell quote routine, skip routine at 141b0c)
	   = 0x06 (Run routine at 141b0c with original parameter values)
	   = 0x07 (Clear r5, r7, and saved stack value, re-set r4 = 7?, then run routine at 141b0c)
	   = 0x08 (Run routine at 141b0c with original parameter values)
	   = else; Run routine at 141b0c with original parameter values

	r5 = ? (see notes)
	r6 = some unit's ID? (see notes)
	r7 = ? (see notes)



001419b8: 27bdffd0 addiu r29,r29,0xffd0
001419bc: afb00018 sw r16,0x0018(r29)
001419c0: 00808021 addu r16,r4,r0		#r16 = PV1
001419c4: afb20020 sw r18,0x0020(r29)
001419c8: 00a09021 addu r18,r5,r0		#r18 = PV2
001419cc: afb1001c sw r17,0x001c(r29)
001419d0: 00c08821 addu r17,r6,r0		#r17 = PV3
001419d4: afb30024 sw r19,0x0024(r29)
001419d8: 00e09821 addu r19,r7,r0		#r19 = PV4
001419dc: afb40028 sw r20,0x0028(r29)
001419e0: 8fb40040 lw r20,0x0040(r29)		#Load previously saved stack value?
001419e4: 34020008 ori r2,r0,0x0008		#r2  = 0x08
001419e8: 12020018 beq r16,r2,0x00141a4c		#Branch if PV1 = 8
001419ec: afbf002c sw r31,0x002c(r29)
001419f0: 34020006 ori r2,r0,0x0006		#r2  = 0x06
001419f4: 12020016 beq r16,r2,0x00141a50		#Branch if PV1 = 6
001419f8: 02002021 addu r4,r16,r0		#Restore original parameter value
001419fc: 0c0233b4 jal 0x0008ced0			#0008cdf0 - 0008cf10 - Find Unit's Misc Data Pointer (+0x15c)
00141a00: 02202021 addu r4,r17,r0		#r4  = Unit's ID
00141a04: 00401821 addu r3,r2,r0		#r3  = Unit's Misc Data Pointer (+0x15c)
00141a08: 34020005 ori r2,r0,0x0005		#r2  = 0x05
00141a0c: 16020007 bne r16,r2,0x00141a2c		#Branch if PV1 ≠ 5
00141a10: 34020007 ori r2,r0,0x0007		#r2  = 0x07
00141a14: 00602021 addu r4,r3,r0		#r4  = Unit's Misc Data Pointer (+0x15c)
00141a18: 02202821 addu r5,r17,r0		#r5  = PV3 (unit ID)
00141a1c: 0c0505d7 jal 0x0014175c			#Spell Quote determination routine
00141a20: 02803021 addu r6,r20,r0		#r6  = previously saved stack value?
00141a24: 0805069a j 0x00141a68				#Jump to End
00141a28: 00000000 nop

00141a2c: 16020008 bne r16,r2,0x00141a50		#Branch if PV1 ≠ 7
00141a30: 02002021 addu r4,r16,r0		#Restore original parameter value
00141a34: 34040007 ori r4,r0,0x0007		#r4  = 0x07
00141a38: 00002821 addu r5,r0,r0		#r5  = 0x00
00141a3c: 02203021 addu r6,r17,r0		#Restore original parameter value
00141a40: 00003821 addu r7,r0,r0		#r7  = 0x00
00141a44: 08050698 j 0x00141a60
00141a48: afa00010 sw r0,0x0010(r29)		#Clear previously saved stack value?

00141a4c: 02002021 addu r4,r16,r0		#Restore original parameter value
00141a50: 02402821 addu r5,r18,r0		#Restore original parameter value
00141a54: 02203021 addu r6,r17,r0		#Restore original parameter value
00141a58: 02603821 addu r7,r19,r0		#Restore original parameter value
00141a5c: afb40010 sw r20,0x0010(r29)		#Save previously saved stack value?

00141a60: 0c0506c3 jal 0x00141b0c			#Routine at 141b0c
00141a64: afa30014 sw r3,0x0014(r29)		#Save r3 to stack

End:
00141a68: 8fbf002c lw r31,0x002c(r29)
00141a6c: 8fb40028 lw r20,0x0028(r29)
00141a70: 8fb30024 lw r19,0x0024(r29)
00141a74: 8fb20020 lw r18,0x0020(r29)
00141a78: 8fb1001c lw r17,0x001c(r29)
00141a7c: 8fb00018 lw r16,0x0018(r29)
00141a80: 27bd0030 addiu r29,r29,0x0030
00141a84: 03e00008 jr r31
00141a88: 00000000 nop


Notes

r4 = 0x01 - ability range? (ability selected) (Move Selected) - free cursor/selection message?
*r5 = 1(range=3) or 0(range!=3) | r6 = ENTD ID | r7 = 0 - 
r4 = 0x04 - movement RSM display? also ability range? (Execute window triggered)
r4 = 0x08 - focus on unit and open menu? (triggered when X is hit on empty panel)
*r5 = 0 | r6 = unit ID | r7 = 0 | 0x01 stored on stack - set active turn
*r5 = 1 | r6 = unit ID | r7 = 0 | 0x01 stored on stack - ability cast (2)
*r5 = 2 | r6 = unit ID | r7 = 0 | 0x01 stored on stack - ability cast (1) [validation?]
r4 = 0x0a - job level up/level up event
*r6 = attacker unit ID | r7 = defender unit ID | store 01 in 0x10(r29)
*r6 = attacker unit ID | r7 = 0 | store 01 in 0x10(r29)
*store 00 in 0x10(r29) - display fail?
*r5 = 0x183f - level up event
*r5 = 0x183e - job level up event
*r5 = 0x1838 -
*r5 = 0x1828 -
*r5 = 0x1800 + post action message (for all post action messages)
r4 = 0x0b - learn on hit
*r5 = learned ability ID? | r6 = ENTD ID | r7 = 00 | control check stored at 0x10(r29)
r4 = 0x0c - Post movement display - treasure/crystal
*r5 = 0 | r6 = ENTD ID | 0 stored at 0x10(r29) | r7 = 0 - prep? and status changes
*r5=r6= ENTD ID | 1 stored at 0x10(r29) | r7 = 0 - player unit or controlled unit display
*r5=r6= ENTD ID | 0 stored at 0x10(r29) | r7 = 0 - Enemy units display
r4 = 0x0e - Trap
*r5 = type of trap | r6 = unit ENTD ID | r7 = 0 | 1 stored at 0x10(r29)
r4 = 0x0f - move find item
*r5 = item to display | r6 = unit ENTD ID | r7 = 0 | 1 stored at 0x10(r29) - player unit
*r5 = item to display | r6 = unit ENTD ID | r7 = 0 | 0 stored at 0x10(r29) - enemy unit
r4 = 0x11 - set attack type stuff
*r5 = attack type flags | r6 = unit ID | r7 = broken/stolen item | 1 stored on stack


Return Locations

00073514: 000734cc - 00073634
000735e0: 000734cc - 00073634