mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-06 12:29:15 +00:00
Merge branch ryujinx:master into master
This commit is contained in:
@@ -6445,26 +6445,27 @@
|
|||||||
{
|
{
|
||||||
"ID": "SettingsButtonResetConfirm",
|
"ID": "SettingsButtonResetConfirm",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
"ar_SA": "أريد إعادة تعيين إعداداتي",
|
"ar_SA": "",
|
||||||
"de_DE": "Ich möchte meine Einstellungen zurücksetzen",
|
"de_DE": "",
|
||||||
"el_GR": "Θέλω να επαναφέρω τις ρυθμίσεις μου",
|
"el_GR": "",
|
||||||
"en_US": "I Want To Reset My Settings",
|
"en_US": "I want to reset my settings.",
|
||||||
"es_ES": "Quiero Restablecer Mi Configuración",
|
"es_ES": "Quiero restablecer mi Configuración.",
|
||||||
"fr_FR": "Je Veux Réinitialiser Mes Paramètres",
|
"fr_FR": "Je veux réinitialiser mes paramètres.",
|
||||||
"he_IL": "אני רוצה לאפס את ההגדרות שלי",
|
"he_IL": "",
|
||||||
"it_IT": "Voglio reimpostare le mie impostazioni",
|
"it_IT": "Voglio ripristinare le mie impostazioni.",
|
||||||
"ja_JP": "設定をリセットしたいです",
|
"ja_JP": "",
|
||||||
"ko_KR": "설정을 초기화하고 싶습니다",
|
"ko_KR": "설정을 초기화하고 싶습니다.",
|
||||||
"no_NO": "Jeg vil tilbakestille innstillingene mine",
|
"no_NO": "Jeg vil tilbakestille innstillingene mine.",
|
||||||
"pl_PL": "Chcę zresetować moje ustawienia",
|
"pl_PL": "",
|
||||||
"pt_BR": "Quero redefinir minhas configurações",
|
"pt_BR": "Quero redefinir minhas configurações.",
|
||||||
"ru_RU": "Я хочу сбросить свои настройки",
|
"ru_RU": "Я хочу сбросить свои настройки.",
|
||||||
"sv_SE": "Jag vill nollställa mina inställningar",
|
"sv_SE": "Jag vill nollställa mina inställningar.",
|
||||||
"th_TH": "ฉันต้องการรีเซ็ตการตั้งค่าของฉัน",
|
"th_TH": "",
|
||||||
"tr_TR": "Ayarlarımı sıfırlamak istiyorum",
|
"tr_TR": "",
|
||||||
"uk_UA": "Я хочу скинути налаштування",
|
"uk_UA": "Я хочу скинути налаштування.",
|
||||||
"zh_CN": "我要重置我的设置",
|
"zh_CN": "我要重置我的设置。",
|
||||||
"zh_TW": "我想重設我的設定"
|
"zh_TW": "我想重設我的設定。"
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace Ryujinx.HLE.HOS.Kernel
|
|||||||
capabilities,
|
capabilities,
|
||||||
context.ResourceLimit,
|
context.ResourceLimit,
|
||||||
MemoryRegion.Service,
|
MemoryRegion.Service,
|
||||||
|
context.Device.Configuration.MemoryConfiguration,
|
||||||
null,
|
null,
|
||||||
customThreadStart);
|
customThreadStart);
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
|||||||
ProcessCreationFlags flags,
|
ProcessCreationFlags flags,
|
||||||
bool fromBack,
|
bool fromBack,
|
||||||
MemoryRegion memRegion,
|
MemoryRegion memRegion,
|
||||||
|
MemoryConfiguration memConfig,
|
||||||
ulong address,
|
ulong address,
|
||||||
ulong size,
|
ulong size,
|
||||||
KMemoryBlockSlabManager slabManager)
|
KMemoryBlockSlabManager slabManager)
|
||||||
@@ -117,6 +118,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
|||||||
addrSpaceBase,
|
addrSpaceBase,
|
||||||
addrSpaceSize,
|
addrSpaceSize,
|
||||||
memRegion,
|
memRegion,
|
||||||
|
memConfig,
|
||||||
address,
|
address,
|
||||||
size,
|
size,
|
||||||
slabManager);
|
slabManager);
|
||||||
@@ -159,6 +161,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
|||||||
ulong addrSpaceStart,
|
ulong addrSpaceStart,
|
||||||
ulong addrSpaceEnd,
|
ulong addrSpaceEnd,
|
||||||
MemoryRegion memRegion,
|
MemoryRegion memRegion,
|
||||||
|
MemoryConfiguration memConfig,
|
||||||
ulong address,
|
ulong address,
|
||||||
ulong size,
|
ulong size,
|
||||||
KMemoryBlockSlabManager slabManager)
|
KMemoryBlockSlabManager slabManager)
|
||||||
@@ -193,7 +196,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
|||||||
|
|
||||||
case ProcessCreationFlags.AddressSpace64BitDeprecated:
|
case ProcessCreationFlags.AddressSpace64BitDeprecated:
|
||||||
aliasRegion.Size = 0x180000000;
|
aliasRegion.Size = 0x180000000;
|
||||||
heapRegion.Size = 0x180000000;
|
heapRegion.Size = memConfig == MemoryConfiguration.MemoryConfiguration12GiB ? 0x300000000u : 0x180000000u;
|
||||||
stackRegion.Size = 0;
|
stackRegion.Size = 0;
|
||||||
tlsIoRegion.Size = 0;
|
tlsIoRegion.Size = 0;
|
||||||
CodeRegionStart = 0x8000000;
|
CodeRegionStart = 0x8000000;
|
||||||
@@ -223,7 +226,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
|||||||
int addressSpaceWidth = (int)ulong.Log2(_reservedAddressSpaceSize);
|
int addressSpaceWidth = (int)ulong.Log2(_reservedAddressSpaceSize);
|
||||||
|
|
||||||
aliasRegion.Size = 1UL << (addressSpaceWidth - 3);
|
aliasRegion.Size = 1UL << (addressSpaceWidth - 3);
|
||||||
heapRegion.Size = 0x180000000;
|
heapRegion.Size = memConfig == MemoryConfiguration.MemoryConfiguration12GiB ? 0x300000000u : 0x180000000u;
|
||||||
stackRegion.Size = 1UL << (addressSpaceWidth - 8);
|
stackRegion.Size = 1UL << (addressSpaceWidth - 8);
|
||||||
tlsIoRegion.Size = 1UL << (addressSpaceWidth - 3);
|
tlsIoRegion.Size = 1UL << (addressSpaceWidth - 3);
|
||||||
CodeRegionStart = BitUtils.AlignDown(address, RegionAlignment);
|
CodeRegionStart = BitUtils.AlignDown(address, RegionAlignment);
|
||||||
@@ -237,7 +240,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
aliasRegion.Size = 0x1000000000;
|
aliasRegion.Size = 0x1000000000;
|
||||||
heapRegion.Size = 0x180000000;
|
heapRegion.Size = memConfig == MemoryConfiguration.MemoryConfiguration12GiB ? 0x300000000u : 0x180000000u;
|
||||||
stackRegion.Size = 0x80000000;
|
stackRegion.Size = 0x80000000;
|
||||||
tlsIoRegion.Size = 0x1000000000;
|
tlsIoRegion.Size = 0x1000000000;
|
||||||
CodeRegionStart = BitUtils.AlignDown(address, RegionAlignment);
|
CodeRegionStart = BitUtils.AlignDown(address, RegionAlignment);
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
KPageList pageList,
|
KPageList pageList,
|
||||||
KResourceLimit resourceLimit,
|
KResourceLimit resourceLimit,
|
||||||
MemoryRegion memRegion,
|
MemoryRegion memRegion,
|
||||||
|
MemoryConfiguration memConfig,
|
||||||
IProcessContextFactory contextFactory,
|
IProcessContextFactory contextFactory,
|
||||||
ThreadStart customThreadStart = null)
|
ThreadStart customThreadStart = null)
|
||||||
{
|
{
|
||||||
@@ -153,6 +154,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
creationInfo.Flags,
|
creationInfo.Flags,
|
||||||
!creationInfo.Flags.HasFlag(ProcessCreationFlags.EnableAslr),
|
!creationInfo.Flags.HasFlag(ProcessCreationFlags.EnableAslr),
|
||||||
memRegion,
|
memRegion,
|
||||||
|
memConfig,
|
||||||
codeAddress,
|
codeAddress,
|
||||||
codeSize,
|
codeSize,
|
||||||
slabManager);
|
slabManager);
|
||||||
@@ -189,6 +191,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
ReadOnlySpan<uint> capabilities,
|
ReadOnlySpan<uint> capabilities,
|
||||||
KResourceLimit resourceLimit,
|
KResourceLimit resourceLimit,
|
||||||
MemoryRegion memRegion,
|
MemoryRegion memRegion,
|
||||||
|
MemoryConfiguration memConfig,
|
||||||
IProcessContextFactory contextFactory,
|
IProcessContextFactory contextFactory,
|
||||||
ThreadStart customThreadStart = null)
|
ThreadStart customThreadStart = null)
|
||||||
{
|
{
|
||||||
@@ -252,6 +255,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
creationInfo.Flags,
|
creationInfo.Flags,
|
||||||
!creationInfo.Flags.HasFlag(ProcessCreationFlags.EnableAslr),
|
!creationInfo.Flags.HasFlag(ProcessCreationFlags.EnableAslr),
|
||||||
memRegion,
|
memRegion,
|
||||||
|
memConfig,
|
||||||
codeAddress,
|
codeAddress,
|
||||||
codeSize,
|
codeSize,
|
||||||
slabManager);
|
slabManager);
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
|||||||
capabilities,
|
capabilities,
|
||||||
resourceLimit,
|
resourceLimit,
|
||||||
memRegion,
|
memRegion,
|
||||||
|
_context.Device.Configuration.MemoryConfiguration,
|
||||||
contextFactory,
|
contextFactory,
|
||||||
customThreadStart);
|
customThreadStart);
|
||||||
|
|
||||||
@@ -888,7 +889,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
|||||||
[Svc(1)]
|
[Svc(1)]
|
||||||
public Result SetHeapSize([PointerSized] out ulong address, [PointerSized] ulong size)
|
public Result SetHeapSize([PointerSized] out ulong address, [PointerSized] ulong size)
|
||||||
{
|
{
|
||||||
if ((size & 0xfffffffe001fffff) != 0)
|
if ((size & 0xfffffffd001fffff) != 0)
|
||||||
{
|
{
|
||||||
address = 0;
|
address = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||||||
codeAddress,
|
codeAddress,
|
||||||
codeSize);
|
codeSize);
|
||||||
|
|
||||||
result = process.InitializeKip(creationInfo, kip.Capabilities, pageList, context.ResourceLimit, memoryRegion, processContextFactory);
|
result = process.InitializeKip(creationInfo, kip.Capabilities, pageList, context.ResourceLimit, memoryRegion, context.Device.Configuration.MemoryConfiguration, processContextFactory);
|
||||||
if (result != Result.Success)
|
if (result != Result.Success)
|
||||||
{
|
{
|
||||||
Logger.Error?.Print(LogClass.Loader, $"Process initialization returned error \"{result}\".");
|
Logger.Error?.Print(LogClass.Loader, $"Process initialization returned error \"{result}\".");
|
||||||
@@ -389,6 +389,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||||||
MemoryMarshal.Cast<byte, uint>(npdm.KernelCapabilityData),
|
MemoryMarshal.Cast<byte, uint>(npdm.KernelCapabilityData),
|
||||||
resourceLimit,
|
resourceLimit,
|
||||||
memoryRegion,
|
memoryRegion,
|
||||||
|
context.Device.Configuration.MemoryConfiguration,
|
||||||
processContextFactory);
|
processContextFactory);
|
||||||
|
|
||||||
if (result != Result.Success)
|
if (result != Result.Success)
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ using LibHac.Tools.FsSystem.NcaUtils;
|
|||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.Systems.PlayReport;
|
using Ryujinx.Ava.Systems.PlayReport;
|
||||||
using Ryujinx.Ava.Utilities;
|
using Ryujinx.Ava.Utilities;
|
||||||
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.FileSystem;
|
using Ryujinx.HLE.FileSystem;
|
||||||
using Ryujinx.HLE.Loaders.Processes.Extensions;
|
using Ryujinx.HLE.Loaders.Processes.Extensions;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Systems.AppLibrary
|
namespace Ryujinx.Ava.Systems.AppLibrary
|
||||||
@@ -84,6 +86,32 @@ namespace Ryujinx.Ava.Systems.AppLibrary
|
|||||||
|
|
||||||
public LocaleKeys? PlayabilityStatus => Compatibility.Convert(x => x.Status).OrElse(null);
|
public LocaleKeys? PlayabilityStatus => Compatibility.Convert(x => x.Status).OrElse(null);
|
||||||
|
|
||||||
|
public bool HasPtcCacheFiles
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
DirectoryInfo mainDir = new(System.IO.Path.Combine(AppDataManager.GamesDirPath, IdString, "cache", "cpu", "0"));
|
||||||
|
DirectoryInfo backupDir = new(System.IO.Path.Combine(AppDataManager.GamesDirPath, IdString, "cache", "cpu", "1"));
|
||||||
|
|
||||||
|
return (mainDir.Exists && (mainDir.EnumerateFiles("*.cache").Any() || mainDir.EnumerateFiles("*.info").Any())) ||
|
||||||
|
(backupDir.Exists && (backupDir.EnumerateFiles("*.cache").Any() || backupDir.EnumerateFiles("*.info").Any()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool HasShaderCacheFiles
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
DirectoryInfo shaderCacheDir = new(System.IO.Path.Combine(AppDataManager.GamesDirPath, IdString, "cache", "shader"));
|
||||||
|
|
||||||
|
if (!shaderCacheDir.Exists) return false;
|
||||||
|
|
||||||
|
return shaderCacheDir.EnumerateDirectories("*").Any() ||
|
||||||
|
shaderCacheDir.GetFiles("*.toc").Length != 0 ||
|
||||||
|
shaderCacheDir.GetFiles("*.data").Length != 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string LocalizedStatusTooltip =>
|
public string LocalizedStatusTooltip =>
|
||||||
Compatibility.Convert(x =>
|
Compatibility.Convert(x =>
|
||||||
#pragma warning disable CS8509 // It is exhaustive for all possible values this can contain.
|
#pragma warning disable CS8509 // It is exhaustive for all possible values this can contain.
|
||||||
|
|||||||
@@ -120,13 +120,13 @@
|
|||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuCacheManagementNukePptc}"
|
Header="{ext:Locale GameListContextMenuCacheManagementNukePptc}"
|
||||||
Icon="{ext:Icon fa-solid fa-trash-can}"
|
Icon="{ext:Icon fa-solid fa-trash-can}"
|
||||||
IsEnabled="{Binding HasPtcCacheFiles}" />
|
IsEnabled="{Binding SelectedApplication.HasPtcCacheFiles, FallbackValue=False}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding PurgeShaderCache}"
|
Command="{Binding PurgeShaderCache}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuCacheManagementPurgeShaderCache}"
|
Header="{ext:Locale GameListContextMenuCacheManagementPurgeShaderCache}"
|
||||||
Icon="{ext:Icon fa-solid fa-trash-can}"
|
Icon="{ext:Icon fa-solid fa-trash-can}"
|
||||||
IsEnabled="{Binding HasShaderCacheFiles}" />
|
IsEnabled="{Binding SelectedApplication.HasShaderCacheFiles, FallbackValue=False}" />
|
||||||
<Separator/>
|
<Separator/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenPtcDirectory}"
|
Command="{Binding OpenPtcDirectory}"
|
||||||
|
|||||||
@@ -354,8 +354,8 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
primary,
|
primary,
|
||||||
secondaryText,
|
secondaryText,
|
||||||
LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
||||||
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
|
||||||
LocaleManager.Instance[LocaleKeys.DialogUpdaterShowChangelogMessage],
|
LocaleManager.Instance[LocaleKeys.DialogUpdaterShowChangelogMessage],
|
||||||
|
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
||||||
(int)Symbol.Help,
|
(int)Symbol.Help,
|
||||||
UserResult.Yes);
|
UserResult.Yes);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Ryujinx.Ava.Common.Locale;
|
|||||||
using Ryujinx.Ava.Common.Models.Amiibo;
|
using Ryujinx.Ava.Common.Models.Amiibo;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.Windows;
|
using Ryujinx.Ava.UI.Windows;
|
||||||
|
using Ryujinx.Ava.Utilities;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
@@ -250,6 +251,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
Logger.Warning?.Print(LogClass.Application, $"Unable to read data from '{_amiiboJsonPath}': {exception}");
|
Logger.Warning?.Print(LogClass.Application, $"Unable to read data from '{_amiiboJsonPath}': {exception}");
|
||||||
|
localIsValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!localIsValid || await NeedsUpdate(amiiboJson.LastUpdated))
|
if (!localIsValid || await NeedsUpdate(amiiboJson.LastUpdated))
|
||||||
@@ -280,11 +282,59 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
return amiiboJson;
|
return amiiboJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task<AmiiboJson?> ReadLocalJsonFileAsync()
|
||||||
|
{
|
||||||
|
bool isValid = false;
|
||||||
|
AmiiboJson amiiboJson = new();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (File.Exists(_amiiboJsonPath))
|
||||||
|
{
|
||||||
|
isValid = TryGetAmiiboJson(await File.ReadAllTextAsync(_amiiboJsonPath), out amiiboJson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Application, $"Unable to read data from '{_amiiboJsonPath}': {exception}");
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application, $"Couldn't get valid amiibo data: {exception}");
|
||||||
|
|
||||||
|
// Neither local file is not valid JSON, close window.
|
||||||
|
await ShowInfoDialog();
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return amiiboJson;
|
||||||
|
}
|
||||||
|
|
||||||
private async Task LoadContentAsync()
|
private async Task LoadContentAsync()
|
||||||
{
|
{
|
||||||
AmiiboJson amiiboJson = await GetMostRecentAmiiboListOrDefaultJson();
|
AmiiboJson? amiiboJson;
|
||||||
|
|
||||||
_amiiboList = amiiboJson.Amiibo.OrderBy(amiibo => amiibo.AmiiboSeries).ToList();
|
if (CommandLineState.OnlyLocalAmiibo)
|
||||||
|
amiiboJson = await ReadLocalJsonFileAsync();
|
||||||
|
else
|
||||||
|
amiiboJson = await GetMostRecentAmiiboListOrDefaultJson();
|
||||||
|
|
||||||
|
if (!amiiboJson.HasValue)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_amiiboList = amiiboJson.Value.Amiibo.OrderBy(amiibo => amiibo.AmiiboSeries).ToList();
|
||||||
|
|
||||||
ParseAmiiboData();
|
ParseAmiiboData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2121,8 +2121,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
});
|
});
|
||||||
|
|
||||||
public static AsyncRelayCommand<MainWindowViewModel> NukePtcCache { get; } =
|
public static AsyncRelayCommand<MainWindowViewModel> NukePtcCache { get; } =
|
||||||
Commands.CreateConditional<MainWindowViewModel>(vm => vm?.SelectedApplication != null &&
|
Commands.CreateConditional<MainWindowViewModel>(vm => vm?.SelectedApplication?.HasPtcCacheFiles ?? false,
|
||||||
vm.HasPtcCacheFiles(),
|
|
||||||
async viewModel =>
|
async viewModel =>
|
||||||
{
|
{
|
||||||
UserResult result = await ContentDialogHelper.CreateLocalizedConfirmationDialog(
|
UserResult result = await ContentDialogHelper.CreateLocalizedConfirmationDialog(
|
||||||
@@ -2171,22 +2170,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
private bool HasPtcCacheFiles()
|
|
||||||
{
|
|
||||||
if (this.SelectedApplication == null) return false;
|
|
||||||
|
|
||||||
DirectoryInfo mainDir = new DirectoryInfo(Path.Combine(AppDataManager.GamesDirPath,
|
|
||||||
this.SelectedApplication.IdString, "cache", "cpu", "0"));
|
|
||||||
DirectoryInfo backupDir = new DirectoryInfo(Path.Combine(AppDataManager.GamesDirPath,
|
|
||||||
this.SelectedApplication.IdString, "cache", "cpu", "1"));
|
|
||||||
|
|
||||||
return (mainDir.Exists && (mainDir.EnumerateFiles("*.cache").Any() || mainDir.EnumerateFiles("*.info").Any())) ||
|
|
||||||
(backupDir.Exists && (backupDir.EnumerateFiles("*.cache").Any() || backupDir.EnumerateFiles("*.info").Any()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AsyncRelayCommand<MainWindowViewModel> PurgeShaderCache { get; } =
|
public static AsyncRelayCommand<MainWindowViewModel> PurgeShaderCache { get; } =
|
||||||
Commands.CreateConditional<MainWindowViewModel>(
|
Commands.CreateConditional<MainWindowViewModel>(
|
||||||
vm => vm?.SelectedApplication != null && vm.HasShaderCacheFiles(),
|
vm => vm?.SelectedApplication?.HasShaderCacheFiles ?? false,
|
||||||
async viewModel =>
|
async viewModel =>
|
||||||
{
|
{
|
||||||
UserResult result = await ContentDialogHelper.CreateLocalizedConfirmationDialog(
|
UserResult result = await ContentDialogHelper.CreateLocalizedConfirmationDialog(
|
||||||
@@ -2243,20 +2229,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
private bool HasShaderCacheFiles()
|
|
||||||
{
|
|
||||||
if (this.SelectedApplication == null) return false;
|
|
||||||
|
|
||||||
DirectoryInfo shaderCacheDir = new(Path.Combine(AppDataManager.GamesDirPath,
|
|
||||||
this.SelectedApplication.IdString, "cache", "shader"));
|
|
||||||
|
|
||||||
if (!shaderCacheDir.Exists) return false;
|
|
||||||
|
|
||||||
return shaderCacheDir.EnumerateDirectories("*").Any() ||
|
|
||||||
shaderCacheDir.GetFiles("*.toc").Any() ||
|
|
||||||
shaderCacheDir.GetFiles("*.data").Any();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RelayCommand<MainWindowViewModel> OpenPtcDirectory { get; } =
|
public static RelayCommand<MainWindowViewModel> OpenPtcDirectory { get; } =
|
||||||
Commands.CreateConditional<MainWindowViewModel>(vm => vm?.SelectedApplication != null,
|
Commands.CreateConditional<MainWindowViewModel>(vm => vm?.SelectedApplication != null,
|
||||||
viewModel =>
|
viewModel =>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<ListBox.Styles>
|
<ListBox.Styles>
|
||||||
<Style Selector="ListBoxItem">
|
<Style Selector="ListBoxItem">
|
||||||
<Setter Property="Margin" Value="5" />
|
<Setter Property="Margin" Value="5" />
|
||||||
<Setter Property="CornerRadius" Value="15" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="ListBoxItem:selected /template/ Rectangle#SelectionIndicator">
|
<Style Selector="ListBoxItem:selected /template/ Rectangle#SelectionIndicator">
|
||||||
<Setter Property="MinHeight" Value="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).GridItemSelectorSize}" />
|
<Setter Property="MinHeight" Value="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).GridItemSelectorSize}" />
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
Classes.normal="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).IsGridMedium}"
|
Classes.normal="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).IsGridMedium}"
|
||||||
Classes.small="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).IsGridSmall}"
|
Classes.small="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).IsGridSmall}"
|
||||||
ClipToBounds="True"
|
ClipToBounds="True"
|
||||||
CornerRadius="12.5">
|
CornerRadius="4">
|
||||||
<Grid RowDefinitions="Auto,Auto">
|
<Grid RowDefinitions="Auto,Auto">
|
||||||
<Image
|
<Image
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
|
|||||||
@@ -34,9 +34,6 @@
|
|||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ListBox.ItemsPanel>
|
</ListBox.ItemsPanel>
|
||||||
<ListBox.Styles>
|
<ListBox.Styles>
|
||||||
<Style Selector="ListBoxItem">
|
|
||||||
<Setter Property="CornerRadius" Value="15" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="ListBoxItem:selected /template/ Rectangle#SelectionIndicator">
|
<Style Selector="ListBoxItem:selected /template/ Rectangle#SelectionIndicator">
|
||||||
<Setter Property="MinHeight" Value="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).ListItemSelectorSize}" />
|
<Setter Property="MinHeight" Value="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).ListItemSelectorSize}" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -49,11 +46,9 @@
|
|||||||
Padding="10"
|
Padding="10"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
ClipToBounds="True">
|
ClipToBounds="True"
|
||||||
|
CornerRadius="5">
|
||||||
<Grid ColumnDefinitions="Auto,10,*,150,100">
|
<Grid ColumnDefinitions="Auto,10,*,150,100">
|
||||||
<Border
|
|
||||||
ClipToBounds="True"
|
|
||||||
CornerRadius="7">
|
|
||||||
<Image
|
<Image
|
||||||
Grid.RowSpan="3"
|
Grid.RowSpan="3"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
@@ -63,7 +58,6 @@
|
|||||||
Classes.normal="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).IsGridMedium}"
|
Classes.normal="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).IsGridMedium}"
|
||||||
Classes.small="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).IsGridSmall}"
|
Classes.small="{Binding $parent[UserControl].((viewModels:MainWindowViewModel)DataContext).IsGridSmall}"
|
||||||
Source="{Binding Icon, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
|
Source="{Binding Icon, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
|
||||||
</Border>
|
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
public static string LaunchApplicationId { get; private set; }
|
public static string LaunchApplicationId { get; private set; }
|
||||||
public static bool StartFullscreenArg { get; private set; }
|
public static bool StartFullscreenArg { get; private set; }
|
||||||
public static bool HideAvailableUpdates { get; private set; }
|
public static bool HideAvailableUpdates { get; private set; }
|
||||||
|
public static bool OnlyLocalAmiibo { get; private set; }
|
||||||
|
|
||||||
public static void ParseArguments(string[] args)
|
public static void ParseArguments(string[] args)
|
||||||
{
|
{
|
||||||
@@ -130,6 +131,10 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
|
|
||||||
OverridePPTC = args[++i];
|
OverridePPTC = args[++i];
|
||||||
break;
|
break;
|
||||||
|
case "-la":
|
||||||
|
case "--local-only-amiibo":
|
||||||
|
OnlyLocalAmiibo = true;
|
||||||
|
break;
|
||||||
case "-m":
|
case "-m":
|
||||||
case "--memory-manager-mode":
|
case "--memory-manager-mode":
|
||||||
if (i + 1 >= args.Length)
|
if (i + 1 >= args.Length)
|
||||||
|
|||||||
Reference in New Issue
Block a user