Difference between revisions of "0494"
Jump to navigation
Jump to search
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{OpCode | {{OpCode | ||
− | | | + | | games = {{Icon|t}} |
− | | description = Gets the | + | | command = GET_POSITION_OF_ANALOGUE_STICKS |
− | | | + | | description = Gets the position of the analogue sticks |
− | | | + | | syntax1 = 0494: get_joystick [''int''] data_to [''var1''] [''var2''] [''var3''] [''var4''] |
− | | | + | | p1t = [''int1''] |
− | | | + | | p1d = Pad, normally 0 for pad 1 (player 1), 1 for pad 2 (player 2) |
− | | | + | | p2t = [''var1''] |
− | + | | p2d = Variable to store the integer position of [[00E1|button 0]] (LEFTSTICKX), -128 left to 128 right | |
+ | | p3t = [''var2''] | ||
+ | | p3d = Variable to store the integer position of button 1 (LEFTSTICKY), -128 up to 128 down | ||
+ | | p4t = [''var3''] | ||
+ | | p4d = Variable to store the integer position of button 2 (RIGHTSTICKX), -128 left to 128 right | ||
+ | | p5t = [''var4''] | ||
+ | | p5d = Variable to store the integer position of button 3 (RIGHTSTICKY), -128 up to 128 down | ||
}} | }} | ||
− | + | This opcode gets the position of the analogue sticks. Pushing the stick to the maximum positions yields a value of ''-128'' or ''128'' depending on the direction, and any position in between yields a value between those two extremes. On a keyboard, the opcode will always return the extreme values. It is a useful alternative for detecting [[00E1|buttons 0 to 3]]. | |
− | |||
− | |||
− | |||
− | |||
− | + | == Keywords == | |
− | + | get, position, analog, analogue, stick, sticks, joystick, data | |
− | ==Keywords== | ||
− | get, joystick |
Latest revision as of 07:20, 5 June 2016
GET_POSITION_OF_ANALOGUE_STICKS
- Description
- Gets the position of the analogue sticks
- Syntax
- 0494: get_joystick [int] data_to [var1] [var2] [var3] [var4]
- Parameter
- [int1]
- Pad, normally 0 for pad 1 (player 1), 1 for pad 2 (player 2)
- [var1]
- Variable to store the integer position of button 0 (LEFTSTICKX), -128 left to 128 right
- [var2]
- Variable to store the integer position of button 1 (LEFTSTICKY), -128 up to 128 down
- [var3]
- Variable to store the integer position of button 2 (RIGHTSTICKX), -128 left to 128 right
- [var4]
- Variable to store the integer position of button 3 (RIGHTSTICKY), -128 up to 128 down
This opcode gets the position of the analogue sticks. Pushing the stick to the maximum positions yields a value of -128 or 128 depending on the direction, and any position in between yields a value between those two extremes. On a keyboard, the opcode will always return the extreme values. It is a useful alternative for detecting buttons 0 to 3.
Keywords
get, position, analog, analogue, stick, sticks, joystick, data