Difference between revisions of "Call Math Skill Ability Loading Routine"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 00181f14: 27bdffe8 addiu r29,r29,0xffe8 00181f18: afbf0010 sw r31,0x0010(r29) 00181f1c: 30a500ff andi r5,r5,0x00ff 00181f20: 0c0607ce jal 0x001...")
 
Line 1: Line 1:
 
<font face='Courier New'>
 
<font face='Courier New'>
 +
Math skill ability loading routine 181f34: [[00181f14 - 00181f34]]
 +
 +
001810d4: [[Load unit Data]]
 +
001817c0: [[Load ability data for skillset]]
 
   
 
   
00181f14: 27bdffe8 addiu r29,r29,0xffe8
 
00181f18: afbf0010 sw r31,0x0010(r29)
 
00181f1c: 30a500ff andi r5,r5,0x00ff
 
00181f20: 0c0607ce jal 0x00181f38
 
00181f24: 3407000f ori r7,r0,0x000f
 
00181f28: 8fbf0010 lw r31,0x0010(r29)
 
00181f2c: 27bd0018 addiu r29,r29,0x0018
 
00181f30: 03e00008 jr r31
 
 
  00181f34: 00000000 nop
 
  00181f34: 00000000 nop
</font>
+
00181f38: 27bdff40 addiu r29,r29,0xff40
 +
00181f3c: afb300b4 sw r19,0x00b4(r29) Store 0x0 onto Stack
 +
00181f40: 00809821 addu r19,r4,r0
 +
00181f44: afb000a8 sw r16,0x00a8(r29) Store 0x0 onto Stack
 +
00181f48: 00c08021 addu r16,r6,r0
 +
00181f4c: afb200b0 sw r18,0x00b0(r29) Store 0x0 onto Stack
 +
00181f50: 00009021 addu r18,r0,r0
 +
00181f54: afb100ac sw r17,0x00ac(r29) Store 0x0 onto Stack
 +
00181f58: 00a08821 addu r17,r5,r0
 +
00181f5c: afb400b8 sw r20,0x00b8(r29) Store 0x0 onto Stack
 +
00181f60: afbf00bc sw r31,0x00bc(r29) Store 0x0 onto Stack
 +
00181f64: 0c060435 jal 0x001810d4 [[Load unit Data]]
 +
00181f68: 00e0a021 addu r20,r7,r0
 +
00181f6c: 10400005 beq r2,r0,0x00181f84 Branch if unit data not found
 +
00181f70: 322300ff andi r3,r17,0x00ff Mask second byte
 +
00181f74: 34020015 ori r2,r0,0x0015 r2 = (0x15) 21
 +
00181f78: 10620004 beq r3,r2,0x00181f8c Branch if skillset = math skill
 +
00181f7c: 2402ffff addiu r2,r0,0xffff
 +
00181f80: a6020000 sh r2,0x0000(r16) store ??? = 0xffff
 +
00181f84: 08060811 j 0x00182044
 +
00181f88: 00001021 addu r2,r0,r0
 +
00181f8c: 02602021 addu r4,r19,r0
 +
00181f90: 27a20060 addiu r2,r29,0x0060
 +
00181f94: afa20010 sw r2,0x0010(r29) Store 0x60 onto Stack
 +
00181f98: 27a20078 addiu r2,r29,0x0078
 +
00181f9c: afa20018 sw r2,0x0018(r29) Store 0x78 onto Stack
 +
00181fa0: 27a20090 addiu r2,r29,0x0090
 +
00181fa4: 34050015 ori r5,r0,0x0015 r5 = (0x15) 21
 +
00181fa8: 27a60020 addiu r6,r29,0x0020
 +
00181fac: 27a70048 addiu r7,r29,0x0048
 +
00181fb0: afa00014 sw r0,0x0014(r29) Store 0x0 onto Stack
 +
00181fb4: 0c0605f0 jal 0x001817c0 [[Load ability data for skillset]]
 +
00181fb8: afa2001c sw r2,0x001c(r29) Store 0x90 onto Stack
 +
00181fbc: 00403021 addu r6,r2,r0
 +
00181fc0: 10c0fff0 beq r6,r0,0x00181f84 Branch if 0x90 == 0x0
 +
00181fc4: 0246102a slt r2,r18,r6 Set if 0 < 0x90
 +
00181fc8: 1040001b beq r2,r0,0x00182038 Branch if not
 +
00181fcc: 00002821 addu r5,r0,r0
 +
00181fd0: 3408fe62 ori r8,r0,0xfe62 r8 = -0x19e
 +
00181fd4: 3c078006 lui r7,0x8006
 +
00181fd8: 24e70eb6 addiu r7,r7,0x0eb6 80060eb6
 +
00181fdc: 27a40020 addiu r4,r29,0x0020
 +
00181fe0: 94830000 lhu r3,0x0000(r4) Load Ability ID
 +
00181fe4: 00000000 nop
 +
00181fe8: 00681021 addu r2,r3,r8 ability ID - 0x19e
 +
00181fec: 3042ffff andi r2,r2,0xffff r2 = FE62 (65122)
 +
00181ff0: 2c420008 sltiu r2,r2,0x0008 Set if not a math skill ability
 +
00181ff4: 1040000c beq r2,r0,0x00182028 Branch if not
 +
00181ff8: 24840002 addiu r4,r4,0x0002
 +
00181ffc: 00031400 sll r2,r3,0x10 Shift left 2 bytes(*0x10000) (*65536)
 +
00182000: 00021403 sra r2,r2,0x10 r2 =  * 0x10 (16)
 +
00182004: 00471021 addu r2,r2,r7
 +
00182008: 90420000 lbu r2,0x0000(r2) Load Range
 +
0018200c: 00000000 nop
 +
00182010: 00541024 and r2,r2,r20 0x0 & Range
 +
00182014: 10400004 beq r2,r0,0x00182028 Branch if 0x0 & Range == 0x0
 +
00182018: 00000000 nop
 +
0018201c: a6030000 sh r3,0x0000(r16) Store  into 0x0
 +
00182020: 26100002 addiu r16,r16,0x0002
 +
00182024: 26520001 addiu r18,r18,0x0001
 +
00182028: 24a50001 addiu r5,r5,0x0001
 +
0018202c: 00a6102a slt r2,r5,r6 Set if 0x1 < 0x90
 +
00182030: 1440ffeb bne r2,r0,0x00181fe0 Branch if so
 +
00182034: 00000000 nop
 +
00182038: 2402ffff addiu r2,r0,0xffff
 +
0018203c: a6020000 sh r2,0x0000(r16) Store -0x10001 into 0x2
 +
00182040: 02401021 addu r2,r18,r0
 +
00182044: 8fbf00bc lw r31,0x00bc(r29) Load Stack + 0xBC
 +
00182048: 8fb400b8 lw r20,0x00b8(r29) Load Stack + 0xB8
 +
0018204c: 8fb300b4 lw r19,0x00b4(r29) Load Stack + 0xB4
 +
00182050: 8fb200b0 lw r18,0x00b0(r29) Load Stack + 0xB0
 +
00182054: 8fb100ac lw r17,0x00ac(r29) Load Stack + 0xAC
 +
00182058: 8fb000a8 lw r16,0x00a8(r29) Load Stack + 0xA8
 +
0018205c: 27bd00c0 addiu r29,r29,0x00c0
 +
00182060: 03e00008 jr r31 Jump to Address
 +
00182064: 00000000 nop
 +
 +
</font>

Revision as of 00:49, 14 February 2015

Math skill ability loading routine 181f34: 00181f14 - 00181f34

	001810d4: Load unit Data
	001817c0: Load ability data for skillset

