Some system routines for ramza crystal, ability CT resolution

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

00070a38: 27bdffd8 addiu r29,r29,0xffd8
00070a3c: afb00018 sw r16,0x0018(r29)
00070a40: 00808021 addu r16,r4,r0
00070a44: 3c03800a lui r3,0x800a
00070a48: 8c638d84 lw r3,-0x727c(r3)		load action type 80098d84
00070a4c: 34020100 ori r2,r0,0x0100
00070a50: afbf0024 sw r31,0x0024(r29)
00070a54: afb20020 sw r18,0x0020(r29)
00070a58: 10620004 beq r3,r2,0x00070a6c		branch if = 0x0100 (active turn?)
00070a5c: afb1001c sw r17,0x001c(r29)
00070a60: 3402ff00 ori r2,r0,0xff00
00070a64: 14620004 bne r3,r2,0x00070a78		branch if not 0xff00 (none?)
00070a68: 34020200 ori r2,r0,0x0200
0x0100 (set active turn?
00070a6c: 34040008 ori r4,r0,0x0008			function = 0x08 (focus on unit?)
00070a70: 0801c2c6 j 0x00070b18
00070a74: 00002821 addu r5,r0,r0
00070a78: 10620004 beq r3,r2,0x00070a8c		branch if = 0x0200 (ability resolution)
00070a7c: 34040008 ori r4,r0,0x0008
00070a80: 34020300 ori r2,r0,0x0300
00070a84: 14620024 bne r3,r2,0x00070b18		branch if not 0x0300
00070a88: 34050001 ori r5,r0,0x0001
0x0300 (crystal/treasure?)
00070a8c: 34050002 ori r5,r0,0x0002
00070a90: 8e020134 lw r2,0x0134(r16)		load unit data
00070a94: 00003821 addu r7,r0,r0
00070a98: 9046018a lbu r6,0x018a(r2)		load ENTD
00070a9c: 34120001 ori r18,r0,0x0001
00070aa0: 0c05066e jal 0x001419b8			system function setup
00070aa4: afb20010 sw r18,0x0010(r29)
00070aa8: 00408821 addu r17,r2,r0
00070aac: 34020002 ori r2,r0,0x0002
00070ab0: 16220018 bne r17,r2,0x00070b14	branch if return != 0x02 success?
00070ab4: 34040008 ori r4,r0,0x0008
00070ab8: 0c050ae9 jal 0x00142ba4			????
00070abc: 00000000 nop
00070ac0: 10400014 beq r2,r0,0x00070b14
00070ac4: 34040008 ori r4,r0,0x0008
00070ac8: 92020006 lbu r2,0x0006(r16)		load spritesheet ID
00070acc: 00000000 nop
00070ad0: 2c420004 sltiu r2,r2,0x0004		set if ramza
00070ad4: 10400007 beq r2,r0,0x00070af4		branch if not
00070ad8: 34050001 ori r5,r0,0x0001
00070adc: 8e020134 lw r2,0x0134(r16)		load data
00070ae0: 00000000 nop
00070ae4: 9046018a lbu r6,0x018a(r2)		load ID
00070ae8: 00003821 addu r7,r0,r0
00070aec: 0801c2cb j 0x00070b2c				jump to system function?
00070af0: afb20010 sw r18,0x0010(r29)
00070af4: 8e020134 lw r2,0x0134(r16)		load data
00070af8: 00002821 addu r5,r0,r0
00070afc: 9046018a lbu r6,0x018a(r2)		load ENTD ID
00070b00: 00003821 addu r7,r0,r0
00070b04: 0c05066e jal 0x001419b8			system function
00070b08: afb20010 sw r18,0x0010(r29)
00070b0c: 0801c2cf j 0x00070b3c
00070b10: 34020002 ori r2,r0,0x0002
00070b14: 34050001 ori r5,r0,0x0001
00070b18: 8e020134 lw r2,0x0134(r16)		load unit data
00070b1c: 00003821 addu r7,r0,r0
00070b20: 9046018a lbu r6,0x018a(r2)
00070b24: 34020001 ori r2,r0,0x0001
00070b28: afa20010 sw r2,0x0010(r29)
00070b2c: 0c05066e jal 0x001419b8			system function prep
00070b30: 00000000 nop
00070b34: 00408821 addu r17,r2,r0
00070b38: 34020002 ori r2,r0,0x0002
if not ramza?
00070b3c: 16220008 bne r17,r2,0x00070b60	branch if return != 0x02
00070b40: 00001021 addu r2,r0,r0			return 0x00
00070b44: 3c028009 lui r2,0x8009
00070b48: 8c4260e4 lw r2,0x60e4(r2)			Load game flow byte
00070b4c: 3c018009 lui r1,0x8009
00070b50: ac2260e8 sw r2,0x60e8(r1)			store game flow byte
00070b54: 0c01c266 jal 0x00070998
00070b58: 00000000 nop
00070b5c: 34020001 ori r2,r0,0x0001
00070b60: 8fbf0024 lw r31,0x0024(r29)
00070b64: 8fb20020 lw r18,0x0020(r29)
00070b68: 8fb1001c lw r17,0x001c(r29)
00070b6c: 8fb00018 lw r16,0x0018(r29)
00070b70: 27bd0028 addiu r29,r29,0x0028
00070b74: 03e00008 jr r31
00070b78: 00000000 nop