Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Updated XOutput1_1.dll
Browse files Browse the repository at this point in the history
nefarius committed Mar 22, 2016
1 parent 7b8f347 commit 85cc28d
Showing 2 changed files with 0 additions and 0 deletions.
Binary file modified ScpControl/XOutput/amd64/XOutput1_1.dll
Binary file not shown.
Binary file modified ScpControl/XOutput/x86/XOutput1_1.dll
Binary file not shown.

5 comments on commit 85cc28d

@mirh
Copy link

@mirh mirh commented on 85cc28d Mar 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between this and x360ce? And why is it needed?
Sorry :s

@nefarius
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot =P

I just found it tempting to invent a library that's used for the exact opposite than the official Microsoft XInput-API so I named it XOutput. This project basically allows any user-mode application to conveniently communicate with the controller emulator driver.

x360ce isn't - despite the name - an actual controller emulator, it tricks the game process into calling its own implementation of the XInput API while the bus driver actually emulates an Xbox controller like it's really physically plugged in. Then I don't have to care about swapping out DLLs and praying that this won't break anything within the target process.

EDIT: here's the project location of XOutput.

@mirh
Copy link

@mirh mirh commented on 85cc28d Mar 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, god. I thought it was about this https://github.com/Stents-/XOutput

@shauleiz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive me for stepping in.
XOutput DLL is an important step in creating a solid API for "Feeder" side, or the hardware side of the SCP virtual devices.
The XInput functions are used by the game application to get position data (State) from the controller, get the controller's capabilities or send Rumble to the controller.
When a physical controller is connected, it is the controller hardware that is eventually responsible for interfacing with these functions.
In our case, it is the virtual device that has to do it. Some data is hard-coded into it but the its position (state) has to be fed from outside.
To make ScpVBus useful to software other than SvpServer - it was wise of @nefarius to add this API that simplifies the interface with the bus and the virtual devices attached to it.

If I may add, XInput supports User Index in the range of 0-3. XOutput, for some reason supports 1-3 See function XOutputGetState():

 DWORD XOutputGetState(DWORD dwUserIndex, PBYTE bVibrate, PBYTE bLargeMotor, PBYTE    bSmallMotor)
{
     if (g_hScpVBus == INVALID_HANDLE_VALUE)
    {
    return ERROR_VBUS_NOT_CONNECTED;
    }

   if (dwUserIndex < 1 || dwUserIndex > 3)
  {
    return ERROR_VBUS_INDEX_OUT_OF_RANGE;
  }

@nefarius
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shauleiz oooops, bug alert! Should be 1-4 ofc.! The reason I'm not using 0-3 is because the plug-in and unplug functions accept 0 which represents all child devices on the bus instead of device no. 1. I have to update the auto-generated comment blocks to reflect this too.

Please sign in to comment.