mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-01 18:49:05 -06:00
Compare commits
18 Commits
Canary-1.2
...
Canary-1.2
Author | SHA1 | Date | |
---|---|---|---|
ca66298817 | |||
9ae1c4380d | |||
c88518bce2 | |||
a3888ed7cf | |||
7cbbd02973 | |||
b2e1e553e4 | |||
699e1962b1 | |||
e486b902b1 | |||
0ab5b41c4b | |||
d10a478cce | |||
ec1020b165 | |||
4082ebad1a | |||
da8ea06074 | |||
7f9dccb293 | |||
8e4a77aba0 | |||
8fd8a776c9 | |||
eec92c242c | |||
42a739d34c |
@ -13,7 +13,7 @@ mkdir -p AppDir/usr/bin
|
||||
|
||||
cp distribution/linux/Ryujinx.desktop AppDir/Ryujinx.desktop
|
||||
cp distribution/linux/appimage/AppRun AppDir/AppRun
|
||||
cp src/Ryujinx.UI.Common/Resources/Logo_Ryujinx.png AppDir/Ryujinx.svg
|
||||
cp distribution/misc/Logo.svg AppDir/Ryujinx.svg
|
||||
|
||||
|
||||
cp -r "$BUILDDIR"/* AppDir/usr/bin/
|
||||
|
@ -9,20 +9,12 @@ namespace Ryujinx.Audio.Backends.Dummy
|
||||
{
|
||||
public class DummyHardwareDeviceDriver : IHardwareDeviceDriver
|
||||
{
|
||||
private readonly ManualResetEvent _updateRequiredEvent;
|
||||
private readonly ManualResetEvent _pauseEvent;
|
||||
private readonly ManualResetEvent _updateRequiredEvent = new(false);
|
||||
private readonly ManualResetEvent _pauseEvent = new(true);
|
||||
|
||||
public static bool IsSupported => true;
|
||||
|
||||
public float Volume { get; set; }
|
||||
|
||||
public DummyHardwareDeviceDriver()
|
||||
{
|
||||
_updateRequiredEvent = new ManualResetEvent(false);
|
||||
_pauseEvent = new ManualResetEvent(true);
|
||||
|
||||
Volume = 1f;
|
||||
}
|
||||
public float Volume { get; set; } = 1f;
|
||||
|
||||
public IHardwareDeviceSession OpenDeviceSession(Direction direction, IVirtualMemoryManager memoryManager, SampleFormat sampleFormat, uint sampleRate, uint channelCount)
|
||||
{
|
||||
@ -60,7 +52,7 @@ namespace Ryujinx.Audio.Backends.Dummy
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
|
@ -13,13 +13,13 @@ namespace Ryujinx.Common.Configuration
|
||||
|
||||
public record EnabledDirtyHack(DirtyHacks Hack, int Value)
|
||||
{
|
||||
private static readonly byte[] _packedFormat = [8, 32];
|
||||
public static readonly byte[] PackedFormat = [8, 32];
|
||||
|
||||
public ulong Pack() => BitTricks.PackBitFields([(uint)Hack, (uint)Value], _packedFormat);
|
||||
public ulong Pack() => BitTricks.PackBitFields([(uint)Hack, (uint)Value], PackedFormat);
|
||||
|
||||
public static EnabledDirtyHack FromPacked(ulong packedHack)
|
||||
public static EnabledDirtyHack Unpack(ulong packedHack)
|
||||
{
|
||||
var unpackedFields = BitTricks.UnpackBitFields(packedHack, _packedFormat);
|
||||
var unpackedFields = BitTricks.UnpackBitFields(packedHack, PackedFormat);
|
||||
if (unpackedFields is not [var hack, var value])
|
||||
throw new ArgumentException(nameof(packedHack));
|
||||
|
||||
@ -39,12 +39,21 @@ namespace Ryujinx.Common.Configuration
|
||||
|
||||
public DirtyHackCollection(ulong[] packedHacks)
|
||||
{
|
||||
foreach ((DirtyHacks dirtyHacks, int value) in packedHacks.Select(EnabledDirtyHack.FromPacked))
|
||||
foreach ((DirtyHacks dirtyHacks, int value) in packedHacks.Select(EnabledDirtyHack.Unpack))
|
||||
{
|
||||
Add(dirtyHacks, value);
|
||||
}
|
||||
}
|
||||
|
||||
public ulong[] PackEntries() =>
|
||||
this
|
||||
.Select(it =>
|
||||
BitTricks.PackBitFields([(uint)it.Key, (uint)it.Value], EnabledDirtyHack.PackedFormat))
|
||||
.ToArray();
|
||||
|
||||
public static implicit operator DirtyHackCollection(EnabledDirtyHack[] hacks) => new(hacks);
|
||||
public static implicit operator DirtyHackCollection(ulong[] packedHacks) => new(packedHacks);
|
||||
|
||||
public new int this[DirtyHacks hack] => TryGetValue(hack, out var value) ? value : -1;
|
||||
|
||||
public bool IsEnabled(DirtyHacks hack) => ContainsKey(hack);
|
||||
|
@ -35,7 +35,8 @@ namespace Ryujinx.Common
|
||||
"010028600EBDA000", // Mario 3D World
|
||||
"0100152000022000", // Mario Kart 8 Deluxe
|
||||
"01005CA01580E000", // Persona 5
|
||||
"01001f5010dfa000", // Pokemon Legends Arceus
|
||||
"0100187003A36000", // Pokémon: Let's Go, Evoli!
|
||||
"010003f003a34000", // Pokémon: Let's Go, Pikachu!
|
||||
"01008C0016544000", // Sea of Stars
|
||||
"01006A800016E000", // Smash Ultimate
|
||||
"0100000000010000", // Super Mario Odyessy
|
||||
|
@ -1,4 +1,5 @@
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Graphics.Device;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.Gpu.Engine.GPFifo;
|
||||
@ -90,6 +91,9 @@ namespace Ryujinx.Graphics.Gpu
|
||||
/// Support buffer updater.
|
||||
/// </summary>
|
||||
internal SupportBufferUpdater SupportBufferUpdater { get; }
|
||||
|
||||
internal DirtyHackCollection DirtyHacks { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Host hardware capabilities.
|
||||
@ -113,7 +117,7 @@ namespace Ryujinx.Graphics.Gpu
|
||||
/// Creates a new instance of the GPU emulation context.
|
||||
/// </summary>
|
||||
/// <param name="renderer">Host renderer</param>
|
||||
public GpuContext(IRenderer renderer)
|
||||
public GpuContext(IRenderer renderer, DirtyHackCollection hackCollection)
|
||||
{
|
||||
Renderer = renderer;
|
||||
|
||||
@ -136,6 +140,8 @@ namespace Ryujinx.Graphics.Gpu
|
||||
|
||||
SupportBufferUpdater = new SupportBufferUpdater(renderer);
|
||||
|
||||
DirtyHacks = hackCollection;
|
||||
|
||||
_firstTimestamp = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds);
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.Shader;
|
||||
@ -366,6 +367,9 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_context.DirtyHacks.IsEnabled(DirtyHacks.ShaderCompilationThreadSleep))
|
||||
Thread.Sleep(_context.DirtyHacks[DirtyHacks.ShaderCompilationThreadSleep]);
|
||||
|
||||
AsyncProgramTranslation asyncTranslation = new(guestShaders, specState, programIndex, isCompute);
|
||||
_asyncTranslationQueue.Add(asyncTranslation, _cancellationToken);
|
||||
}
|
||||
|
@ -114,10 +114,10 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
||||
}
|
||||
}
|
||||
|
||||
string usedCharacterStr = BitConverter.ToString(usedCharacter).Replace("-", "");
|
||||
string variationStr = BitConverter.ToString(variation).Replace("-", "");
|
||||
string amiiboIDStr = BitConverter.ToString(amiiboID).Replace("-", "");
|
||||
string setIDStr = BitConverter.ToString(setID).Replace("-", "");
|
||||
string usedCharacterStr = Convert.ToHexString(usedCharacter);
|
||||
string variationStr = Convert.ToHexString(variation);
|
||||
string amiiboIDStr = Convert.ToHexString(amiiboID);
|
||||
string setIDStr = Convert.ToHexString(setID);
|
||||
string head = usedCharacterStr + variationStr;
|
||||
string tail = amiiboIDStr + setIDStr + "02";
|
||||
string finalID = head + tail;
|
||||
@ -289,8 +289,8 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
||||
|
||||
private static void LogFinalData(byte[] titleId, byte[] appId, string head, string tail, string finalID, string nickName, DateTime initDateTime, DateTime writeDateTime, ushort settingsValue, ushort writeCounterValue, byte[] applicationAreas)
|
||||
{
|
||||
Logger.Debug?.Print(LogClass.ServiceNfp, $"Title ID: 0x{BitConverter.ToString(titleId).Replace("-", "")}");
|
||||
Logger.Debug?.Print(LogClass.ServiceNfp, $"Application Program ID: 0x{BitConverter.ToString(appId).Replace("-", "")}");
|
||||
Logger.Debug?.Print(LogClass.ServiceNfp, $"Title ID: 0x{Convert.ToHexString(titleId)}");
|
||||
Logger.Debug?.Print(LogClass.ServiceNfp, $"Application Program ID: 0x{Convert.ToHexString(appId)}");
|
||||
Logger.Debug?.Print(LogClass.ServiceNfp, $"Head: {head}");
|
||||
Logger.Debug?.Print(LogClass.ServiceNfp, $"Tail: {tail}");
|
||||
Logger.Debug?.Print(LogClass.ServiceNfp, $"Final ID: {finalID}");
|
||||
|
@ -57,9 +57,10 @@ namespace Ryujinx.HLE
|
||||
: MemoryAllocationFlags.Reserve | MemoryAllocationFlags.Mirrorable;
|
||||
|
||||
#pragma warning disable IDE0055 // Disable formatting
|
||||
DirtyHacks = new DirtyHackCollection(Configuration.Hacks);
|
||||
AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver);
|
||||
Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), memoryAllocationFlags);
|
||||
Gpu = new GpuContext(Configuration.GpuRenderer);
|
||||
Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks);
|
||||
System = new HOS.Horizon(this);
|
||||
Statistics = new PerformanceStatistics();
|
||||
Hid = new Hid(this, System.HidStorage);
|
||||
@ -77,7 +78,7 @@ namespace Ryujinx.HLE
|
||||
System.EnablePtc = Configuration.EnablePtc;
|
||||
System.FsIntegrityCheckLevel = Configuration.FsIntegrityCheckLevel;
|
||||
System.GlobalAccessLogMode = Configuration.FsGlobalAccessLogMode;
|
||||
DirtyHacks = new DirtyHackCollection(Configuration.Hacks);
|
||||
|
||||
UpdateVSyncInterval();
|
||||
#pragma warning restore IDE0055
|
||||
|
||||
|
77
src/Ryujinx/UI/ViewModels/SettingsHacksViewModel.cs
Normal file
77
src/Ryujinx/UI/ViewModels/SettingsHacksViewModel.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using Gommon;
|
||||
using Ryujinx.Ava.Utilities.Configuration;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
public class SettingsHacksViewModel : BaseModel
|
||||
{
|
||||
private readonly SettingsViewModel _baseViewModel;
|
||||
|
||||
public SettingsHacksViewModel() {}
|
||||
|
||||
public SettingsHacksViewModel(SettingsViewModel settingsVm)
|
||||
{
|
||||
_baseViewModel = settingsVm;
|
||||
}
|
||||
|
||||
private bool _xc2MenuSoftlockFix = ConfigurationState.Instance.Hacks.Xc2MenuSoftlockFix;
|
||||
private bool _shaderTranslationThreadSleep = ConfigurationState.Instance.Hacks.EnableShaderTranslationDelay;
|
||||
private int _shaderTranslationSleepDelay = ConfigurationState.Instance.Hacks.ShaderTranslationDelay;
|
||||
|
||||
public bool Xc2MenuSoftlockFixEnabled
|
||||
{
|
||||
get => _xc2MenuSoftlockFix;
|
||||
set
|
||||
{
|
||||
_xc2MenuSoftlockFix = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShaderTranslationDelayEnabled
|
||||
{
|
||||
get => _shaderTranslationThreadSleep;
|
||||
set
|
||||
{
|
||||
_shaderTranslationThreadSleep = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string ShaderTranslationDelayTooltipText => $"Current value: {ShaderTranslationDelay}";
|
||||
|
||||
public int ShaderTranslationDelay
|
||||
{
|
||||
get => _shaderTranslationSleepDelay;
|
||||
set
|
||||
{
|
||||
_shaderTranslationSleepDelay = value;
|
||||
|
||||
OnPropertiesChanged(nameof(ShaderTranslationDelay), nameof(ShaderTranslationDelayTooltipText));
|
||||
}
|
||||
}
|
||||
|
||||
public static string Xc2MenuFixTooltip { get; } = Lambda.String(sb =>
|
||||
{
|
||||
sb.AppendLine(
|
||||
"This fix applies a 2ms delay (via 'Thread.Sleep(2)') every time the game tries to read data from the emulated Switch filesystem.")
|
||||
.AppendLine();
|
||||
|
||||
sb.AppendLine("From the issue on GitHub:").AppendLine();
|
||||
sb.Append(
|
||||
"When clicking very fast from game main menu to 2nd submenu, " +
|
||||
"there is a low chance that the game will softlock, " +
|
||||
"the submenu won't show up, while background music is still there.");
|
||||
});
|
||||
|
||||
public static string ShaderTranslationDelayTooltip { get; } = Lambda.String(sb =>
|
||||
{
|
||||
sb.AppendLine("This hack applies the delay you specify every time shaders are attempted to be translated.")
|
||||
.AppendLine();
|
||||
|
||||
sb.Append("Configurable via slider, only when this option is enabled.");
|
||||
});
|
||||
}
|
||||
}
|
@ -65,9 +65,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private string _ldnPassphrase;
|
||||
private string _ldnServer;
|
||||
|
||||
private bool _xc2MenuSoftlockFix = ConfigurationState.Instance.Hacks.Xc2MenuSoftlockFix;
|
||||
private bool _shaderTranslationThreadSleep = ConfigurationState.Instance.Hacks.EnableShaderCompilationThreadSleep;
|
||||
private int _shaderTranslationSleepDelay = ConfigurationState.Instance.Hacks.ShaderCompilationThreadSleepDelay;
|
||||
public SettingsHacksViewModel DirtyHacks { get; }
|
||||
|
||||
public int ResolutionScale
|
||||
{
|
||||
@ -279,39 +277,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool Xc2MenuSoftlockFixEnabled
|
||||
{
|
||||
get => _xc2MenuSoftlockFix;
|
||||
set
|
||||
{
|
||||
_xc2MenuSoftlockFix = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShaderTranslationDelayEnabled
|
||||
{
|
||||
get => _shaderTranslationThreadSleep;
|
||||
set
|
||||
{
|
||||
_shaderTranslationThreadSleep = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int ShaderTranslationDelay
|
||||
{
|
||||
get => _shaderTranslationSleepDelay;
|
||||
set
|
||||
{
|
||||
_shaderTranslationSleepDelay = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int Language { get; set; }
|
||||
public int Region { get; set; }
|
||||
public int FsGlobalAccessLogMode { get; set; }
|
||||
@ -424,9 +389,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
_virtualFileSystem = virtualFileSystem;
|
||||
_contentManager = contentManager;
|
||||
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
Task.Run(LoadTimeZones);
|
||||
|
||||
DirtyHacks = new SettingsHacksViewModel(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,6 +414,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
Task.Run(LoadAvailableGpus);
|
||||
LoadCurrentConfiguration();
|
||||
|
||||
DirtyHacks = new SettingsHacksViewModel(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -660,9 +630,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
OpenglDebugLevel = (int)config.Logger.GraphicsDebugLevel.Value;
|
||||
|
||||
MultiplayerModeIndex = (int)config.Multiplayer.Mode.Value;
|
||||
DisableP2P = config.Multiplayer.DisableP2p.Value;
|
||||
LdnPassphrase = config.Multiplayer.LdnPassphrase.Value;
|
||||
LdnServer = config.Multiplayer.LdnServer.Value;
|
||||
DisableP2P = config.Multiplayer.DisableP2p;
|
||||
LdnPassphrase = config.Multiplayer.LdnPassphrase;
|
||||
LdnServer = config.Multiplayer.LdnServer;
|
||||
}
|
||||
|
||||
public void SaveSettings()
|
||||
@ -786,9 +756,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
config.Multiplayer.LdnServer.Value = LdnServer;
|
||||
|
||||
// Dirty Hacks
|
||||
config.Hacks.Xc2MenuSoftlockFix.Value = Xc2MenuSoftlockFixEnabled;
|
||||
config.Hacks.EnableShaderCompilationThreadSleep.Value = ShaderTranslationDelayEnabled;
|
||||
config.Hacks.ShaderCompilationThreadSleepDelay.Value = ShaderTranslationDelay;
|
||||
config.Hacks.Xc2MenuSoftlockFix.Value = DirtyHacks.Xc2MenuSoftlockFixEnabled;
|
||||
config.Hacks.EnableShaderTranslationDelay.Value = DirtyHacks.ShaderTranslationDelayEnabled;
|
||||
config.Hacks.ShaderTranslationDelay.Value = DirtyHacks.ShaderTranslationDelay;
|
||||
|
||||
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
||||
|
||||
@ -822,24 +792,5 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
RevertIfNotSaved();
|
||||
CloseWindow?.Invoke();
|
||||
}
|
||||
|
||||
public static string Xc2MenuFixTooltip { get; } = Lambda.String(sb =>
|
||||
{
|
||||
sb.AppendLine(
|
||||
"This fix applies a 2ms delay (via 'Thread.Sleep(2)') every time the game tries to read data from the emulated Switch filesystem.")
|
||||
.AppendLine();
|
||||
|
||||
sb.AppendLine("From the issue on GitHub:").AppendLine();
|
||||
sb.Append(
|
||||
"When clicking very fast from game main menu to 2nd submenu, " +
|
||||
"there is a low chance that the game will softlock, " +
|
||||
"the submenu won't show up, while background music is still there.");
|
||||
});
|
||||
|
||||
public static string ShaderTranslationDelayTooltip { get; } = Lambda.String(sb =>
|
||||
{
|
||||
sb.Append(
|
||||
"This hack applies the delay you specify every time shaders are attempted to be translated.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -29,15 +29,15 @@
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource SecondaryTextColor}"
|
||||
TextDecorations="Underline"
|
||||
Text="Game-specific hacks & tricks to alleviate performance issues or crashing. May cause issues." />
|
||||
Text="Game-specific hacks & tricks to alleviate performance issues or crashing. Will cause issues." />
|
||||
<StackPanel
|
||||
Margin="0,10,0,0"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
ToolTip.Tip="{Binding Xc2MenuFixTooltip}">
|
||||
ToolTip.Tip="{Binding DirtyHacks.Xc2MenuFixTooltip}">
|
||||
<CheckBox
|
||||
Margin="0"
|
||||
IsChecked="{Binding Xc2MenuSoftlockFixEnabled}"/>
|
||||
IsChecked="{Binding DirtyHacks.Xc2MenuSoftlockFixEnabled}"/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="Xenoblade Chronicles 2 Menu Softlock Fix" />
|
||||
@ -47,16 +47,17 @@
|
||||
Margin="0,10,0,0"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
ToolTip.Tip="{Binding ShaderTranslationDelayTooltip}">
|
||||
ToolTip.Tip="{Binding DirtyHacks.ShaderTranslationDelayTooltip}">
|
||||
<CheckBox
|
||||
Margin="0"
|
||||
IsChecked="{Binding ShaderTranslationDelayEnabled}"/>
|
||||
IsChecked="{Binding DirtyHacks.ShaderTranslationDelayEnabled}"/>
|
||||
<TextBlock VerticalAlignment="Center"
|
||||
Text="Arbitrary Delay on Shader Translation"/>
|
||||
</StackPanel>
|
||||
<Slider HorizontalAlignment="Center"
|
||||
Value="{Binding ShaderTranslationDelay}"
|
||||
ToolTip.Tip="{Binding ShaderTranslationDelay}"
|
||||
<Slider IsVisible="{Binding DirtyHacks.ShaderTranslationDelayEnabled}"
|
||||
HorizontalAlignment="Center"
|
||||
Value="{Binding DirtyHacks.ShaderTranslationDelay}"
|
||||
ToolTip.Tip="{Binding DirtyHacks.ShaderTranslationDelayTooltipText}"
|
||||
Width="175"
|
||||
Margin="0,-3,0,0"
|
||||
Height="32"
|
||||
|
@ -1,13 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
|
||||
namespace Ryujinx.Ava.UI.Views.Settings
|
||||
{
|
||||
public partial class SettingsHacksView : UserControl
|
||||
{
|
||||
public SettingsViewModel ViewModel;
|
||||
|
||||
public SettingsHacksView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -170,7 +170,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
{
|
||||
var ldnGameDataArray = e.LdnData.ToList();
|
||||
ViewModel.LdnData.Clear();
|
||||
foreach (var application in ViewModel.Applications)
|
||||
foreach (var application in ViewModel.Applications.Where(it => it.HasControlHolder))
|
||||
{
|
||||
ref var controlHolder = ref application.ControlHolder.Value;
|
||||
|
||||
|
@ -87,7 +87,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
NavPanel.Content = LoggingPage;
|
||||
break;
|
||||
case nameof(HacksPage):
|
||||
HacksPage.ViewModel = ViewModel;
|
||||
HacksPage.DataContext = ViewModel;
|
||||
NavPanel.Content = HacksPage;
|
||||
break;
|
||||
default:
|
||||
|
@ -75,11 +75,11 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
||||
TitleUpdates = _titleUpdates.AsObservableCache();
|
||||
DownloadableContents = _downloadableContents.AsObservableCache();
|
||||
|
||||
_nspIcon = EmbeddedResources.Read("Ryujinx.Assets.UIImages.Icon_NSP.png");
|
||||
_xciIcon = EmbeddedResources.Read("Ryujinx.Assets.UIImages.Icon_XCI.png");
|
||||
_ncaIcon = EmbeddedResources.Read("Ryujinx.Assets.UIImages.Icon_NCA.png");
|
||||
_nroIcon = EmbeddedResources.Read("Ryujinx.Assets.UIImages.Icon_NRO.png");
|
||||
_nsoIcon = EmbeddedResources.Read("Ryujinx.Assets.UIImages.Icon_NSO.png");
|
||||
_nspIcon = EmbeddedResources.Read("Ryujinx/Assets.UIImages.Icon_NSP.png");
|
||||
_xciIcon = EmbeddedResources.Read("Ryujinx/Assets.UIImages.Icon_XCI.png");
|
||||
_ncaIcon = EmbeddedResources.Read("Ryujinx/Assets.UIImages.Icon_NCA.png");
|
||||
_nroIcon = EmbeddedResources.Read("Ryujinx/Assets.UIImages.Icon_NRO.png");
|
||||
_nsoIcon = EmbeddedResources.Read("Ryujinx/Assets.UIImages.Icon_NSO.png");
|
||||
}
|
||||
|
||||
/// <exception cref="Ryujinx.HLE.Exceptions.InvalidNpdmException">The npdm file doesn't contain valid data.</exception>
|
||||
|
@ -752,13 +752,14 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
||||
Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks;
|
||||
|
||||
{
|
||||
EnabledDirtyHack[] hacks = configurationFileFormat.DirtyHacks.Select(EnabledDirtyHack.FromPacked).ToArray();
|
||||
EnabledDirtyHack[] hacks = (configurationFileFormat.DirtyHacks ?? []).Select(EnabledDirtyHack.Unpack).ToArray();
|
||||
|
||||
Hacks.Xc2MenuSoftlockFix.Value = hacks.Any(it => it.Hack == DirtyHacks.Xc2MenuSoftlockFix);
|
||||
|
||||
var shaderCompilationThreadSleep = hacks.FirstOrDefault(it => it.Hack == DirtyHacks.ShaderCompilationThreadSleep);
|
||||
Hacks.EnableShaderCompilationThreadSleep.Value = shaderCompilationThreadSleep != null;
|
||||
Hacks.ShaderCompilationThreadSleepDelay.Value = shaderCompilationThreadSleep?.Value ?? 0;
|
||||
|
||||
var shaderCompilationThreadSleep = hacks.FirstOrDefault(it =>
|
||||
it.Hack == DirtyHacks.ShaderCompilationThreadSleep);
|
||||
Hacks.EnableShaderTranslationDelay.Value = shaderCompilationThreadSleep != null;
|
||||
Hacks.ShaderTranslationDelay.Value = shaderCompilationThreadSleep?.Value ?? 0;
|
||||
}
|
||||
|
||||
if (configurationFileUpdated)
|
||||
|
@ -10,6 +10,7 @@ using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RyuLogger = Ryujinx.Common.Logging.Logger;
|
||||
|
||||
namespace Ryujinx.Ava.Utilities.Configuration
|
||||
{
|
||||
@ -628,25 +629,36 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
||||
|
||||
public ReactiveObject<bool> Xc2MenuSoftlockFix { get; private set; }
|
||||
|
||||
public ReactiveObject<bool> EnableShaderCompilationThreadSleep { get; private set; }
|
||||
public ReactiveObject<bool> EnableShaderTranslationDelay { get; private set; }
|
||||
|
||||
public ReactiveObject<int> ShaderCompilationThreadSleepDelay { get; private set; }
|
||||
public ReactiveObject<int> ShaderTranslationDelay { get; private set; }
|
||||
|
||||
public HacksSection()
|
||||
{
|
||||
ShowDirtyHacks = new ReactiveObject<bool>();
|
||||
Xc2MenuSoftlockFix = new ReactiveObject<bool>();
|
||||
Xc2MenuSoftlockFix.Event += HackChanged;
|
||||
EnableShaderCompilationThreadSleep = new ReactiveObject<bool>();
|
||||
EnableShaderCompilationThreadSleep.Event += HackChanged;
|
||||
ShaderCompilationThreadSleepDelay = new ReactiveObject<int>();
|
||||
EnableShaderTranslationDelay = new ReactiveObject<bool>();
|
||||
EnableShaderTranslationDelay.Event += HackChanged;
|
||||
ShaderTranslationDelay = new ReactiveObject<int>();
|
||||
}
|
||||
|
||||
private void HackChanged(object sender, ReactiveEventArgs<bool> rxe)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Info?.Print(LogClass.Configuration, $"EnabledDirtyHacks set to: [{EnabledHacks.Select(x => x.Hack).JoinToString(", ")}]", "LogValueChange");
|
||||
var newHacks = EnabledHacks.Select(x => x.Hack)
|
||||
.JoinToString(", ");
|
||||
|
||||
if (newHacks != _lastHackCollection)
|
||||
{
|
||||
RyuLogger.Info?.Print(LogClass.Configuration,
|
||||
$"EnabledDirtyHacks set to: [{newHacks}]", "LogValueChange");
|
||||
|
||||
_lastHackCollection = newHacks;
|
||||
}
|
||||
}
|
||||
|
||||
private static string _lastHackCollection;
|
||||
|
||||
public EnabledDirtyHack[] EnabledHacks
|
||||
{
|
||||
get
|
||||
@ -656,8 +668,8 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
||||
if (Xc2MenuSoftlockFix)
|
||||
Apply(DirtyHacks.Xc2MenuSoftlockFix);
|
||||
|
||||
if (EnableShaderCompilationThreadSleep)
|
||||
Apply(DirtyHacks.ShaderCompilationThreadSleep, ShaderCompilationThreadSleepDelay);
|
||||
if (EnableShaderTranslationDelay)
|
||||
Apply(DirtyHacks.ShaderCompilationThreadSleep, ShaderTranslationDelay);
|
||||
|
||||
return enabledHacks.ToArray();
|
||||
|
||||
|
Reference in New Issue
Block a user