Some kind of ENTD/Unit manipulation

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
ENTD/Unit initialization?
0018c758: 27bdffb0 addiu r29,r29,0xffb0
0018c75c: afb00028 sw r16,0x0028(r29)
0018c760: 00808021 addu r16,r4,r0
0018c764: afb5003c sw r21,0x003c(r29)
0018c768: 2615012c addiu r21,r16,0x012c
0018c76c: 02a02021 addu r4,r21,r0
0018c770: 27a50010 addiu r5,r29,0x0010
0018c774: 34060010 ori r6,r0,0x0010
0018c778: afbf0048 sw r31,0x0048(r29)
0018c77c: afb70044 sw r23,0x0044(r29)
0018c780: afb60040 sw r22,0x0040(r29)
0018c784: afb40038 sw r20,0x0038(r29)
0018c788: afb30034 sw r19,0x0034(r29)
0018c78c: afb20030 sw r18,0x0030(r29)
0018c790: afb1002c sw r17,0x002c(r29)
0018c794: 92170161 lbu r23,0x0161(r16)		load ENTD unit ID
0018c798: 34020082 ori r2,r0,0x0082
0018c79c: a2020003 sb r2,0x0003(r16)		store Job ID
0018c7a0: 0c017895 jal 0x0005e254		store X into Y
0018c7a4: a2020000 sb r2,0x0000(r16)		store Sprite set
0018c7a8: 02002021 addu r4,r16,r0
0018c7ac: 00002821 addu r5,r0,r0
0018c7b0: 00003021 addu r6,r0,r0
0018c7b4: 340200fe ori r2,r0,0x00fe
0018c7b8: 92160002 lbu r22,0x0002(r16)		load party ID
0018c7bc: 96110048 lhu r17,0x0048(r16)		Y coordinate?
0018c7c0: 92130047 lbu r19,0x0047(r16)		X coordinate
0018c7c4: 92140048 lbu r20,0x0048(r16)		Y coordinate?
0018c7c8: 34070082 ori r7,r0,0x0082
0018c7cc: a2020002 sb r2,0x0002(r16)		store party ID
0018c7d0: 001193c2 srl r18,r17,0x0f
0018c7d4: 00118a02 srl r17,r17,0x08
0018c7d8: 0c016a6d jal 0x0005a9b4		Unit Battle Initialization
0018c7dc: 3231000f andi r17,r17,0x000f
0018c7e0: 27a40010 addiu r4,r29,0x0010
0018c7e4: 02a02821 addu r5,r21,r0
0018c7e8: 34060010 ori r6,r0,0x0010
0018c7ec: 001293c0 sll r18,r18,0x0f
0018c7f0: a2140048 sb r20,0x0048(r16)		store Y coordinate
0018c7f4: 96020048 lhu r2,0x0048(r16)		load Y coordinate
0018c7f8: 00118a00 sll r17,r17,0x08
0018c7fc: a2130047 sb r19,0x0047(r16)		store X coordinate
0018c800: a2160002 sb r22,0x0002(r16)		store party ID
0018c804: 30427fff andi r2,r2,0x7fff
0018c808: 00521025 or r2,r2,r18
0018c80c: 3042f0ff andi r2,r2,0xf0ff
0018c810: 00511025 or r2,r2,r17
0018c814: 0c017895 jal 0x0005e254		???
0018c818: a6020048 sh r2,0x0048(r16)		store X coordinate
0018c81c: 02002021 addu r4,r16,r0
0018c820: 27a50020 addiu r5,r29,0x0020
0018c824: 0c017822 jal 0x0005e088		Calculate Palette/portrait
0018c828: a0970161 sb r23,0x0161(r4)		store ENTD ID
0018c82c: 8fbf0048 lw r31,0x0048(r29)
0018c830: 8fb70044 lw r23,0x0044(r29)
0018c834: 8fb60040 lw r22,0x0040(r29)
0018c838: 8fb5003c lw r21,0x003c(r29)
0018c83c: 8fb40038 lw r20,0x0038(r29)
0018c840: 8fb30034 lw r19,0x0034(r29)
0018c844: 8fb20030 lw r18,0x0030(r29)
0018c848: 8fb1002c lw r17,0x002c(r29)
0018c84c: 8fb00028 lw r16,0x0028(r29)
0018c850: 27bd0050 addiu r29,r29,0x0050
0018c854: 03e00008 jr r31
0018c858: 00000000 nop