h6. [[Joystick]] h6(. » [[Joystick SWI Calls|SWI Calls]] h6((. » [[Joystick_Read]] h6(((. » Joystick_Read 0 h2. Joystick_Read 0 h5. (SWI &43F40) |_<^{width:4em}. Entry | | |<^. R0 |<^. 0 + stick number in bits 0-7 | |_<^{width:4em}. Exit | | |/5<^. R0 |<^. State: | |<^. Bits 0-7: Signed Y value (-127 down, +127 up) | |<^. Bits 8-15: Signed X value (-127 left, +127 right) | |<^. Bits 16-23: Buttons (such as the fire button)| |<^. Bits 24-31: Reserved | h4. Use The purpose of this call is to read the latest 8 bit joystick value. h4. Notes For digital joysticks, fixed values of ±64 will be returned when the switches are activated. Due calibration drift in analogue circuitry it is recommended to use the band -&20 to +&20 as an "at rest" region. Prior to a call to this SWI the joystick hardware may be disabled or powered down. As it is the buffered value that is returned, triggering a new conversion to be scheduled, the very first call to this SWI will return X=0 Y=0. h4. See also * [[Joystick_Read 1]]