0008945c - 00089524

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#Parameters:
  #r4 = Misc Unit ID
  #r5 = ?
  #r6 = ?
  #r7 = ?
 
0008945c: 27bdffc8 addiu r29,r29,0xffc8
00089460: afb1001c sw r17,0x001c(r29)
00089464: 00808821 addu r17,r4,r0              #r17 = Misc Unit ID
00089468: afb5002c sw r21,0x002c(r29)
0008946c: 00a0a821 addu r21,r5,r0              #r21 = ?
00089470: afb40028 sw r20,0x0028(r29)
00089474: 00c0a021 addu r20,r6,r0              #r20 = ?
00089478: afb20020 sw r18,0x0020(r29)
0008947c: 00e09021 addu r18,r7,r0              #r18 = ?
00089480: afb30024 sw r19,0x0024(r29)
00089484: 8fb30048 lw r19,0x0048(r29)          #r19 = ?
00089488: 3224ffff andi r4,r17,0xffff          #r4  = Misc Unit ID
0008948c: afbf0030 sw r31,0x0030(r29)
00089490: 0c01e9b9 jal 0x0007a6e4              #Find Current Misc Unit Data Pointer (external ID)?
00089494: afb00018 sw r16,0x0018(r29)
00089498: 00408021 addu r16,r2,r0              #r16 = Misc Unit Data Pointer
0008949c: 12000018 beq r16,r0,0x00089500       #Branch to END if Misc Unit Data Pointer = 0 (invalid)
000894a0: 00000000 nop                         #
000894a4: 0c01e9ee jal 0x0007a7b8                  #0007a7b8 - 0007a83c
000894a8: 02202021 addu r4,r17,r0                  #r4 = Misc Unit ID (input parameter for jal)
000894ac: 34040004 ori r4,r0,0x0004                #r4 = 0x04
000894b0: 34030001 ori r3,r0,0x0001                #r3 = 0x01
000894b4: 00143c00 sll r7,r20,0x10                 #r7 = r20(?) << 10
000894b8: 02a02821 addu r5,r21,r0                  #Restore r5 input parameter
000894bc: 02203021 addu r6,r17,r0                  #r6 = Misc Unit ID
000894c0: 96020012 lhu r2,0x0012(r16)              #r2 = Sprite display bytes
000894c4: 00073c03 sra r7,r7,0x10                  #r7 = r20(?) without upper half?
000894c8: a203013e sb r3,0x013e(r16)               #Save 0x01 as Modified palette byte?
000894cc: a2000298 sb r0,0x0298(r16)               #Clear Shadow
000894d0: 3042ff9f andi r2,r2,0xff9f               #Remove 0x40 and 0x20 flags
000894d4: 34420021 ori r2,r2,0x0021                #Add 0x20 and 0x01 flags
000894d8: a6020012 sh r2,0x0012(r16)               #Save new Sprite display bytes
000894dc: 00121400 sll r2,r18,0x10                 #
000894e0: 00021403 sra r2,r2,0x10                  #r2 = r18 without upper half
000894e4: afa20010 sw r2,0x0010(r29)               #Save adjusted r18 to the stack
000894e8: 00131400 sll r2,r19,0x10                 #
000894ec: 00021403 sra r2,r2,0x10                  #r2 = r19 without upper half
000894f0: 0c024cf1 jal 0x000933c4                  #000933c4 - 00093498
000894f4: afa20014 sw r2,0x0014(r29)               #Save adjusted r19 to the stack
000894f8: a6000076 sh r0,0x0076(r16)               #Clear 0x76 of Misc unit data (height related?)
000894fc: a6000074 sh r0,0x0074(r16)               #Clear 0x74 of Misc unit data (height related?)

End:
00089500: 8fbf0030 lw r31,0x0030(r29)
00089504: 8fb5002c lw r21,0x002c(r29)
00089508: 8fb40028 lw r20,0x0028(r29)
0008950c: 8fb30024 lw r19,0x0024(r29)
00089510: 8fb20020 lw r18,0x0020(r29)
00089514: 8fb1001c lw r17,0x001c(r29)
00089518: 8fb00018 lw r16,0x0018(r29)
0008951c: 27bd0038 addiu r29,r29,0x0038
00089520: 03e00008 jr r31
00089524: 00000000 nop

Return location

Battle.bin
0008953c: 00089528 - 00089550
0008d288: 0008d26c - 0008d29c