Compare commits
1 Commits
cfcbaefbf2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b16b844760 |
@@ -3,7 +3,6 @@
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Alimer.Bindings.SDL" Version="3.7.1" />
|
||||
<PackageVersion Include="Avalonia" Version="11.0.13" />
|
||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.0.13" />
|
||||
<PackageVersion Include="Avalonia.Desktop" Version="11.0.13" />
|
||||
|
||||
@@ -75,8 +75,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Horizon", "src\Ryuj
|
||||
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}"
|
||||
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}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ryujinx.Graphics.Metal", "src\Ryujinx.Graphics.Metal\Ryujinx.Graphics.Metal.csproj", "{C08931FA-1191-417A-864F-3882D93E683B}"
|
||||
@@ -261,10 +259,6 @@ Global
|
||||
{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.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
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -969,6 +969,7 @@
|
||||
0100751007ADA000,"Don't Starve: Nintendo Switch Edition",nvdec,playable,2022-02-05 20:43:34
|
||||
010088B010DD2000,"Dongo Adventure",,playable,2022-10-04 16:22:26
|
||||
0100C1F0051B6000,"Donkey Kong Country™: Tropical Freeze",,playable,2024-08-05 16:46:10
|
||||
01009D901BC56000,"Donkey Kong Country™: Returns HD",gpu,ingame,2025-02-16 13:44:12
|
||||
0100F2C00F060000,"Doodle Derby",,boots,2020-12-04 22:51:48
|
||||
0100416004C00000,"DOOM",gpu;slow;nvdec;online-broken,ingame,2024-09-23 15:40:07
|
||||
010018900DD00000,"DOOM (1993)",nvdec;online-broken,menus,2022-09-06 13:32:19
|
||||
|
||||
|
@@ -56,7 +56,6 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion
|
||||
return motionBackendType switch
|
||||
{
|
||||
MotionInputBackendType.GamepadDriver => JsonSerializer.Deserialize(ref reader, _serializerContext.StandardMotionConfigController),
|
||||
MotionInputBackendType.Handheld => JsonSerializer.Deserialize(ref reader, _serializerContext.StandardMotionConfigController),
|
||||
MotionInputBackendType.CemuHook => JsonSerializer.Deserialize(ref reader, _serializerContext.CemuHookMotionConfigController),
|
||||
_ => throw new InvalidOperationException($"Unknown backend type {motionBackendType}"),
|
||||
};
|
||||
@@ -67,7 +66,6 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion
|
||||
switch (value.MotionBackend)
|
||||
{
|
||||
case MotionInputBackendType.GamepadDriver:
|
||||
case MotionInputBackendType.Handheld:
|
||||
JsonSerializer.Serialize(writer, value as StandardMotionConfigController, _serializerContext.StandardMotionConfigController);
|
||||
break;
|
||||
case MotionInputBackendType.CemuHook:
|
||||
|
||||
@@ -9,6 +9,5 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion
|
||||
Invalid,
|
||||
GamepadDriver,
|
||||
CemuHook,
|
||||
Handheld,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<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>
|
||||
@@ -1,85 +0,0 @@
|
||||
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,13 +2,12 @@ using System;
|
||||
|
||||
namespace Ryujinx.Input.HLE
|
||||
{
|
||||
public class InputManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver, IHandheld handheld)
|
||||
public class InputManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver)
|
||||
: IDisposable
|
||||
{
|
||||
public IGamepadDriver KeyboardDriver { get; } = keyboardDriver;
|
||||
public IGamepadDriver GamepadDriver { get; } = gamepadDriver;
|
||||
public IGamepadDriver MouseDriver { get; private set; }
|
||||
public IHandheld Handheld { get; } = handheld;
|
||||
|
||||
public void SetMouseDriver(IGamepadDriver mouseDriver)
|
||||
{
|
||||
@@ -19,7 +18,7 @@ namespace Ryujinx.Input.HLE
|
||||
|
||||
public NpadManager CreateNpadManager()
|
||||
{
|
||||
return new NpadManager(KeyboardDriver, GamepadDriver, MouseDriver, Handheld);
|
||||
return new NpadManager(KeyboardDriver, GamepadDriver, MouseDriver);
|
||||
}
|
||||
|
||||
public TouchScreenManager CreateTouchScreenManager()
|
||||
@@ -39,7 +38,6 @@ namespace Ryujinx.Input.HLE
|
||||
KeyboardDriver?.Dispose();
|
||||
GamepadDriver?.Dispose();
|
||||
MouseDriver?.Dispose();
|
||||
Handheld?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,14 +218,12 @@ namespace Ryujinx.Input.HLE
|
||||
public string Id { get; private set; }
|
||||
|
||||
private readonly CemuHookClient _cemuHookClient;
|
||||
private readonly IHandheld _handheld;
|
||||
|
||||
public NpadController(CemuHookClient cemuHookClient, IHandheld handheld)
|
||||
public NpadController(CemuHookClient cemuHookClient)
|
||||
{
|
||||
State = default;
|
||||
Id = null;
|
||||
_cemuHookClient = cemuHookClient;
|
||||
_handheld = handheld;
|
||||
}
|
||||
|
||||
public bool UpdateDriverConfiguration(IGamepadDriver gamepadDriver, InputConfig config)
|
||||
@@ -289,18 +287,6 @@ namespace Ryujinx.Input.HLE
|
||||
|
||||
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 (gamepad.Features.HasFlag(GamepadFeaturesFlag.Motion))
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace Ryujinx.Input.HLE
|
||||
private readonly IGamepadDriver _keyboardDriver;
|
||||
private readonly IGamepadDriver _gamepadDriver;
|
||||
private readonly IGamepadDriver _mouseDriver;
|
||||
private readonly IHandheld _handheld;
|
||||
private bool _isDisposed;
|
||||
|
||||
private List<InputConfig> _inputConfig;
|
||||
@@ -39,7 +38,7 @@ namespace Ryujinx.Input.HLE
|
||||
private bool _enableMouse;
|
||||
private Switch _device;
|
||||
|
||||
public NpadManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver, IGamepadDriver mouseDriver, IHandheld handheld)
|
||||
public NpadManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver, IGamepadDriver mouseDriver)
|
||||
{
|
||||
_controllers = new NpadController[MaxControllers];
|
||||
_cemuHookClient = new CemuHookClient(this);
|
||||
@@ -48,7 +47,6 @@ namespace Ryujinx.Input.HLE
|
||||
_gamepadDriver = gamepadDriver;
|
||||
_mouseDriver = mouseDriver;
|
||||
_inputConfig = [];
|
||||
_handheld = handheld;
|
||||
|
||||
_gamepadDriver.OnGamepadConnected += HandleOnGamepadConnected;
|
||||
_gamepadDriver.OnGamepadDisconnected += HandleOnGamepadDisconnected;
|
||||
@@ -141,7 +139,7 @@ namespace Ryujinx.Input.HLE
|
||||
}
|
||||
else
|
||||
{
|
||||
controller = new(_cemuHookClient, _handheld);
|
||||
controller = new(_cemuHookClient);
|
||||
}
|
||||
|
||||
bool isValid = DriverConfigurationUpdate(ref controller, inputConfigEntry);
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Ryujinx.Input
|
||||
{
|
||||
public interface IHandheld : IDisposable
|
||||
{
|
||||
Vector3 GetMotionData(MotionInputId gyroscope);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,6 @@ using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using Ryujinx.Input;
|
||||
using Ryujinx.Input.HLE;
|
||||
using Ryujinx.Input.SDL2;
|
||||
using Ryujinx.Input.SDL3;
|
||||
using Ryujinx.SDL2.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -183,7 +182,7 @@ namespace Ryujinx.Headless
|
||||
_accountManager = new AccountManager(_libHacHorizonManager.RyujinxClient, option.UserProfile);
|
||||
_userChannelPersistence = new UserChannelPersistence();
|
||||
|
||||
_inputManager = new InputManager(new SDL2KeyboardDriver(), new SDL2GamepadDriver(), new SDL3MotionDriver());
|
||||
_inputManager = new InputManager(new SDL2KeyboardDriver(), new SDL2GamepadDriver());
|
||||
|
||||
GraphicsConfig.EnableShaderCache = !option.DisableShaderCache;
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@
|
||||
<ProjectReference Include="..\Ryujinx.Graphics.Metal\Ryujinx.Graphics.Metal.csproj" />
|
||||
<ProjectReference Include="..\Ryujinx.Input\Ryujinx.Input.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.SoundIo\Ryujinx.Audio.Backends.SoundIo.csproj" />
|
||||
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
public partial class GamepadInputConfig : BaseModel
|
||||
{
|
||||
public bool EnableCemuHookMotion { get; set; }
|
||||
public bool EnableHandheldMotion { get; set; }
|
||||
public string DsuServerHost { get; set; }
|
||||
public int DsuServerPort { get; set; }
|
||||
public int Slot { get; set; }
|
||||
@@ -163,7 +162,7 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
EnableMotion = controllerInput.Motion.EnableMotion;
|
||||
GyroDeadzone = controllerInput.Motion.GyroDeadzone;
|
||||
Sensitivity = controllerInput.Motion.Sensitivity;
|
||||
EnableHandheldMotion = controllerInput.Motion.MotionBackend == MotionInputBackendType.Handheld;
|
||||
|
||||
if (controllerInput.Motion is CemuHookMotionConfigController cemuHook)
|
||||
{
|
||||
EnableCemuHookMotion = true;
|
||||
@@ -286,7 +285,7 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
config.Motion = new StandardMotionConfigController
|
||||
{
|
||||
EnableMotion = EnableMotion,
|
||||
MotionBackend = EnableHandheldMotion ? MotionInputBackendType.Handheld : MotionInputBackendType.GamepadDriver,
|
||||
MotionBackend = MotionInputBackendType.GamepadDriver,
|
||||
GyroDeadzone = GyroDeadzone,
|
||||
Sensitivity = Sensitivity,
|
||||
};
|
||||
|
||||
@@ -18,34 +18,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
|
||||
[ObservableProperty] private double _gyroDeadzone;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
[ObservableProperty] private bool _enableCemuHookMotion;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,17 +61,6 @@
|
||||
Margin="5, 0"
|
||||
Text="{Binding GyroDeadzone, StringFormat=\{0:0.00\}}" />
|
||||
</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
|
||||
Height="1"
|
||||
Margin="0,5" />
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||
Sensitivity = config.Sensitivity,
|
||||
GyroDeadzone = config.GyroDeadzone,
|
||||
EnableCemuHookMotion = config.EnableCemuHookMotion,
|
||||
EnableHandheldMotion = config.EnableHandheldMotion,
|
||||
};
|
||||
|
||||
InitializeComponent();
|
||||
@@ -59,7 +58,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||
config.DsuServerHost = content._viewModel.DsuServerHost;
|
||||
config.DsuServerPort = content._viewModel.DsuServerPort;
|
||||
config.EnableCemuHookMotion = content._viewModel.EnableCemuHookMotion;
|
||||
config.EnableHandheldMotion = content._viewModel.EnableHandheldMotion;
|
||||
config.MirrorInput = content._viewModel.MirrorInput;
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ using Ryujinx.HLE.HOS;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using Ryujinx.Input.HLE;
|
||||
using Ryujinx.Input.SDL2;
|
||||
using Ryujinx.Input.SDL3;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -110,7 +109,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
InputManager = new InputManager(new AvaloniaKeyboardDriver(this), new SDL2GamepadDriver(), new SDL3MotionDriver());
|
||||
InputManager = new InputManager(new AvaloniaKeyboardDriver(this), new SDL2GamepadDriver());
|
||||
|
||||
_ = this.GetObservable(IsActiveProperty).Subscribe(it => ViewModel.IsActive = it);
|
||||
this.ScalingChanged += OnScalingChanged;
|
||||
|
||||
Reference in New Issue
Block a user