Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
44dbab3848 | |||
cada4d04ef | |||
e9edf0ab7f |
@ -75,7 +75,7 @@ namespace Ryujinx
|
|||||||
|
|
||||||
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
||||||
{
|
{
|
||||||
MessageBoxA(IntPtr.Zero, "You are running an outdated version of Windows.\n\nStarting on June 1st 2022, Ryujinx will only support Windows 10 1803 and newer.\n", $"Ryujinx {Version}", MbIconWarning);
|
MessageBoxA(IntPtr.Zero, "You are running an outdated version of Windows.\n\nRyujinx supports Windows 10 version 1803 and newer.\n", $"Ryujinx {Version}", MbIconWarning);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse arguments
|
// Parse arguments
|
||||||
|
@ -22,6 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||||||
|
|
||||||
private bool _sixAxisSensorFusionEnabled;
|
private bool _sixAxisSensorFusionEnabled;
|
||||||
private bool _unintendedHomeButtonInputProtectionEnabled;
|
private bool _unintendedHomeButtonInputProtectionEnabled;
|
||||||
|
private bool _npadAnalogStickCenterClampEnabled;
|
||||||
private bool _vibrationPermitted;
|
private bool _vibrationPermitted;
|
||||||
private bool _usbFullKeyControllerEnabled;
|
private bool _usbFullKeyControllerEnabled;
|
||||||
private readonly bool _isFirmwareUpdateAvailableForSixAxisSensor;
|
private readonly bool _isFirmwareUpdateAvailableForSixAxisSensor;
|
||||||
@ -1107,6 +1108,19 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||||||
// If not, it returns nothing.
|
// If not, it returns nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(134)] // 6.1.0+
|
||||||
|
// SetNpadUseAnalogStickUseCenterClamp(bool Enable, nn::applet::AppletResourceUserId)
|
||||||
|
public ResultCode SetNpadUseAnalogStickUseCenterClamp(ServiceCtx context)
|
||||||
|
{
|
||||||
|
ulong pid = context.RequestData.ReadUInt64();
|
||||||
|
_npadAnalogStickCenterClampEnabled = context.RequestData.ReadUInt32() != 0;
|
||||||
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceHid, new { pid, appletResourceUserId, _npadAnalogStickCenterClampEnabled });
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
[CommandCmif(200)]
|
[CommandCmif(200)]
|
||||||
// GetVibrationDeviceInfo(nn::hid::VibrationDeviceHandle) -> nn::hid::VibrationDeviceInfo
|
// GetVibrationDeviceInfo(nn::hid::VibrationDeviceHandle) -> nn::hid::VibrationDeviceInfo
|
||||||
public ResultCode GetVibrationDeviceInfo(ServiceCtx context)
|
public ResultCode GetVibrationDeviceInfo(ServiceCtx context)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using DiscordRPC;
|
using DiscordRPC;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.UI.Common.Configuration;
|
using Ryujinx.UI.Common.Configuration;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace Ryujinx.UI.Common
|
namespace Ryujinx.UI.Common
|
||||||
{
|
{
|
||||||
@ -9,6 +10,9 @@ namespace Ryujinx.UI.Common
|
|||||||
private const string Description = "A simple, experimental Nintendo Switch emulator.";
|
private const string Description = "A simple, experimental Nintendo Switch emulator.";
|
||||||
private const string ApplicationId = "1216775165866807456";
|
private const string ApplicationId = "1216775165866807456";
|
||||||
|
|
||||||
|
private const int ApplicationByteLimit = 128;
|
||||||
|
private const string Ellipsis = "…";
|
||||||
|
|
||||||
private static DiscordRpcClient _discordClient;
|
private static DiscordRpcClient _discordClient;
|
||||||
private static RichPresence _discordPresenceMain;
|
private static RichPresence _discordPresenceMain;
|
||||||
|
|
||||||
@ -60,18 +64,18 @@ namespace Ryujinx.UI.Common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SwitchToPlayingState(string titleId, string titleName)
|
public static void SwitchToPlayingState(string titleId, string applicationName)
|
||||||
{
|
{
|
||||||
_discordClient?.SetPresence(new RichPresence
|
_discordClient?.SetPresence(new RichPresence
|
||||||
{
|
{
|
||||||
Assets = new Assets
|
Assets = new Assets
|
||||||
{
|
{
|
||||||
LargeImageKey = "game",
|
LargeImageKey = "game",
|
||||||
LargeImageText = titleName,
|
LargeImageText = TruncateToByteLength(applicationName, ApplicationByteLimit),
|
||||||
SmallImageKey = "ryujinx",
|
SmallImageKey = "ryujinx",
|
||||||
SmallImageText = Description,
|
SmallImageText = Description,
|
||||||
},
|
},
|
||||||
Details = $"Playing {titleName}",
|
Details = TruncateToByteLength($"Playing {applicationName}", ApplicationByteLimit),
|
||||||
State = (titleId == "0000000000000000") ? "Homebrew" : titleId.ToUpper(),
|
State = (titleId == "0000000000000000") ? "Homebrew" : titleId.ToUpper(),
|
||||||
Timestamps = Timestamps.Now,
|
Timestamps = Timestamps.Now,
|
||||||
Buttons =
|
Buttons =
|
||||||
@ -90,6 +94,28 @@ namespace Ryujinx.UI.Common
|
|||||||
_discordClient?.SetPresence(_discordPresenceMain);
|
_discordClient?.SetPresence(_discordPresenceMain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string TruncateToByteLength(string input, int byteLimit)
|
||||||
|
{
|
||||||
|
if (Encoding.UTF8.GetByteCount(input) <= byteLimit)
|
||||||
|
{
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find the length to trim the string to guarantee we have space for the trailing ellipsis.
|
||||||
|
int trimLimit = byteLimit - Encoding.UTF8.GetByteCount(Ellipsis);
|
||||||
|
|
||||||
|
// Basic trim to best case scenario of 1 byte characters.
|
||||||
|
input = input[..trimLimit];
|
||||||
|
|
||||||
|
while (Encoding.UTF8.GetByteCount(input) > trimLimit)
|
||||||
|
{
|
||||||
|
// Remove one character from the end of the string at a time.
|
||||||
|
input = input[..^1];
|
||||||
|
}
|
||||||
|
|
||||||
|
return input.TrimEnd() + Ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
public static void Exit()
|
public static void Exit()
|
||||||
{
|
{
|
||||||
_discordClient?.Dispose();
|
_discordClient?.Dispose();
|
||||||
|
@ -40,7 +40,7 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
||||||
{
|
{
|
||||||
_ = MessageBoxA(IntPtr.Zero, "You are running an outdated version of Windows.\n\nStarting on June 1st 2022, Ryujinx will only support Windows 10 1803 and newer.\n", $"Ryujinx {Version}", MbIconwarning);
|
_ = MessageBoxA(IntPtr.Zero, "You are running an outdated version of Windows.\n\nRyujinx supports Windows 10 version 1803 and newer.\n", $"Ryujinx {Version}", MbIconwarning);
|
||||||
}
|
}
|
||||||
|
|
||||||
PreviewerDetached = true;
|
PreviewerDetached = true;
|
||||||
|
Reference in New Issue
Block a user