Entry | |
---|---|
R0 | 256 + stick number in bits 0-7 |
Exit | |
---|---|
R0 | Position: |
Bits 0-15: Unsigned Y value (0 down, 65535 up) | |
Bits 16-31: Unsigned X value (0 left, 65535 right) | |
R1 | Bits 0-31: Buttons (such as the fire button) |
The purpose of this call is to read the latest 16 bit joystick value.
Due calibration drift in analogue circuitry it is recommended to use the band &6000 to &A000 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.
Prior to 23-11-2021, R1 returned only 8 buttons with bits 8-31 being reserved.