mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-21 17:47:11 +02:00
language feature: Extension Members: More converted
This commit is contained in:
parent
2403bd4f3c
commit
3311842a16
7 changed files with 45 additions and 54 deletions
|
@ -121,8 +121,8 @@ namespace Ryujinx.HLE.HOS
|
||||||
TickSource,
|
TickSource,
|
||||||
device,
|
device,
|
||||||
device.Memory,
|
device.Memory,
|
||||||
device.Configuration.MemoryConfiguration.ToKernelMemorySize(),
|
device.Configuration.MemoryConfiguration.KernelMemorySize,
|
||||||
device.Configuration.MemoryConfiguration.ToKernelMemoryArrange());
|
device.Configuration.MemoryConfiguration.KernelMemoryArrange);
|
||||||
|
|
||||||
Device = device;
|
Device = device;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace Ryujinx.HLE.HOS.Services.Spl
|
||||||
#pragma warning disable IDE0059 // Remove unnecessary value assignment
|
#pragma warning disable IDE0059 // Remove unnecessary value assignment
|
||||||
SystemVersion version = context.Device.System.ContentManager.GetCurrentFirmwareVersion();
|
SystemVersion version = context.Device.System.ContentManager.GetCurrentFirmwareVersion();
|
||||||
#pragma warning restore IDE0059
|
#pragma warning restore IDE0059
|
||||||
MemorySize memorySize = context.Device.Configuration.MemoryConfiguration.ToKernelMemorySize();
|
MemorySize memorySize = context.Device.Configuration.MemoryConfiguration.KernelMemorySize;
|
||||||
|
|
||||||
switch (configItem)
|
switch (configItem)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,11 +18,11 @@ namespace Ryujinx.HLE
|
||||||
{
|
{
|
||||||
private const ulong GiB = 1024 * 1024 * 1024;
|
private const ulong GiB = 1024 * 1024 * 1024;
|
||||||
|
|
||||||
#pragma warning disable IDE0055 // Disable formatting
|
extension(MemoryConfiguration configuration)
|
||||||
public static MemoryArrange ToKernelMemoryArrange(this MemoryConfiguration configuration)
|
|
||||||
{
|
{
|
||||||
return configuration switch
|
public MemoryArrange KernelMemoryArrange => configuration switch
|
||||||
{
|
{
|
||||||
|
#pragma warning disable IDE0055 // Disable formatting
|
||||||
MemoryConfiguration.MemoryConfiguration4GiB => MemoryArrange.MemoryArrange4GiB,
|
MemoryConfiguration.MemoryConfiguration4GiB => MemoryArrange.MemoryArrange4GiB,
|
||||||
MemoryConfiguration.MemoryConfiguration4GiBAppletDev => MemoryArrange.MemoryArrange4GiBAppletDev,
|
MemoryConfiguration.MemoryConfiguration4GiBAppletDev => MemoryArrange.MemoryArrange4GiBAppletDev,
|
||||||
MemoryConfiguration.MemoryConfiguration4GiBSystemDev => MemoryArrange.MemoryArrange4GiBSystemDev,
|
MemoryConfiguration.MemoryConfiguration4GiBSystemDev => MemoryArrange.MemoryArrange4GiBSystemDev,
|
||||||
|
@ -31,38 +31,36 @@ namespace Ryujinx.HLE
|
||||||
MemoryConfiguration.MemoryConfiguration8GiB => MemoryArrange.MemoryArrange8GiB,
|
MemoryConfiguration.MemoryConfiguration8GiB => MemoryArrange.MemoryArrange8GiB,
|
||||||
MemoryConfiguration.MemoryConfiguration12GiB => MemoryArrange.MemoryArrange12GiB,
|
MemoryConfiguration.MemoryConfiguration12GiB => MemoryArrange.MemoryArrange12GiB,
|
||||||
_ => throw new AggregateException($"Invalid memory configuration \"{configuration}\"."),
|
_ => throw new AggregateException($"Invalid memory configuration \"{configuration}\"."),
|
||||||
|
#pragma warning restore IDE0055
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
public MemorySize KernelMemorySize => configuration switch
|
||||||
public static MemorySize ToKernelMemorySize(this MemoryConfiguration configuration)
|
|
||||||
{
|
|
||||||
return configuration switch
|
|
||||||
{
|
{
|
||||||
|
#pragma warning disable IDE0055 // Disable formatting
|
||||||
MemoryConfiguration.MemoryConfiguration4GiB or
|
MemoryConfiguration.MemoryConfiguration4GiB or
|
||||||
MemoryConfiguration.MemoryConfiguration4GiBAppletDev or
|
MemoryConfiguration.MemoryConfiguration4GiBAppletDev or
|
||||||
MemoryConfiguration.MemoryConfiguration4GiBSystemDev => MemorySize.MemorySize4GiB,
|
MemoryConfiguration.MemoryConfiguration4GiBSystemDev => MemorySize.MemorySize4GiB,
|
||||||
MemoryConfiguration.MemoryConfiguration6GiB or
|
MemoryConfiguration.MemoryConfiguration6GiB or
|
||||||
MemoryConfiguration.MemoryConfiguration6GiBAppletDev => MemorySize.MemorySize6GiB,
|
MemoryConfiguration.MemoryConfiguration6GiBAppletDev => MemorySize.MemorySize6GiB,
|
||||||
MemoryConfiguration.MemoryConfiguration8GiB => MemorySize.MemorySize8GiB,
|
MemoryConfiguration.MemoryConfiguration8GiB => MemorySize.MemorySize8GiB,
|
||||||
MemoryConfiguration.MemoryConfiguration12GiB => MemorySize.MemorySize12GiB,
|
MemoryConfiguration.MemoryConfiguration12GiB => MemorySize.MemorySize12GiB,
|
||||||
_ => throw new AggregateException($"Invalid memory configuration \"{configuration}\"."),
|
_ => throw new AggregateException($"Invalid memory configuration \"{configuration}\"."),
|
||||||
|
#pragma warning restore IDE0055
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
public ulong DramSize => configuration switch
|
||||||
public static ulong ToDramSize(this MemoryConfiguration configuration)
|
|
||||||
{
|
|
||||||
return configuration switch
|
|
||||||
{
|
{
|
||||||
|
#pragma warning disable IDE0055 // Disable formatting
|
||||||
MemoryConfiguration.MemoryConfiguration4GiB or
|
MemoryConfiguration.MemoryConfiguration4GiB or
|
||||||
MemoryConfiguration.MemoryConfiguration4GiBAppletDev or
|
MemoryConfiguration.MemoryConfiguration4GiBAppletDev or
|
||||||
MemoryConfiguration.MemoryConfiguration4GiBSystemDev => 4 * GiB,
|
MemoryConfiguration.MemoryConfiguration4GiBSystemDev => 4 * GiB,
|
||||||
MemoryConfiguration.MemoryConfiguration6GiB or
|
MemoryConfiguration.MemoryConfiguration6GiB or
|
||||||
MemoryConfiguration.MemoryConfiguration6GiBAppletDev => 6 * GiB,
|
MemoryConfiguration.MemoryConfiguration6GiBAppletDev => 6 * GiB,
|
||||||
MemoryConfiguration.MemoryConfiguration8GiB => 8 * GiB,
|
MemoryConfiguration.MemoryConfiguration8GiB => 8 * GiB,
|
||||||
MemoryConfiguration.MemoryConfiguration12GiB => 12 * GiB,
|
MemoryConfiguration.MemoryConfiguration12GiB => 12 * GiB,
|
||||||
_ => throw new AggregateException($"Invalid memory configuration \"{configuration}\"."),
|
_ => throw new AggregateException($"Invalid memory configuration \"{configuration}\"."),
|
||||||
|
#pragma warning restore IDE0055
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#pragma warning restore IDE0055
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace Ryujinx.HLE
|
||||||
#pragma warning disable IDE0055 // Disable formatting
|
#pragma warning disable IDE0055 // Disable formatting
|
||||||
DirtyHacks = new DirtyHacks(Configuration.Hacks);
|
DirtyHacks = new DirtyHacks(Configuration.Hacks);
|
||||||
AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver);
|
AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver);
|
||||||
Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), memoryAllocationFlags);
|
Memory = new MemoryBlock(Configuration.MemoryConfiguration.DramSize, memoryAllocationFlags);
|
||||||
Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks);
|
Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks);
|
||||||
System = new HOS.Horizon(this);
|
System = new HOS.Horizon(this);
|
||||||
Statistics = new PerformanceStatistics(this);
|
Statistics = new PerformanceStatistics(this);
|
||||||
|
|
|
@ -29,9 +29,11 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return app.PercentageProgress != null ? null :
|
return app.PercentageProgress != null
|
||||||
app.ProcessingOutcome is not OperationOutcome.Successful and not OperationOutcome.Undetermined ? app.ProcessingOutcome.ToLocalisedText() :
|
? null
|
||||||
null;
|
: app.ProcessingOutcome is not OperationOutcome.Successful and not OperationOutcome.Undetermined
|
||||||
|
? app.ProcessingOutcome.LocalizedText
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
|
|
@ -5,32 +5,23 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||||
{
|
{
|
||||||
public static class XCIFileTrimmerOperationOutcomeExtensions
|
public static class XCIFileTrimmerOperationOutcomeExtensions
|
||||||
{
|
{
|
||||||
public static string ToLocalisedText(this OperationOutcome operationOutcome)
|
extension(OperationOutcome opOutcome)
|
||||||
{
|
{
|
||||||
switch (operationOutcome)
|
public string LocalizedText => opOutcome switch
|
||||||
{
|
{
|
||||||
case OperationOutcome.NoTrimNecessary:
|
OperationOutcome.NoTrimNecessary => LocaleManager.Instance[LocaleKeys.TrimXCIFileNoTrimNecessary],
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileNoTrimNecessary];
|
OperationOutcome.NoUntrimPossible => LocaleManager.Instance[LocaleKeys.TrimXCIFileNoUntrimPossible],
|
||||||
case OperationOutcome.NoUntrimPossible:
|
OperationOutcome.ReadOnlyFileCannotFix => LocaleManager.Instance[
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileNoUntrimPossible];
|
LocaleKeys.TrimXCIFileReadOnlyFileCannotFix],
|
||||||
case OperationOutcome.ReadOnlyFileCannotFix:
|
OperationOutcome.FreeSpaceCheckFailed => LocaleManager.Instance[
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileReadOnlyFileCannotFix];
|
LocaleKeys.TrimXCIFileFreeSpaceCheckFailed],
|
||||||
case OperationOutcome.FreeSpaceCheckFailed:
|
OperationOutcome.InvalidXCIFile => LocaleManager.Instance[LocaleKeys.TrimXCIFileInvalidXCIFile],
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileFreeSpaceCheckFailed];
|
OperationOutcome.FileIOWriteError => LocaleManager.Instance[LocaleKeys.TrimXCIFileFileIOWriteError],
|
||||||
case OperationOutcome.InvalidXCIFile:
|
OperationOutcome.FileSizeChanged => LocaleManager.Instance[LocaleKeys.TrimXCIFileFileSizeChanged],
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileInvalidXCIFile];
|
OperationOutcome.Cancelled => LocaleManager.Instance[LocaleKeys.TrimXCIFileCancelled],
|
||||||
case OperationOutcome.FileIOWriteError:
|
OperationOutcome.Undetermined => LocaleManager.Instance[LocaleKeys.TrimXCIFileFileUndertermined],
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileFileIOWriteError];
|
_ => null
|
||||||
case OperationOutcome.FileSizeChanged:
|
};
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileFileSizeChanged];
|
|
||||||
case OperationOutcome.Cancelled:
|
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileCancelled];
|
|
||||||
case OperationOutcome.Undetermined:
|
|
||||||
return LocaleManager.Instance[LocaleKeys.TrimXCIFileFileUndertermined];
|
|
||||||
case OperationOutcome.Successful:
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1873,7 +1873,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
public async void ProcessTrimResult(String filename, XCIFileTrimmer.OperationOutcome operationOutcome)
|
public async void ProcessTrimResult(String filename, XCIFileTrimmer.OperationOutcome operationOutcome)
|
||||||
{
|
{
|
||||||
string notifyUser = operationOutcome.ToLocalisedText();
|
string notifyUser = operationOutcome.LocalizedText;
|
||||||
|
|
||||||
if (notifyUser != null)
|
if (notifyUser != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue