Identify Cross Sections Routine

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Cross Section Identification  

0017a5bc: 00003021 addu r6,r0,r0				r6 = 0
0017a5c0: 00002821 addu r5,r0,r0				r5 = 0
0017a5c4: 3407003f ori r7,r0,0x003f				r7 = 0x003f
0017a5c8: 3c038019 lui r3,0x8019
0017a5cc: 2463f8cc addiu r3,r3,-0x0734			r3 = Tile Data (0x18f8cc)
0017a5d0: 3c048019 lui r4,0x8019
0017a5d4: 24842dd8 addiu r4,r4,0x2dd8			r4 = Tile Grid Data (0x192dd8)
0017a5d8: 90820000 lbu r2,0x0000(r4)			r2 = Tile's Range
0017a5dc: 00000000 nop
0017a5e0: 1040000f beq r2,r0,0x0017a620			Branch if Range = 0
0017a5e4: 00000000 nop
0017a5e8: 90620006 lbu r2,0x0006(r3)			r2 = Load Select/Targetable
0017a5ec: 00000000 nop
0017a5f0: 30420001 andi r2,r2,0x0001			If Tile is Unselectable
0017a5f4: 1440000a bne r2,r0,0x0017a620			Branch if True
0017a5f8: 00000000 nop
0017a5fc: 90620000 lbu r2,0x0000(r3)			r2 = Load Cross Section
0017a600: 00000000 nop
0017a604: 3042003f andi r2,r2,0x003f			If Cross Section
0017a608: 10470005 beq r2,r7,0x0017a620			Branch if True
0017a60c: 00000000 nop
0017a610: 90620005 lbu r2,0x0005(r3)			r2 = Load 5th byte (?)
0017a614: 24c60001 addiu r6,r6,0x0001			r6++
0017a618: 0805e98b j 0x0017a62c
0017a61c: 34420040 ori r2,r2,0x0040				r2 = 0x0040
0017a620: 90620005 lbu r2,0x0005(r3)			r2 = Load 5th byte (?)
0017a624: 00000000 nop
0017a628: 304200bf andi r2,r2,0x00bf			r2 = 0x00bf
0017a62c: a0620005 sb r2,0x0005(r3)				Save 0x40 (Cross Section) or 0xbf
0017a630: 24630008 addiu r3,r3,0x0008			Next Tile
0017a634: 24a50001 addiu r5,r5,0x0001			r5++
0017a638: 28a20200 slti r2,r5,0x0200			If r5 < 0x200
0017a63c: 1440ffe6 bne r2,r0,0x0017a5d8			Branch Back
0017a640: 24840005 addiu r4,r4,0x0005			Next Tile
0017a644: 03e00008 jr r31
0017a648: 00c01021 addu r2,r6,r0				r2 = 0x200