Difference between revisions of "Get Number of Turns to Resolve(Alt)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
  00181724: 8c63f51c lw r3,-0x0ae4(r3) load ?? ability slot counter?
 
  00181724: 8c63f51c lw r3,-0x0ae4(r3) load ?? ability slot counter?
 
  00181728: 34020009 ori r2,r0,0x0009
 
  00181728: 34020009 ori r2,r0,0x0009
  0018172c: 14620004 bne r3,r2,0x 00181740 branch if not 0x09
+
  0018172c: 14620004 bne r3,r2,0x 00181740 branch if not 0x09 - active turn
 
  00181730: 00004021 addu r8,r0,r0
 
  00181730: 00004021 addu r8,r0,r0
 
  00181734: 10a00002 beq r5,r0,0x 00181740 branch if 0 CT
 
  00181734: 10a00002 beq r5,r0,0x 00181740 branch if 0 CT
Line 10: Line 10:
 
  00181740: 00052a00 sll r5,r5,0x08 (CT + 1)* 128
 
  00181740: 00052a00 sll r5,r5,0x08 (CT + 1)* 128
 
  00181744: 340a001f ori r10,r0,0x001f
 
  00181744: 340a001f ori r10,r0,0x001f
  00181748: 90c30000 lbu r3,0x0000(r6) unit ID?
+
  00181748: 90c30000 lbu r3,0x0000(r6) stack + 0x10
 
  0018174c: 00000000 nop
 
  0018174c: 00000000 nop
  00181750: 30690040 andi r9,r3,0x0040 r9 = short charge check?
+
  00181750: 30690040 andi r9,r3,0x0040 r9 = mounted check?
 
  00181754: 3063001f andi r3,r3,0x001f
 
  00181754: 3063001f andi r3,r3,0x001f
 
  00181758: 106a0017 beq r3,r10,0x 001817b8
 
  00181758: 106a0017 beq r3,r10,0x 001817b8
Line 18: Line 18:
 
  00181760: 94c70002 lhu r7,0x0002(r6)
 
  00181760: 94c70002 lhu r7,0x0002(r6)
 
  00181764: 00000000 nop
 
  00181764: 00000000 nop
  00181768: 00e5102a slt r2,r7,r5 set if ?? < (CT + 1)* 128
+
  00181768: 00e5102a slt r2,r7,r5 set if ?? < (CT + 1)* 128
  0018176c: 1440000d bne r2,r0,0x 001817a4
+
  0018176c: 1440000d bne r2,r0,0x 001817a4               branch if ??
 
  00181770: 00000000 nop
 
  00181770: 00000000 nop
 
  00181774: 14a70009 bne r5,r7,0x 0018179c
 
  00181774: 14a70009 bne r5,r7,0x 0018179c

Revision as of 12:36, 17 March 2014

Ability loading?
00181720: 3c038019 lui r3,0x8019
00181724: 8c63f51c lw r3,-0x0ae4(r3)			load ?? ability slot counter?
00181728: 34020009 ori r2,r0,0x0009
0018172c: 14620004 bne r3,r2,0x 00181740		branch if not 0x09 - active turn
00181730: 00004021 addu r8,r0,r0
00181734: 10a00002 beq r5,r0,0x 00181740		branch if 0 CT
00181738: 00000000 nop
0018173c: 24a50001 addiu r5,r5,0x0001			CT + 1
00181740: 00052a00 sll r5,r5,0x08			(CT + 1)* 128
00181744: 340a001f ori r10,r0,0x001f
00181748: 90c30000 lbu r3,0x0000(r6)			stack + 0x10
0018174c: 00000000 nop
00181750: 30690040 andi r9,r3,0x0040			r9 = mounted check?
00181754: 3063001f andi r3,r3,0x001f			
00181758: 106a0017 beq r3,r10,0x 001817b8
0018175c: 340200ff ori r2,r0,0x00ff
00181760: 94c70002 lhu r7,0x0002(r6)
00181764: 00000000 nop
00181768: 00e5102a slt r2,r7,r5			set if ?? < (CT + 1)* 128
0018176c: 1440000d bne r2,r0,0x 001817a4               branch if ??
00181770: 00000000 nop
00181774: 14a70009 bne r5,r7,0x 0018179c
00181778: 00000000 nop
0018177c: 14830003 bne r4,r3,0x 0018178c
00181780: 0064102a slt r2,r3,r4
00181784: 15200005 bne r9,r0,0x 0018179c
00181788: 00000000 nop
0018178c: 10400003 beq r2,r0,0x 0018179c
00181790: 00000000 nop
00181794: 15200003 bne r9,r0,0x 001817a4
00181798: 00000000 nop
0018179c: 080605ee j 0x 001817b8
001817a0: 310200ff andi r2,r8,0x00ff			return counter
001817a4: 25080001 addiu r8,r8,0x0001			counter++
001817a8: 29020028 slti r2,r8,0x0028			limit = 0x28
001817ac: 1440ffe6 bne r2,r0,0x 00181748			
001817b0: 24c60004 addiu r6,r6,0x0004			stack++
001817b4: 340200ff ori r2,r0,0x00ff
001817b8: 03e00008 jr r31
001817bc: 00000000 nop