Difference between revisions of "Monster skill, frog attack ability loading"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 
  Monster skill, frog ability loading
 
  Monster skill, frog ability loading
  001822cc: 27bdffc8 addiu r29,r29,0xffc8
+
  001822cc: 27bdffc8 addiu r29,r29,0xffc8 - 0x38
 
  001822d0: afb20020 sw r18,0x0020(r29)
 
  001822d0: afb20020 sw r18,0x0020(r29)
  001822d4: 8fb20048 lw r18,0x0048(r29)
+
  001822d4: 8fb20048 lw r18,0x0048(r29) Raw CT pointer from stack
 
  001822d8: afb1001c sw r17,0x001c(r29)
 
  001822d8: afb1001c sw r17,0x001c(r29)
  001822dc: 00c08821 addu r17,r6,r0
+
  001822dc: 00c08821 addu r17,r6,r0 Ability ID list
 
  001822e0: afb40028 sw r20,0x0028(r29)
 
  001822e0: afb40028 sw r20,0x0028(r29)
  001822e4: 34140003 ori r20,r0,0x0003
+
  001822e4: 34140003 ori r20,r0,0x0003 No. Abilities in skillset (default 3)
 
  001822e8: afb30024 sw r19,0x0024(r29)
 
  001822e8: afb30024 sw r19,0x0024(r29)
 
  001822ec: 00009821 addu r19,r0,r0
 
  001822ec: 00009821 addu r19,r0,r0
 
  001822f0: afb5002c sw r21,0x002c(r29)
 
  001822f0: afb5002c sw r21,0x002c(r29)
  001822f4: 00a0a821 addu r21,r5,r0
+
  001822f4: 00a0a821 addu r21,r5,r0 r21 = skillset ID
 
  001822f8: afbf0030 sw r31,0x0030(r29)
 
  001822f8: afbf0030 sw r31,0x0030(r29)
 
  001822fc: 0c060435 jal 0x 001810d4 get unit data
 
  001822fc: 0c060435 jal 0x 001810d4 get unit data
  00182300: afb0 0018 sw r16,0x 0018(r29)
+
  00182300: afb00018 sw r16,0x 0018(r29)
 
  00182304: 00402021 addu r4,r2,r0
 
  00182304: 00402021 addu r4,r2,r0
  00182308: 1080003f beq r4,r0,0x 00182408
+
  00182308: 1080003f beq r4,r0,0x 00182408 branch if unit is invalid
 
  0018230c: 00001021 addu r2,r0,r0
 
  0018230c: 00001021 addu r2,r0,r0
 
   
 
   
  00182310: 9082005a lbu r2,0x005a(r4)
+
  00182310: 9082005a lbu r2,0x005a(r4) load target statuses
 
  00182314: 00000000 nop
 
  00182314: 00000000 nop
 
  00182318: 30420002 andi r2,r2,0x0002
 
  00182318: 30420002 andi r2,r2,0x0002
 
  0018231c: 10400002 beq r2,r0,0x 00182328 branch if not frog
 
  0018231c: 10400002 beq r2,r0,0x 00182328 branch if not frog
 
  00182320: 32a200ff andi r2,r21,0x00ff
 
  00182320: 32a200ff andi r2,r21,0x00ff
  00182324: 34130001 ori r19,r0,0x0001
+
  00182324: 34130001 ori r19,r0,0x0001 set frog register to true
 
   
 
   
 
  00182328: 3c018006 lui r1,0x8006
 
  00182328: 3c018006 lui r1,0x8006
Line 31: Line 31:
 
  00182338: 10620004 beq r3,r2,0x 0018234c branch if not 06 - monster skillset
 
  00182338: 10620004 beq r3,r2,0x 0018234c branch if not 06 - monster skillset
 
  0018233c: 2402ffff addiu r2,r0,0xffff
 
  0018233c: 2402ffff addiu r2,r0,0xffff
  00182340: a6220000 sh r2,0x0000(r17) store 0xff into ??
+
  00182340: a6220000 sh r2,0x0000(r17) store 0xffff into ability ID list (end list if not monster)
 
  00182344: 08060902 j 0x 00182408 jump to end, return r2 = 00
 
  00182344: 08060902 j 0x 00182408 jump to end, return r2 = 00
 
  00182348: 00001021 addu r2,r0,r0
 
  00182348: 00001021 addu r2,r0,r0
Line 38: Line 38:
 
  00182350: 3405016f ori r5,r0,0x016f
 
  00182350: 3405016f ori r5,r0,0x016f
 
  00182354: a6250000 sh r5,0x0000(r17) store ability = 0x16f, frog attack
 
  00182354: a6250000 sh r5,0x0000(r17) store ability = 0x16f, frog attack
  00182358: 26310002 addiu r17,r17,0x0002
