Skip to content

Commit

Permalink
Modified to work with Stadia Controller. Note: Vibration motors don't…
Browse files Browse the repository at this point in the history
… seem to be working correctly right now
  • Loading branch information
Connor Walker committed Dec 1, 2020
1 parent 7661474 commit e428e42
Show file tree
Hide file tree
Showing 12 changed files with 509 additions and 548 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Build and debug",
"type": "cppvsdbg",
"request": "launch",
"program": "bin/mi-vigem.exe",
"program": "bin/stadia-vigem.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
Expand Down
36 changes: 3 additions & 33 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"label": "Compile resources",
"command": "rc.exe",
"args": [
"/foobj/mi-vigem.res",
"/foobj/stadia-vigem.res",
"res/res.rc"
],
"group": "build",
Expand All @@ -17,22 +17,7 @@
{
"type": "shell",
"label": "Build debug binary",
"command": "cl.exe",
"args": [
"/Zi",
"/Od",
"/EHsc",
"/DWIN32",
"/D_UNICODE",
"/DUNICODE",
"/Iinclude",
"/Foobj/",
"/Febin/mi-vigem.exe",
"lib/ViGEmClient/*.cpp",
"obj/mi-vigem.res",
"src/*.c"

],
"command": "./Build-Debug.cmd",
"problemMatcher": [
"$msCompile"
],
Expand All @@ -44,22 +29,7 @@
{
"type": "shell",
"label": "Build release binary",
"command": "cl.exe",
"args": [
"/GL",
"/Zi",
"/O2",
"/EHsc",
"/DWIN32",
"/D_UNICODE",
"/DUNICODE",
"/Iinclude",
"/Foobj/",
"/Febin/mi-vigem.exe",
"lib/ViGEmClient/*.cpp",
"obj/mi-vigem.res",
"src/*.c"
],
"command": "./Build-Release.cmd",
"problemMatcher": [
"$msCompile"
],
Expand Down
5 changes: 5 additions & 0 deletions Build-Debug.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdir bin
mkdir Foobj
mkdir obj
rc.exe /foobj/stadia-vigem.res res/res.rc
cl.exe /Zi /Od /EHsc /DWIN32 /D_UNICODE /DUNICODE /Iinclude /Foobj/ /Febin/stadia-vigem.exe lib/ViGEmClient/*.cpp obj/stadia-vigem.res src/*.c
5 changes: 5 additions & 0 deletions Build-Release.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdir bin
mkdir Foobj
mkdir obj
rc.exe /foobj/stadia-vigem.res res/res.rc
cl.exe /GL /Zi /O2 /EHsc /DWIN32 /D_UNICODE /DUNICODE /Iinclude /Foobj/ /Febin/stadia-vigem.exe lib/ViGEmClient/*.cpp obj/stadia-vigem.res src/*.c
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Mi-ViGEm
# Stadia-ViGEm

XBox360 controller emulation for Xiaomi gamepad. Supports multiple devices and vibration. Implemented on vanilla C and WinAPI, supposed to be much more lightweight comparing to it's analogs.
XBox360 controller emulation for Stadia controller. Supports multiple devices and vibration. Forked from Mi-ViGEm (https://github.com/grayver/Mi-ViGEm) by grayver.
XBox360 emulation driver is provided by ViGEm (https://github.com/ViGEm/ViGEmBus), by Benjamin Höglinger.

## Requirements
- Windows 10 (should work on Windows 7 and 8 also)
- ViGEm bus installed (can be downloaded [here](https://github.com/ViGEm/ViGEmBus/releases))

## How it works
Mi-ViGEm program at start scans for Xiaomi Gamepad devices and then proxies found Xiaomi gamepads to virtual XBox360 gamepads (with help of ViGEmBus). Also Mi-ViGEm subscribes to system device plug/unplug notifications and rescan devices on each notification.
All found devices are displayed in tray icon context menu (along with their battery level). Manual device rescan can be initiated via tray icon context menu.
Stadia-ViGEm program at start scans for Stadia Controllers and then proxies found Stadia Controllers to virtual XBox360 gamepads (with help of ViGEmBus). Also Stadia-ViGEm subscribes to system device plug/unplug notifications and rescan devices on each notification.
All found devices are displayed in tray icon context menu. Manual device rescan can be initiated via tray icon context menu.

## Thanks to

grayver, the developer of Mi-ViGEm that makes up 95% of this program.

This project is inspired by following projects written on C#:
- https://github.com/irungentoo/Xiaomi_gamepad
- https://github.com/dancol90/mi-360
Expand Down
16 changes: 8 additions & 8 deletions res/res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
APP_ICON ICON "icon.ico"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,0,0
PRODUCTVERSION 1,1,0,0
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "Mi-ViGEm application"
VALUE "FileVersion", "1.1.0.0"
VALUE "LegalCopyright", "Grayver"
VALUE "OriginalFilename", "mi-vigem.exe"
VALUE "ProductName", "Mi-ViGEm"
VALUE "ProductVersion", "1.1.0.0"
VALUE "FileDescription", "Stadia Controller ViGEm client"
VALUE "FileVersion", "1.0.0.0"
VALUE "LegalCopyright", "WALKCO"
VALUE "OriginalFilename", "stadia-vigem.exe"
VALUE "ProductName", "Stadia-ViGEm"
VALUE "ProductVersion", "1.0.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit e428e42

Please sign in to comment.