Calculate Zodiac Symbol

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Calculate Zodiac Symbol
0005e5d8: 00002821 addu r5,r0,r0		Zodiac = 0
0005e5dc: 00003021 addu r6,r0,r0		Counter = 0
0005e5e0: 3084ffff andi r4,r4,0xffff		r4 = Birthday
0005e5e4: 3c038006 lui r3,0x8006
0005e5e8: 246361e8 addiu r3,r3,0x61e8		r3 = Pointer to Zodiac Day Limits
0005e5ec: 94620000 lhu r2,0x0000(r3)		Load Zodiac Day Limit
0005e5f0: 24c60001 addiu r6,r6,0x0001		Counter ++
0005e5f4: 0082102b sltu r2,r4,r2
0005e5f8: 38420001 xori r2,r2,0x0001		r2 = 0 if Birthday < Day Limit
0005e5fc: 00a22821 addu r5,r5,r2		Zodiac += r2
0005e600: 28c2000c slti r2,r6,0x000c
0005e604: 1440fff9 bne r2,r0,0x0005e5ec		Branch if Counter < 12
0005e608: 24630002 addiu r3,r3,0x0002		Pointer += 2
0005e60c: 3c032aaa lui r3,0x2aaa
0005e610: 3463aaab ori r3,r3,0xaaab
0005e614: 24a20009 addiu r2,r5,0x0009		Zodiac += 9 (9-20 here)
0005e618: 00430018 mult r2,r3			(Zodiac + 9) * 0.167
0005e61c: 000227c3 sra r4,r2,0x1f
0005e620: 00001810 mfhi r3			Zodiac Mod = Zodiac * 0.167
0005e624: 00031843 sra r3,r3,0x01		Zodiac Mod / 2
0005e628: 00642823 subu r5,r3,r4
0005e62c: 00051840 sll r3,r5,0x01		Zodiac Mod / 2 * 2
0005e630: 00651821 addu r3,r3,r5		Zodiac Mod / 2 * 3
0005e634: 00031880 sll r3,r3,0x02		Zodiac Mod / 2 * 12
0005e638: 00431023 subu r2,r2,r3		Zodiac -= Zodiac Mod
0005e63c: 03e00008 jr r31
0005e640: 3042ffff andi r2,r2,0xffff


Return Locations

00059e8c: Create Monster Egg
0005a0ec: Out of Battle Unit Generation
0005af00: ENTD Data Calculation