Compare commits
2 Commits
metal
...
d16e39da1f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d16e39da1f | ||
|
|
4028a623be |
@@ -3,6 +3,7 @@
|
|||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="Alimer.Bindings.SDL" Version="3.7.1" />
|
||||||
<PackageVersion Include="Avalonia" Version="11.0.13" />
|
<PackageVersion Include="Avalonia" Version="11.0.13" />
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.0.13" />
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.0.13" />
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="11.0.13" />
|
<PackageVersion Include="Avalonia.Desktop" Version="11.0.13" />
|
||||||
@@ -42,7 +43,7 @@
|
|||||||
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
|
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
|
||||||
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
|
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
|
||||||
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
||||||
<PackageVersion Include="Gommon" Version="2.7.1.1" />
|
<PackageVersion Include="Gommon" Version="2.7.1" />
|
||||||
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
||||||
<PackageVersion Include="Sep" Version="0.6.0" />
|
<PackageVersion Include="Sep" Version="0.6.0" />
|
||||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Horizon", "src\Ryuj
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Horizon.Kernel.Generators", "src\Ryujinx.Horizon.Kernel.Generators\Ryujinx.Horizon.Kernel.Generators.csproj", "{7F55A45D-4E1D-4A36-ADD3-87F29A285AA2}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Horizon.Kernel.Generators", "src\Ryujinx.Horizon.Kernel.Generators\Ryujinx.Horizon.Kernel.Generators.csproj", "{7F55A45D-4E1D-4A36-ADD3-87F29A285AA2}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ryujinx.Input.SDL3", "src\Ryujinx.Input.SDL3\Ryujinx.Input.SDL3.csproj", "{3BF24278-547D-42C2-9D43-182B978F54DD}"
|
||||||
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.HLE.Generators", "src\Ryujinx.HLE.Generators\Ryujinx.HLE.Generators.csproj", "{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.HLE.Generators", "src\Ryujinx.HLE.Generators\Ryujinx.HLE.Generators.csproj", "{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ryujinx.Graphics.Metal", "src\Ryujinx.Graphics.Metal\Ryujinx.Graphics.Metal.csproj", "{C08931FA-1191-417A-864F-3882D93E683B}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ryujinx.Graphics.Metal", "src\Ryujinx.Graphics.Metal\Ryujinx.Graphics.Metal.csproj", "{C08931FA-1191-417A-864F-3882D93E683B}"
|
||||||
@@ -259,6 +261,10 @@ Global
|
|||||||
{81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Release|Any CPU.Build.0 = Release|Any CPU
|
{81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3BF24278-547D-42C2-9D43-182B978F54DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3BF24278-547D-42C2-9D43-182B978F54DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3BF24278-547D-42C2-9D43-182B978F54DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3BF24278-547D-42C2-9D43-182B978F54DD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -1436,7 +1436,7 @@
|
|||||||
010083A018262000,"Hitman: Blood Money — Reprisal",deadlock,ingame,2024-09-28 16:28:50
|
010083A018262000,"Hitman: Blood Money — Reprisal",deadlock,ingame,2024-09-28 16:28:50
|
||||||
01004B100A5CC000,"Hob: The Definitive Edition",,playable,2021-01-13 09:39:19
|
01004B100A5CC000,"Hob: The Definitive Edition",,playable,2021-01-13 09:39:19
|
||||||
0100F7300ED2C000,"Hoggy2",,playable,2022-10-10 13:53:35
|
0100F7300ED2C000,"Hoggy2",,playable,2022-10-10 13:53:35
|
||||||
0100F7E00C70E000,"Hogwarts Legacy",UE4;slow,ingame,2024-09-03 19:53:58
|
0100F7E00C70E000,"Hogwarts Legacy",slow,ingame,2024-09-03 19:53:58
|
||||||
0100633007D48000,"Hollow Knight",nvdec,playable,2023-01-16 15:44:56
|
0100633007D48000,"Hollow Knight",nvdec,playable,2023-01-16 15:44:56
|
||||||
0100F2100061E800,"Hollow0",UE4;gpu,ingame,2021-03-03 23:42:56
|
0100F2100061E800,"Hollow0",UE4;gpu,ingame,2021-03-03 23:42:56
|
||||||
0100342009E16000,"Holy Potatoes! What The Hell?!",,playable,2020-07-03 10:48:56
|
0100342009E16000,"Holy Potatoes! What The Hell?!",,playable,2020-07-03 10:48:56
|
||||||
@@ -1800,7 +1800,6 @@
|
|||||||
010005A00B312000,"Megaton Rainfall",gpu;opengl,boots,2022-08-04 18:29:43
|
010005A00B312000,"Megaton Rainfall",gpu;opengl,boots,2022-08-04 18:29:43
|
||||||
0100EA100DF92000,"Meiji Katsugeki Haikara Ryuuseigumi - Seibai Shimaseu, Yonaoshi Kagyou",32-bit;nvdec,playable,2022-12-05 13:19:12
|
0100EA100DF92000,"Meiji Katsugeki Haikara Ryuuseigumi - Seibai Shimaseu, Yonaoshi Kagyou",32-bit;nvdec,playable,2022-12-05 13:19:12
|
||||||
0100B360068B2000,"Mekorama",gpu,boots,2021-06-17 16:37:21
|
0100B360068B2000,"Mekorama",gpu,boots,2021-06-17 16:37:21
|
||||||
010012301932A000,"Melatonin",,playable,2025-02-16 04:08:17
|
|
||||||
01000FA010340000,"Melbits World",nvdec;online,menus,2021-11-26 13:51:22
|
01000FA010340000,"Melbits World",nvdec;online,menus,2021-11-26 13:51:22
|
||||||
0100F68019636000,"Melon Journey",,playable,2023-04-23 21:20:01
|
0100F68019636000,"Melon Journey",,playable,2023-04-23 21:20:01
|
||||||
010079C012896000,"Memories Off -Innocent Fille- for Dearest",,playable,2020-08-04 07:31:22
|
010079C012896000,"Memories Off -Innocent Fille- for Dearest",,playable,2020-08-04 07:31:22
|
||||||
|
|||||||
|
@@ -56,6 +56,7 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion
|
|||||||
return motionBackendType switch
|
return motionBackendType switch
|
||||||
{
|
{
|
||||||
MotionInputBackendType.GamepadDriver => JsonSerializer.Deserialize(ref reader, _serializerContext.StandardMotionConfigController),
|
MotionInputBackendType.GamepadDriver => JsonSerializer.Deserialize(ref reader, _serializerContext.StandardMotionConfigController),
|
||||||
|
MotionInputBackendType.Handheld => JsonSerializer.Deserialize(ref reader, _serializerContext.StandardMotionConfigController),
|
||||||
MotionInputBackendType.CemuHook => JsonSerializer.Deserialize(ref reader, _serializerContext.CemuHookMotionConfigController),
|
MotionInputBackendType.CemuHook => JsonSerializer.Deserialize(ref reader, _serializerContext.CemuHookMotionConfigController),
|
||||||
_ => throw new InvalidOperationException($"Unknown backend type {motionBackendType}"),
|
_ => throw new InvalidOperationException($"Unknown backend type {motionBackendType}"),
|
||||||
};
|
};
|
||||||
@@ -66,6 +67,7 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion
|
|||||||
switch (value.MotionBackend)
|
switch (value.MotionBackend)
|
||||||
{
|
{
|
||||||
case MotionInputBackendType.GamepadDriver:
|
case MotionInputBackendType.GamepadDriver:
|
||||||
|
case MotionInputBackendType.Handheld:
|
||||||
JsonSerializer.Serialize(writer, value as StandardMotionConfigController, _serializerContext.StandardMotionConfigController);
|
JsonSerializer.Serialize(writer, value as StandardMotionConfigController, _serializerContext.StandardMotionConfigController);
|
||||||
break;
|
break;
|
||||||
case MotionInputBackendType.CemuHook:
|
case MotionInputBackendType.CemuHook:
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion
|
|||||||
Invalid,
|
Invalid,
|
||||||
GamepadDriver,
|
GamepadDriver,
|
||||||
CemuHook,
|
CemuHook,
|
||||||
|
Handheld,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace Ryujinx.Common
|
|
||||||
{
|
|
||||||
public static class SharedConstants
|
|
||||||
{
|
|
||||||
public const string DefaultLanPlayHost = "ryuldn.vudjun.com";
|
|
||||||
public const short LanPlayPort = 30456;
|
|
||||||
public const string DefaultLanPlayWebHost = "ryuldnweb.vudjun.com";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -23,6 +23,9 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
|
|||||||
{
|
{
|
||||||
class IUserLocalCommunicationService : IpcService, IDisposable
|
class IUserLocalCommunicationService : IpcService, IDisposable
|
||||||
{
|
{
|
||||||
|
public static string DefaultLanPlayHost = "ryuldn.vudjun.com";
|
||||||
|
public static short LanPlayPort = 30456;
|
||||||
|
|
||||||
public INetworkClient NetworkClient { get; private set; }
|
public INetworkClient NetworkClient { get; private set; }
|
||||||
|
|
||||||
private const int NifmRequestID = 90;
|
private const int NifmRequestID = 90;
|
||||||
@@ -1089,18 +1092,20 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
|
|||||||
case MultiplayerMode.LdnRyu:
|
case MultiplayerMode.LdnRyu:
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string ldnServer = context.Device.Configuration.MultiplayerLdnServer
|
string ldnServer = context.Device.Configuration.MultiplayerLdnServer;
|
||||||
?? throw new InvalidOperationException("Cannot initialize RyuLDN with a null Multiplayer server.");
|
if (string.IsNullOrEmpty(ldnServer))
|
||||||
|
{
|
||||||
|
ldnServer = DefaultLanPlayHost;
|
||||||
|
}
|
||||||
if (!IPAddress.TryParse(ldnServer, out IPAddress ipAddress))
|
if (!IPAddress.TryParse(ldnServer, out IPAddress ipAddress))
|
||||||
{
|
{
|
||||||
ipAddress = Dns.GetHostEntry(ldnServer).AddressList[0];
|
ipAddress = Dns.GetHostEntry(ldnServer).AddressList[0];
|
||||||
}
|
}
|
||||||
NetworkClient = new LdnMasterProxyClient(ipAddress.ToString(), SharedConstants.LanPlayPort, context.Device.Configuration);
|
NetworkClient = new LdnMasterProxyClient(ipAddress.ToString(), LanPlayPort, context.Device.Configuration);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Error?.Print(LogClass.ServiceLdn, "Could not locate RyuLDN server. Defaulting to stubbed wireless.");
|
Logger.Error?.Print(LogClass.ServiceLdn, "Could not locate LdnRyu server. Defaulting to stubbed wireless.");
|
||||||
Logger.Error?.Print(LogClass.ServiceLdn, ex.Message);
|
Logger.Error?.Print(LogClass.ServiceLdn, ex.Message);
|
||||||
NetworkClient = new LdnDisabledClient();
|
NetworkClient = new LdnDisabledClient();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ namespace Ryujinx.Input.SDL2
|
|||||||
byte blue = packedRgb > 0 ? (byte)(packedRgb % 256) : (byte)0;
|
byte blue = packedRgb > 0 ? (byte)(packedRgb % 256) : (byte)0;
|
||||||
|
|
||||||
if (SDL_GameControllerSetLED(_gamepadHandle, red, green, blue) != 0)
|
if (SDL_GameControllerSetLED(_gamepadHandle, red, green, blue) != 0)
|
||||||
Logger.Debug?.Print(LogClass.Hid, "LED setting failed; probably in the middle of disconnecting.");
|
Logger.Error?.Print(LogClass.Hid, "LED setting failed; probably in the middle of disconnecting.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private GamepadFeaturesFlag GetFeaturesFlag()
|
private GamepadFeaturesFlag GetFeaturesFlag()
|
||||||
|
|||||||
13
src/Ryujinx.Input.SDL3/Ryujinx.Input.SDL3.csproj
Normal file
13
src/Ryujinx.Input.SDL3/Ryujinx.Input.SDL3.csproj
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Ryujinx.Input\Ryujinx.Input.csproj" />
|
||||||
|
<PackageReference Include="Alimer.Bindings.SDL" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
85
src/Ryujinx.Input.SDL3/SDL3MotionDriver.cs
Normal file
85
src/Ryujinx.Input.SDL3/SDL3MotionDriver.cs
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
using SDL3;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Numerics;
|
||||||
|
using static SDL3.SDL3;
|
||||||
|
|
||||||
|
namespace Ryujinx.Input.SDL3
|
||||||
|
{
|
||||||
|
public unsafe class SDL3MotionDriver : IHandheld, IDisposable
|
||||||
|
{
|
||||||
|
private readonly Dictionary<SDL_SensorType, SDL_Sensor> sensors;
|
||||||
|
private bool _disposed;
|
||||||
|
|
||||||
|
public SDL3MotionDriver()
|
||||||
|
{
|
||||||
|
int result = SDL_Init(SDL_InitFlags.Sensor);
|
||||||
|
if (result < 0)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"SDL sensor initialization failed: {SDL_GetError()}");
|
||||||
|
}
|
||||||
|
sensors = SDL_GetSensors().ToArray().ToDictionary(SDL_GetSensorTypeForID, SDL_OpenSensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
~SDL3MotionDriver()
|
||||||
|
{
|
||||||
|
Dispose(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_disposed)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (disposing && sensors != null)
|
||||||
|
{
|
||||||
|
foreach (var sensor in sensors.Values)
|
||||||
|
{
|
||||||
|
if (sensor != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
SDL_CloseSensor(sensor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector3 GetMotionData(MotionInputId inputType)
|
||||||
|
{
|
||||||
|
ObjectDisposedException.ThrowIf(_disposed, this);
|
||||||
|
|
||||||
|
return inputType switch
|
||||||
|
{
|
||||||
|
MotionInputId.Gyroscope => GetSensorVector(SDL_SensorType.Gyro) * 180 / MathF.PI,
|
||||||
|
MotionInputId.Accelerometer => GetSensorVector(SDL_SensorType.Accel) / SDL_STANDARD_GRAVITY,
|
||||||
|
_ => Vector3.Zero
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private Vector3 GetSensorVector(SDL_SensorType sensorType)
|
||||||
|
{
|
||||||
|
if (!sensors.TryGetValue(sensorType, out SDL_Sensor sensor))
|
||||||
|
{
|
||||||
|
return Vector3.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = stackalloc float[3];
|
||||||
|
if (SDL_GetSensorData(sensor, data, 3) < 0)
|
||||||
|
{
|
||||||
|
return Vector3.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Vector3(data[0], data[1], data[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,12 +2,13 @@ using System;
|
|||||||
|
|
||||||
namespace Ryujinx.Input.HLE
|
namespace Ryujinx.Input.HLE
|
||||||
{
|
{
|
||||||
public class InputManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver)
|
public class InputManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver, IHandheld handheld)
|
||||||
: IDisposable
|
: IDisposable
|
||||||
{
|
{
|
||||||
public IGamepadDriver KeyboardDriver { get; } = keyboardDriver;
|
public IGamepadDriver KeyboardDriver { get; } = keyboardDriver;
|
||||||
public IGamepadDriver GamepadDriver { get; } = gamepadDriver;
|
public IGamepadDriver GamepadDriver { get; } = gamepadDriver;
|
||||||
public IGamepadDriver MouseDriver { get; private set; }
|
public IGamepadDriver MouseDriver { get; private set; }
|
||||||
|
public IHandheld Handheld { get; } = handheld;
|
||||||
|
|
||||||
public void SetMouseDriver(IGamepadDriver mouseDriver)
|
public void SetMouseDriver(IGamepadDriver mouseDriver)
|
||||||
{
|
{
|
||||||
@@ -18,7 +19,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
|
|
||||||
public NpadManager CreateNpadManager()
|
public NpadManager CreateNpadManager()
|
||||||
{
|
{
|
||||||
return new NpadManager(KeyboardDriver, GamepadDriver, MouseDriver);
|
return new NpadManager(KeyboardDriver, GamepadDriver, MouseDriver, Handheld);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TouchScreenManager CreateTouchScreenManager()
|
public TouchScreenManager CreateTouchScreenManager()
|
||||||
@@ -38,6 +39,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
KeyboardDriver?.Dispose();
|
KeyboardDriver?.Dispose();
|
||||||
GamepadDriver?.Dispose();
|
GamepadDriver?.Dispose();
|
||||||
MouseDriver?.Dispose();
|
MouseDriver?.Dispose();
|
||||||
|
Handheld?.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,12 +218,14 @@ namespace Ryujinx.Input.HLE
|
|||||||
public string Id { get; private set; }
|
public string Id { get; private set; }
|
||||||
|
|
||||||
private readonly CemuHookClient _cemuHookClient;
|
private readonly CemuHookClient _cemuHookClient;
|
||||||
|
private readonly IHandheld _handheld;
|
||||||
|
|
||||||
public NpadController(CemuHookClient cemuHookClient)
|
public NpadController(CemuHookClient cemuHookClient, IHandheld handheld)
|
||||||
{
|
{
|
||||||
State = default;
|
State = default;
|
||||||
Id = null;
|
Id = null;
|
||||||
_cemuHookClient = cemuHookClient;
|
_cemuHookClient = cemuHookClient;
|
||||||
|
_handheld = handheld;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateDriverConfiguration(IGamepadDriver gamepadDriver, InputConfig config)
|
public bool UpdateDriverConfiguration(IGamepadDriver gamepadDriver, InputConfig config)
|
||||||
@@ -287,6 +289,18 @@ namespace Ryujinx.Input.HLE
|
|||||||
|
|
||||||
if (_config is StandardControllerInputConfig controllerConfig && controllerConfig.Motion.EnableMotion)
|
if (_config is StandardControllerInputConfig controllerConfig && controllerConfig.Motion.EnableMotion)
|
||||||
{
|
{
|
||||||
|
if (controllerConfig.Motion.MotionBackend == MotionInputBackendType.Handheld)
|
||||||
|
{
|
||||||
|
Vector3 accelerometer = _handheld.GetMotionData(MotionInputId.Accelerometer);
|
||||||
|
Vector3 gyroscope = _handheld.GetMotionData(MotionInputId.Gyroscope);
|
||||||
|
|
||||||
|
accelerometer = new Vector3(accelerometer.X, -accelerometer.Z, accelerometer.Y);
|
||||||
|
gyroscope = new Vector3(gyroscope.X, -gyroscope.Z, gyroscope.Y);
|
||||||
|
|
||||||
|
_leftMotionInput.Update(accelerometer, gyroscope, (ulong)PerformanceCounter.ElapsedNanoseconds / 1000, controllerConfig.Motion.Sensitivity, (float)controllerConfig.Motion.GyroDeadzone);
|
||||||
|
_rightMotionInput = _leftMotionInput;
|
||||||
|
}
|
||||||
|
|
||||||
if (controllerConfig.Motion.MotionBackend == MotionInputBackendType.GamepadDriver)
|
if (controllerConfig.Motion.MotionBackend == MotionInputBackendType.GamepadDriver)
|
||||||
{
|
{
|
||||||
if (gamepad.Features.HasFlag(GamepadFeaturesFlag.Motion))
|
if (gamepad.Features.HasFlag(GamepadFeaturesFlag.Motion))
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
private readonly IGamepadDriver _keyboardDriver;
|
private readonly IGamepadDriver _keyboardDriver;
|
||||||
private readonly IGamepadDriver _gamepadDriver;
|
private readonly IGamepadDriver _gamepadDriver;
|
||||||
private readonly IGamepadDriver _mouseDriver;
|
private readonly IGamepadDriver _mouseDriver;
|
||||||
|
private readonly IHandheld _handheld;
|
||||||
private bool _isDisposed;
|
private bool _isDisposed;
|
||||||
|
|
||||||
private List<InputConfig> _inputConfig;
|
private List<InputConfig> _inputConfig;
|
||||||
@@ -38,7 +39,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
private bool _enableMouse;
|
private bool _enableMouse;
|
||||||
private Switch _device;
|
private Switch _device;
|
||||||
|
|
||||||
public NpadManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver, IGamepadDriver mouseDriver)
|
public NpadManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver, IGamepadDriver mouseDriver, IHandheld handheld)
|
||||||
{
|
{
|
||||||
_controllers = new NpadController[MaxControllers];
|
_controllers = new NpadController[MaxControllers];
|
||||||
_cemuHookClient = new CemuHookClient(this);
|
_cemuHookClient = new CemuHookClient(this);
|
||||||
@@ -47,6 +48,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
_gamepadDriver = gamepadDriver;
|
_gamepadDriver = gamepadDriver;
|
||||||
_mouseDriver = mouseDriver;
|
_mouseDriver = mouseDriver;
|
||||||
_inputConfig = [];
|
_inputConfig = [];
|
||||||
|
_handheld = handheld;
|
||||||
|
|
||||||
_gamepadDriver.OnGamepadConnected += HandleOnGamepadConnected;
|
_gamepadDriver.OnGamepadConnected += HandleOnGamepadConnected;
|
||||||
_gamepadDriver.OnGamepadDisconnected += HandleOnGamepadDisconnected;
|
_gamepadDriver.OnGamepadDisconnected += HandleOnGamepadDisconnected;
|
||||||
@@ -139,7 +141,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
controller = new(_cemuHookClient);
|
controller = new(_cemuHookClient, _handheld);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isValid = DriverConfigurationUpdate(ref controller, inputConfigEntry);
|
bool isValid = DriverConfigurationUpdate(ref controller, inputConfigEntry);
|
||||||
|
|||||||
10
src/Ryujinx.Input/IHandheld.cs
Normal file
10
src/Ryujinx.Input/IHandheld.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System;
|
||||||
|
using System.Numerics;
|
||||||
|
|
||||||
|
namespace Ryujinx.Input
|
||||||
|
{
|
||||||
|
public interface IHandheld : IDisposable
|
||||||
|
{
|
||||||
|
Vector3 GetMotionData(MotionInputId gyroscope);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -951,7 +951,7 @@ namespace Ryujinx.Ava
|
|||||||
ConfigurationState.Instance.Multiplayer.Mode,
|
ConfigurationState.Instance.Multiplayer.Mode,
|
||||||
ConfigurationState.Instance.Multiplayer.DisableP2p,
|
ConfigurationState.Instance.Multiplayer.DisableP2p,
|
||||||
ConfigurationState.Instance.Multiplayer.LdnPassphrase,
|
ConfigurationState.Instance.Multiplayer.LdnPassphrase,
|
||||||
ConfigurationState.Instance.Multiplayer.GetLdnServer(),
|
ConfigurationState.Instance.Multiplayer.LdnServer,
|
||||||
ConfigurationState.Instance.Graphics.CustomVSyncInterval.Value,
|
ConfigurationState.Instance.Graphics.CustomVSyncInterval.Value,
|
||||||
ConfigurationState.Instance.Hacks.ShowDirtyHacks ? ConfigurationState.Instance.Hacks.EnabledHacks : null));
|
ConfigurationState.Instance.Hacks.ShowDirtyHacks ? ConfigurationState.Instance.Hacks.EnabledHacks : null));
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@ using Ryujinx.HLE.HOS.Services.Account.Acc;
|
|||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
using Ryujinx.Input.HLE;
|
using Ryujinx.Input.HLE;
|
||||||
using Ryujinx.Input.SDL2;
|
using Ryujinx.Input.SDL2;
|
||||||
|
using Ryujinx.Input.SDL3;
|
||||||
using Ryujinx.SDL2.Common;
|
using Ryujinx.SDL2.Common;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -182,7 +183,7 @@ namespace Ryujinx.Headless
|
|||||||
_accountManager = new AccountManager(_libHacHorizonManager.RyujinxClient, option.UserProfile);
|
_accountManager = new AccountManager(_libHacHorizonManager.RyujinxClient, option.UserProfile);
|
||||||
_userChannelPersistence = new UserChannelPersistence();
|
_userChannelPersistence = new UserChannelPersistence();
|
||||||
|
|
||||||
_inputManager = new InputManager(new SDL2KeyboardDriver(), new SDL2GamepadDriver());
|
_inputManager = new InputManager(new SDL2KeyboardDriver(), new SDL2GamepadDriver(), new SDL3MotionDriver());
|
||||||
|
|
||||||
GraphicsConfig.EnableShaderCache = !option.DisableShaderCache;
|
GraphicsConfig.EnableShaderCache = !option.DisableShaderCache;
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
<ProjectReference Include="..\Ryujinx.Graphics.Metal\Ryujinx.Graphics.Metal.csproj" />
|
<ProjectReference Include="..\Ryujinx.Graphics.Metal\Ryujinx.Graphics.Metal.csproj" />
|
||||||
<ProjectReference Include="..\Ryujinx.Input\Ryujinx.Input.csproj" />
|
<ProjectReference Include="..\Ryujinx.Input\Ryujinx.Input.csproj" />
|
||||||
<ProjectReference Include="..\Ryujinx.Input.SDL2\Ryujinx.Input.SDL2.csproj" />
|
<ProjectReference Include="..\Ryujinx.Input.SDL2\Ryujinx.Input.SDL2.csproj" />
|
||||||
|
<ProjectReference Include="..\Ryujinx.Input.SDL3\Ryujinx.Input.SDL3.csproj" />
|
||||||
<ProjectReference Include="..\Ryujinx.Audio.Backends.OpenAL\Ryujinx.Audio.Backends.OpenAL.csproj" />
|
<ProjectReference Include="..\Ryujinx.Audio.Backends.OpenAL\Ryujinx.Audio.Backends.OpenAL.csproj" />
|
||||||
<ProjectReference Include="..\Ryujinx.Audio.Backends.SoundIo\Ryujinx.Audio.Backends.SoundIo.csproj" />
|
<ProjectReference Include="..\Ryujinx.Audio.Backends.SoundIo\Ryujinx.Audio.Backends.SoundIo.csproj" />
|
||||||
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace Ryujinx.Ava.UI.Models.Input
|
|||||||
public partial class GamepadInputConfig : BaseModel
|
public partial class GamepadInputConfig : BaseModel
|
||||||
{
|
{
|
||||||
public bool EnableCemuHookMotion { get; set; }
|
public bool EnableCemuHookMotion { get; set; }
|
||||||
|
public bool EnableHandheldMotion { get; set; }
|
||||||
public string DsuServerHost { get; set; }
|
public string DsuServerHost { get; set; }
|
||||||
public int DsuServerPort { get; set; }
|
public int DsuServerPort { get; set; }
|
||||||
public int Slot { get; set; }
|
public int Slot { get; set; }
|
||||||
@@ -162,7 +163,7 @@ namespace Ryujinx.Ava.UI.Models.Input
|
|||||||
EnableMotion = controllerInput.Motion.EnableMotion;
|
EnableMotion = controllerInput.Motion.EnableMotion;
|
||||||
GyroDeadzone = controllerInput.Motion.GyroDeadzone;
|
GyroDeadzone = controllerInput.Motion.GyroDeadzone;
|
||||||
Sensitivity = controllerInput.Motion.Sensitivity;
|
Sensitivity = controllerInput.Motion.Sensitivity;
|
||||||
|
EnableHandheldMotion = controllerInput.Motion.MotionBackend == MotionInputBackendType.Handheld;
|
||||||
if (controllerInput.Motion is CemuHookMotionConfigController cemuHook)
|
if (controllerInput.Motion is CemuHookMotionConfigController cemuHook)
|
||||||
{
|
{
|
||||||
EnableCemuHookMotion = true;
|
EnableCemuHookMotion = true;
|
||||||
@@ -285,7 +286,7 @@ namespace Ryujinx.Ava.UI.Models.Input
|
|||||||
config.Motion = new StandardMotionConfigController
|
config.Motion = new StandardMotionConfigController
|
||||||
{
|
{
|
||||||
EnableMotion = EnableMotion,
|
EnableMotion = EnableMotion,
|
||||||
MotionBackend = MotionInputBackendType.GamepadDriver,
|
MotionBackend = EnableHandheldMotion ? MotionInputBackendType.Handheld : MotionInputBackendType.GamepadDriver,
|
||||||
GyroDeadzone = GyroDeadzone,
|
GyroDeadzone = GyroDeadzone,
|
||||||
Sensitivity = Sensitivity,
|
Sensitivity = Sensitivity,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,6 +18,34 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
[ObservableProperty] private double _gyroDeadzone;
|
[ObservableProperty] private double _gyroDeadzone;
|
||||||
|
|
||||||
[ObservableProperty] private bool _enableCemuHookMotion;
|
private bool _enableCemuHookMotion;
|
||||||
|
public bool EnableCemuHookMotion
|
||||||
|
{
|
||||||
|
get => _enableCemuHookMotion;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
EnableHandheldMotion = false;
|
||||||
|
}
|
||||||
|
_enableCemuHookMotion = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _enableHandheldMotion;
|
||||||
|
public bool EnableHandheldMotion
|
||||||
|
{
|
||||||
|
get => _enableHandheldMotion;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
EnableCemuHookMotion = false;
|
||||||
|
}
|
||||||
|
_enableHandheldMotion = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -793,7 +793,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task HandleFirmwareInstallation(string filename)
|
private async Task HandleFirmwareInstallation(string filename)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,6 +61,17 @@
|
|||||||
Margin="5, 0"
|
Margin="5, 0"
|
||||||
Text="{Binding GyroDeadzone, StringFormat=\{0:0.00\}}" />
|
Text="{Binding GyroDeadzone, StringFormat=\{0:0.00\}}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<Separator
|
||||||
|
Height="1"
|
||||||
|
Margin="0,5" />
|
||||||
|
<CheckBox
|
||||||
|
Margin="5"
|
||||||
|
IsChecked="{Binding EnableHandheldMotion}">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,3,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{ext:Locale ControllerSettingsMotionUseHandheldCompatibleMotion}" />
|
||||||
|
</CheckBox>
|
||||||
<Separator
|
<Separator
|
||||||
Height="1"
|
Height="1"
|
||||||
Margin="0,5" />
|
Margin="0,5" />
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
Sensitivity = config.Sensitivity,
|
Sensitivity = config.Sensitivity,
|
||||||
GyroDeadzone = config.GyroDeadzone,
|
GyroDeadzone = config.GyroDeadzone,
|
||||||
EnableCemuHookMotion = config.EnableCemuHookMotion,
|
EnableCemuHookMotion = config.EnableCemuHookMotion,
|
||||||
|
EnableHandheldMotion = config.EnableHandheldMotion,
|
||||||
};
|
};
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -58,6 +59,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
config.DsuServerHost = content._viewModel.DsuServerHost;
|
config.DsuServerHost = content._viewModel.DsuServerHost;
|
||||||
config.DsuServerPort = content._viewModel.DsuServerPort;
|
config.DsuServerPort = content._viewModel.DsuServerPort;
|
||||||
config.EnableCemuHookMotion = content._viewModel.EnableCemuHookMotion;
|
config.EnableCemuHookMotion = content._viewModel.EnableCemuHookMotion;
|
||||||
|
config.EnableHandheldMotion = content._viewModel.EnableHandheldMotion;
|
||||||
config.MirrorInput = content._viewModel.MirrorInput;
|
config.MirrorInput = content._viewModel.MirrorInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -133,6 +133,12 @@
|
|||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageBrazilianPortuguese}" />
|
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageBrazilianPortuguese}" />
|
||||||
</ComboBoxItem>
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageSwedish}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageNorwegian}" />
|
||||||
|
</ComboBoxItem>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ using Ryujinx.HLE.HOS;
|
|||||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
using Ryujinx.Input.HLE;
|
using Ryujinx.Input.HLE;
|
||||||
using Ryujinx.Input.SDL2;
|
using Ryujinx.Input.SDL2;
|
||||||
|
using Ryujinx.Input.SDL3;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -109,7 +110,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
if (Program.PreviewerDetached)
|
if (Program.PreviewerDetached)
|
||||||
{
|
{
|
||||||
InputManager = new InputManager(new AvaloniaKeyboardDriver(this), new SDL2GamepadDriver());
|
InputManager = new InputManager(new AvaloniaKeyboardDriver(this), new SDL2GamepadDriver(), new SDL3MotionDriver());
|
||||||
|
|
||||||
_ = this.GetObservable(IsActiveProperty).Subscribe(it => ViewModel.IsActive = it);
|
_ = this.GetObservable(IsActiveProperty).Subscribe(it => ViewModel.IsActive = it);
|
||||||
this.ScalingChanged += OnScalingChanged;
|
this.ScalingChanged += OnScalingChanged;
|
||||||
@@ -139,24 +140,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
base.OnApplyTemplate(e);
|
base.OnApplyTemplate(e);
|
||||||
|
|
||||||
NotificationHelper.SetNotificationManager(this);
|
NotificationHelper.SetNotificationManager(this);
|
||||||
|
|
||||||
Executor.ExecuteBackgroundAsync(async () =>
|
Executor.ExecuteBackgroundAsync(ShowIntelMacWarningAsync);
|
||||||
{
|
|
||||||
await ShowIntelMacWarningAsync();
|
|
||||||
FilePath firmwarePath = CommandLineState.FirmwareToInstallPathArg;
|
|
||||||
if (firmwarePath is not null)
|
|
||||||
{
|
|
||||||
if ((firmwarePath.ExistsAsFile && firmwarePath.Extension is "xci" or "zip") ||
|
|
||||||
firmwarePath.ExistsAsDirectory)
|
|
||||||
{
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
|
||||||
ViewModel.HandleFirmwareInstallation(firmwarePath));
|
|
||||||
CommandLineState.FirmwareToInstallPathArg = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Logger.Notice.Print(LogClass.UI, "Invalid firmware type provided. Path must be a directory, or a .zip or .xci file.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnScalingChanged(object sender, EventArgs e)
|
private void OnScalingChanged(object sender, EventArgs e)
|
||||||
@@ -189,12 +174,17 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
{
|
{
|
||||||
Dispatcher.UIThread.Post(() =>
|
Dispatcher.UIThread.Post(() =>
|
||||||
{
|
{
|
||||||
|
List<LdnGameData> ldnGameDataArray = e.LdnData.ToList();
|
||||||
ViewModel.LdnData.Clear();
|
ViewModel.LdnData.Clear();
|
||||||
foreach (ApplicationData application in ViewModel.Applications.Where(it => it.HasControlHolder))
|
foreach (ApplicationData application in ViewModel.Applications.Where(it => it.HasControlHolder))
|
||||||
{
|
{
|
||||||
ref ApplicationControlProperty controlHolder = ref application.ControlHolder.Value;
|
ref ApplicationControlProperty controlHolder = ref application.ControlHolder.Value;
|
||||||
|
|
||||||
ViewModel.LdnData[application.IdString] = e.LdnData.Where(ref controlHolder);
|
ViewModel.LdnData[application.IdString] =
|
||||||
|
LdnGameData.GetArrayForApp(
|
||||||
|
ldnGameDataArray,
|
||||||
|
ref controlHolder
|
||||||
|
);
|
||||||
|
|
||||||
UpdateApplicationWithLdnData(application);
|
UpdateApplicationWithLdnData(application);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
{
|
{
|
||||||
public class ApplicationLibrary
|
public class ApplicationLibrary
|
||||||
{
|
{
|
||||||
|
public const string DefaultLanPlayWebHost = "ryuldnweb.vudjun.com";
|
||||||
public Language DesiredLanguage { get; set; }
|
public Language DesiredLanguage { get; set; }
|
||||||
public event EventHandler<ApplicationCountUpdatedEventArgs> ApplicationCountUpdated;
|
public event EventHandler<ApplicationCountUpdatedEventArgs> ApplicationCountUpdated;
|
||||||
public event Action<LdnGameDataReceivedEventArgs> LdnGameDataReceived;
|
public event Action<LdnGameDataReceivedEventArgs> LdnGameDataReceived;
|
||||||
@@ -825,6 +826,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
|
|
||||||
public async Task RefreshLdn()
|
public async Task RefreshLdn()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ConfigurationState.Instance.Multiplayer.Mode == MultiplayerMode.LdnRyu)
|
if (ConfigurationState.Instance.Multiplayer.Mode == MultiplayerMode.LdnRyu)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -832,22 +834,33 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
string ldnWebHost = ConfigurationState.Instance.Multiplayer.LdnServer;
|
string ldnWebHost = ConfigurationState.Instance.Multiplayer.LdnServer;
|
||||||
if (string.IsNullOrEmpty(ldnWebHost))
|
if (string.IsNullOrEmpty(ldnWebHost))
|
||||||
{
|
{
|
||||||
ldnWebHost = SharedConstants.DefaultLanPlayWebHost;
|
ldnWebHost = DefaultLanPlayWebHost;
|
||||||
}
|
}
|
||||||
|
IEnumerable<LdnGameData> ldnGameDataArray = Array.Empty<LdnGameData>();
|
||||||
using HttpClient httpClient = new();
|
using HttpClient httpClient = new();
|
||||||
string ldnGameDataArrayString = await httpClient.GetStringAsync($"https://{ldnWebHost}/api/public_games");
|
string ldnGameDataArrayString = await httpClient.GetStringAsync($"https://{ldnWebHost}/api/public_games");
|
||||||
LdnGameData[] ldnGameDataArray = JsonHelper.Deserialize(ldnGameDataArrayString, _ldnDataSerializerContext.IEnumerableLdnGameData).ToArray();
|
ldnGameDataArray = JsonHelper.Deserialize(ldnGameDataArrayString, _ldnDataSerializerContext.IEnumerableLdnGameData);
|
||||||
LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs(ldnGameDataArray));
|
LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs
|
||||||
return;
|
{
|
||||||
|
LdnData = ldnGameDataArray
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Warning?.Print(LogClass.Application, $"Failed to fetch the public games JSON from the API. Player and game count in the game list will be unavailable.\n{ex.Message}");
|
Logger.Warning?.Print(LogClass.Application, $"Failed to fetch the public games JSON from the API. Player and game count in the game list will be unavailable.\n{ex.Message}");
|
||||||
|
LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs
|
||||||
|
{
|
||||||
|
LdnData = Array.Empty<LdnGameData>()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
LdnGameDataReceived?.Invoke(LdnGameDataReceivedEventArgs.Empty);
|
{
|
||||||
|
LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs
|
||||||
|
{
|
||||||
|
LdnData = Array.Empty<LdnGameData>()
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace the currently stored DLC state for the game with the provided DLC state.
|
// Replace the currently stored DLC state for the game with the provided DLC state.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
public IEnumerable<string> Players { get; set; }
|
public IEnumerable<string> Players { get; set; }
|
||||||
|
|
||||||
public static Array GetArrayForApp(
|
public static Array GetArrayForApp(
|
||||||
LdnGameData[] receivedData, ref ApplicationControlProperty acp)
|
IEnumerable<LdnGameData> receivedData, ref ApplicationControlProperty acp)
|
||||||
{
|
{
|
||||||
LibHac.Common.FixedArrays.Array8<ulong> communicationId = acp.LocalCommunicationId;
|
LibHac.Common.FixedArrays.Array8<ulong> communicationId = acp.LocalCommunicationId;
|
||||||
|
|
||||||
@@ -40,10 +40,4 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
public int GameCount => _ldnDatas.Length;
|
public int GameCount => _ldnDatas.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class LdnGameDataHelper
|
|
||||||
{
|
|
||||||
public static LdnGameData.Array Where(this LdnGameData[] unfilteredDatas, ref ApplicationControlProperty acp)
|
|
||||||
=> LdnGameData.GetArrayForApp(unfilteredDatas, ref acp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
{
|
{
|
||||||
public class LdnGameDataReceivedEventArgs : EventArgs
|
public class LdnGameDataReceivedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public static new readonly LdnGameDataReceivedEventArgs Empty = new(null);
|
public IEnumerable<LdnGameData> LdnData { get; set; }
|
||||||
|
|
||||||
public LdnGameDataReceivedEventArgs(LdnGameData[] ldnData)
|
|
||||||
{
|
|
||||||
LdnData = ldnData ?? [];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public LdnGameData[] LdnData { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using Gommon;
|
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@@ -14,7 +13,6 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
public static string OverrideBackendThreading { get; private set; }
|
public static string OverrideBackendThreading { get; private set; }
|
||||||
public static string OverrideHideCursor { get; private set; }
|
public static string OverrideHideCursor { get; private set; }
|
||||||
public static string BaseDirPathArg { get; private set; }
|
public static string BaseDirPathArg { get; private set; }
|
||||||
public static FilePath FirmwareToInstallPathArg { get; set; }
|
|
||||||
public static string Profile { get; private set; }
|
public static string Profile { get; private set; }
|
||||||
public static string LaunchPathArg { get; private set; }
|
public static string LaunchPathArg { get; private set; }
|
||||||
public static string LaunchApplicationId { get; private set; }
|
public static string LaunchApplicationId { get; private set; }
|
||||||
@@ -43,19 +41,6 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
|
|
||||||
BaseDirPathArg = args[++i];
|
BaseDirPathArg = args[++i];
|
||||||
|
|
||||||
arguments.Add(arg);
|
|
||||||
arguments.Add(args[i]);
|
|
||||||
break;
|
|
||||||
case "--install-firmware":
|
|
||||||
if (i + 1 >= args.Length)
|
|
||||||
{
|
|
||||||
Logger.Error?.Print(LogClass.Application, $"Invalid option '{arg}'");
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
FirmwareToInstallPathArg = new FilePath(args[++i]);
|
|
||||||
|
|
||||||
arguments.Add(arg);
|
arguments.Add(arg);
|
||||||
arguments.Add(args[i]);
|
arguments.Add(args[i]);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using ARMeilleure;
|
using ARMeilleure;
|
||||||
using Gommon;
|
using Gommon;
|
||||||
using Ryujinx.Ava.Utilities.AppLibrary;
|
|
||||||
using Ryujinx.Ava.Utilities.Configuration.System;
|
using Ryujinx.Ava.Utilities.Configuration.System;
|
||||||
using Ryujinx.Ava.Utilities.Configuration.UI;
|
using Ryujinx.Ava.Utilities.Configuration.UI;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
@@ -648,14 +647,6 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ReactiveObject<string> LdnServer { get; private set; }
|
public ReactiveObject<string> LdnServer { get; private set; }
|
||||||
|
|
||||||
public string GetLdnServer()
|
|
||||||
{
|
|
||||||
string ldnServer = LdnServer;
|
|
||||||
return string.IsNullOrEmpty(ldnServer)
|
|
||||||
? SharedConstants.DefaultLanPlayHost
|
|
||||||
: ldnServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MultiplayerSection()
|
public MultiplayerSection()
|
||||||
{
|
{
|
||||||
LanInterfaceId = new ReactiveObject<string>();
|
LanInterfaceId = new ReactiveObject<string>();
|
||||||
|
|||||||
Reference in New Issue
Block a user