Depth Calculation

From Final Fantasy Hacktics Wiki
Revision as of 14:46, 8 February 2015 by Choto (talk | contribs) (Created page with "<font face='Courier New'> 001797b4: 27bdffe0 addiu r29,r29,0xffe0 001797b8: afb00010 sw r16,0x0010(r29) 001797bc: 00808021 addu r16,r4,r0 001797c0: afb10014 sw r17,0x001...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

001797b4: 27bdffe0 addiu r29,r29,0xffe0
001797b8: afb00010 sw r16,0x0010(r29)
001797bc: 00808021 addu r16,r4,r0
001797c0: afb10014 sw r17,0x0014(r29)
001797c4: afbf0018 sw r31,0x0018(r29)
001797c8: 0c060428 jal 0x001810a0				map location calculation
001797cc: 00008821 addu r17,r0,r0
001797d0: 000210c0 sll r2,r2,0x03
001797d4: 3c038019 lui r3,0x8019
001797d8: 2463f8cc addiu r3,r3,0xf8cc
001797dc: 00431021 addu r2,r2,r3
001797e0: 92050182 lbu r5,0x0182(r16)			load mount info
001797e4: 90440002 lbu r4,0x0002(r2)			load height 1
001797e8: 90430003 lbu r3,0x0003(r2)			load height 2
001797ec: 90420003 lbu r2,0x0003(r2)			load height 2
001797f0: 00042040 sll r4,r4,0x01				height 1*2
001797f4: 3063001f andi r3,r3,0x001f			height in halves
001797f8: 00832021 addu r4,r4,r3				r4 = total height
001797fc: 00021142 srl r2,r2,0x05				r2 = depth
00179800: 00023040 sll r6,r2,0x01				depth*2
00179804: 30a20080 andi r2,r5,0x0080
00179808: 10400009 beq r2,r0,0x00179830			branch if not riding chocobo
0017980c: 00801821 addu r3,r4,r0
00179810: 30a2001f andi r2,r5,0x001f
00179814: 000218c0 sll r3,r2,0x03
00179818: 00621823 subu r3,r3,r2
0017981c: 00031980 sll r3,r3,0x06
00179820: 3c028019 lui r2,0x8019
00179824: 244208cc addiu r2,r2,0x08cc			
00179828: 00628021 addu r16,r3,r2				mounted units data
0017982c: 24830002 addiu r3,r4,0x0002			height++
not mounted
00179830: 92050095 lbu r5,0x0095(r16)			load support
00179834: 00000000 nop
00179838: 30a20008 andi r2,r5,0x0008
0017983c: 14400006 bne r2,r0,0x00179858			branch if float
00179840: 00000000 nop
00179844: 9202005a lbu r2,0x005a(r16)			load status
00179848: 00000000 nop
0017984c: 30420040 andi r2,r2,0x0040
00179850: 10400003 beq r2,r0,0x00179860			branch if not float
00179854: 00000000 nop
00179858: 24630002 addiu r3,r3,0x0002			height++
0017985c: 34110001 ori r17,r0,0x0001
00179860: 10c0000c beq r6,r0,0x00179894			branch if depth =0
00179864: 322200ff andi r2,r17,0x00ff
00179868: 14400004 bne r2,r0,0x0017987c
0017986c: 00661021 addu r2,r3,r6
00179870: 30a20080 andi r2,r5,0x0080
00179874: 10400003 beq r2,r0,0x00179884			branch if not walk on water
00179878: 00661021 addu r2,r3,r6
0017987c: 0805e625 j 0x00179894
00179880: 00401821 addu r3,r2,r0
00179884: 30a20040 andi r2,r5,0x0040
00179888: 10400002 beq r2,r0,0x00179894			branch if not move in water
0017988c: 246200fe addiu r2,r3,0x00fe			
00179890: 00c21821 addu r3,r6,r2				depth-1?
00179894: 306200ff andi r2,r3,0x00ff			return depth
00179898: 8fbf0018 lw r31,0x0018(r29)
0017989c: 8fb10014 lw r17,0x0014(r29)
001798a0: 8fb00010 lw r16,0x0010(r29)
001798a4: 27bd0020 addiu r29,r29,0x0020
001798a8: 03e00008 jr r31
001798ac: 00000000 nop