From 9d2443ed0019483f53df7f882e1637a2b732e18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger-Stelzer?= Date: Thu, 14 Nov 2019 18:46:02 +0100 Subject: [PATCH] Attempted to fix issue #5 Added basic DS4 test code to tester application --- app/Tester/Tester.cpp | 30 ++++++++++++++++++++++++++++-- app/Tester/Tester.vcxproj | 10 +++++----- appveyor.yml | 2 +- src/ViGEmClient.cpp | 12 +++++++++++- src/ViGEmClient.vcxproj | 18 +++++++++--------- 5 files changed, 54 insertions(+), 18 deletions(-) diff --git a/app/Tester/Tester.cpp b/app/Tester/Tester.cpp index dc8f4a9..0dc3074 100644 --- a/app/Tester/Tester.cpp +++ b/app/Tester/Tester.cpp @@ -38,12 +38,19 @@ int main() auto ret = vigem_connect(client); +#if X360 const auto x360 = vigem_target_x360_alloc(); - ret = vigem_target_add(client, x360); + ret = vigem_target_add(client, x360); - ret = vigem_target_x360_register_notification(client, x360, ¬ification); + ret = vigem_target_x360_register_notification(client, x360, ¬ification); +#endif + + const auto ds4 = vigem_target_ds4_alloc(); + + ret = vigem_target_add(client, ds4); +#if X360 XUSB_REPORT report; XUSB_REPORT_INIT(&report); @@ -54,8 +61,27 @@ int main() Sleep(10); } +#endif + + DS4_REPORT report; + DS4_REPORT_INIT(&report); + + while (!(GetAsyncKeyState(VK_ESCAPE) & 0x8000)) + { + ret = vigem_target_ds4_update(client, ds4, report); + report.bThumbLX++; + report.wButtons |= DS4_BUTTON_CIRCLE; + Sleep(10); + } + +#if X360 vigem_target_x360_unregister_notification(x360); vigem_target_remove(client, x360); vigem_target_free(x360); +#endif + + vigem_target_remove(client, ds4); + vigem_target_free(ds4); + vigem_free(client); } diff --git a/app/Tester/Tester.vcxproj b/app/Tester/Tester.vcxproj index 045ec6d..2dcc7f4 100644 --- a/app/Tester/Tester.vcxproj +++ b/app/Tester/Tester.vcxproj @@ -23,32 +23,32 @@ {2F4ED0AB-0B51-4506-91AA-1984C5D44B85} Win32Proj Tester - 10.0.17763.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/appveyor.yml b/appveyor.yml index 710f231..cb72e00 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 1.16.{build}.0 -image: Visual Studio 2017 +image: Visual Studio 2019 build_script: - ps: .\build.ps1 artifacts: diff --git a/src/ViGEmClient.cpp b/src/ViGEmClient.cpp index cc23494..8055d82 100644 --- a/src/ViGEmClient.cpp +++ b/src/ViGEmClient.cpp @@ -23,11 +23,17 @@ SOFTWARE. */ +// +// WinAPI +// #include #include #include #include +// +// Driver shared +// #include "ViGEm/km/BusShared.h" #include "ViGEm/Client.h" #include @@ -39,11 +45,15 @@ SOFTWARE. #include #include #include - #include +#include +// +// Internal +// #include "Internal.h" + typedef BOOL(WINAPI *MINIDUMPWRITEDUMP)( HANDLE hProcess, DWORD dwPid, diff --git a/src/ViGEmClient.vcxproj b/src/ViGEmClient.vcxproj index dddf1ba..3e6c8c9 100644 --- a/src/ViGEmClient.vcxproj +++ b/src/ViGEmClient.vcxproj @@ -42,59 +42,59 @@ $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) - $(LatestTargetPlatformVersion) + 10.0 $(WindowsTargetPlatformVersion) StaticLibrary true - v141 + v142 Unicode DynamicLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode DynamicLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode DynamicLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode DynamicLibrary false - v141 + v142 true Unicode