Looking at the input packages from the controller it looks like you need to create a buffer of size 0x0E = 14, ZeroMemory it (or just write the first byte to 0 like MSDN is suggesting) and just call HidD_GetInputReport(HANDLE, buffer, 14) HidD_SetOutputReport(gamePad, (PVOID)&rc, sizeof(RumbleContinous )) This is how I did it: struct RumbleContinous This turns on and of all motors with the rumble motors speed at 0xFF and the triggers at speed 0xF0. With that information i was able to let the motors and triggers rumble as I desireįor example: Two of my output rumble packets look like this (Using the pulse length to dirty turn on and off the motors):.All in and outcoming data (At least buttons and Rumble motors) seem to follow the following patternīyte 2: Package number (always incrementing every package).Using HidP_GetCaps(HANDLE, HIDP_CAPS*) doesn’t seem to return valid data since it reports a OutputReportByteLength of 0 but I am able to send Output reports of size 5 (Turn ON) and 9 (Set rumble motors).I have created a handle to the device using HANDLE gamePad = CreateFile(path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL).I have found the controller’s path using SetupDiGetClassDevs(.), SetupDiEnumDeviceInfo(.), SetupDiEnumDeviceInterfaces(.) and SetupDiGetDeviceInterfaceDetail(.).I have connected the gamepad via USB with my computer (So that I can read all the USB Packages sent and received from the device).The main goal is to overcome the XINPUT overhead and writing a flexible framework so that I can integrate other gamepads as well. I have already reverse engineered the USB URB protocol with the help of the following article. But I'm stuck reading the button values using HidD_GetInputReport(HANDLE, VOID*, ULONG) or ReadFile() / ReadFileEx() with and without the HANDLE being created with FILE_FLAG_OVERLAPPED and using OVERLAPPED and Windows Events. I'm currently able to control all the rumble motors (including the force feedback triggers) by sending the packet using HidD_SetOutputReport(HANDLE, VOID*, ULONG). Fixed a bug that prevented files from opening when dropped on the app icon.I am trying to talk to the XBOX ONE Controller via the Microsoft HID API without using XINPUT. Fixed a bug that prevented Xbox One controller triggers from working. Fixed a bug that prevented game controllers from registering D-pad diagonal directions properly. Worked around a bug in macOS Catalina that caused a warning dialog to appear. Added support for the Switch Pro controller, Xbox One controller and newer PS4 controllers. Added a completely redesigned interface for configuring game controllers. Completely rewrote game controller support, adding new controller art, improved element naming and much more. sixtyforce can now download and install app updates. Rewrote the majority of sixtyforce in Swift. Start the implementation of the buffer in real time. Improved restoration and registration status. Updated to use modern memory protection. Fixed a bug that caused the left and right audio channels were reversed. Added default settings for multiple controllers. The USB controllers can now be connected and disconnected when Sistyforce is running. Nearly every part of a Nintendo 64 has been painstakingly recreated entirely out of software to pull off such an amazing feat. It does this by dynamically translating the code that a Nintendo 64 uses into something your Mac understands. Sixtyforce the Nintendo 64 emulator for the Mac.
0 Comments
Leave a Reply. |