Difference between revisions of "Set initial panels"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 001798b0: 27bdffd0 addiu r29,r29,0xffd0 001798b4: afb00020 sw r16,0x0020(r29) 001798b8: 00808021 addu r16,r4,r0 001798bc: afb10024 sw r17,0x002...")
 
m
 
Line 1: Line 1:
 +
:''ASM duplicate of [[Arc Range Calculation Routine]].''
 +
 
<font face='Courier New'>
 
<font face='Courier New'>
 
   
 
   

Latest revision as of 20:01, 15 January 2019

ASM duplicate of Arc Range Calculation Routine.

001798b0: 27bdffd0 addiu r29,r29,0xffd0
001798b4: afb00020 sw r16,0x0020(r29)
001798b8: 00808021 addu r16,r4,r0
001798bc: afb10024 sw r17,0x0024(r29)
001798c0: afbf0028 sw r31,0x0028(r29)
001798c4: 0c05e5ed jal 0x001797b4				depth calculation
001798c8: 00a08821 addu r17,r5,r0
001798cc: 00401821 addu r3,r2,r0				r3 = depth
001798d0: 920c0047 lbu r12,0x0047(r16)			unit X
001798d4: 3c02800e lui r2,0x800e
001798d8: 90424ea0 lbu r2,0x4ea0(r2)			load max?
001798dc: 920d0048 lbu r13,0x0048(r16)			load Y
001798e0: 18400049 blez r2,0x00179a08
001798e4: 00004821 addu r9,r0,r0
001798e8: 3c108019 lui r16,0x8019
001798ec: 2610f8cc addiu r16,r16,0xf8cc			load panel data
001798f0: 306e00ff andi r14,r3,0x00ff			r14 = depth
001798f4: 322500ff andi r5,r17,0x00ff			r5 = ?
001798f8: 340f0001 ori r15,r0,0x0001
001798fc: 01a9102a slt r2,r13,r9				set if unit Y < 0
00179900: 14400002 bne r2,r0,0x0017990c			branch if so
00179904: 012d5823 subu r11,r9,r13
00179908: 01a95823 subu r11,r13,r9				make positive
0017990c: 3c02800e lui r2,0x800e
00179910: 90424e9c lbu r2,0x4e9c(r2)			load max ?
00179914: 00000000 nop
00179918: 18400035 blez r2,0x001799f0			branch if negative
0017991c: 00004021 addu r8,r0,r0				X Panel= r8
00179920: 0188102a slt r2,r12,r8				set if unit X < 0
00179924: 14400002 bne r2,r0,0x00179930			branch if X < 0
00179928: 010c1023 subu r2,r8,r12				Unit X - X panel
0017992c: 01881023 subu r2,r12,r8				make positive
00179930: 004b5021 addu r10,r2,r11				unit X + unit Y?
00179934: 29420003 slti r2,r10,0x0003			set if on the border of the map?
00179938: 14400027 bne r2,r0,0x001799d8			branch if so
0017993c: 00000000 nop
if not on the border of the map
00179940: 00003821 addu r7,r0,r0
00179944: 3c02800e lui r2,0x800e
00179948: 90424e9c lbu r2,0x4e9c(r2)			load max X
0017994c: 00000000 nop
00179950: 01220018 mult r9,r2
00179954: 00071a00 sll r3,r7,0x08
00179958: 00001012 mflo r2
0017995c: 00621821 addu r3,r3,r2
00179960: 00683021 addu r6,r3,r8
00179964: 000610c0 sll r2,r6,0x03
00179968: 00501021 addu r2,r2,r16
0017996c: 90430002 lbu r3,0x0002(r2)			load height
00179970: 90440003 lbu r4,0x0003(r2)			load height
00179974: 90420003 lbu r2,0x0003(r2)			load depth
00179978: 00031840 sll r3,r3,0x01
0017997c: 3084001f andi r4,r4,0x001f			height (halves)
00179980: 00641821 addu r3,r3,r4				total height
00179984: 00021142 srl r2,r2,0x05				depth
00179988: 00021040 sll r2,r2,0x01				depth*2
0017998c: 00621821 addu r3,r3,r2				new total height
00179990: 306300ff andi r3,r3,0x00ff			r3 = total height?
00179994: 01c31023 subu r2,r14,r3				depth-height
00179998: 04410002 bgez r2,0x001799a4			branch if 
0017999c: 00000000 nop
001799a0: 24420003 addiu r2,r2,0x0003
001799a4: 00021083 sra r2,r2,0x02
001799a8: 01421023 subu r2,r10,r2				unit x + Y - ??
001799ac: 00a2102a slt r2,r5,r2					set if less than depth?
001799b0: 14400006 bne r2,r0,0x001799cc			skip panel aoe setting
001799b4: 24e70001 addiu r7,r7,0x0001
001799b8: 00061080 sll r2,r6,0x02				panel ID*4?
001799bc: 00461021 addu r2,r2,r6				panel ID*5
001799c0: 3c018019 lui r1,0x8019
001799c4: 00220821 addu r1,r1,r2
001799c8: a02f2dd8 sb r15,0x2dd8(r1)			store panel aoe?
001799cc: 28e20002 slti r2,r7,0x0002			number of range on ability
001799d0: 1440ffdc bne r2,r0,0x00179944
001799d4: 00000000 nop
001799d8: 3c02800e lui r2,0x800e
001799dc: 90424e9c lbu r2,0x4e9c(r2)			map max X
001799e0: 25080001 addiu r8,r8,0x0001			
001799e4: 0102102a slt r2,r8,r2					set if panel < map max X
001799e8: 1440ffce bne r2,r0,0x00179924			branch if so
001799ec: 0188102a slt r2,r12,r8
001799f0: 3c02800e lui r2,0x800e
001799f4: 90424ea0 lbu r2,0x4ea0(r2)			load map max Y
001799f8: 25290001 addiu r9,r9,0x0001			 Y Panel +1
001799fc: 0122102a slt r2,r9,r2
00179a00: 1440ffbf bne r2,r0,0x00179900			set if panel < map max Y
00179a04: 01a9102a slt r2,r13,r9				set if counter < Panel
00179a08: 8fbf0028 lw r31,0x0028(r29)
00179a0c: 8fb10024 lw r17,0x0024(r29)
00179a10: 8fb00020 lw r16,0x0020(r29)
00179a14: 27bd0030 addiu r29,r29,0x0030
00179a18: 03e00008 jr r31
00179a1c: 00000000 nop