00181f34: 00000000 nop
00181f38: 27bdff40 addiu r29,r29,0xff40			
00181f3c: afb300b4 sw r19,0x00b4(r29)			Store 0x0 onto Stack
00181f40: 00809821 addu r19,r4,r0
00181f44: afb000a8 sw r16,0x00a8(r29)			Store 0x0 onto Stack
00181f48: 00c08021 addu r16,r6,r0
00181f4c: afb200b0 sw r18,0x00b0(r29)			Store 0x0 onto Stack
00181f50: 00009021 addu r18,r0,r0
00181f54: afb100ac sw r17,0x00ac(r29)			Store 0x0 onto Stack
00181f58: 00a08821 addu r17,r5,r0
00181f5c: afb400b8 sw r20,0x00b8(r29)			Store 0x0 onto Stack
00181f60: afbf00bc sw r31,0x00bc(r29)			Store 0x0 onto Stack
00181f64: 0c060435 jal 0x001810d4			Load unit Data
00181f68: 00e0a021 addu r20,r7,r0
00181f6c: 10400005 beq r2,r0,0x00181f84			Branch if unit data not found
00181f70: 322300ff andi r3,r17,0x00ff			Mask second byte
00181f74: 34020015 ori r2,r0,0x0015			r2 = (0x15) 21
00181f78: 10620004 beq r3,r2,0x00181f8c			Branch if skillset = math skill
00181f7c: 2402ffff addiu r2,r0,0xffff
00181f80: a6020000 sh r2,0x0000(r16)			store ??? = 0xffff
00181f84: 08060811 j 0x00182044			
00181f88: 00001021 addu r2,r0,r0
00181f8c: 02602021 addu r4,r19,r0
00181f90: 27a20060 addiu r2,r29,0x0060
00181f94: afa20010 sw r2,0x0010(r29)			Store 0x60 onto Stack
00181f98: 27a20078 addiu r2,r29,0x0078
00181f9c: afa20018 sw r2,0x0018(r29)			Store 0x78 onto Stack
00181fa0: 27a20090 addiu r2,r29,0x0090
00181fa4: 34050015 ori r5,r0,0x0015			r5 = (0x15) 21
00181fa8: 27a60020 addiu r6,r29,0x0020
00181fac: 27a70048 addiu r7,r29,0x0048
00181fb0: afa00014 sw r0,0x0014(r29)			Store 0x0 onto Stack
00181fb4: 0c0605f0 jal 0x001817c0			Load ability data for skillset
00181fb8: afa2001c sw r2,0x001c(r29)			Store 0x90 onto Stack
00181fbc: 00403021 addu r6,r2,r0
00181fc0: 10c0fff0 beq r6,r0,0x00181f84			Branch if 0x90 == 0x0
00181fc4: 0246102a slt r2,r18,r6			Set if 0 < 0x90
00181fc8: 1040001b beq r2,r0,0x00182038			Branch if not
00181fcc: 00002821 addu r5,r0,r0
00181fd0: 3408fe62 ori r8,r0,0xfe62			r8 = -0x19e
00181fd4: 3c078006 lui r7,0x8006			
00181fd8: 24e70eb6 addiu r7,r7,0x0eb6			80060eb6
00181fdc: 27a40020 addiu r4,r29,0x0020
00181fe0: 94830000 lhu r3,0x0000(r4)			Load Ability ID
00181fe4: 00000000 nop
00181fe8: 00681021 addu r2,r3,r8			ability ID - 0x19e
00181fec: 3042ffff andi r2,r2,0xffff			r2 = FE62 (65122) 
00181ff0: 2c420008 sltiu r2,r2,0x0008			Set if not a math skill ability
00181ff4: 1040000c beq r2,r0,0x00182028			Branch if not
00181ff8: 24840002 addiu r4,r4,0x0002
00181ffc: 00031400 sll r2,r3,0x10			Shift left 2 bytes(*0x10000) (*65536)
00182000: 00021403 sra r2,r2,0x10			r2 =  * 0x10 (16)
00182004: 00471021 addu r2,r2,r7
00182008: 90420000 lbu r2,0x0000(r2)			Load Range
0018200c: 00000000 nop
00182010: 00541024 and r2,r2,r20			0x0 & Range
00182014: 10400004 beq r2,r0,0x00182028			Branch if 0x0 & Range == 0x0
00182018: 00000000 nop
0018201c: a6030000 sh r3,0x0000(r16)			Store  into 0x0
00182020: 26100002 addiu r16,r16,0x0002
00182024: 26520001 addiu r18,r18,0x0001
00182028: 24a50001 addiu r5,r5,0x0001
0018202c: 00a6102a slt r2,r5,r6			Set if 0x1 < 0x90
00182030: 1440ffeb bne r2,r0,0x00181fe0			Branch if so
00182034: 00000000 nop
00182038: 2402ffff addiu r2,r0,0xffff
0018203c: a6020000 sh r2,0x0000(r16)			Store -0x10001 into 0x2
00182040: 02401021 addu r2,r18,r0
00182044: 8fbf00bc lw r31,0x00bc(r29)			Load Stack + 0xBC
00182048: 8fb400b8 lw r20,0x00b8(r29)			Load Stack + 0xB8
0018204c: 8fb300b4 lw r19,0x00b4(r29)			Load Stack + 0xB4
00182050: 8fb200b0 lw r18,0x00b0(r29)			Load Stack + 0xB0
00182054: 8fb100ac lw r17,0x00ac(r29)			Load Stack + 0xAC
00182058: 8fb000a8 lw r16,0x00a8(r29)			Load Stack + 0xA8
0018205c: 27bd00c0 addiu r29,r29,0x00c0			
00182060: 03e00008 jr r31			Jump to Address
00182064: 00000000 nop