mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-13 13:37:00 +00:00
Merge branch ryujinx:master into ui-actions-new
This commit is contained in:
commit
39653c5250
7 changed files with 65 additions and 8 deletions
|
|
@ -20,5 +20,21 @@ namespace Ryujinx.Common.Utilities
|
||||||
Debug.Assert(res != -1);
|
Debug.Assert(res != -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "dumpable" attribute of the calling process
|
||||||
|
private const int PR_SET_DUMPABLE = 4;
|
||||||
|
|
||||||
|
[DllImport("libc", SetLastError = true)]
|
||||||
|
private static extern int prctl(int option, int arg2);
|
||||||
|
|
||||||
|
public static void SetCoreDumpable(bool dumpable)
|
||||||
|
{
|
||||||
|
if (OperatingSystem.IsLinux())
|
||||||
|
{
|
||||||
|
int dumpableInt = dumpable ? 1 : 0;
|
||||||
|
int result = prctl(PR_SET_DUMPABLE, dumpableInt);
|
||||||
|
Debug.Assert(result == 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -416,7 +416,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
|
||||||
return ResultCode.InvalidParameters;
|
return ResultCode.InvalidParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Stub?.PrintStub(LogClass.ServiceAm, new { albumReportOption });
|
context.Device.UIHandler.TakeScreenshot();
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,5 +68,10 @@ namespace Ryujinx.HLE.UI
|
||||||
/// Displays the player select dialog and returns the selected profile.
|
/// Displays the player select dialog and returns the selected profile.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
UserProfile ShowPlayerSelectDialog();
|
UserProfile ShowPlayerSelectDialog();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Takes a screenshot from the current renderer and saves it in the screenshots folder.
|
||||||
|
/// </summary>
|
||||||
|
void TakeScreenshot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -580,5 +580,10 @@ namespace Ryujinx.Headless
|
||||||
{
|
{
|
||||||
return AccountSaveDataManager.GetLastUsedUser();
|
return AccountSaveDataManager.GetLastUsedUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TakeScreenshot()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.GraphicsDriver;
|
using Ryujinx.Common.GraphicsDriver;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Common.SystemInterop;
|
using Ryujinx.Common.SystemInterop;
|
||||||
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.Graphics.Vulkan.MoltenVK;
|
using Ryujinx.Graphics.Vulkan.MoltenVK;
|
||||||
using Ryujinx.Headless;
|
using Ryujinx.Headless;
|
||||||
using Ryujinx.SDL3.Common;
|
using Ryujinx.SDL3.Common;
|
||||||
|
|
@ -46,7 +47,7 @@ namespace Ryujinx.Ava
|
||||||
public static int Main(string[] args)
|
public static int Main(string[] args)
|
||||||
{
|
{
|
||||||
Version = ReleaseInformation.Version;
|
Version = ReleaseInformation.Version;
|
||||||
|
|
||||||
if (OperatingSystem.IsWindows())
|
if (OperatingSystem.IsWindows())
|
||||||
{
|
{
|
||||||
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 0, 19041))
|
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 0, 19041))
|
||||||
|
|
@ -55,8 +56,11 @@ namespace Ryujinx.Ava
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Environment.CurrentDirectory.StartsWithIgnoreCase("C:\\Program Files") ||
|
var programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
|
||||||
Environment.CurrentDirectory.StartsWithIgnoreCase("C:\\Program Files (x86)"))
|
var programFilesX86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
|
||||||
|
|
||||||
|
if (Environment.CurrentDirectory.StartsWithIgnoreCase(programFiles) ||
|
||||||
|
Environment.CurrentDirectory.StartsWithIgnoreCase(programFilesX86))
|
||||||
{
|
{
|
||||||
_ = Win32NativeInterop.MessageBoxA(nint.Zero, "Ryujinx is not intended to be run from the Program Files folder. Please move it out and relaunch.", $"Ryujinx {Version}", MbIconwarning);
|
_ = Win32NativeInterop.MessageBoxA(nint.Zero, "Ryujinx is not intended to be run from the Program Files folder. Please move it out and relaunch.", $"Ryujinx {Version}", MbIconwarning);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -73,11 +77,23 @@ namespace Ryujinx.Ava
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool noGuiArg = ConsumeCommandLineArgument(ref args, "--no-gui") || ConsumeCommandLineArgument(ref args, "nogui");
|
||||||
|
bool coreDumpArg = ConsumeCommandLineArgument(ref args, "--core-dumps");
|
||||||
|
|
||||||
|
// TODO: Ryujinx causes core dumps on Linux when it exits "uncleanly", eg. through an unhandled exception.
|
||||||
|
// This is undesirable and causes very odd behavior during development (the process stops responding,
|
||||||
|
// the .NET debugger freezes or suddenly detaches, /tmp/ gets filled etc.), unless explicitly requested by the user.
|
||||||
|
// This needs to be investigated, but calling prctl() is better than modifying system-wide settings or leaving this be.
|
||||||
|
if (!coreDumpArg)
|
||||||
|
{
|
||||||
|
OsUtils.SetCoreDumpable(false);
|
||||||
|
}
|
||||||
|
|
||||||
PreviewerDetached = true;
|
PreviewerDetached = true;
|
||||||
|
|
||||||
if (args.Length > 0 && args[0] is "--no-gui" or "nogui")
|
if (noGuiArg)
|
||||||
{
|
{
|
||||||
HeadlessRyujinx.Entrypoint(args[1..]);
|
HeadlessRyujinx.Entrypoint(args);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,6 +128,14 @@ namespace Ryujinx.Ava
|
||||||
: [Win32RenderingMode.Software]
|
: [Win32RenderingMode.Software]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
private static bool ConsumeCommandLineArgument(ref string[] args, string targetArgument)
|
||||||
|
{
|
||||||
|
List<string> argList = [.. args];
|
||||||
|
bool found = argList.Remove(targetArgument);
|
||||||
|
args = argList.ToArray();
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
private static void Initialize(string[] args)
|
private static void Initialize(string[] args)
|
||||||
{
|
{
|
||||||
// Ensure Discord presence timestamp begins at the absolute start of when Ryujinx is launched
|
// Ensure Discord presence timestamp begins at the absolute start of when Ryujinx is launched
|
||||||
|
|
@ -177,7 +201,6 @@ namespace Ryujinx.Ava
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static string GetDirGameUserConfig(string gameId, bool changeFolderForGame = false)
|
public static string GetDirGameUserConfig(string gameId, bool changeFolderForGame = false)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(gameId))
|
if (string.IsNullOrEmpty(gameId))
|
||||||
|
|
|
||||||
|
|
@ -327,5 +327,10 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TakeScreenshot()
|
||||||
|
{
|
||||||
|
_parent.ViewModel.AppHost.ScreenshotRequested = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1333,7 +1333,10 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TakeScreenshot() => AppHost.ScreenshotRequested = true;
|
public void TakeScreenshot()
|
||||||
|
{
|
||||||
|
AppHost.ScreenshotRequested = true;
|
||||||
|
}
|
||||||
|
|
||||||
public void HideUi() => ShowMenuAndStatusBar = false;
|
public void HideUi() => ShowMenuAndStatusBar = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue