Skip to content

Instantly share code, notes, and snippets.

View TheNathannator's full-sized avatar
🥁
probably drumming

Nathan TheNathannator

🥁
probably drumming
View GitHub Profile
@TheNathannator
TheNathannator / main.cpp
Last active May 19, 2024 01:45
Using GameInput to read raw Xbox One controller data
#include <cassert>
#include <iostream>
#include <iomanip>
#include <memory>
#include <windows.h>
#include <wrl.h>
// Install the https://www.nuget.org/packages/Microsoft.GameInput package for this example
#include <GameInput.h>
@TheNathannator
TheNathannator / WiiMap2GCMap.py
Last active February 18, 2024 02:49 — forked from NWPlayer123/WiiMap2GCMap.py
Converts Wii symbol maps (e.g. Kirby's Return to Dreamland) to GameCube symbol maps
import os
import sys
def sanitize(line):
line = line.strip()
line = line.replace("\t", " ")
for i in range(5):
line = line.replace(" ", " ")
return line.split(" ")

Xbox One Controller Protocol Notes

The Xbox One controller protocol is quite in-depth. This is a collection of all the information I've gathered over time about it, most of which is sourced from medusalix's xone driver for Linux. There's a little bit of my own research/reverse engineering in there too, but a majority of the information comes from xone.

The info here refers to the USB/wireless side of things, it does not fully apply to the interface the Xbox One controller driver on Windows exposes. That interface is covered here. The wireless receiver protocol is also not documented here, as that's its own beast to handle.

Struct definitions and code examples are not guaranteed to be valid C/C++ code, and are meant mainly for efficiently defining how things are structured or handled. All structs are assumed to be packed with 1-byte alignment.

Table of Contents

@TheNathannator
TheNathannator / GIP Interface Writeup.md
Last active April 23, 2024 21:46
A writeup on how to interact with the Xbox One driver on Windows directly

GIP Interface

A writeup on how to directly communicate with GIP (Xbox One) devices on a basic level.

I tried Windows.Gaming.Input.Custom and was unable to get it to work, so I resorted to this. Would have liked if I could do things more legitimately with what little documentation was provided, but oh well.

This writeup is not at all comprehensive of every possibilty with the interface, otherwise there'd be far too much to go through.

Thanks to the XInputHooker project for having a bunch of function detours set up, made my life easier when doing all of this.