Difference between revisions of "Cos call function"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
m (Talcall moved page 0001bc28 - 0001bcc4 to Sin call function: I manually figured out what this was for, that's the reason.)
(No difference)

Revision as of 09:59, 1 July 2021

0001bc28: 04810002 bgez r4,0x0001bc34			branch if input => 0?
0001bc2c: 00000000 nop
0001bc30: 00042023 subu r4,r0,r4			obtain positive
0001bc34: 30840fff andi r4,r4,0x0fff			
0001bc38: 28820801 slti r2,r4,0x0801			r2 = true if r4 <= 0x0800
0001bc3c: 10400010 beq r2,r0,0x0001bc80			$Branch if > 0x800
0001bc40: 28820401 slti r2,r4,0x0401				|r2 = true if r4 <= 0x400
0001bc44: 10400008 beq r2,r0,0x0001bc68				#Branch if > 0x400
0001bc48: 34020400 ori r2,r0,0x0400					|r2 = 0x400
0001bc4c: 00441023 subu r2,r2,r4					|r2 = 0x400 - r4
0001bc50: 00021040 sll r2,r2,0x01					|r2 * 2
0001bc54: 3c018003 lui r1,0x8003					|
0001bc58: 00220821 addu r1,r1,r2					|
0001bc5c: 8422b0a4 lh r2,-0x4f5c(r1)					|sin that shit
0001bc60: 08006f30 j 0x0001bcc0						|finish function
0001bc64: 00000000 nop							|
0001bc68: 00041040 sll r2,r4,0x01				#r2 = r4 * 2
0001bc6c: 3c018003 lui r1,0x8003				|
0001bc70: 00220821 addu r1,r1,r2				|
0001bc74: 8422a8a4 lh r2,-0x575c(r1)				|sin that shit, but in reverse order from that above
0001bc78: 08006f30 j 0x0001bcc0					|Finish function
0001bc7c: 00021023 subu r2,r0,r2				|obtain negative
0001bc80: 28820c01 slti r2,r4,0x0c01			$r2 = true if r4 <= 0x0c00
0001bc84: 14400007 bne r2,r0,0x0001bca4			#branch if r4 <= 0x0c00
0001bc88: 34020c00 ori r2,r0,0x0c00				|r2 = 0x0c00
0001bc8c: 00041040 sll r2,r4,0x01				|r2 = r4 * 2
0001bc90: 3c018003 lui r1,0x8003				|
0001bc94: 00220821 addu r1,r1,r2				|
0001bc98: 842298a4 lh r2,-0x675c(r1)				|Sin that shit
0001bc9c: 08006f30 j 0x0001bcc0					|Finish function
0001bca0: 00000000 nop						|
0001bca4: 00441023 subu r2,r2,r4			#r2 = r4 * 2
0001bca8: 00021040 sll r2,r2,0x01			
0001bcac: 3c018003 lui r1,0x8003			
0001bcb0: 00220821 addu r1,r1,r2			
0001bcb4: 8422b0a4 lh r2,-0x4f5c(r1)			trend here is that this is a sin call function.
0001bcb8: 00000000 nop
0001bcbc: 00021023 subu r2,r0,r2			obtain negative r2
0001bcc0: 03e00008 jr r31
0001bcc4: 00000000 nop