0x142c24
Jump to navigation
Jump to search
# ROUTINE: ? 0x142c24 # Modifies parameter button input variable based on value of script variables 41 (0x29) and 42 (0x2a). # Parameters: # r4 = (button_input_ptr) Pointer to button input 80142c24: 27bdffe0 addiu r29,r29,-0x0020 80142c28: afb10014 sw r17,0x0014(r29) 80142c2c: 00808821 addu r17,r4,r0 # button_input_ptr 80142c30: afbf0018 sw r31,0x0018(r29) 80142c34: afb00010 sw r16,0x0010(r29) 80142c38: 8e230000 lw r3,0x0000(r17) # input = *button_input_ptr 80142c3c: 3402090c ori r2,r0,0x090c # 0x90c // Bitmask for Start, Select, L1, R1 80142c40: 14620004 bne r3,r2,0x80142c54 80142c44: 34040029 ori r4,r0,0x0029 # 41 # if (input == 0x90c) { // If Start, Select, L1, R1 all pressed 80142c48: 0c01025d jal 0x80040974 # ROUTINE: ? 0x40974 // Do reset? 80142c4c: 00000000 nop 80142c50: 34040029 ori r4,r0,0x0029 # 41 # } 80142c54: 8e300000 lw r16,0x0000(r17) # *button_input_ptr 80142c58: 3c02ffff lui r2,0xffff 80142c5c: 0c04ed64 jal 0x8013b590 # ROUTINE: scriptVar_41 = Get Script Variable (41) 80142c60: 02028024 and r16,r16,r2 # *button_input_ptr & 0xffff0000 // Check Left, Down, Right, Up, Start, R3, L3, Select 80142c64: 3404002a ori r4,r0,0x002a # 42 80142c68: 8e230000 lw r3,0x0000(r17) # *button_input_ptr 80142c6c: 3842ffff xori r2,r2,0xffff # scriptVar_41 xor 0xffff // (Flip low order 16 bits) 80142c70: 00431024 and r2,r2,r3 # (scriptVar_41 xor 0xffff) & *button_input_ptr 80142c74: 0c04ed64 jal 0x8013b590 # ROUTINE: scriptVar_42 = Get Script Variable (42) 80142c78: ae220000 sw r2,0x0000(r17) # *button_input_ptr = (scriptVar_41 xor 0xffff) & *button_input_ptr 80142c7c: 8e230000 lw r3,0x0000(r17) # *button_input_ptr 80142c80: 00000000 nop 80142c84: 00431025 or r2,r2,r3 # (scriptVar_42 | *button_input_ptr) 80142c88: 02028025 or r16,r16,r2 # (*button_input_ptr & 0xffff0000) | (scriptVar_42 | *button_input_ptr) 80142c8c: ae300000 sw r16,0x0000(r17) # *button_input_ptr = (*button_input_ptr & 0xffff0000) | (scriptVar_42 | *button_input_ptr) 80142c90: 8fbf0018 lw r31,0x0018(r29) 80142c94: 8fb10014 lw r17,0x0014(r29) 80142c98: 8fb00010 lw r16,0x0010(r29) 80142c9c: 27bd0020 addiu r29,r29,0x0020 80142ca0: 03e00008 jr r31 80142ca4: 00000000 nop