Load Known Ability Flag
Jump to navigation
Jump to search
Load Known Ability Flag 0019aa50: 000410c0 sll r2,r4,0x03 Unit's ID * 8 0019aa54: 00441023 subu r2,r2,r4 ID * 7 0019aa58: 00021180 sll r2,r2,0x06 ID * 1c0 0019aa5c: 3c038019 lui r3,0x8019 0019aa60: 246308cc addiu r3,r3,0x08cc 0019aa64: 00432021 addu r4,r2,r3 0019aa68: 90820006 lbu r2,0x0006(r4) Load Unit's Gender Byte 0019aa6c: 00000000 nop 0019aa70: 30420020 andi r2,r2,0x0020 0019aa74: 14400022 bne r2,r0,0x 0019ab00 Branch if Unit is a monster 0019aa78: 34020001 ori r2,r0,0x0001 r2 = 1 0019aa7c: 24a3fffb addiu r3,r5,0xfffb r3 = Skillset ID - 5 (Basic Skill) 0019aa80: 2c620013 sltiu r2,r3,0x0013 0019aa84: 10400003 beq r2,r0,0x 0019aa94 Branch if Skillset isn't Generic (-mime) 0019aa88: 00000000 nop 0019aa8c: 08066ab0 j 0x 0019aac0 0019aa90: 00602821 addu r5,r3,r0 r5 = Skillset ID 0019aa94: 90820012 lbu r2,0x0012(r4) Load Unit's Primary Skillset 0019aa98: 00000000 nop 0019aa9c: 10a20007 beq r5,r2,0x 0019aabc Branch if Skillset = Primary Skillset 0019aaa0: 00000000 nop 0019aaa4: 90820162 lbu r2,0x0162(r4) Load Unit's Special Skillset? 0019aaa8: 00000000 nop 0019aaac: 10a20004 beq r5,r2,0x 0019aac0 Branch if Skillset = Special Skillset? 0019aab0: 00002821 addu r5,r0,r0 Skillset = 0 (Base) 0019aab4: 08066ac0 j 0x 0019ab00 0019aab8: 34020001 ori r2,r0,0x0001 r2 = 1 0019aabc: 00002821 addu r5,r0,r0 Skillset = 0 (Base) 0019aac0: 00c01821 addu r3,r6,r0 r3 = Counter 0019aac4: 00051040 sll r2,r5,0x01 Skillset ID * 2 0019aac8: 00451021 addu r2,r2,r5 ID * 3 0019aacc: 00441021 addu r2,r2,r4 0019aad0: 04c10002 bgez r6,0x 0019aadc Branch if Preset Value >= 0 0019aad4: 24420099 addiu r2,r2,0x0099 r2 = Pointer to Unit's Known abilties 0019aad8: 24c30007 addiu r3,r6,0x0007 Counter + 7 0019aadc: 000320c3 sra r4,r3,0x03 Counter / 8 0019aae0: 00441021 addu r2,r2,r4 0019aae4: 90420000 lbu r2,0x0000(r2) Load known Ability Byte 0019aae8: 000420c0 sll r4,r4,0x03 Counter / 8 * 8 0019aaec: 00c42023 subu r4,r6,r4 C Mod = Counter - Counter / 8 * 8 0019aaf0: 34030080 ori r3,r0,0x0080 r3 = 0x80 0019aaf4: 00831807 srav r3,r3,r4 0x80 / 2^(C Mod) (get ability to load) 0019aaf8: 00431024 and r2,r2,r3 Get Known Ability 0019aafc: 0002102b sltu r2,r0,r2 r2 = 1 if known, r2 = 0 otherwise 0019ab00: 03e00008 jr r31 0019ab04: 00000000 nop