+
  00182358: 26310002 addiu r17,r17,0x0002 next ability ID
 
   
 
   
  0018235c: 0c06090c jal 0x 00182430 monster skill check  
+
  0018235c: 0c06090c jal 0x00182430 monster skill check  
 
  00182360: 00000000 nop
 
  00182360: 00000000 nop
  00182364: 10400002 beq r2,r0,0x 00182370
+
  00182364: 10400002 beq r2,r0,0x00182370 branch if not monster skillset (if not beast-master?)
  00182368: 00008021 addu r16,r0,r0
+
  00182368: 00008021 addu r16,r0,r0 r16 = 0
 
   
 
   
  0018236c: 34140004 ori r20,r0,0x0004
+
  0018236c: 34140004 ori r20,r0,0x0004 if monster skillset, 4 abilities available (if beast-master adjacent unit?)
  00182370: 12800025 beq r20,r0,0x 00182408 branch if returned value = 0?
+
  00182370: 12800025 beq r20,r0,0x00182408 end if No. abilities in skillset is 0
  00182374: 32a400ff andi r4,r21,0x00ff
+
  00182374: 32a400ff andi r4,r21,0x00ff r4 = skillset
 
  00182378: 0c01695a jal 0x0005a568 load ability from skillset
 
  00182378: 0c01695a jal 0x0005a568 load ability from skillset
 
  0018237c: 02002821 addu r5,r16,r0
 
  0018237c: 02002821 addu r5,r16,r0
  00182380: 00402021 addu r4,r2,r0
+
  00182380: 00402021 addu r4,r2,r0 r4 = ability
 
  00182384: 12600006 beq r19,r0,0x 001823a0 branch if not frog?
 
  00182384: 12600006 beq r19,r0,0x 001823a0 branch if not frog?
  00182388: 00802821 addu r5,r4,r0
+
  00182388: 00802821 addu r5,r4,r0 r5 = ability
 
   
 
   
 
  0018238c: 00041400 sll r2,r4,0x10
 
  0018238c: 00041400 sll r2,r4,0x10
  00182390: 00021403 sra r2,r2,0x10
+
  00182390: 00021403 sra r2,r2,0x10 r2 = ability
 
  00182394: 3403001d ori r3,r0,0x001d
 
  00182394: 3403001d ori r3,r0,0x001d
  00182398: 14430017 bne r2,r3,0x 001823f8 branch if attack is not frog
+
  00182398: 14430017 bne r2,r3,0x001823f8 branch if attack is not frog? (HUH?? c... can frogs use frog????)
 
  0018239c: 00000000 nop
 
  0018239c: 00000000 nop
 
   
 
   
 
  001823a0: 00041400 sll r2,r4,0x10
 
  001823a0: 00041400 sll r2,r4,0x10
 
  001823a4: 00021c03 sra r3,r2,0x10
 
  001823a4: 00021c03 sra r3,r2,0x10
  001823a8: 10600013 beq r3,r0,0x 001823f8
+
  001823a8: 10600013 beq r3,r0,0x 001823f8 branch if attack is 0 (attack)
 
  001823ac: 2482ffff addiu r2,r4,0xffff
 
  001823ac: 2482ffff addiu r2,r4,0xffff
 
  001823b0: 3042ffff andi r2,r2,0xffff
 
  001823b0: 3042ffff andi r2,r2,0xffff
 
  001823b4: 2c42016f sltiu r2,r2,0x016f
 
  001823b4: 2c42016f sltiu r2,r2,0x016f
  001823b8: 1040000f beq r2,r0,0x 001823f8
+
  001823b8: 1040000f beq r2,r0,0x001823f8 branch if attack is potion or greater
 
  001823bc: 000310c0 sll r2,r3,0x03
 
  001823bc: 000310c0 sll r2,r3,0x03
 
  001823c0: 00431023 subu r2,r2,r3
 
  001823c0: 00431023 subu r2,r2,r3
  001823c4: 00021040 sll r2,r2,0x01
+
  001823c4: 00021040 sll r2,r2,0x01 ID * 14
 
  001823c8: 3c018006 lui r1,0x8006
 
  001823c8: 3c018006 lui r1,0x8006
 
  001823cc: 00220821 addu r1,r1,r2
 
  001823cc: 00220821 addu r1,r1,r2
  001823d0: 9022fbf5 lbu r2,-0x040b(r1) load ability flags 5
