- Update ViGEm

This commit is contained in:
David Khachaturov 2021-03-29 09:40:15 +01:00
parent 19bc9e32c5
commit 8d14a39ea4
6 changed files with 16 additions and 14 deletions

View file

@ -102,8 +102,8 @@
<Reference Include="JetBrains.Annotations, Version=2020.1.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.1.0\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference>
<Reference Include="Nefarius.ViGEm.Client, Version=1.17.175.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nefarius.ViGEm.Client.1.17.175\lib\net452\Nefarius.ViGEm.Client.dll</HintPath>
<Reference Include="Nefarius.ViGEm.Client, Version=1.17.178.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nefarius.ViGEm.Client.1.17.178\lib\net452\Nefarius.ViGEm.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@ -180,6 +180,12 @@
<None Include="Drivers\HIDGuardian\_drivers\HidGuardian\HidGuardian.sys">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Content Include="Drivers\ViGEmBusSetup_x64.msi">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Drivers\ViGEmBusSetup_x86.msi">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
@ -232,9 +238,6 @@
<Content Include="Drivers\README.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Drivers\ViGEmBus_Setup_1.16.116.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Icons\snes.png" />
<None Include="Properties\app.manifest" />
<Content Include="Icons\betterjoyforcemu_icon.ico" />

Binary file not shown.

Binary file not shown.

View file

@ -21,7 +21,7 @@ namespace BetterJoyForCemu {
public Joycon other {
get {
return _other;
}
}
set {
_other = value;
@ -29,13 +29,12 @@ namespace BetterJoyForCemu {
if (_other == null || _other == this) {
// Set LED to current Pad ID
SetLEDByPlayerNum(PadId);
}
else {
} else {
// Set LED to current Joycon Pair
int lowestPadId = Math.Min(_other.PadId, PadId);
SetLEDByPlayerNum(lowestPadId);
}
}
}
}
public bool active_gyro = false;
@ -148,7 +147,7 @@ namespace BetterJoyForCemu {
public Queue<float[]> queue;
public void set_vals(float low_freq, float high_freq, float amplitude) {
float[] rumbleQueue = new float[] {low_freq, high_freq, amplitude};
float[] rumbleQueue = new float[] { low_freq, high_freq, amplitude };
// Keep a queue of 15 items, discard oldest item if queue is full.
if (queue.Count > 15) {
queue.Dequeue();
@ -288,7 +287,7 @@ namespace BetterJoyForCemu {
handle = handle_;
imu_enabled = imu;
do_localize = localize;
rumble_obj = new Rumble(new float[] {lowFreq, highFreq, 0});
rumble_obj = new Rumble(new float[] { lowFreq, highFreq, 0 });
for (int i = 0; i < buttons_down_timestamp.Length; i++)
buttons_down_timestamp[i] = -1;
filterweight = alpha;
@ -521,7 +520,7 @@ namespace BetterJoyForCemu {
HIDapi.hid_set_nonblocking(handle, 0);
// Subcommand(0x40, new byte[] { 0x0 }, 1); // disable IMU sensor
//Subcommand(0x48, new byte[] { 0x0 }, 1); // Would turn off rumble?
//Subcommand(0x48, new byte[] { 0x0 }, 1); // Would turn off rumble?
if (isUSB) {
byte[] a = Enumerable.Repeat((byte)0, 64).ToArray();
@ -809,7 +808,7 @@ namespace BetterJoyForCemu {
stop_polling = false;
int attempts = 0;
while (!stop_polling & state > state_.NO_JOYCONS) {
if (rumble_obj.queue.Count > 0) {
if (rumble_obj.queue.Count > 0a) {
SendRumble(rumble_obj.GetData());
}
int a = ReceiveRaw();

View file

@ -2,6 +2,6 @@
<packages>
<package id="Crc32.NET" version="1.2.0" targetFramework="net461" />
<package id="JetBrains.Annotations" version="2020.1.0" targetFramework="net461" />
<package id="Nefarius.ViGEm.Client" version="1.17.175" targetFramework="net461" />
<package id="Nefarius.ViGEm.Client" version="1.17.178" targetFramework="net461" />
<package id="WindowsInput" version="6.1.0" targetFramework="net461" />
</packages>