Difference between revisions of "0008a4ac - 0008a6d4"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
Line 146: Line 146:
 
  0008a6ac: ae040030 sw r4,0x0030(r16)
 
  0008a6ac: ae040030 sw r4,0x0030(r16)
 
  0008a6b0: ae050034 sw r5,0x0034(r16) #store temp. variables back into misc. unit data
 
  0008a6b0: ae050034 sw r5,0x0034(r16) #store temp. variables back into misc. unit data
  0008a6b4: 0c02255f jal 0x0008957c #[[0008957c - 000895c0]]
+
  0008a6b4: 0c02255f jal 0x0008957c #[[0008957c - 000895c0]] - convert xyz mods to xyz coordinates and store to xyz locations
 
  0008a6b8: 02002021 addu r4,r16,r0 #unit misc. data pointer
 
  0008a6b8: 02002021 addu r4,r16,r0 #unit misc. data pointer
 
  0008a6bc: ae11008c sw r17,0x008c(r16)
 
  0008a6bc: ae11008c sw r17,0x008c(r16)

Latest revision as of 09:59, 7 November 2022

used for... rush?
0008a4ac: 27bdffc0 addiu r29,r29,0xffc0
0008a4b0: afb00030 sw r16,0x0030(r29)
0008a4b4: 00808021 addu r16,r4,r0
0008a4b8: afbf0038 sw r31,0x0038(r29)
0008a4bc: afb10034 sw r17,0x0034(r29)
0008a4c0: 8e11008c lw r17,0x008c(r16)			#load input variable
0008a4c4: 8e020028 lw r2,0x0028(r16)
0008a4c8: 8e03002c lw r3,0x002c(r16)
0008a4cc: 8e040030 lw r4,0x0030(r16)			#temp xzy?
0008a4d0: 8e050034 lw r5,0x0034(r16)
0008a4d4: afa20020 sw r2,0x0020(r29)
0008a4d8: afa30024 sw r3,0x0024(r29)
0008a4dc: afa40028 sw r4,0x0028(r29)
0008a4e0: afa5002c sw r5,0x002c(r29)
0008a4e4: 8e030088 lw r3,0x0088(r16)			#load distortion phase
0008a4e8: 00000000 nop
0008a4ec: 10600005 beq r3,r0,0x0008a504		#branch if initialising
0008a4f0: 34020001 ori r2,r0,0x0001
0008a4f4: 1062000d beq r3,r2,0x0008a52c		#branch if executing
0008a4f8: 00000000 nop
0008a4fc: 080229a5 j 0x0008a694			#skip otherwise
0008a500: 00000000 nop
Initialising
0008a504: 3c028009 lui r2,0x8009
0008a508: 8c426128 lw r2,0x6128(r2)			#contains generic z value? target z mod?
0008a50c: 02002021 addu r4,r16,r0
0008a510: 0c01fc90 jal 0x0007f240			#0007f240 - 0007f2a8
0008a514: afa20024 sw r2,0x0024(r29)			#overwrites temp. z value from misc. unit data?
0008a518: 8e020088 lw r2,0x0088(r16)			#distortion phase
0008a51c: 34030001 ori r3,r0,0x0001
0008a520: a2030298 sb r3,0x0298(r16)			#enable the unit's shadow
0008a524: 24420001 addiu r2,r2,0x0001
0008a528: ae020088 sw r2,0x0088(r16)			#set phase to 1
0008a52c: 3c038009 lui r3,0x8009
0008a530: 8c6360e4 lw r3,0x60e4(r3)			#load current game display value?
0008a534: 34020034 ori r2,r0,0x0034
0008a538: 14620023 bne r3,r2,0x0008a5c8		#branch if not 0x34 display?
0008a53c: 27a40010 addiu r4,r29,0x0010
display value = 0x34
0008a540: 9206007e lbu r6,0x007e(r16)			#load unit map level
0008a544: 9202007c lbu r2,0x007c(r16)
0008a548: 9203007c lbu r3,0x007c(r16)			#load the unit's x coordinate twice
0008a54c: a200018d sb r0,0x018d(r16)			#set targets hit to 0?
0008a550: 000228c0 sll r5,r2,0x03
0008a554: 00a22823 subu r5,r5,r2
0008a558: 00052880 sll r5,r5,0x02			#x coordinate * e
0008a55c: 9202007d lbu r2,0x007d(r16)			#load unit's y coordinate
0008a560: 24a5000e addiu r5,r5,0x000e			#(x coordinate + 1) * tile width
0008a564: 000238c0 sll r7,r2,0x03
0008a568: 00e23823 subu r7,r7,r2
0008a56c: 00073880 sll r7,r7,0x02
0008a570: 24e7000e addiu r7,r7,0x000e			#(unit's y coordinate + 1) * tile width
0008a574: 000310c0 sll r2,r3,0x03
0008a578: 00431023 subu r2,r2,r3
0008a57c: 00021080 sll r2,r2,0x02
0008a580: 9203007d lbu r3,0x007d(r16)			#load y coordinate
0008a584: 2442000e addiu r2,r2,0x000e			#(x coordinate + 1) * e
0008a588: a6020040 sh r2,0x0040(r16)			#store (x coordinate + 1) * e into x coordinate on screen
0008a58c: 00021300 sll r2,r2,0x0c
0008a590: ae020018 sw r2,0x0018(r16)			#store the same * 0x1000 as x mod
0008a594: 000310c0 sll r2,r3,0x03
0008a598: 00431023 subu r2,r2,r3
0008a59c: 00021080 sll r2,r2,0x02
0008a5a0: 2442000e addiu r2,r2,0x000e			#(y coordinate + 1) * e
0008a5a4: a6020044 sh r2,0x0044(r16)			#store into y location on screen
0008a5a8: 00021300 sll r2,r2,0x0c
0008a5ac: 0c010ac7 jal 0x00042b1c			#store (x+1) * e, map level, and (y+1)*e to stack (... really?) 00042b1c - 00042b28
0008a5b0: ae02001c sw r2,0x001c(r16)			#store as y mod
0008a5b4: 02002021 addu r4,r16,r0
0008a5b8: 0c01f4fd jal 0x0007d3f4			#0007d3f4 - 0007d474
0008a5bc: 27a50010 addiu r5,r29,0x0010			#parse stack with all the coordinates in it (in case unit is mounted)
0008a5c0: 08022990 j 0x0008a640
0008a5c4: a7a20012 sh r2,0x0012(r29)			#store height where map level was
Current display != 0x34
0008a5c8: 9202018d lbu r2,0x018d(r16)			#load number of targets to hit
0008a5cc: 00000000 nop
0008a5d0: 10400009 beq r2,r0,0x0008a5f8		#branch if none
0008a5d4: 00000000 nop
0008a5d8: 9204018e lbu r4,0x018e(r16)			#load first target
0008a5dc: 0c01e9c9 jal 0x0007a724			#Get unit misc data that matches r4 ID - load target's misc. data
0008a5e0: 00000000 nop
0008a5e4: 9043007c lbu r3,0x007c(r2)			#target x,
0008a5e8: 9046007e lbu r6,0x007e(r2)			#map level,
0008a5ec: 9042007d lbu r2,0x007d(r2)			#and y
0008a5f0: 08022983 j 0x0008a60c
0008a5f4: 27a40010 addiu r4,r29,0x0010			#
if no targets
0008a5f8: 8e020134 lw r2,0x0134(r16)			#if no targets, load pointer to attacking unit's data
0008a5fc: 27a40010 addiu r4,r29,0x0010
0008a600: 8443017a lh r3,0x017a(r2)
0008a604: 8446017c lh r6,0x017c(r2)
0008a608: 8442017e lh r2,0x017e(r2)			#load target tile x, y, and height
display != 0x34 cont.
0008a60c: 000328c0 sll r5,r3,0x03
0008a610: 00a32823 subu r5,r5,r3
0008a614: 00052880 sll r5,r5,0x02
0008a618: 24a5000e addiu r5,r5,0x000e			#(x + 1) * tile width
0008a61c: 000238c0 sll r7,r2,0x03
0008a620: 00e23823 subu r7,r7,r2
0008a624: 00073880 sll r7,r7,0x02
0008a628: 0c010ac7 jal 0x00042b1c			#store positional data to stack 00042b1c - 00042b28
0008a62c: 24e7000e addiu r7,r7,0x000e			#(y + 1) * tile width
0008a630: 02002021 addu r4,r16,r0
0008a634: 0c01f4b7 jal 0x0007d2dc			#return height of centre of target tile 0007d2dc - 0007d34c
0008a638: 27a50010 addiu r5,r29,0x0010
0008a63c: a7a20012 sh r2,0x0012(r29)			#store height of tile to stack
0008a640: 86020042 lh r2,0x0042(r16)			#load height mod of current unit
0008a644: 87a30012 lh r3,0x0012(r29)			#load height of tile
0008a648: 00000000 nop
0008a64c: 0043102a slt r2,r2,r3
0008a650: 1040000d beq r2,r0,0x0008a688		#branch if height of target tile is less than height of current tile
0008a654: 00031300 sll r2,r3,0x0c
0008a658: 8e02001c lw r2,0x001c(r16)			#load unit's height mod
0008a65c: 8fa30024 lw r3,0x0024(r29)			#load difference of attacker and target height mod?
0008a660: 00000000 nop
0008a664: 00431021 addu r2,r2,r3			#add them together!
0008a668: ae02001c sw r2,0x001c(r16)			#store in unit's height mod!
0008a66c: 8fa20024 lw r2,0x0024(r29)			#load difference?
0008a670: 3c038009 lui r3,0x8009
0008a674: 8c636128 lw r3,0x6128(r3)			#?
0008a678: 00000000 nop
0008a67c: 00431021 addu r2,r2,r3			#add them together
0008a680: 080229a5 j 0x0008a694
0008a684: afa20024 sw r2,0x0024(r29)			#store into, difference? it's really hard to tell what this is, I can't find where it's written...
If Height of target tile <= height of unit:
0008a688: ae02001c sw r2,0x001c(r16)			#store height of tile into unit's height mod
0008a68c: ae0002e8 sw r0,0x02e8(r16)			#clear unused section
0008a690: a2000087 sb r0,0x0087(r16)			#clear distort anim. ID
return if target height > current height
0008a694: 8fa20020 lw r2,0x0020(r29)			#load temp. x?
0008a698: 8fa30024 lw r3,0x0024(r29)			#load temp. height?
0008a69c: 8fa40028 lw r4,0x0028(r29)			#load temp. y?
0008a6a0: 8fa5002c lw r5,0x002c(r29)
0008a6a4: ae020028 sw r2,0x0028(r16)
0008a6a8: ae03002c sw r3,0x002c(r16)
0008a6ac: ae040030 sw r4,0x0030(r16)
0008a6b0: ae050034 sw r5,0x0034(r16)			#store temp. variables back into misc. unit data
0008a6b4: 0c02255f jal 0x0008957c			#0008957c - 000895c0 - convert xyz mods to xyz coordinates and store to xyz locations
0008a6b8: 02002021 addu r4,r16,r0			#unit misc. data pointer
0008a6bc: ae11008c sw r17,0x008c(r16)
0008a6c0: 8fbf0038 lw r31,0x0038(r29)
0008a6c4: 8fb10034 lw r17,0x0034(r29)
0008a6c8: 8fb00030 lw r16,0x0030(r29)
0008a6cc: 27bd0040 addiu r29,r29,0x0040
0008a6d0: 03e00008 jr r31
0008a6d4: 00000000 nop