+
  001823d0: 9022fbf5 lbu r2,-0x040b(r1) load ability flags 3
 
  001823d4: 00000000 nop
 
  001823d4: 00000000 nop
  001823d8: 000219c2 srl r3,r2,0x07
+
  001823d8: 000219c2 srl r3,r2,0x07 reflectable in bit 1
 
  001823dc: 30420020 andi r2,r2,0x0020 affected by silence check
 
  001823dc: 30420020 andi r2,r2,0x0020 affected by silence check
  001823e0: 00021102 srl r2,r2,0x04
+
  001823e0: 00021102 srl r2,r2,0x04 silencable in bit 2
 
  001823e4: 00621825 or r3,r3,r2
 
  001823e4: 00621825 or r3,r3,r2
  001823e8: a2430000 sb r3,0x0000(r18)
+
  001823e8: a2430000 sb r3,0x0000(r18) store reflectable/silence (cannot perform monster abilities? weird.)
 
  001823ec: 26520001 addiu r18,r18,0x0001
 
  001823ec: 26520001 addiu r18,r18,0x0001
  001823f0: a6250000 sh r5,0x0000(r17) store ability
+
  001823f0: a6250000 sh r5,0x0000(r17) store ability ID in list
  001823f4: 26310002 addiu r17,r17,0x0002
+
  001823f4: 26310002 addiu r17,r17,0x0002 next ability ID
  001823f8: 26100001 addiu r16,r16,0x0001
+
  001823f8: 26100001 addiu r16,r16,0x0001 increase counter by 1
  001823fc: 0214102a slt r2,r16,r20
+
  001823fc: 0214102a slt r2,r16,r20 set if less than No. abilities in skillset
  00182400: 1440ffdd bne r2,r0,0x 00182378
+
  00182400: 1440ffdd bne r2,r0,0x00182378 loop 3 times (4 if beast-master?)
  00182404: 32a400ff andi r4,r21,0x00ff
+
  00182404: 32a400ff andi r4,r21,0x00ff Skillset
 
   
 
   
 
  00182408: 8fbf0030 lw r31,0x0030(r29)
 
  00182408: 8fbf0030 lw r31,0x0030(r29)
Line 93: Line 93:
 
  00182418: 8fb20020 lw r18,0x0020(r29)
 
  00182418: 8fb20020 lw r18,0x0020(r29)
 
  0018241c: 8fb1001c lw r17,0x001c(r29)
 
  0018241c: 8fb1001c lw r17,0x001c(r29)
  00182420: 8fb0 0018 lw r16,0x 0018(r29)
+
  00182420: 8fb00018 lw r16,0x0018(r29)
 
  00182424: 27bd0038 addiu r29,r29,0x0038
 
  00182424: 27bd0038 addiu r29,r29,0x0038
 
  00182428: 03e00008 jr r31
 
  00182428: 03e00008 jr r31
 
  0018242c: 00000000 nop
 
  0018242c: 00000000 nop

Latest revision as of 01:07, 19 February 2022

Monster skill, frog ability loading
001822cc: 27bdffc8 addiu r29,r29,0xffc8			- 0x38
001822d0: afb20020 sw r18,0x0020(r29)
001822d4: 8fb20048 lw r18,0x0048(r29)				Raw CT pointer from stack
001822d8: afb1001c sw r17,0x001c(r29)
001822dc: 00c08821 addu r17,r6,r0				Ability ID list
001822e0: afb40028 sw r20,0x0028(r29)
001822e4: 34140003 ori r20,r0,0x0003				No. Abilities in skillset (default 3)
001822e8: afb30024 sw r19,0x0024(r29)
001822ec: 00009821 addu r19,r0,r0
001822f0: afb5002c sw r21,0x002c(r29)
001822f4: 00a0a821 addu r21,r5,r0				r21 = skillset ID
001822f8: afbf0030 sw r31,0x0030(r29)
001822fc: 0c060435 jal 0x 001810d4				get unit data
00182300: afb00018 sw r16,0x 0018(r29)
00182304: 00402021 addu r4,r2,r0
00182308: 1080003f beq r4,r0,0x 00182408			branch if unit is invalid
0018230c: 00001021 addu r2,r0,r0

00182310: 9082005a lbu r2,0x005a(r4)			load target statuses
00182314: 00000000 nop
00182318: 30420002 andi r2,r2,0x0002
0018231c: 10400002 beq r2,r0,0x 00182328			branch if not frog
00182320: 32a200ff andi r2,r21,0x00ff
00182324: 34130001 ori r19,r0,0x0001			set frog register to true

