Compare commits
4 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f43442f774 | ||
|
|
88d11d3d8d | ||
|
|
391f57bdd2 | ||
|
|
fd2b5a7fc1 |
@@ -16,7 +16,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||||||
_baseStorage = SharedRef<LibHac.FsSrv.Sf.IStorage>.CreateMove(ref baseStorage);
|
_baseStorage = SharedRef<LibHac.FsSrv.Sf.IStorage>.CreateMove(ref baseStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string Xc2TitleId = "0100e95004038000";
|
private const string Xc2JpTitleId = "0100f3400332c000";
|
||||||
|
private const string Xc2GlobalTitleId = "0100e95004038000";
|
||||||
|
private static bool IsXc2 => TitleIDs.CurrentApplication.Value.OrDefault() is Xc2GlobalTitleId or Xc2JpTitleId;
|
||||||
|
|
||||||
[CommandCmif(0)]
|
[CommandCmif(0)]
|
||||||
// Read(u64 offset, u64 length) -> buffer<u8, 0x46, 0> buffer
|
// Read(u64 offset, u64 length) -> buffer<u8, 0x46, 0> buffer
|
||||||
@@ -39,7 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||||||
using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true);
|
using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true);
|
||||||
Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size);
|
Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size);
|
||||||
|
|
||||||
if (context.Device.DirtyHacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix) && TitleIDs.CurrentApplication.Value == Xc2TitleId)
|
if (context.Device.DirtyHacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix) && IsXc2)
|
||||||
{
|
{
|
||||||
// Add a load-bearing sleep to avoid XC2 softlock
|
// Add a load-bearing sleep to avoid XC2 softlock
|
||||||
// https://web.archive.org/web/20240728045136/https://github.com/Ryujinx/Ryujinx/issues/2357
|
// https://web.archive.org/web/20240728045136/https://github.com/Ryujinx/Ryujinx/issues/2357
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Ryujinx.Headless
|
|||||||
// Make process DPI aware for proper window sizing on high-res screens.
|
// Make process DPI aware for proper window sizing on high-res screens.
|
||||||
ForceDpiAware.Windows();
|
ForceDpiAware.Windows();
|
||||||
|
|
||||||
Console.Title = $"Ryujinx Console {Program.Version} (Headless)";
|
Console.Title = $"HeadlessRyujinx Console {Program.Version}";
|
||||||
|
|
||||||
if (OperatingSystem.IsMacOS() || OperatingSystem.IsLinux())
|
if (OperatingSystem.IsMacOS() || OperatingSystem.IsLinux())
|
||||||
{
|
{
|
||||||
@@ -163,6 +163,11 @@ namespace Ryujinx.Headless
|
|||||||
|
|
||||||
ReloadConfig();
|
ReloadConfig();
|
||||||
|
|
||||||
|
if (option.InheritConfig)
|
||||||
|
{
|
||||||
|
option.InheritMainConfigInput(originalArgs, ConfigurationState.Instance);
|
||||||
|
}
|
||||||
|
|
||||||
_virtualFileSystem = VirtualFileSystem.CreateInstance();
|
_virtualFileSystem = VirtualFileSystem.CreateInstance();
|
||||||
_libHacHorizonManager = new LibHacHorizonManager();
|
_libHacHorizonManager = new LibHacHorizonManager();
|
||||||
|
|
||||||
@@ -224,15 +229,7 @@ namespace Ryujinx.Headless
|
|||||||
_enableKeyboard = option.EnableKeyboard;
|
_enableKeyboard = option.EnableKeyboard;
|
||||||
_enableMouse = option.EnableMouse;
|
_enableMouse = option.EnableMouse;
|
||||||
|
|
||||||
static void LoadPlayerConfiguration(string inputProfileName, string inputId, PlayerIndex index)
|
|
||||||
{
|
|
||||||
InputConfig inputConfig = HandlePlayerConfiguration(inputProfileName, inputId, index);
|
|
||||||
|
|
||||||
if (inputConfig != null)
|
|
||||||
{
|
|
||||||
_inputConfiguration.Add(inputConfig);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadPlayerConfiguration(option.InputProfile1Name, option.InputId1, PlayerIndex.Player1);
|
LoadPlayerConfiguration(option.InputProfile1Name, option.InputId1, PlayerIndex.Player1);
|
||||||
LoadPlayerConfiguration(option.InputProfile2Name, option.InputId2, PlayerIndex.Player2);
|
LoadPlayerConfiguration(option.InputProfile2Name, option.InputId2, PlayerIndex.Player2);
|
||||||
@@ -244,7 +241,6 @@ namespace Ryujinx.Headless
|
|||||||
LoadPlayerConfiguration(option.InputProfile8Name, option.InputId8, PlayerIndex.Player8);
|
LoadPlayerConfiguration(option.InputProfile8Name, option.InputId8, PlayerIndex.Player8);
|
||||||
LoadPlayerConfiguration(option.InputProfileHandheldName, option.InputIdHandheld, PlayerIndex.Handheld);
|
LoadPlayerConfiguration(option.InputProfileHandheldName, option.InputIdHandheld, PlayerIndex.Handheld);
|
||||||
|
|
||||||
|
|
||||||
if (_inputConfiguration.Count == 0)
|
if (_inputConfiguration.Count == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -306,6 +302,24 @@ namespace Ryujinx.Headless
|
|||||||
}
|
}
|
||||||
|
|
||||||
_inputManager.Dispose();
|
_inputManager.Dispose();
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
void LoadPlayerConfiguration(string inputProfileName, string inputId, PlayerIndex index)
|
||||||
|
{
|
||||||
|
if (index == PlayerIndex.Handheld && _inputConfiguration.Count > 0)
|
||||||
|
{
|
||||||
|
Logger.Info?.Print(LogClass.Configuration, "Skipping handheld configuration as there are already other players configured.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
InputConfig inputConfig = option.InheritedInputConfigs[index] ?? HandlePlayerConfiguration(inputProfileName, inputId, index);
|
||||||
|
|
||||||
|
if (inputConfig != null)
|
||||||
|
{
|
||||||
|
_inputConfiguration.Add(inputConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetupProgressHandler()
|
private static void SetupProgressHandler()
|
||||||
|
|||||||
@@ -154,11 +154,38 @@ namespace Ryujinx.Headless
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
bool NeedsOverride(string argKey) => originalArgs.None(arg => arg.TrimStart('-').EqualsIgnoreCase(OptionName(argKey)));
|
bool NeedsOverride(string argKey) => originalArgs.None(arg => arg.TrimStart('-').EqualsIgnoreCase(OptionName(argKey)));
|
||||||
|
|
||||||
string OptionName(string propertyName) =>
|
|
||||||
typeof(Options)!.GetProperty(propertyName)!.GetCustomAttribute<OptionAttribute>()!.LongName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void InheritMainConfigInput(string[] originalArgs, ConfigurationState configurationState)
|
||||||
|
{
|
||||||
|
Dictionary<PlayerIndex, (string InputId, string InputProfileName)> indicesToProperties = new()
|
||||||
|
{
|
||||||
|
{ PlayerIndex.Handheld, (nameof(InputIdHandheld), nameof(InputProfileHandheldName)) },
|
||||||
|
{ PlayerIndex.Player1, (nameof(InputId1), nameof(InputProfile1Name)) },
|
||||||
|
{ PlayerIndex.Player2, (nameof(InputId2), nameof(InputProfile2Name)) },
|
||||||
|
{ PlayerIndex.Player3, (nameof(InputId3), nameof(InputProfile3Name)) },
|
||||||
|
{ PlayerIndex.Player4, (nameof(InputId4), nameof(InputProfile4Name)) },
|
||||||
|
{ PlayerIndex.Player5, (nameof(InputId5), nameof(InputProfile5Name)) },
|
||||||
|
{ PlayerIndex.Player6, (nameof(InputId6), nameof(InputProfile6Name)) },
|
||||||
|
{ PlayerIndex.Player7, (nameof(InputId7), nameof(InputProfile7Name)) },
|
||||||
|
{ PlayerIndex.Player8, (nameof(InputId8), nameof(InputProfile8Name)) }
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach ((PlayerIndex playerIndex, _) in indicesToProperties
|
||||||
|
.Where(it => NeedsOverride(it.Value.InputId) && NeedsOverride(it.Value.InputProfileName)))
|
||||||
|
{
|
||||||
|
configurationState.Hid.InputConfig.Value.FindFirst(x => x.PlayerIndex == playerIndex)
|
||||||
|
.IfPresent(ic => InheritedInputConfigs[playerIndex] = ic);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
bool NeedsOverride(string argKey) => originalArgs.None(arg => arg.TrimStart('-').EqualsIgnoreCase(OptionName(argKey)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string OptionName(string propertyName) =>
|
||||||
|
typeof(Options)!.GetProperty(propertyName)!.GetCustomAttribute<OptionAttribute>()!.LongName;
|
||||||
|
|
||||||
// General
|
// General
|
||||||
|
|
||||||
[Option("use-main-config", Required = false, Default = false, HelpText = "Use the settings from what was configured via the UI.")]
|
[Option("use-main-config", Required = false, Default = false, HelpText = "Use the settings from what was configured via the UI.")]
|
||||||
@@ -391,5 +418,7 @@ namespace Ryujinx.Headless
|
|||||||
|
|
||||||
[Value(0, MetaName = "input", HelpText = "Input to load.", Required = true)]
|
[Value(0, MetaName = "input", HelpText = "Input to load.", Required = true)]
|
||||||
public string InputPath { get; set; }
|
public string InputPath { get; set; }
|
||||||
|
|
||||||
|
public SafeDictionary<PlayerIndex, InputConfig> InheritedInputConfigs = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<UserControl
|
|
||||||
xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignWidth="800"
|
|
||||||
d:DesignHeight="450"
|
|
||||||
x:Class="Ryujinx.Ava.UI.Renderer.RendererHost"
|
|
||||||
FlowDirection="LeftToRight"
|
|
||||||
Focusable="True">
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Gommon;
|
using Avalonia.Media;
|
||||||
using Ryujinx.Ava.Utilities.Configuration;
|
using Ryujinx.Ava.Utilities.Configuration;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Renderer
|
namespace Ryujinx.Ava.UI.Renderer
|
||||||
{
|
{
|
||||||
public partial class RendererHost : UserControl, IDisposable
|
public class RendererHost : UserControl, IDisposable
|
||||||
{
|
{
|
||||||
public readonly EmbeddedWindow EmbeddedWindow;
|
public readonly EmbeddedWindow EmbeddedWindow;
|
||||||
|
|
||||||
@@ -19,7 +18,8 @@ namespace Ryujinx.Ava.UI.Renderer
|
|||||||
|
|
||||||
public RendererHost()
|
public RendererHost()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
Focusable = true;
|
||||||
|
FlowDirection = FlowDirection.LeftToRight;
|
||||||
|
|
||||||
EmbeddedWindow = ConfigurationState.Instance.Graphics.GraphicsBackend.Value switch
|
EmbeddedWindow = ConfigurationState.Instance.Graphics.GraphicsBackend.Value switch
|
||||||
{
|
{
|
||||||
@@ -43,8 +43,6 @@ namespace Ryujinx.Ava.UI.Renderer
|
|||||||
|
|
||||||
public RendererHost(string titleId)
|
public RendererHost(string titleId)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
switch (TitleIDs.SelectGraphicsBackend(titleId, ConfigurationState.Instance.Graphics.GraphicsBackend))
|
switch (TitleIDs.SelectGraphicsBackend(titleId, ConfigurationState.Instance.Graphics.GraphicsBackend))
|
||||||
{
|
{
|
||||||
case GraphicsBackend.OpenGl:
|
case GraphicsBackend.OpenGl:
|
||||||
@@ -109,3 +107,4 @@ namespace Ryujinx.Ava.UI.Renderer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,8 +107,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
// some reason. so we save the items here and add them back after
|
// some reason. so we save the items here and add them back after
|
||||||
var items = SelectedDownloadableContents.ToArray();
|
var items = SelectedDownloadableContents.ToArray();
|
||||||
|
|
||||||
_views.Clear();
|
Views.Clear();
|
||||||
_views.AddRange(view);
|
Views.AddRange(view);
|
||||||
|
|
||||||
foreach (DownloadableContentModel item in items)
|
foreach (DownloadableContentModel item in items)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -182,7 +182,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
Applications.ToObservableChangeSet()
|
Applications.ToObservableChangeSet()
|
||||||
.Filter(Filter)
|
.Filter(Filter)
|
||||||
.Sort(GetComparer())
|
.Sort(GetComparer())
|
||||||
|
.OnItemAdded(_ => OnPropertyChanged(nameof(AppsObservableList)))
|
||||||
|
.OnItemRemoved(_ => OnPropertyChanged(nameof(AppsObservableList)))
|
||||||
|
#pragma warning disable MVVMTK0034 // Event to update is fired below
|
||||||
.Bind(out _appsObservableList)
|
.Bind(out _appsObservableList)
|
||||||
|
#pragma warning restore MVVMTK0034
|
||||||
.AsObservableList();
|
.AsObservableList();
|
||||||
|
|
||||||
_rendererWaitEvent = new AutoResetEvent(false);
|
_rendererWaitEvent = new AutoResetEvent(false);
|
||||||
@@ -192,9 +196,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
LoadConfigurableHotKeys();
|
LoadConfigurableHotKeys();
|
||||||
|
|
||||||
Volume = ConfigurationState.Instance.System.AudioVolume;
|
Volume = ConfigurationState.Instance.System.AudioVolume;
|
||||||
}
|
|
||||||
CustomVSyncInterval = ConfigurationState.Instance.Graphics.CustomVSyncInterval.Value;
|
CustomVSyncInterval = ConfigurationState.Instance.Graphics.CustomVSyncInterval.Value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Initialize(
|
public void Initialize(
|
||||||
ContentManager contentManager,
|
ContentManager contentManager,
|
||||||
|
|||||||
Reference in New Issue
Block a user