Range Calculation

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

Range Calculation? 19795c: 0019795c - 00197b28

	0019f258: 0019f258 - 0019f2a0
	0017a8c0: Calculate ability range for menu types?
	0019f258: 0019f258 - 0019f2a0
	0019f258: 0019f258 - 0019f2a0

0019795c: 27bdffb8 addiu r29,r29,0xffb8			
00197960: afb00038 sw r16,0x0038(r29)			Store 0x0 onto Stack
00197964: 3c10801a lui r16,0x801a			
00197968: 2610f3c4 addiu r16,r16,0xf3c4
0019796c: 26040018 addiu r4,r16,0x0018
00197970: afbf0040 sw r31,0x0040(r29)			Store 0x0 onto Stack
00197974: 0c067c96 jal 0x0019f258			0019f258 - 0019f2a0
00197978: afb1003c sw r17,0x003c(r29)			Store 0x0 onto Stack
0019797c: 3c02801a lui r2,0x801a			
00197980: 9042f3c8 lbu r2,-0x0c38(r2)			Load ???
00197984: 00000000 nop
00197988: 1040000a beq r2,r0,0x001979b4			Branch if  == 0x0
0019798c: 00008821 addu r17,r0,r0
00197990: 0c05ea30 jal 0x0017a8c0			Calculate ability range for menu types?
00197994: 2604001c addiu r4,r16,0x001c
00197998: 34030003 ori r3,r0,0x0003			r3 = (0x3) 3
0019799c: 14430023 bne r2,r3,0x00197a2c			Branch if  != 3 (3)
001979a0: 00005821 addu r11,r0,r0
001979a4: 0c067c96 jal 0x0019f258			0019f258 - 0019f2a0
001979a8: 26040e30 addiu r4,r16,0x0e30
001979ac: 08065ec5 j 0x00197b14			
001979b0: 00001021 addu r2,r0,r0
001979b4: 00002021 addu r4,r0,r0
001979b8: 3c038019 lui r3,0x8019			
001979bc: 2463f8d1 addiu r3,r3,0xf8d1
001979c0: 90620000 lbu r2,0x0000(r3)			Load ???
001979c4: 24840001 addiu r4,r4,0x0001
001979c8: 304200bf andi r2,r2,0x00bf			 & 0xBF
001979cc: a0620000 sb r2,0x0000(r3)			Store Tile Type
001979d0: 28820200 slti r2,r4,0x0200			Set if 0x1 < 512
001979d4: 1440fffa bne r2,r0,0x001979c0			Branch if so
001979d8: 24630008 addiu r3,r3,0x0008
001979dc: 9203001a lbu r3,0x001a(r16)			Load Start of AI data
001979e0: 92020e3a lbu r2,0x0e3a(r16)			Load Start of AI data
001979e4: 00000000 nop
001979e8: 00620018 mult r3,r2				 * 
001979ec: 92020019 lbu r2,0x0019(r16)			Load Start of AI data
001979f0: 92040018 lbu r4,0x0018(r16)			Load Start of AI data
001979f4: 00021200 sll r2,r2,0x08			Shift left 1 bytes(*0x100) (*256)
001979f8: 00001812 mflo r3				0x0
001979fc: 00641821 addu r3,r3,r4
00197a00: 00621821 addu r3,r3,r2
00197a04: 000318c0 sll r3,r3,0x03			Shift left 3 bits (*0x8) (*8)
00197a08: 3c018019 lui r1,0x8019			
00197a0c: 00230821 addu r1,r1,r3
00197a10: 9022f8d1 lbu r2,-0x072f(r1)			Load Start of AI data
00197a14: 00000000 nop
00197a18: 34420040 ori r2,r2,0x0040			r2 = Add 40 to 
00197a1c: 3c018019 lui r1,0x8019			
00197a20: 00230821 addu r1,r1,r3
00197a24: a022f8d1 sb r2,-0x072f(r1)			Store  into 0x8018F8D1
00197a28: 00005821 addu r11,r0,r0
00197a2c: 02005021 addu r10,r16,r0
00197a30: 92020e3b lbu r2,0x0e3b(r16)			Load Start of AI data
00197a34: 00000000 nop
00197a38: 1840002f blez r2,0x00197af8
00197a3c: 00002821 addu r5,r0,r0
00197a40: 000b6200 sll r12,r11,0x08			Shift left 1 bytes(*0x100) (*256)
00197a44: 25470b4c addiu r7,r10,0x0b4c
00197a48: 25480bdc addiu r8,r10,0x0bdc
00197a4c: a4e00000 sh r0,0x0000(r7)			Store 0x0 into 0x19FF10
00197a50: 95020000 lhu r2,0x0000(r8)			Load Start of AI data
00197a54: 00000000 nop
00197a58: 10400021 beq r2,r0,0x00197ae0			Branch if  == 0x0
00197a5c: 00000000 nop
00197a60: 92030e3a lbu r3,0x0e3a(r16)			Load Start of AI data
00197a64: 00000000 nop
00197a68: 1060001d beq r3,r0,0x00197ae0			Branch if  == 0x0
00197a6c: 00002021 addu r4,r0,r0
00197a70: 00404821 addu r9,r2,r0
00197a74: 00e03021 addu r6,r7,r0
00197a78: 00891004 sllv r2,r9,r4			Exception
00197a7c: 30428000 andi r2,r2,0x8000			 & 0x8000
00197a80: 10400012 beq r2,r0,0x00197acc			Branch if  & 0x8000 == 0x0
00197a84: 00a30018 mult r5,r3				0 * 
00197a88: 00001012 mflo r2				0x0
00197a8c: 00441021 addu r2,r2,r4
00197a90: 004c1021 addu r2,r2,r12
00197a94: 000210c0 sll r2,r2,0x03			Shift left 3 bits (*0x8) (*8)
00197a98: 3c018019 lui r1,0x8019			
00197a9c: 00220821 addu r1,r1,r2
00197aa0: 9022f8d1 lbu r2,-0x072f(r1)			Load Start of AI data
00197aa4: 00000000 nop
00197aa8: 00021182 srl r2,r2,0x06			Shift right 6 bits (/0x40) (/64)r2 =  >> 6 * 0x6 (6)
00197aac: 30420001 andi r2,r2,0x0001			 >> 6 & 0x1
00197ab0: 10400006 beq r2,r0,0x00197acc			Branch if  >> 6 & 0x1 == 0x0
00197ab4: 34028000 ori r2,r0,0x8000			r2 = (0x8000) 32768
00197ab8: 26310001 addiu r17,r17,0x0001
00197abc: 94c30000 lhu r3,0x0000(r6)			Load Start of AI data
00197ac0: 00821007 srav r2,r2,r4			Exception
00197ac4: 00621825 or r3,r3,r2			r3 = 8000 (32768)
00197ac8: a4c30000 sh r3,0x0000(r6)			Store 8000 (32768) |  into 0x19FF10
00197acc: 92030e3a lbu r3,0x0e3a(r16)			Load Start of AI data
00197ad0: 24840001 addiu r4,r4,0x0001
00197ad4: 0083102a slt r2,r4,r3			Set if 0x1 < ???
00197ad8: 1440ffe8 bne r2,r0,0x00197a7c			Branch if so
00197adc: 00891004 sllv r2,r9,r4			Exception
00197ae0: 24e70002 addiu r7,r7,0x0002
00197ae4: 92020e3b lbu r2,0x0e3b(r16)			Load Start of AI data
00197ae8: 24a50001 addiu r5,r5,0x0001
00197aec: 00a2102a slt r2,r5,r2			Set if 0x1 < ???
00197af0: 1440ffd6 bne r2,r0,0x00197a4c			Branch if so
00197af4: 25080002 addiu r8,r8,0x0002
00197af8: 256b0001 addiu r11,r11,0x0001
00197afc: 29620002 slti r2,r11,0x0002			Set if 0x1 < 2
00197b00: 1440ffcb bne r2,r0,0x00197a30			Branch if so
00197b04: 254a0024 addiu r10,r10,0x0024
00197b08: 0c067c96 jal 0x0019f258			0019f258 - 0019f2a0
00197b0c: 26040e30 addiu r4,r16,0x0e30
00197b10: 02201021 addu r2,r17,r0
00197b14: 8fbf0040 lw r31,0x0040(r29)			Load Stack + 0x40
00197b18: 8fb1003c lw r17,0x003c(r29)			Load Stack + 0x3C
00197b1c: 8fb00038 lw r16,0x0038(r29)			Load Stack + 0x38
00197b20: 27bd0048 addiu r29,r29,0x0048			
00197b24: 03e00008 jr r31			Jump to Address
00197b28: 00000000 nop