001a8f14 - 001a90cc

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

001a8f14: 00802821 addu r5,r4,r0			#r5 = input pointer to store polygon type data
001a8f18: 3c07801c lui r7,0x801c
001a8f1c: 8ce78a3c lw r7,-0x75c4(r7)			#801b8a3c* (byte.)
001a8f20: 3c03801c lui r3,0x801c
001a8f24: 8c638a38 lw r3,-0x75c8(r3)			#pointer to beginning of non-pointer data in secondary effect?
001a8f28: 00071080 sll r2,r7,0x02
001a8f2c: 00431821 addu r3,r2,r3
001a8f30: 8c620000 lw r2,0x0000(r3)			#load related data?
001a8f34: 00000000 nop
001a8f38: 00022602 srl r4,r2,0x18			#r4 = type of polygon
001a8f3c: aca20000 sw r2,0x0000(r5)			#store r2 word in stack
001a8f40: 34020035 ori r2,r0,0x0035
001a8f44: 10820031 beq r4,r2,0x001a900c		#branch if 4th byte is 0x35 (quad)
001a8f48: 00a03021 addu r6,r5,r0
001a8f4c: 2c820036 sltiu r2,r4,0x0036
001a8f50: 10400005 beq r2,r0,0x001a8f68		#branch if 4th byte is more than 0x35
001a8f54: 34020031 ori r2,r0,0x0031
001a8f58: 1082001a beq r4,r2,0x001a8fc4		#branch if 4th byte is 0x31 (quad polygon)
001a8f5c: 00000000 nop
001a8f60: 0806a42b j 0x001a90ac			#otherwise, triggers error (seems delicate)
001a8f64: 00000000 nop
001a8f68: 34020037 ori r2,r0,0x0037
001a8f6c: 10820027 beq r4,r2,0x001a900c		#branch if 0x37 (tri polygon)
001a8f70: 34020039 ori r2,r0,0x0039
001a8f74: 1482004d bne r4,r2,0x001a90ac		#branch if not 0x39 (reflect unique polygon)
001a8f78: 00000000 nop
Quad polygon:
001a8f7c: 8c620004 lw r2,0x0004(r3)			#load 2nd word from data
001a8f80: 00000000 nop
001a8f84: aca20004 sw r2,0x0004(r5)			#store 2nd word into stack
001a8f88: 8c620008 lw r2,0x0008(r3)
001a8f8c: 00000000 nop
001a8f90: aca20008 sw r2,0x0008(r5)			#3rd word into stack
001a8f94: 8c62000c lw r2,0x000c(r3)
001a8f98: 00000000 nop
001a8f9c: aca2000c sw r2,0x000c(r5)			#same deal
001a8fa0: 8c620010 lw r2,0x0010(r3)
001a8fa4: 00000000 nop
001a8fa8: aca20010 sw r2,0x0010(r5)			#(all palette data)
001a8fac: 8c620014 lw r2,0x0014(r3)
001a8fb0: 00000000 nop
001a8fb4: aca20068 sw r2,0x0068(r5)			#store the 6th word a lot deeper into the stack. seems like a special case. contains 2 pointers for vector data?
001a8fb8: 8c630018 lw r3,0x0018(r3)			#load 7th word
001a8fbc: 0806a3ff j 0x001a8ffc
001a8fc0: 24e20007 addiu r2,r7,0x0007			#set this table's entry length as 7 (so the next set of data doesn't reload any duplicate information)
Tri polygon:
001a8fc4: 8c620004 lw r2,0x0004(r3)
001a8fc8: 00000000 nop
001a8fcc: aca20004 sw r2,0x0004(r5)
001a8fd0: 8c620008 lw r2,0x0008(r3)
001a8fd4: 00000000 nop
001a8fd8: aca20008 sw r2,0x0008(r5)
001a8fdc: 8c62000c lw r2,0x000c(r3)
001a8fe0: 00000000 nop
001a8fe4: aca2000c sw r2,0x000c(r5)
001a8fe8: 8c620010 lw r2,0x0010(r3)
001a8fec: 00000000 nop
001a8ff0: aca20068 sw r2,0x0068(r5)			#store polygon points 1 and 2
001a8ff4: 8c630014 lw r3,0x0014(r3)
001a8ff8: 24e20006 addiu r2,r7,0x0006			#Table entry length = 6
001a8ffc: 3c01801c lui r1,0x801c
001a9000: ac228a3c sw r2,-0x75c4(r1)
001a9004: 0806a432 j 0x001a90c8
001a9008: aca3006c sw r3,0x006c(r5)			#store 3rd and 4th polygon points.
Reflect tri polygon:
001a900c: 3c04801c lui r4,0x801c
001a9010: 8c848a3c lw r4,-0x75c4(r4)			#Counter?
001a9014: 3c02801c lui r2,0x801c
001a9018: 8c428a38 lw r2,-0x75c8(r2)			#pointer to start of polygon data
001a901c: 00041880 sll r3,r4,0x02
001a9020: 00621821 addu r3,r3,r2
001a9024: 8c620010 lw r2,0x0010(r3)			#palette data
001a9028: 00000000 nop
001a902c: acc20004 sw r2,0x0004(r6)			
001a9030: 8c620014 lw r2,0x0014(r3)
001a9034: 00000000 nop
001a9038: acc20008 sw r2,0x0008(r6)
001a903c: 8c620018 lw r2,0x0018(r3)
001a9040: 00000000 nop
001a9044: acc2000c sw r2,0x000c(r6)			#palette stuff
001a9048: 8c62001c lw r2,0x001c(r3)			#load 1st & 2nd points
001a904c: 00000000 nop
001a9050: acc20068 sw r2,0x0068(r6)			#1c and 20 have the points for reflect's model
001a9054: 8c620020 lw r2,0x0020(r3)			#3rd point.
001a9058: 00000000 nop
001a905c: acc2006c sw r2,0x006c(r6)			#store third point
001a9060: 9462000a lhu r2,0x000a(r3)
001a9064: 00000000 nop
001a9068: a4a20014 sh r2,0x0014(r5)
001a906c: 94620006 lhu r2,0x0006(r3)
001a9070: 00000000 nop
001a9074: a4a20016 sh r2,0x0016(r5)
001a9078: 94620004 lhu r2,0x0004(r3)
001a907c: 00000000 nop
001a9080: a4a20018 sh r2,0x0018(r5)
001a9084: 94620008 lhu r2,0x0008(r3)
001a9088: 00000000 nop
001a908c: a4a2001a sh r2,0x001a(r5)			#additional palette information?
001a9090: 9462000c lhu r2,0x000c(r3)
001a9094: 24840009 addiu r4,r4,0x0009			#increment counter? by 9 (9 table entries here?)
001a9098: a4a2001c sh r2,0x001c(r5)
001a909c: 3c01801c lui r1,0x801c
001a90a0: ac248a3c sw r4,-0x75c4(r1)
001a90a4: 0806a432 j 0x001a90c8
001a90a8: 00000000 nop
4th byte is invalid?
001a90ac: 3c02801c lui r2,0x801c
001a90b0: 8c428a3c lw r2,-0x75c4(r2)			#counter byte?
001a90b4: 90a30001 lbu r3,0x0001(r5)
001a90b8: 24420001 addiu r2,r2,0x0001			#+ 1
001a90bc: 00431021 addu r2,r2,r3
001a90c0: 3c01801c lui r1,0x801c
001a90c4: ac228a3c sw r2,-0x75c4(r1)			#store and try next word if failed
End:
001a90c8: 03e00008 jr r31
001a90cc: 00000000 nop