00182328: 3c018006 lui r1,0x8006
0018232c: 00220821 addu r1,r1,r2
00182330: 90235cb4 lbu r3,0x5cb4(r1)			load action menu byte
00182334: 34020006 ori r2,r0,0x0006
00182338: 10620004 beq r3,r2,0x 0018234c			branch if not 06 - monster skillset
0018233c: 2402ffff addiu r2,r0,0xffff
00182340: a6220000 sh r2,0x0000(r17)			store 0xffff into ability ID list (end list if not monster)
00182344: 08060902 j 0x 00182408					jump to end, return r2 = 00
00182348: 00001021 addu r2,r0,r0

0018234c: 12600003 beq r19,r0,0x 0018235c		branch if not frog
00182350: 3405016f ori r5,r0,0x016f
00182354: a6250000 sh r5,0x0000(r17)			store ability = 0x16f, frog attack
00182358: 26310002 addiu r17,r17,0x0002		next ability ID

0018235c: 0c06090c jal 0x00182430			monster skill check 
00182360: 00000000 nop
00182364: 10400002 beq r2,r0,0x00182370		branch if not monster skillset (if not beast-master?)
00182368: 00008021 addu r16,r0,r0			r16 = 0

0018236c: 34140004 ori r20,r0,0x0004			if monster skillset, 4 abilities available (if beast-master adjacent unit?)
00182370: 12800025 beq r20,r0,0x00182408		end if No. abilities in skillset is 0
00182374: 32a400ff andi r4,r21,0x00ff			r4 = skillset
00182378: 0c01695a jal 0x0005a568				load ability from skillset
0018237c: 02002821 addu r5,r16,r0
00182380: 00402021 addu r4,r2,r0			r4 = ability
00182384: 12600006 beq r19,r0,0x 001823a0		branch if not frog?
00182388: 00802821 addu r5,r4,r0			r5 = ability

0018238c: 00041400 sll r2,r4,0x10
00182390: 00021403 sra r2,r2,0x10			r2 = ability
00182394: 3403001d ori r3,r0,0x001d
00182398: 14430017 bne r2,r3,0x001823f8			branch if attack is not frog? (HUH?? c... can frogs use frog????)
0018239c: 00000000 nop

001823a0: 00041400 sll r2,r4,0x10
001823a4: 00021c03 sra r3,r2,0x10
001823a8: 10600013 beq r3,r0,0x 001823f8			branch if attack is 0 (attack)
001823ac: 2482ffff addiu r2,r4,0xffff
001823b0: 3042ffff andi r2,r2,0xffff
001823b4: 2c42016f sltiu r2,r2,0x016f
001823b8: 1040000f beq r2,r0,0x001823f8			branch if attack is potion or greater
001823bc: 000310c0 sll r2,r3,0x03
001823c0: 00431023 subu r2,r2,r3
001823c4: 00021040 sll r2,r2,0x01			ID * 14
001823c8: 3c018006 lui r1,0x8006
001823cc: 00220821 addu r1,r1,r2
001823d0: 9022fbf5 lbu r2,-0x040b(r1)			load ability flags 3
001823d4: 00000000 nop
001823d8: 000219c2 srl r3,r2,0x07			reflectable in bit 1
001823dc: 30420020 andi r2,r2,0x0020			affected by silence check
001823e0: 00021102 srl r2,r2,0x04			silencable in bit 2
001823e4: 00621825 or r3,r3,r2
001823e8: a2430000 sb r3,0x0000(r18)			store reflectable/silence (cannot perform monster abilities? weird.)
001823ec: 26520001 addiu r18,r18,0x0001
001823f0: a6250000 sh r5,0x0000(r17)			store ability ID in list
001823f4: 26310002 addiu r17,r17,0x0002		next ability ID
001823f8: 26100001 addiu r16,r16,0x0001		increase counter by 1
001823fc: 0214102a slt r2,r16,r20			set if less than No. abilities in skillset
00182400: 1440ffdd bne r2,r0,0x00182378		loop 3 times (4 if beast-master?)
00182404: 32a400ff andi r4,r21,0x00ff			Skillset

00182408: 8fbf0030 lw r31,0x0030(r29)
0018240c: 8fb5002c lw r21,0x002c(r29)
00182410: 8fb40028 lw r20,0x0028(r29)
00182414: 8fb30024 lw r19,0x0024(r29)
00182418: 8fb20020 lw r18,0x0020(r29)
0018241c: 8fb1001c lw r17,0x001c(r29)
00182420: 8fb00018 lw r16,0x0018(r29)
00182424: 27bd0038 addiu r29,r29,0x0038
00182428: 03e00008 jr r31
0018242c: 00000000 nop