Move Atk sprites to Frame Buffer from RAM

From Final Fantasy Hacktics Wiki
(Redirected from 00085a18 - 00085b9c)
Jump to navigation Jump to search

00085a18: 27bdffc8 addiu r29,r29,0xffc8
00085a1c: afb40028 sw r20,0x0028(r29)
00085a20: 0080a021 addu r20,r4,r0			misc. data pointer
00085a24: afb20020 sw r18,0x0020(r29)
00085a28: 00a09021 addu r18,r5,r0			Attacker SPR2+ to go in VRAM slot 4 or 5
00085a2c: 00061100 sll r2,r6,0x04			r6 = target(?) SPR2+ to go in VRAM slot 4 or 5
00085a30: 00461023 subu r2,r2,r6
00085a34: 000210c0 sll r2,r2,0x03
00085a38: 00461023 subu r2,r2,r6
00085a3c: 00021080 sll r2,r2,0x02
00085a40: 00461021 addu r2,r2,r6
00085a44: afb30024 sw r19,0x0024(r29)
00085a48: 00029980 sll r19,r2,0x06
00085a4c: 02629823 subu r19,r19,r2
00085a50: 02669821 addu r19,r19,r6			VRAM input ID * 0x7564 (size of VRAM slot data)
00085a54: afb1001c sw r17,0x001c(r29)
00085a58: 3c11800b lui r17,0x800b
00085a5c: 26318928 addiu r17,r17,0x8928		Dedicated VRAM space for graphical data
00085a60: afb5002c sw r21,0x002c(r29)
00085a64: 0271a821 addu r21,r19,r17			Dedicated VRAM space for graphical data of current unit
00085a68: afbf0030 sw r31,0x0030(r29)
00085a6c: afb00018 sw r16,0x0018(r29)
00085a70: 92830005 lbu r3,0x0005(r20)			Load spritesheet VRAM slot
00085a74: 02a02821 addu r5,r21,r0
00085a78: 00031100 sll r2,r3,0x04
00085a7c: 00431023 subu r2,r2,r3			VRAM slot * f
00085a80: 00021100 sll r2,r2,0x04			VRAM slot * F0
00085a84: 00431021 addu r2,r2,r3			VRAM * F1
00085a88: 00022080 sll r4,r2,0x02			VRAM * 3C4
00085a8c: 00822023 subu r4,r4,r2			VRAM * 2D3
00085a90: 000410c0 sll r2,r4,0x03			VRAM * 1698
00085a94: 00822021 addu r4,r4,r2			VRAM * 196B
00085a98: 00042040 sll r4,r4,0x01			VRAM * 32D6
00085a9c: 3c02800c lui r2,0x800c
00085aa0: 24427cea addiu r2,r2,0x7cea
00085aa4: 0c01ea8d jal 0x0007aa34			Store graphical data to VRAM? - decompress and store graphics data to VRAM
00085aa8: 00822021 addu r4,r4,r2			Current sprite's atksp data to decompress (0x800c7cea)
00085aac: 00121100 sll r2,r18,0x04
00085ab0: 00521023 subu r2,r2,r18
00085ab4: 000210c0 sll r2,r2,0x03
00085ab8: 00521023 subu r2,r2,r18
00085abc: 00021080 sll r2,r2,0x02
00085ac0: 00521021 addu r2,r2,r18
00085ac4: 00028180 sll r16,r2,0x06
00085ac8: 02028023 subu r16,r16,r2
00085acc: 02128021 addu r16,r16,r18			attacker VRAM slot to put atksp * 0x7564
00085ad0: 2631eea8 addiu r17,r17,0xeea8		VRAM slot address (4) + 0xc
00085ad4: 02112021 addu r4,r16,r17			RECT *recp pointer to frame buffer slot size (x, y, w, h)
00085ad8: 0c00923f jal 0x000248fc			SYS LoadImage move graphics data into frame buffer
00085adc: 02a02821 addu r5,r21,r0			pointer to decompressed graphics data of unit
00085ae0: 92820005 lbu r2,0x0005(r20)			VRAM slot ID (?)
00085ae4: 27a40010 addiu r4,r29,0x0010                 Rect recp* of source image (unit's portrait in the frame buffer)
00085ae8: 000210c2 srl r2,r2,0x03			isolates 8th unique portrait
00085aec: 00021180 sll r2,r2,0x06			
00085af0: 24420340 addiu r2,r2,0x0340			X location of unit's portrait
00085af4: a7a20010 sh r2,0x0010(r29)			store in 0x10 stack
00085af8: 92820005 lbu r2,0x0005(r20)
00085afc: 34030040 ori r3,r0,0x0040
00085b00: a7a30014 sh r3,0x0014(r29)			store width of image = 0x40
00085b04: 34030020 ori r3,r0,0x0020
00085b08: a7a30016 sh r3,0x0016(r29)			store height of image = 0x20
00085b0c: 30420007 andi r2,r2,0x0007			unique portrait ID; y value of 0th ID and 8th ID is identical
00085b10: 00021140 sll r2,r2,0x05			
00085b14: 24420100 addiu r2,r2,0x0100			Portrait's Y location on frame buffer
00085b18: a7a20012 sh r2,0x0012(r29)			store in 0x12 stack
00085b1c: 3c01800a lui r1,0x800a
00085b20: 00300821 addu r1,r1,r16			0x800a0000 + TPAGE ID * page size
00085b24: 842677d2 lh r6,0x77d2(r1)			frame buffer slot dest top-left y
00085b28: 3c01800a lui r1,0x800a
00085b2c: 00300821 addu r1,r1,r16			0x800a0000 + TPAGE ID * page size
00085b30: 842577d0 lh r5,0x77d0(r1)			frame buffer slot dest top-left x
00085b34: 0c009271 jal 0x000249c4			SYS MoveImage
00085b38: 24c600c8 addiu r6,r6,0x00c8                  y + 0xc8 (destination of portrait in frame buffer)
00085b3c: 92820004 lbu r2,0x0004(r20)			Misc unit ID
00085b40: 34030001 ori r3,r0,0x0001			1
00085b44: 3c018004 lui r1,0x8004
00085b48: ac235990 sw r3,0x5990(r1)			store 1 at 0x80045990
00085b4c: 34420080 ori r2,r2,0x0080			enable VRAM flag 0x80?
00085b50: 3c01800a lui r1,0x800a
00085b54: 00300821 addu r1,r1,r16
00085b58: ac2277c4 sw r2,0x77c4(r1)			store cas misc ID in caster's occupied VRAM slot
00085b5c: 34020002 ori r2,r0,0x0002			
00085b60: 3c01800a lui r1,0x800a
00085b64: 00330821 addu r1,r1,r19
00085b68: ac2277c8 sw r2,0x77c8(r1)			store 0x2 in caster's occupied VRAM slot (prevents filling anymore VRAM slots?)
00085b6c: 3c01800a lui r1,0x800a
00085b70: 00300821 addu r1,r1,r16
00085b74: ac2377cc sw r3,0x77cc(r1)			store 0x1 in caster's occupied VRAM slot
00085b78: 8fbf0030 lw r31,0x0030(r29)
00085b7c: 8fb5002c lw r21,0x002c(r29)
00085b80: 8fb40028 lw r20,0x0028(r29)
00085b84: 8fb30024 lw r19,0x0024(r29)
00085b88: 8fb20020 lw r18,0x0020(r29)
00085b8c: 8fb1001c lw r17,0x001c(r29)
00085b90: 8fb00018 lw r16,0x0018(r29)
00085b94: 27bd0038 addiu r29,r29,0x0038
00085b98: 03e00008 jr r31
00085b9c: 00000000 nop