website logo
โŒ˜K
Hand Held Legend Wiki
Modding Tips
Restore Your Original Gameboy Bumper Buttons To Factory
IPS Comparison Info
Headphones Working But Speaker Is Not
Power Switch Cleaning Guide
IPS LCD Dry Test
GBA SP | IPS LCD Dry Test
Soldering Iron Guide
HHL Products
GC Pocket Adapter
Open Controller DevKit
Retro-C Cable Information
RetroGlow
ProGCC Mod Kit
T6 Torx Screws
Console Guides
Game Gear
Electrolytic Re-Cap Guide
Nintendo Switch
GameCube
Game Boy (DMG)
Game Boy Pocket
Game Boy Color
Game Boy Advance (AGB)
Game Boy Advance SP
Mod Install Guides
Nintendo Switch
Game Gear
GameCube
Game Boy (DMG)
Game Boy Pocket/Light
Game Boy Color
Game Boy Advance (AGB)
Game Boy Advance SP
Atari Lynx
WonderSwan
Product Usage Guides
Writing A Rom To A Flash Cart
๐Ÿงƒ CleanJuice Modules
Game Boy Color
Troubleshooting
๐Ÿ”‰Audio
IPS Troubleshooting Guide
โšกEZ-Flash Omega Troubleshoot
๐Ÿ”‹ Power Switch Is Too Small
Developer Center
OpenJoyPad HID USB Specification
USB Product IDs Used
Nintendo Switch
Affiliate Guidelines
Docs powered byย archbeeย 
10min

Analog Stick Data

Decode Joystick Data

This is a section detailing how to interpret analog/joystick data coming from the controller.

Slow Mode/Short Input Report Joystick Data

Starting on byte 4 of the incoming report from the controller, you can find the joystick analog data encoded as follows.

Byte Number

Description

Example Data

4

Lower byte of X axis

๏ปฟ

5

Upper byte of X axis

๏ปฟ

6

Lower byte of Y axis

๏ปฟ

7

Upper byte of Y axis

๏ปฟ

To get values for the right stick, add 4 to the byte index.

To get the X or Y axis values, OR the respective bytes together.

C++
|
๏ปฟ

Standard Input Mode Joystick Data

Starting on byte 6 of a standard input mode report from the controller, you can find the joystick analog data encoded as follows.

Byte Number

Description

Example Data

6

Lower byte of X axis. 8 bits.

๏ปฟ

7

Lower 4 bits are the Upper byte of X axis. Upper 4 bits are the lower byte of the Y axis

๏ปฟ

8

Upper byte of Y axis. 8 bits.

๏ปฟ

For the right stick, add 3 to the byte index.

To get the decoded X or Y axis values, some math is involved.

C++
|
๏ปฟ

Encode Joystick Data

This section details how to take an analog stick value and encode it to be read by the console.

Slow Mode Joystick Data

In a standard input report, bytes 4-7 represent the stick data.

For this example, we will use these values and we will only focus on the left stick which is bytes 4-5.

X axis - 0x7D4 (2004 in decimal)

Y axis - 0x6C5 (1733 in decimal)

C++
|
๏ปฟ

Standard Input Mode Joystick Data

In a standard input report, bytes 6-11 represent the stick data.

For this example, we will use these values and we will only focus on the left stick which is bytes 6-8.

X axis - 0x7D4 (2004 in decimal)

Y axis - 0x6C5 (1733 in decimal)

C++
|
๏ปฟ

๏ปฟ

Updated 03 Mar 2023
Did this page help you?
Yes
No
UP NEXT
Analog Stick Calibration Data
Docs powered byย archbeeย 
TABLE OF CONTENTS
Decode Joystick Data
Slow Mode/Short Input Report Joystick Data
Standard Input Mode Joystick Data
Encode Joystick Data
Slow Mode Joystick Data
Standard Input Mode Joystick Data