Difference between revisions of "Main act menu loading"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
(One intermediate revision by the same user not shown)
Line 40: Line 40:
 
  001402bc: 02402021 addu r4,r18,r0 r4 = action menu byte
 
  001402bc: 02402021 addu r4,r18,r0 r4 = action menu byte
 
  001402c0: 02002821 addu r5,r16,r0 r5 = negated action/not action * 2?
 
  001402c0: 02002821 addu r5,r16,r0 r5 = negated action/not action * 2?
  001402c4: 0c050335 jal 0x00140cd4 if elemental, this switches to next thread and does not complete loading abilities?
+
  001402c4: 0c050335 jal 0x00140cd4 [[Ability selected routine]]
 
  001402c8: 02e03021 addu r6,r23,r0 r6 = skillset usability
 
  001402c8: 02e03021 addu r6,r23,r0 r6 = skillset usability
 
  001402cc: 1653000d bne r18,r19,0x00140304 branch if action menu is not math
 
  001402cc: 1653000d bne r18,r19,0x00140304 branch if action menu is not math
Line 59: Line 59:
 
  00140308: 8c843cb8 lw r4,0x3cb8(r4) pointer to menu data
 
  00140308: 8c843cb8 lw r4,0x3cb8(r4) pointer to menu data
 
  0014030c: 00000000 nop
 
  0014030c: 00000000 nop
  00140310: 84820128 lh r2,0x0128(r4) load action menu byte (number of menus to navigate? (geomancy is 1, white magic is 2))
+
  00140310: 84820128 lh r2,0x0128(r4) load selected action menu byte (attack, primary, secondary, etc.)
 
  00140314: 00000000 nop
 
  00140314: 00000000 nop
 
  00140318: 00021040 sll r2,r2,0x01 times 2
 
  00140318: 00021040 sll r2,r2,0x01 times 2
 
  0014031c: 02821021 addu r2,r20,r2 added to charging/preview pointer of unit
 
  0014031c: 02821021 addu r2,r20,r2 added to charging/preview pointer of unit
  00140320: 90430003 lbu r3,0x0003(r2) load current menu state?
+
  00140320: 90430003 lbu r3,0x0003(r2) load old menu selection
 
  00140324: 00000000 nop
 
  00140324: 00000000 nop
  00140328: a48300ec sh r3,0x00ec(r4) store counter
+
  00140328: a48300ec sh r3,0x00ec(r4) store menu selection
  0014032c: 90430004 lbu r3,0x0004(r2) load ?
+
  0014032c: 90430004 lbu r3,0x0004(r2) load scroll
 
  00140330: 24510003 addiu r17,r2,0x0003 + 3
 
  00140330: 24510003 addiu r17,r2,0x0003 + 3
 
  00140334: 3c018016 lui r1,0x8016
 
  00140334: 3c018016 lui r1,0x8016
Line 110: Line 110:
 
  001403d4: 904200ec lbu r2,0x00ec(r2) load counter
 
  001403d4: 904200ec lbu r2,0x00ec(r2) load counter
 
  001403d8: 00000000 nop
 
  001403d8: 00000000 nop
  001403dc: a2220000 sb r2,0x0000(r17) store
+
  001403dc: a2220000 sb r2,0x0000(r17) store  
 
  001403e0: 3c028016 lui r2,0x8016
 
  001403e0: 3c028016 lui r2,0x8016
 
  001403e4: 904269bc lbu r2,0x69bc(r2)
 
  001403e4: 904269bc lbu r2,0x69bc(r2)

Latest revision as of 08:11, 24 May 2024

