Open SP2

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

0007a840: 27bdffe8 addiu r29,r29,0xffe8
0007a844: 00803821 addu r7,r4,r0
0007a848: 00a03021 addu r6,r5,r0			dedicated space to load file into
0007a84c: afbf0010 sw r31,0x0010(r29)
0007a850: 90e30005 lbu r3,0x0005(r7)			unit's VRAM slot ID
0007a854: 8ce40170 lw r4,0x0170(r7)			Ability ID
0007a858: 00031100 sll r2,r3,0x04
0007a85c: 00431023 subu r2,r2,r3
0007a860: 00021100 sll r2,r2,0x04
0007a864: 00431021 addu r2,r2,r3			ID * F1
0007a868: 00021880 sll r3,r2,0x02			ID * 3c4
0007a86c: 00621823 subu r3,r3,r2			ID * 2d3
0007a870: 000310c0 sll r2,r3,0x03			ID * 1698
0007a874: 00621821 addu r3,r3,r2			ID * 196b
0007a878: 00031840 sll r3,r3,0x01			ID * 32d6 (pretty sure?)
0007a87c: 00041040 sll r2,r4,0x01
0007a880: 00441021 addu r2,r2,r4			ability ID * 3
0007a884: 3404009a ori r4,r0,0x009a			9a?
0007a888: 3c01800c lui r1,0x800c
0007a88c: 00230821 addu r1,r1,r3
0007a890: 90237ce9 lbu r3,0x7ce9(r1)			portrait ID?
0007a894: 3c018009 lui r1,0x8009
0007a898: 00220821 addu r1,r1,r2			
0007a89c: 90253e11 lbu r5,0x3e11(r1)			load ability's execution animation
0007a8a0: 14640017 bne r3,r4,0x0007a900		branch if not iron giant portrait?
0007a8a4: 000318c0 sll r3,r3,0x03
0007a8a8: 30a300ff andi r3,r5,0x00ff			
0007a8ac: 2462ff8d addiu r2,r3,0xff8d			change animation - 0x73 (use katana +?)
0007a8b0: 000228c0 sll r5,r2,0x03			change animation * 0x8 (seems to also take negative values without check + table extends down?)
0007a8b4: 3c018009 lui r1,0x8009
0007a8b8: 00250821 addu r1,r1,r5
0007a8bc: 8c2456c4 lw r4,0x56c4(r1)
0007a8c0: 00000000 nop
0007a8c4: 10800024 beq r4,r0,0x0007a958		LBA sector of file to load for animation
0007a8c8: 2402ffff addiu r2,r0,0xffff
0007a8cc: 8ce201f8 lw r2,0x01f8(r7)			SEQ data pointer
0007a8d0: 00000000 nop
0007a8d4: 8c420004 lw r2,0x0004(r2)			SP2 start indicator?
0007a8d8: 00000000 nop
0007a8dc: 00021042 srl r2,r2,0x01
0007a8e0: 0062102b sltu r2,r3,r2			true if change-of-animation is less than sp2 start
0007a8e4: 1440001b bne r2,r0,0x0007a954		Branch if loading sprite from SP1
0007a8e8: 00000000 nop
0007a8ec: 3c018009 lui r1,0x8009
0007a8f0: 00250821 addu r1,r1,r5
0007a8f4: 8c2556c8 lw r5,0x56c8(r1)			file size to load
0007a8f8: 0801ea51 j 0x0007a944
0007a8fc: 00000000 nop

Not Iron Giant:
0007a900: 3c018009 lui r1,0x8009
0007a904: 00230821 addu r1,r1,r3
0007a908: 8c2451cc lw r4,0x51cc(r1)			LBA pointer?
0007a90c: 00000000 nop
0007a910: 10800011 beq r4,r0,0x0007a958
0007a914: 2402ffff addiu r2,r0,0xffff
0007a918: 8ce201f8 lw r2,0x01f8(r7)			SEQ data pointer
0007a91c: 00000000 nop
0007a920: 8c420004 lw r2,0x0004(r2)			start of SP2 indicator
0007a924: 00000000 nop
0007a928: 00021042 srl r2,r2,0x01
0007a92c: 00a2102b sltu r2,r5,r2
0007a930: 14400008 bne r2,r0,0x0007a954		branch if SP1 animation
0007a934: 00000000 nop
0007a938: 3c018009 lui r1,0x8009
0007a93c: 00230821 addu r1,r1,r3
0007a940: 8c2551d0 lw r5,0x51d0(r1)			file size?
All:
0007a944: 0c0111a5 jal 0x00044694			Load Data From Disc (0x44694) - load appropriate file as requested
0007a948: 00000000 nop
0007a94c: 0801ea56 j 0x0007a958
0007a950: 0002102b sltu r2,r0,r2
0007a954: 2402ffff addiu r2,r0,0xffff
0007a958: 8fbf0010 lw r31,0x0010(r29)
0007a95c: 27bd0018 addiu r29,r29,0x0018
0007a960: 03e00008 jr r31
0007a964: 00000000 nop