Block Start Event Instruction
Jump to navigation
Jump to search
# ROUTINE: BlockStart event instruction 8013e904: 27bdffa8 addiu r29,r29,-0x0058 8013e908: 3c028017 lui r2,0x8017 8013e90c: 8c424038 lw r2,0x4038(r2) # threadID 8013e910: 34030008 ori r3,r0,0x0008 # 8 8013e914: afbf0054 sw r31,0x0054(r29) 8013e918: afb40050 sw r20,0x0050(r29) 8013e91c: afb3004c sw r19,0x004c(r29) 8013e920: afb20048 sw r18,0x0048(r29) 8013e924: afb10044 sw r17,0x0044(r29) 8013e928: afb00040 sw r16,0x0040(r29) 8013e92c: 00021280 sll r2,r2,0x0a # threadID * sizeof(thread) 8013e930: 3c018017 lui r1,0x8017 8013e934: 00220821 addu r1,r1,r2 8013e938: ac2398b8 sw r3,-0x6748(r1) # thread.TaskID = 8 8013e93c: 0c0532f0 jal 0x8014cbc0 # eventInstructionPtr = Get First Thread Parameter (); 8013e940: 00000000 nop 8013e944: 00409021 addu r18,r2,r0 # eventInstructionPtr 8013e948: 92430000 lbu r3,0x0000(r18) # eventInstructionID = *eventInstructionPtr 8013e94c: 3402002b ori r2,r0,0x002b # EVENT_INSTRUCTION_BLOCK_END 8013e950: 10620116 beq r3,r2,0x8013edac # if (eventInstructionID != EVENT_INSTRUCTION_BLOCK_END) { 8013e954: 26500001 addiu r16,r18,0x0001 # eventInstructionParamsPtr = eventInstructionPtr + 1 8013e958: 341407d0 ori r20,r0,0x07d0 # 0x07d0 # do { 8013e95c: 0c05181e jal 0x80146078 # halfwordParam1 = Load Halfword (eventInstructionParamsPtr); 8013e960: 02002021 addu r4,r16,r0 8013e964: 00408821 addu r17,r2,r0 # halfwordParam1 8013e968: 92430000 lbu r3,0x0000(r18) # eventInstructionID 8013e96c: 34020043 ori r2,r0,0x0043 8013e970: 14620010 bne r3,r2,0x8013e9b4 # if (eventInstructionID == EVENT_INSTRUCTION_CALL_FUNCTION) { 8013e974: 34020021 ori r2,r0,0x0021 8013e978: 92430001 lbu r3,0x0001(r18) # functionID 8013e97c: 34020009 ori r2,r0,0x0009 8013e980: 14620006 bne r3,r2,0x8013e99c # if (functionID == 9) { 8013e984: 3402000a ori r2,r0,0x000a 8013e988: 34040053 ori r4,r0,0x0053 8013e98c: 0c04ed91 jal 0x8013b644 # Set Script Variable (0x53, 1); 8013e990: 34050001 ori r5,r0,0x0001 8013e994: 0804fb60 j 0x8013ed80 8013e998: 00000000 nop 8013e99c: 146200f8 bne r3,r2,0x8013ed80 # } else if (functionID == 10) { 8013e9a0: 34040053 ori r4,r0,0x0053 8013e9a4: 0c04ed91 jal 0x8013b644 # Set Script Variable (0x53, 0); 8013e9a8: 00002821 addu r5,r0,r0 8013e9ac: 0804fb60 j 0x8013ed80 8013e9b0: 00000000 nop # } 8013e9b4: 14620007 bne r3,r2,0x8013e9d4 # } else if (eventInstructionID == EVENT_INSTRUCTION_SOUND) { 8013e9b8: 3402005f ori r2,r0,0x005f 8013e9bc: 00111400 sll r2,r17,0x10 8013e9c0: 00021403 sra r2,r2,0x10 8013e9c4: 3c018016 lui r1,0x8016 8013e9c8: ac225fb4 sw r2,0x5fb4(r1) # *0x80165fb4 = soundID 8013e9cc: 0804fb60 j 0x8013ed80 8013e9d0: 00000000 nop 8013e9d4: 14620005 bne r3,r2,0x8013e9ec # } else if (eventInstructionID == EVENT_INSTRUCTION_WARP_UNIT) { 8013e9d8: 3402007e ori r2,r0,0x007e 8013e9dc: 0c051f98 jal 0x80147e60 # Warp Unit (eventInstructionParamsPtr); 8013e9e0: 02002021 addu r4,r16,r0 8013e9e4: 0804fb60 j 0x8013ed80 8013e9e8: 00000000 nop 8013e9ec: 14620005 bne r3,r2,0x8013ea04 # } else if (eventInstructionID == EVENT_INSTRUCTION_WAIT_VALUE) { 8013e9f0: 34020072 ori r2,r0,0x0072 8013e9f4: 0c0528fe jal 0x8014a3f8 # ? 0x14a3f8 (eventInstructionParamsPtr); 8013e9f8: 02002021 addu r4,r16,r0 8013e9fc: 0804fb60 j 0x8013ed80 8013ea00: 00000000 nop 8013ea04: 14620005 bne r3,r2,0x8013ea1c # } else if (eventInstructionID == 0x72) { // Never used 8013ea08: 34020028 ori r2,r0,0x0028 8013ea0c: 0c04f961 jal 0x8013e584 # ? 0x13e584 (); 8013ea10: 00000000 nop 8013ea14: 0804fb60 j 0x8013ed80 8013ea18: 00000000 nop 8013ea1c: 14620009 bne r3,r2,0x8013ea44 # } else if (eventInstructionID == EVENT_INSTRUCTION_WALK_TO) { 8013ea20: 34020079 ori r2,r0,0x0079 8013ea24: 3c028014 lui r2,0x8014 8013ea28: 2442e5c0 addiu r2,r2,-0x1a40 # 0x8013e5c0 8013ea2c: 3c018017 lui r1,0x8017 8013ea30: ac223ca8 sw r2,0x3ca8(r1) # Routine to call: 0x8013e5c0 8013ea34: 0c0533ad jal 0x8014ceb4 # Call Inner Subroutine (eventInstructionParamsPtr); // Called on main thread 8013ea38: 02002021 addu r4,r16,r0 8013ea3c: 0804fb60 j 0x8013ed80 8013ea40: 00000000 nop 8013ea44: 14620014 bne r3,r2,0x8013ea98 # } else if (eventInstructionID == EVENT_INSTRUCTION_WALK_TO_ANIM) { 8013ea48: 34020070 ori r2,r0,0x0070 8013ea4c: 00112400 sll r4,r17,0x10 8013ea50: 0c04cc56 jal 0x80133158 # miscID = Get misc ID (halfwordParam1); 8013ea54: 00042403 sra r4,r4,0x10 8013ea58: 00021400 sll r2,r2,0x10 8013ea5c: 00028403 sra r16,r2,0x10 # miscID 8013ea60: 12140008 beq r16,r20,0x8013ea84 # if (miscID != 0x07d0) { 8013ea64: 00101040 sll r2,r16,0x01 8013ea68: 0c05181e jal 0x80146078 # animationID = Load Halfword (eventInstructionPtr + 3); 8013ea6c: 26440003 addiu r4,r18,0x0003 8013ea70: 00101840 sll r3,r16,0x01 8013ea74: 3c018017 lui r1,0x8017 8013ea78: 00230821 addu r1,r1,r3 8013ea7c: a422da6c sh r2,-0x2594(r1) # *(0x8016da6c + (miscID * 2)) = animationID 8013ea80: 00101040 sll r2,r16,0x01 # } 8013ea84: 3c018017 lui r1,0x8017 8013ea88: 00220821 addu r1,r1,r2 8013ea8c: a420da98 sh r0,-0x2568(r1) # *(0x8016da98 + (miscID * 2)) = 0 8013ea90: 0804fb60 j 0x8013ed80 8013ea94: 00000000 nop 8013ea98: 14620005 bne r3,r2,0x8013eab0 # } else if (eventInstructionID == EVENT_INSTRUCTION_JUMP) { 8013ea9c: 34020029 ori r2,r0,0x0029 8013eaa0: 0c04f9c2 jal 0x8013e708 # ? 0x13e708 (eventInstructionParamsPtr); 8013eaa4: 02002021 addu r4,r16,r0 8013eaa8: 0804fb60 j 0x8013ed80 8013eaac: 00000000 nop 8013eab0: 14620006 bne r3,r2,0x8013eacc # } else if (eventInstructionID == EVENT_INSTRUCTION_WAIT_WALK) { 8013eab4: 34020011 ori r2,r0,0x0011 8013eab8: 00112400 sll r4,r17,0x10 8013eabc: 0c04f9f4 jal 0x8013e7d0 # ? 0x13e7d0 (halfwordParam1); 8013eac0: 00042403 sra r4,r4,0x10 8013eac4: 0804fb60 j 0x8013ed80 8013eac8: 00000000 nop 8013eacc: 14620005 bne r3,r2,0x8013eae4 # } else if (eventInstructionID == EVENT_INSTRUCTION_UNIT_ANIM) { 8013ead0: 34020068 ori r2,r0,0x0068 8013ead4: 0c0524e6 jal 0x80149398 # Unit Anim (eventInstructionParamsPtr); 8013ead8: 02002021 addu r4,r16,r0 8013eadc: 0804fb60 j 0x8013ed80 8013eae0: 00000000 nop 8013eae4: 92430000 lbu r3,0x0000(r18) 8013eae8: 00000000 nop 8013eaec: 14620005 bne r3,r2,0x8013eb04 # } else if (eventInstructionID == EVENT_INSTRUCTION_MIRROR_SPRITE) { 8013eaf0: 34020097 ori r2,r0,0x0097 8013eaf4: 0c04f997 jal 0x8013e65c 8013eaf8: 26440001 addiu r4,r18,0x0001 # ? 0x13e65c (eventInstructionParamsPtr); 8013eafc: 0804fb60 j 0x8013ed80 8013eb00: 00000000 nop 8013eb04: 14620005 bne r3,r2,0x8013eb1c # } else if (eventInstructionID == EVENT_INSTRUCTION_RESET_PALETTE) { 8013eb08: 34020071 ori r2,r0,0x0071 8013eb0c: 0c04f9b1 jal 0x8013e6c4 # ? 0x13e6c4 (eventInstructionParamsPtr); 8013eb10: 26440001 addiu r4,r18,0x0001 8013eb14: 0804fb60 j 0x8013ed80 8013eb18: 00000000 nop 8013eb1c: 1462000c bne r3,r2,0x8013eb50 # } else if (eventInstructionID == 0x71) { // Unknown 8013eb20: 34020046 ori r2,r0,0x0046 8013eb24: 00112400 sll r4,r17,0x10 8013eb28: 0c04cc56 jal 0x80133158 # miscID = Get misc ID (halfwordParam1); 8013eb2c: 00042403 sra r4,r4,0x10 8013eb30: 00021400 sll r2,r2,0x10 8013eb34: 00022403 sra r4,r2,0x10 8013eb38: 10940091 beq r4,r20,0x8013ed80 # if (miscID != 0x07d0) { 8013eb3c: 00000000 nop 8013eb40: 0c01e9ee jal 0x8007a7b8 # ? 0x7a7b8 (miscID); 8013eb44: 00000000 nop 8013eb48: 0804fb60 j 0x8013ed80 8013eb4c: 00000000 nop # } 8013eb50: 1462000c bne r3,r2,0x8013eb84 # } else if (eventInstructionID == EVENT_INSTRUCTION_ERASE) { 8013eb54: 34020044 ori r2,r0,0x0044 8013eb58: 00112400 sll r4,r17,0x10 8013eb5c: 0c04cc56 jal 0x80133158 # miscID = Get misc ID (halfwordParam1); 8013eb60: 00042403 sra r4,r4,0x10 8013eb64: 00021400 sll r2,r2,0x10 8013eb68: 00022403 sra r4,r2,0x10 8013eb6c: 10940084 beq r4,r20,0x8013ed80 # if (miscID != 0x07d0) { 8013eb70: 00000000 nop 8013eb74: 0c023463 jal 0x8008d18c # ? 0x8d18c (miscID); 8013eb78: 00000000 nop 8013eb7c: 0804fb60 j 0x8013ed80 8013eb80: 00000000 nop # } 8013eb84: 1462000c bne r3,r2,0x8013ebb8 # } else if (eventInstructionID == EVENT_INSTRUCTION_DRAW) { 8013eb88: 34020012 ori r2,r0,0x0012 8013eb8c: 00112400 sll r4,r17,0x10 8013eb90: 0c04cc56 jal 0x80133158 # miscID = Get misc ID (halfwordParam1); 8013eb94: 00042403 sra r4,r4,0x10 8013eb98: 00021400 sll r2,r2,0x10 8013eb9c: 00022403 sra r4,r2,0x10 8013eba0: 10940077 beq r4,r20,0x8013ed80 # if (miscID != 0x07d0) { 8013eba4: 00000000 nop 8013eba8: 0c02344e jal 0x8008d138 # ? 0x8d138 (miscID); 8013ebac: 00000000 nop 8013ebb0: 0804fb60 j 0x8013ed80 8013ebb4: 00000000 nop # } 8013ebb8: 1462000c bne r3,r2,0x8013ebec # } else if (eventInstructionID == 0x12) { // Unknown 8013ebbc: 340200f1 ori r2,r0,0x00f1 8013ebc0: 00112400 sll r4,r17,0x10 8013ebc4: 0c04cc56 jal 0x80133158 # miscID = Get misc ID (halfwordParam1); 8013ebc8: 00042403 sra r4,r4,0x10 8013ebcc: 00021400 sll r2,r2,0x10 8013ebd0: 00022403 sra r4,r2,0x10 8013ebd4: 1094006a beq r4,r20,0x8013ed80 # if (miscID != 0x07d0) { 8013ebd8: 00000000 nop 8013ebdc: 0c052936 jal 0x8014a4d8 # ? 0x14a4d8 (miscID); 8013ebe0: 00000000 nop 8013ebe4: 0804fb60 j 0x8013ed80 8013ebe8: 00000000 nop # } 8013ebec: 14620008 bne r3,r2,0x8013ec10 # } else if (eventInstructionID == EVENT_INSTRUCTION_WAIT) { 8013ebf0: 3402002d ori r2,r0,0x002d 8013ebf4: 0c05181e jal 0x80146078 # waitAmount = Load Halfword (eventInstructionParamsPtr); 8013ebf8: 26440001 addiu r4,r18,0x0001 8013ebfc: 00021400 sll r2,r2,0x10 8013ec00: 0c053216 jal 0x8014c858 # Wait (waitAmount); 8013ec04: 00022403 sra r4,r2,0x10 8013ec08: 0804fb60 j 0x8013ed80 8013ec0c: 00000000 nop 8013ec10: 14620005 bne r3,r2,0x8013ec28 # } else if (eventInstructionID == EVENT_INSTRUCTION_ROTATE_UNIT) { 8013ec14: 34020053 ori r2,r0,0x0053 8013ec18: 0c0520a1 jal 0x80148284 # ? 0x148284 (eventInstructionParamsPtr); 8013ec1c: 26440001 addiu r4,r18,0x0001 8013ec20: 0804fb60 j 0x8013ed80 8013ec24: 00000000 nop 8013ec28: 14620006 bne r3,r2,0x8013ec44 # } else if (eventInstructionID == EVENT_INSTRUCTION_FACE_UNIT) { 8013ec2c: 3413003b ori r19,r0,0x003b 8013ec30: 26440001 addiu r4,r18,0x0001 8013ec34: 0c052021 jal 0x80148084 # ? 0x148084 (eventInstructionParamsPtr, 1); 8013ec38: 34050001 ori r5,r0,0x0001 8013ec3c: 0804fb60 j 0x8013ed80 8013ec40: 00000000 nop 8013ec44: 10730003 beq r3,r19,0x8013ec54 # } else if ((eventInstructionID == EVENT_INSTRUCTION_SPRITE_MOVE) 8013ec48: 3402006e ori r2,r0,0x006e 8013ec4c: 14620020 bne r3,r2,0x8013ecd0 # or (eventInstructionID == EVENT_INSTRUCTION_SPRITE_MOVE_BETA)) { 8013ec50: 3402006f ori r2,r0,0x006f 8013ec54: 0c052712 jal 0x80149c48 # threadID = ? 0x149c48 (16); 8013ec58: 34040010 ori r4,r0,0x0010 8013ec5c: 92430000 lbu r3,0x0000(r18) # eventInstructionID 8013ec60: 00000000 nop 8013ec64: 14730005 bne r3,r19,0x8013ec7c 8013ec68: 00408021 addu r16,r2,r0 # result_0x149c48 # if (eventInstructionID == 0x3b) { 8013ec6c: 3c058014 lui r5,0x8014 8013ec70: 24a56ee4 addiu r5,r5,0x6ee4 # funcPtr = 0x80146ee4 8013ec74: 0804fb22 j 0x8013ec88 8013ec78: 02002021 addu r4,r16,r0 # } else { 8013ec7c: 02002021 addu r4,r16,r0 8013ec80: 3c058014 lui r5,0x8014 8013ec84: 24a56f20 addiu r5,r5,0x6f20 # funcPtr = 0x80146f20 # } 8013ec88: 0c053228 jal 0x8014c8a0 # Initialize Thread (threadID, funcPtr); 8013ec8c: 00108280 sll r16,r16,0x0a # threadID * sizeof(thread) 8013ec90: 00112400 sll r4,r17,0x10 8013ec94: 26420001 addiu r2,r18,0x0001 # eventInstructionParamsPtr 8013ec98: 3c018017 lui r1,0x8017 8013ec9c: 00300821 addu r1,r1,r16 8013eca0: ac22986c sw r2,-0x6794(r1) # threads[threadID].FunctionParameter1 = eventInstructionParamsPtr 8013eca4: 3402000b ori r2,r0,0x000b 8013eca8: 3c018017 lui r1,0x8017 8013ecac: 00300821 addu r1,r1,r16 8013ecb0: ac2298b8 sw r2,-0x6748(r1) # threads[threadID].TaskID = 11 8013ecb4: 0c04cc56 jal 0x80133158 # miscID = Get misc ID (halfwordParam1); 8013ecb8: 00042403 sra r4,r4,0x10 8013ecbc: 3c018017 lui r1,0x8017 8013ecc0: 00300821 addu r1,r1,r16 8013ecc4: ac2298bc sw r2,-0x6744(r1) # threads[threadID].0x50 = miscID 8013ecc8: 0804fb60 j 0x8013ed80 8013eccc: 00000000 nop 8013ecd0: 92430000 lbu r3,0x0000(r18) 8013ecd4: 00000000 nop 8013ecd8: 14620006 bne r3,r2,0x8013ecf4 # } else if (eventInstructionID == EVENT_INSTRUCTION_WAIT_SPRITE_MOVE) { 8013ecdc: 34020064 ori r2,r0,0x0064 8013ece0: 00112400 sll r4,r17,0x10 8013ece4: 0c051bd7 jal 0x80146f5c # ? 0x146f5c (halfwordParam1); 8013ece8: 00042403 sra r4,r4,0x10 8013ecec: 0804fb60 j 0x8013ed80 8013ecf0: 00000000 nop 8013ecf4: 14620006 bne r3,r2,0x8013ed10 # } else if (eventInstructionID == EVENT_INSTRUCTION_WAIT_ROTATE_UNIT) { 8013ecf8: 34020065 ori r2,r0,0x0065 8013ecfc: 92440001 lbu r4,0x0001(r18) # unitID 8013ed00: 0c05263f jal 0x801498fc # ? 0x1498fc (unitID); 8013ed04: 00000000 nop 8013ed08: 0804fb60 j 0x8013ed80 8013ed0c: 00000000 nop 8013ed10: 14620005 bne r3,r2,0x8013ed28 # } else if (eventInstructionID == EVENT_INSTRUCTION_WAIT_ROTATE_ALL) { 8013ed14: 3402008c ori r2,r0,0x008c 8013ed18: 0c05263f jal 0x801498fc # ? 0x1498fc (-1); 8013ed1c: 2404ffff addiu r4,r0,-0x0001 8013ed20: 0804fb60 j 0x8013ed80 8013ed24: 00000000 nop 8013ed28: 14620005 bne r3,r2,0x8013ed40 # } else if (eventInstructionID == EVENT_INSTRUCTION_UNIT_ANIM_ROTATE) { 8013ed2c: 34020032 ori r2,r0,0x0032 8013ed30: 0c051feb jal 0x80147fac # ? 0x147fac (eventInstructionParamsPtr); 8013ed34: 26440001 addiu r4,r18,0x0001 8013ed38: 0804fb60 j 0x8013ed80 8013ed3c: 00000000 nop 8013ed40: 1462000f bne r3,r2,0x8013ed80 # } else if (eventInstructionID == EVENT_INSTRUCTION_COLOR_UNIT) { 8013ed44: 00112400 sll r4,r17,0x10 8013ed48: 0c04cc56 jal 0x80133158 # miscID = Get misc ID (halfwordParam1); 8013ed4c: 00042403 sra r4,r4,0x10 8013ed50: 00021400 sll r2,r2,0x10 8013ed54: 00023403 sra r6,r2,0x10 8013ed58: 10d40009 beq r6,r20,0x8013ed80 # if (miscID != 0x07d0) { 8013ed5c: 00000000 nop 8013ed60: 82420005 lb r2,0x0005(r18) # greenValue 8013ed64: 92440003 lbu r4,0x0003(r18) # presetColor 8013ed68: 92450007 lbu r5,0x0007(r18) # time 8013ed6c: 82470004 lb r7,0x0004(r18) # redValue 8013ed70: afa20010 sw r2,0x0010(r29) # greenValue 8013ed74: 82420006 lb r2,0x0006(r18) # blueValue 8013ed78: 0c024cf1 jal 0x800933c4 ? 0x933c4 (presetColor, time, miscID, redValue, greenValue, blueValue); 8013ed7c: afa20014 sw r2,0x0014(r29) # blueValue # } # } 8013ed80: 92420000 lbu r2,0x0000(r18) # eventInstructionID 8013ed84: 3c018015 lui r1,0x8015 8013ed88: 00220821 addu r1,r1,r2 8013ed8c: 9022d170 lbu r2,-0x2e90(r1) # eventParameterLengthArray[eventInstructionID] 8013ed90: 00000000 nop 8013ed94: 24420001 addiu r2,r2,0x0001 # eventInstructionSize = eventParameterLengthArray[eventInstructionID] + 1 8013ed98: 02429021 addu r18,r18,r2 # eventInstructionPtr = eventInstructionPtr + eventInstructionSize // Go to next instruction 8013ed9c: 92430000 lbu r3,0x0000(r18) # eventInstructionID 8013eda0: 3402002b ori r2,r0,0x002b 8013eda4: 1462feed bne r3,r2,0x8013e95c 8013eda8: 26500001 addiu r16,r18,0x0001 # eventInstructionParamsPtr = eventInstructionPtr + 1 # } while (eventInstructionID != EVENT_INSTRUCTION_BLOCK_END); # } 8013edac: 0c053256 jal 0x8014c958 # Stop Current Thread (); 8013edb0: 00000000 nop 8013edb4: 8fbf0054 lw r31,0x0054(r29) 8013edb8: 8fb40050 lw r20,0x0050(r29) 8013edbc: 8fb3004c lw r19,0x004c(r29) 8013edc0: 8fb20048 lw r18,0x0048(r29) 8013edc4: 8fb10044 lw r17,0x0044(r29) 8013edc8: 8fb00040 lw r16,0x0040(r29) 8013edcc: 27bd0058 addiu r29,r29,0x0058 8013edd0: 03e00008 jr r31 8013edd4: 00000000 nop