00140228: 3c038017 lui r3,0x8017
0014022c: 8c633cb8 lw r3,0x3cb8(r3)
00140230: 3c028015 lui r2,0x8015
00140234: 9042d324 lbu r2,-0x2cdc(r2)			ability selected/not?
00140238: 27bdffc8 addiu r29,r29,0xffc8
0014023c: afbf0034 sw r31,0x0034(r29)
00140240: afbe0030 sw r30,0x0030(r29)
00140244: afb7002c sw r23,0x002c(r29)
00140248: afb60028 sw r22,0x0028(r29)
0014024c: afb50024 sw r21,0x0024(r29)
00140250: afb40020 sw r20,0x0020(r29)
00140254: afb3001c sw r19,0x001c(r29)
00140258: afb20018 sw r18,0x0018(r29)
0014025c: afb10014 sw r17,0x0014(r29)
00140260: afb00010 sw r16,0x0010(r29)
00140264: 2c420001 sltiu r2,r2,0x0001			true if ability not selected?
00140268: 84700128 lh r16,0x0128(r3)			load skillset counter
0014026c: 3c038015 lui r3,0x8015	
00140270: 8463d08a lh r3,-0x2f76(r3)			load Unit ID
00140274: 3c018017 lui r1,0x8017
00140278: 00300821 addu r1,r1,r16
0014027c: 9032404c lbu r18,0x404c(r1)			load action byte
00140280: 3c018017 lui r1,0x8017
00140284: 00300821 addu r1,r1,r16
00140288: 9037403c lbu r23,0x403c(r1)			load skillset usability
0014028c: 00028040 sll r16,r2,0x01			r16 = selected/not action pointer?
00140290: 00031100 sll r2,r3,0x04			ID * 0x10
00140294: 00431021 addu r2,r2,r3			ID * 0x11
00140298: 3c038015 lui r3,0x8015
0014029c: 2463d46c addiu r3,r3,0xd46c			14d46c (charging/preview?)
001402a0: 0600007b bltz r16,0x00140490			branch to end if error?
001402a4: 0043a021 addu r20,r2,r3			r20 = charging/preview pointer + ID * 0x11
001402a8: 34130003 ori r19,r0,0x0003
001402ac: 3c1e8016 lui r30,0x8016
001402b0: 27de6a34 addiu r30,r30,0x6a34			80166a34 (skillset data)
001402b4: 34161024 ori r22,r0,0x1024			r22 = 0x1024
001402b8: 2415ffff addiu r21,r0,0xffff			r21 = -0x1
001402bc: 02402021 addu r4,r18,r0			r4 = action menu byte
001402c0: 02002821 addu r5,r16,r0			r5 = negated action/not action * 2?
001402c4: 0c050335 jal 0x00140cd4			Ability selected routine
001402c8: 02e03021 addu r6,r23,r0			r6 = skillset usability
001402cc: 1653000d bne r18,r19,0x00140304		branch if action menu is not math
001402d0: 2602000b addiu r2,r16,0x000b			r2 = mess + 0xb
001402d4: 02821021 addu r2,r20,r2			r2 = action halfword pointer + charging/preview pointer of unit
001402d8: 00508821 addu r17,r2,r16			r17 = acting/not * 4 + preview pointer + 0xb 
001402dc: 3c038017 lui r3,0x8017
001402e0: 8c633cb8 lw r3,0x3cb8(r3)				load menu data
001402e4: 92220000 lbu r2,0x0000(r17)			0xb or 0xf of preview/charging pointer
001402e8: 00000000 nop
001402ec: a46200ec sh r2,0x00ec(r3)				store counter (number of menus?)
001402f0: 92220001 lbu r2,0x0001(r17)			0xc or 0x10 of preview/charging pointer
001402f4: 3c018016 lui r1,0x8016
001402f8: a42269bc sh r2,0x69bc(r1)				801669bc store the number of slots scrolled down the current menu (?)
001402fc: 080500d0 j 0x00140340
00140300: 03c01821 addu r3,r30,r0			r3 = skillset data
00140304: 3c048017 lui r4,0x8017
00140308: 8c843cb8 lw r4,0x3cb8(r4)			pointer to menu data
0014030c: 00000000 nop
00140310: 84820128 lh r2,0x0128(r4)			load selected action menu byte (attack, primary, secondary, etc.)
00140314: 00000000 nop
00140318: 00021040 sll r2,r2,0x01			times 2
0014031c: 02821021 addu r2,r20,r2			added to charging/preview pointer of unit
00140320: 90430003 lbu r3,0x0003(r2)			load old menu selection
00140324: 00000000 nop
00140328: a48300ec sh r3,0x00ec(r4)			store menu selection
0014032c: 90430004 lbu r3,0x0004(r2)			load scroll
00140330: 24510003 addiu r17,r2,0x0003			+ 3
00140334: 3c018016 lui r1,0x8016
00140338: a42369bc sh r3,0x69bc(r1)			store number of slots scrolled down the menu
0014033c: 03c01821 addu r3,r30,r0
00140340: 2464000c addiu r4,r3,0x000c			r4 = skillset data pointer + 0xc
00140344: 16530003 bne r18,r19,0x00140354		branch if not equip change
00140348: 00000000 nop
0014034c: 16000003 bne r16,r0,0x0014035c		branch if acting/not (number of menus? * 2) is not 0
00140350: 00000000 nop
00140354: 080500d8 j 0x00140360
00140358: a4760000 sh r22,0x0000(r3)			store 0x1024 here
0014035c: a4750000 sh r21,0x0000(r3)			store -0x1 here
00140360: 24630002 addiu r3,r3,0x0002			next area in skillset data
00140364: 0064102a slt r2,r3,r4			set if skillset data doesn't yet match skillset + 0xc
00140368: 1440fff6 bne r2,r0,0x00140344		do 6 times
0014036c: 00000000 nop
00140370: 3c048017 lui r4,0x8017
00140374: 8c843cb8 lw r4,0x3cb8(r4)				load block address
00140378: 00000000 nop
0014037c: 84820128 lh r2,0x0128(r4)				load action menu byte (currently selected in action menu list...?)
00140380: 3c018017 lui r1,0x8017
00140384: 00220821 addu r1,r1,r2			
00140388: 9023404c lbu r3,0x404c(r1)			load action menu
0014038c: 3402000c ori r2,r0,0x000c
00140390: 14620003 bne r3,r2,0x001403a0			branch if action menu != equip change
00140394: 00000000 nop
00140398: 0c04f0e9 jal 0x0013c3a4				equip change routine 0013c3a4 - 0013c568
0014039c: a48000ec sh r0,0x00ec(r4)				store 0 in counter
001403a0: 3c028014 lui r2,0x8014
001403a4: 2442fa6c addiu r2,r2,0xfa6c			13fa6c - got to abilities in skillset loading
001403a8: 3c018017 lui r1,0x8017
001403ac: ac223ca8 sw r2,0x3ca8(r1)				store return address
001403b0: 0c0533ad jal 0x0014ceb4				Load Abilities for skillset Jump to other routine - save r31, stack
001403b4: 02002021 addu r4,r16,r0
001403b8: 0c050af4 jal 0x00142bd0				store some main data
001403bc: 340400fb ori r4,r0,0x00fb
001403c0: 0c04e6fb jal 0x00139bec				exit?
001403c4: 00000000 nop
001403c8: 3c028017 lui r2,0x8017
001403cc: 8c423cb8 lw r2,0x3cb8(r2)
001403d0: 00000000 nop
001403d4: 904200ec lbu r2,0x00ec(r2)			load counter
001403d8: 00000000 nop
001403dc: a2220000 sb r2,0x0000(r17)			store 
001403e0: 3c028016 lui r2,0x8016
001403e4: 904269bc lbu r2,0x69bc(r2)
001403e8: 12530003 beq r18,r19,0x001403f8
001403ec: a2220001 sb r2,0x0001(r17)
001403f0: 0c053256 jal 0x0014c958
001403f4: 00000000 nop
001403f8: 3c028017 lui r2,0x8017
001403fc: 8442e430 lh r2,-0x1bd0(r2)			16e430
00140400: 00000000 nop
00140404: 14550007 bne r2,r21,0x00140424
00140408: 34020002 ori r2,r0,0x0002
0014040c: 16020003 bne r16,r2,0x0014041c		branch if not selecting ability type
00140410: 00000000 nop
00140414: 0c053256 jal 0x0014c958
00140418: 00000000 nop
0014041c: 08050121 j 0x00140484
00140420: 26100002 addiu r16,r16,0x0002			
00140424: 3c028017 lui r2,0x8017
00140428: 8c423cb8 lw r2,0x3cb8(r2)
0014042c: 00000000 nop
00140430: 844200ec lh r2,0x00ec(r2)				load counter
00140434: 3c038017 lui r3,0x8017
00140438: 8c634048 lw r3,0x4048(r3)
0014043c: 00021040 sll r2,r2,0x01
00140440: 00431021 addu r2,r2,r3
00140444: 94420000 lhu r2,0x0000(r2)			load selection
00140448: 00000000 nop
0014044c: 24439000 addiu r3,r2,0x9000
00140450: 34020002 ori r2,r0,0x0002
00140454: 16020003 bne r16,r2,0x00140464		branch if not selecting ability type
00140458: 34020001 ori r2,r0,0x0001
0014045c: 3c018017 lui r1,0x8017
00140460: a4239830 sh r3,-0x67d0(r1)
00140464: 16020003 bne r16,r2,0x00140474		branch if not selecting value
00140468: 00000000 nop
0014046c: 3c018017 lui r1,0x8017
00140470: a4239832 sh r3,-0x67ce(r1)
00140474: 16000003 bne r16,r0,0x00140484		branch if not selecting ability
00140478: 00000000 nop
0014047c: 3c018017 lui r1,0x8017
00140480: a423982e sh r3,-0x67d2(r1)
00140484: 2610ffff addiu r16,r16,0xffff
00140488: 0601ff8d bgez r16,0x001402c0			do for each math skill
0014048c: 02402021 addu r4,r18,r0
00140490: 0c053256 jal 0x0014c958
00140494: 00000000 nop
00140498: 8fbf0034 lw r31,0x0034(r29)
0014049c: 8fbe0030 lw r30,0x0030(r29)
001404a0: 8fb7002c lw r23,0x002c(r29)
001404a4: 8fb60028 lw r22,0x0028(r29)
001404a8: 8fb50024 lw r21,0x0024(r29)
001404ac: 8fb40020 lw r20,0x0020(r29)
001404b0: 8fb3001c lw r19,0x001c(r29)
001404b4: 8fb20018 lw r18,0x0018(r29)
001404b8: 8fb10014 lw r17,0x0014(r29)
001404bc: 8fb00010 lw r16,0x0010(r29)
001404c0: 27bd0038 addiu r29,r29,0x0038
001404c4: 03e00008 jr r31
001404c8: 00000000 nop