Compare commits
9 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61ae427a4d | ||
|
|
19d2883a35 | ||
|
|
617c03119f | ||
|
|
e43d899e1d | ||
|
|
0cd09ea0c5 | ||
|
|
4135d74e4d | ||
|
|
bd29f658b1 | ||
|
|
df150f0788 | ||
|
|
e50198b37d |
@@ -17,6 +17,7 @@
|
||||
<PackageVersion Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.4.0"/>
|
||||
<PackageVersion Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="9.4.0"/>
|
||||
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
|
||||
<PackageVersion Include="Concentus" Version="2.2.0" />
|
||||
<PackageVersion Include="DiscordRichPresence" Version="1.2.1.24" />
|
||||
<PackageVersion Include="DynamicData" Version="9.0.4" />
|
||||
|
||||
@@ -314,7 +314,7 @@ namespace Ryujinx.Ava
|
||||
|
||||
_renderer.Window?.ChangeVSyncMode(e.NewValue);
|
||||
|
||||
_viewModel.ShowCustomVSyncIntervalPicker = (e.NewValue == VSyncMode.Custom);
|
||||
_viewModel.UpdateVSyncIntervalPicker();
|
||||
}
|
||||
|
||||
public void VSyncModeToggle()
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<PackageReference Include="Avalonia.Svg" />
|
||||
<PackageReference Include="Avalonia.Svg.Skia" />
|
||||
<PackageReference Include="CommandLineParser" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" />
|
||||
<PackageReference Include="DiscordRichPresence" />
|
||||
<PackageReference Include="DynamicData" />
|
||||
<PackageReference Include="FluentAvaloniaUI" />
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
x:DataType="viewModels:MainWindowViewModel">
|
||||
<UserControl.Resources>
|
||||
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||
<controls:ApplicationContextMenu x:Key="ApplicationContextMenu" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -26,10 +25,10 @@
|
||||
Padding="8"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
ContextFlyout="{StaticResource ApplicationContextMenu}"
|
||||
SelectedItem="{Binding GridSelectedApplication}"
|
||||
ContextFlyout="{Binding GridAppContextMenu}"
|
||||
DoubleTapped="GameList_DoubleTapped"
|
||||
ItemsSource="{Binding AppsObservableList}"
|
||||
SelectionChanged="GameList_SelectionChanged">
|
||||
ItemsSource="{Binding AppsObservableList}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel
|
||||
|
||||
@@ -26,11 +26,5 @@ namespace Ryujinx.Ava.UI.Controls
|
||||
if (sender is ListBox { SelectedItem: ApplicationData selected })
|
||||
RaiseEvent(new ApplicationOpenedEventArgs(selected, ApplicationOpenedEvent));
|
||||
}
|
||||
|
||||
public void GameList_SelectionChanged(object sender, SelectionChangedEventArgs args)
|
||||
{
|
||||
if (DataContext is MainWindowViewModel viewModel && sender is ListBox { SelectedItem: ApplicationData selected })
|
||||
viewModel.GridSelectedApplication = selected;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:converters="clr-namespace:Avalonia.Data.Converters;assembly=Avalonia.Base"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Focusable="True"
|
||||
@@ -16,7 +15,6 @@
|
||||
x:DataType="viewModels:MainWindowViewModel">
|
||||
<UserControl.Resources>
|
||||
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||
<controls:ApplicationContextMenu x:Key="ApplicationContextMenu" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -28,10 +26,10 @@
|
||||
Padding="8"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
ContextFlyout="{StaticResource ApplicationContextMenu}"
|
||||
SelectedItem="{Binding ListSelectedApplication}"
|
||||
ContextFlyout="{Binding ListAppContextMenu}"
|
||||
DoubleTapped="GameList_DoubleTapped"
|
||||
ItemsSource="{Binding AppsObservableList}"
|
||||
SelectionChanged="GameList_SelectionChanged">
|
||||
ItemsSource="{Binding AppsObservableList}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel
|
||||
|
||||
@@ -30,12 +30,6 @@ namespace Ryujinx.Ava.UI.Controls
|
||||
RaiseEvent(new ApplicationOpenedEventArgs(selected, ApplicationOpenedEvent));
|
||||
}
|
||||
|
||||
public void GameList_SelectionChanged(object sender, SelectionChangedEventArgs args)
|
||||
{
|
||||
if (DataContext is MainWindowViewModel viewModel && sender is ListBox { SelectedItem: ApplicationData selected })
|
||||
viewModel.ListSelectedApplication = selected;
|
||||
}
|
||||
|
||||
private async void IdString_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is not MainWindowViewModel mwvm)
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
public class BaseModel : INotifyPropertyChanged
|
||||
public class BaseModel : ObservableObject
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
protected void OnPropertiesChanged(string firstPropertyName, params ReadOnlySpan<string> propertyNames)
|
||||
{
|
||||
OnPropertyChanged(firstPropertyName);
|
||||
|
||||
@@ -93,10 +93,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
_applicationData = applicationData;
|
||||
|
||||
if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
_storageProvider = desktop.MainWindow.StorageProvider;
|
||||
}
|
||||
_storageProvider = RyujinxApp.MainWindow.StorageProvider;
|
||||
|
||||
LoadDownloadableContents();
|
||||
}
|
||||
|
||||
@@ -245,9 +245,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
{
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
_mainWindow =
|
||||
(MainWindow)((IClassicDesktopStyleApplicationLifetime)Application.Current
|
||||
.ApplicationLifetime).MainWindow;
|
||||
_mainWindow = RyujinxApp.MainWindow;
|
||||
|
||||
AvaloniaKeyboardDriver = new AvaloniaKeyboardDriver(owner);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using Avalonia.Media;
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Platform.Storage;
|
||||
using Avalonia.Threading;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using DynamicData;
|
||||
using DynamicData.Binding;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
@@ -54,77 +55,112 @@ using ShaderCacheLoadingState = Ryujinx.Graphics.Gpu.Shader.ShaderCacheState;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
public class MainWindowViewModel : BaseModel
|
||||
public partial class MainWindowViewModel : BaseModel
|
||||
{
|
||||
private const int HotKeyPressDelayMs = 500;
|
||||
private delegate int LoadContentFromFolderDelegate(List<string> dirs, out int numRemoved);
|
||||
|
||||
private ObservableCollectionExtended<ApplicationData> _applications;
|
||||
private string _aspectStatusText;
|
||||
[ObservableProperty] private ObservableCollectionExtended<ApplicationData> _applications;
|
||||
[ObservableProperty] private string _aspectRatioStatusText;
|
||||
[ObservableProperty] private string _loadHeading;
|
||||
[ObservableProperty] private string _cacheLoadStatus;
|
||||
[ObservableProperty] private string _dockedStatusText;
|
||||
[ObservableProperty] private string _fifoStatusText;
|
||||
[ObservableProperty] private string _gameStatusText;
|
||||
[ObservableProperty] private string _volumeStatusText;
|
||||
[ObservableProperty] private string _gpuNameText;
|
||||
[ObservableProperty] private string _backendText;
|
||||
[ObservableProperty] private string _shaderCountText;
|
||||
[ObservableProperty] private bool _showShaderCompilationHint;
|
||||
[ObservableProperty] private bool _isFullScreen;
|
||||
[ObservableProperty] private int _progressMaximum;
|
||||
[ObservableProperty] private int _progressValue;
|
||||
[ObservableProperty] private bool _showMenuAndStatusBar = true;
|
||||
[ObservableProperty] private bool _showStatusSeparator;
|
||||
[ObservableProperty] private Brush _progressBarForegroundColor;
|
||||
[ObservableProperty] private Brush _progressBarBackgroundColor;
|
||||
[ObservableProperty] private Brush _vSyncModeColor;
|
||||
[ObservableProperty] private byte[] _selectedIcon;
|
||||
[ObservableProperty] private int _statusBarProgressMaximum;
|
||||
[ObservableProperty] private int _statusBarProgressValue;
|
||||
[ObservableProperty] private string _statusBarProgressStatusText;
|
||||
[ObservableProperty] private bool _statusBarProgressStatusVisible;
|
||||
[ObservableProperty] private bool _isPaused;
|
||||
[ObservableProperty] private bool _isLoadingIndeterminate = true;
|
||||
[ObservableProperty] private bool _showAll;
|
||||
[ObservableProperty] private string _lastScannedAmiiboId;
|
||||
[ObservableProperty] private ReadOnlyObservableCollection<ApplicationData> _appsObservableList;
|
||||
[ObservableProperty] private long _lastFullscreenToggle = Environment.TickCount64;
|
||||
[ObservableProperty] private bool _showContent = true;
|
||||
[ObservableProperty] private float _volumeBeforeMute;
|
||||
[ObservableProperty] private bool _areMimeTypesRegistered = FileAssociationHelper.AreMimeTypesRegistered;
|
||||
[ObservableProperty] private Cursor _cursor;
|
||||
[ObservableProperty] private string _title;
|
||||
[ObservableProperty] private WindowState _windowState;
|
||||
[ObservableProperty] private double _windowWidth;
|
||||
[ObservableProperty] private double _windowHeight;
|
||||
[ObservableProperty] private bool _isActive;
|
||||
[ObservableProperty] private bool _isSubMenuOpen;
|
||||
[ObservableProperty] private ApplicationContextMenu _listAppContextMenu;
|
||||
[ObservableProperty] private ApplicationContextMenu _gridAppContextMenu;
|
||||
|
||||
private string _loadHeading;
|
||||
private string _cacheLoadStatus;
|
||||
private string _searchText;
|
||||
private Timer _searchTimer;
|
||||
private string _dockedStatusText;
|
||||
private string _vSyncModeText;
|
||||
private string _fifoStatusText;
|
||||
private string _gameStatusText;
|
||||
private string _volumeStatusText;
|
||||
private string _gpuStatusText;
|
||||
private string _shaderCountText;
|
||||
private bool _showLoadProgress;
|
||||
private bool _isGameRunning;
|
||||
private bool _isAmiiboRequested;
|
||||
private bool _isAmiiboBinRequested;
|
||||
private bool _showShaderCompilationHint;
|
||||
private bool _isGameRunning;
|
||||
private bool _isFullScreen;
|
||||
private int _progressMaximum;
|
||||
private int _progressValue;
|
||||
private long _lastFullscreenToggle = Environment.TickCount64;
|
||||
private bool _showLoadProgress;
|
||||
private bool _showMenuAndStatusBar = true;
|
||||
private bool _showStatusSeparator;
|
||||
private Brush _progressBarForegroundColor;
|
||||
private Brush _progressBarBackgroundColor;
|
||||
private Brush _vSyncModeColor;
|
||||
private byte[] _selectedIcon;
|
||||
private bool _isAppletMenuActive;
|
||||
private int _statusBarProgressMaximum;
|
||||
private int _statusBarProgressValue;
|
||||
private string _statusBarProgressStatusText;
|
||||
private bool _statusBarProgressStatusVisible;
|
||||
private bool _isPaused;
|
||||
private bool _showContent = true;
|
||||
private bool _isLoadingIndeterminate = true;
|
||||
private bool _showAll;
|
||||
private string _lastScannedAmiiboId;
|
||||
private bool _statusBarVisible;
|
||||
private ReadOnlyObservableCollection<ApplicationData> _appsObservableList;
|
||||
|
||||
private string _searchText;
|
||||
private Timer _searchTimer;
|
||||
private string _vSyncModeText;
|
||||
private string _showUiKey = "F4";
|
||||
private string _pauseKey = "F5";
|
||||
private string _screenshotKey = "F8";
|
||||
private float _volume;
|
||||
private float _volumeBeforeMute;
|
||||
private string _backendText;
|
||||
|
||||
private bool _areMimeTypesRegistered = FileAssociationHelper.AreMimeTypesRegistered;
|
||||
private bool _isAppletMenuActive;
|
||||
private bool _statusBarVisible;
|
||||
private bool _canUpdate = true;
|
||||
private Cursor _cursor;
|
||||
private string _title;
|
||||
private ApplicationData _currentApplicationData;
|
||||
private readonly AutoResetEvent _rendererWaitEvent;
|
||||
private WindowState _windowState;
|
||||
private double _windowWidth;
|
||||
private double _windowHeight;
|
||||
private int _customVSyncInterval;
|
||||
private int _customVSyncIntervalPercentageProxy;
|
||||
private ApplicationData _listSelectedApplication;
|
||||
private ApplicationData _gridSelectedApplication;
|
||||
|
||||
private bool _isActive;
|
||||
private bool _isSubMenuOpen;
|
||||
public ApplicationData ListSelectedApplication
|
||||
{
|
||||
get => _listSelectedApplication;
|
||||
set
|
||||
{
|
||||
_listSelectedApplication = value;
|
||||
|
||||
public ApplicationData ListSelectedApplication;
|
||||
public ApplicationData GridSelectedApplication;
|
||||
#pragma warning disable MVVMTK0034
|
||||
if (_listSelectedApplication != null && _listAppContextMenu == null)
|
||||
|
||||
ListAppContextMenu = new ApplicationContextMenu();
|
||||
else if (_listSelectedApplication == null && _listAppContextMenu != null)
|
||||
ListAppContextMenu = null!;
|
||||
#pragma warning restore MVVMTK0034
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ApplicationData GridSelectedApplication
|
||||
{
|
||||
get => _gridSelectedApplication;
|
||||
set
|
||||
{
|
||||
_gridSelectedApplication = value;
|
||||
|
||||
#pragma warning disable MVVMTK0034
|
||||
if (_gridSelectedApplication != null && _gridAppContextMenu == null)
|
||||
GridAppContextMenu = new ApplicationContextMenu();
|
||||
else if (_gridSelectedApplication == null && _gridAppContextMenu != null)
|
||||
GridAppContextMenu = null!;
|
||||
#pragma warning restore MVVMTK0034
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// Key is Title ID
|
||||
public SafeDictionary<string, LdnGameData.Array> LdnData = [];
|
||||
@@ -218,7 +254,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public bool CanUpdate
|
||||
{
|
||||
get => _canUpdate && EnableNonGameRunningControls && Updater.CanUpdate(false);
|
||||
get => _canUpdate && EnableNonGameRunningControls && Updater.CanUpdate();
|
||||
set
|
||||
{
|
||||
_canUpdate = value;
|
||||
@@ -226,49 +262,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public Cursor Cursor
|
||||
{
|
||||
get => _cursor;
|
||||
set
|
||||
{
|
||||
_cursor = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ReadOnlyObservableCollection<ApplicationData> AppsObservableList
|
||||
{
|
||||
get => _appsObservableList;
|
||||
set
|
||||
{
|
||||
_appsObservableList = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPaused
|
||||
{
|
||||
get => _isPaused;
|
||||
set
|
||||
{
|
||||
_isPaused = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public long LastFullscreenToggle
|
||||
{
|
||||
get => _lastFullscreenToggle;
|
||||
set
|
||||
{
|
||||
_lastFullscreenToggle = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool StatusBarVisible
|
||||
{
|
||||
get => _statusBarVisible && EnableNonGameRunningControls;
|
||||
@@ -284,17 +277,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public bool ShowFirmwareStatus => !ShowLoadProgress;
|
||||
|
||||
public bool ShowShaderCompilationHint
|
||||
{
|
||||
get => _showShaderCompilationHint;
|
||||
set
|
||||
{
|
||||
_showShaderCompilationHint = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsGameRunning
|
||||
{
|
||||
get => _isGameRunning;
|
||||
@@ -350,61 +332,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public string GameStatusText
|
||||
{
|
||||
get => _gameStatusText;
|
||||
set
|
||||
{
|
||||
_gameStatusText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsFullScreen
|
||||
{
|
||||
get => _isFullScreen;
|
||||
set
|
||||
{
|
||||
_isFullScreen = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSubMenuOpen
|
||||
{
|
||||
get => _isSubMenuOpen;
|
||||
set
|
||||
{
|
||||
_isSubMenuOpen = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowAll
|
||||
{
|
||||
get => _showAll;
|
||||
set
|
||||
{
|
||||
_showAll = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string LastScannedAmiiboId
|
||||
{
|
||||
get => _lastScannedAmiiboId;
|
||||
set
|
||||
{
|
||||
_lastScannedAmiiboId = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ApplicationData SelectedApplication
|
||||
{
|
||||
get
|
||||
@@ -418,87 +345,20 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool OpenUserSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.UserAccountSaveDataSize > 0;
|
||||
public bool OpenUserSaveDirectoryEnabled => SelectedApplication.HasControlHolder && SelectedApplication.ControlHolder.Value.UserAccountSaveDataSize > 0;
|
||||
|
||||
public bool OpenDeviceSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.DeviceSaveDataSize > 0;
|
||||
public bool OpenDeviceSaveDirectoryEnabled => SelectedApplication.HasControlHolder && SelectedApplication.ControlHolder.Value.DeviceSaveDataSize > 0;
|
||||
|
||||
public bool TrimXCIEnabled => XCIFileTrimmer.CanTrim(SelectedApplication.Path, new XCITrimmerLog.MainWindow(this));
|
||||
|
||||
public bool OpenBcatSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.BcatDeliveryCacheStorageSize > 0;
|
||||
|
||||
public string LoadHeading
|
||||
{
|
||||
get => _loadHeading;
|
||||
set
|
||||
{
|
||||
_loadHeading = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string CacheLoadStatus
|
||||
{
|
||||
get => _cacheLoadStatus;
|
||||
set
|
||||
{
|
||||
_cacheLoadStatus = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Brush ProgressBarBackgroundColor
|
||||
{
|
||||
get => _progressBarBackgroundColor;
|
||||
set
|
||||
{
|
||||
_progressBarBackgroundColor = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Brush ProgressBarForegroundColor
|
||||
{
|
||||
get => _progressBarForegroundColor;
|
||||
set
|
||||
{
|
||||
_progressBarForegroundColor = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Brush VSyncModeColor
|
||||
{
|
||||
get => _vSyncModeColor;
|
||||
set
|
||||
{
|
||||
_vSyncModeColor = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
public bool OpenBcatSaveDirectoryEnabled => SelectedApplication.HasControlHolder && SelectedApplication.ControlHolder.Value.BcatDeliveryCacheStorageSize > 0;
|
||||
|
||||
public bool ShowCustomVSyncIntervalPicker
|
||||
=> _isGameRunning && AppHost.Device.VSyncMode == VSyncMode.Custom;
|
||||
|
||||
public void UpdateVSyncIntervalPicker()
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_isGameRunning)
|
||||
{
|
||||
return AppHost.Device.VSyncMode ==
|
||||
VSyncMode.Custom;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
OnPropertyChanged();
|
||||
}
|
||||
OnPropertyChanged(nameof(ShowCustomVSyncIntervalPicker));
|
||||
}
|
||||
|
||||
public int CustomVSyncIntervalPercentageProxy
|
||||
@@ -551,126 +411,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] SelectedIcon
|
||||
{
|
||||
get => _selectedIcon;
|
||||
set
|
||||
{
|
||||
_selectedIcon = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int ProgressMaximum
|
||||
{
|
||||
get => _progressMaximum;
|
||||
set
|
||||
{
|
||||
_progressMaximum = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int ProgressValue
|
||||
{
|
||||
get => _progressValue;
|
||||
set
|
||||
{
|
||||
_progressValue = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int StatusBarProgressMaximum
|
||||
{
|
||||
get => _statusBarProgressMaximum;
|
||||
set
|
||||
{
|
||||
_statusBarProgressMaximum = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int StatusBarProgressValue
|
||||
{
|
||||
get => _statusBarProgressValue;
|
||||
set
|
||||
{
|
||||
_statusBarProgressValue = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool StatusBarProgressStatusVisible
|
||||
{
|
||||
get => _statusBarProgressStatusVisible;
|
||||
set
|
||||
{
|
||||
_statusBarProgressStatusVisible = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string StatusBarProgressStatusText
|
||||
{
|
||||
get => _statusBarProgressStatusText;
|
||||
set
|
||||
{
|
||||
_statusBarProgressStatusText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string FifoStatusText
|
||||
{
|
||||
get => _fifoStatusText;
|
||||
set
|
||||
{
|
||||
_fifoStatusText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string GpuNameText
|
||||
{
|
||||
get => _gpuStatusText;
|
||||
set
|
||||
{
|
||||
_gpuStatusText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string ShaderCountText
|
||||
{
|
||||
get => _shaderCountText;
|
||||
set
|
||||
{
|
||||
_shaderCountText = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string BackendText
|
||||
{
|
||||
get => _backendText;
|
||||
set
|
||||
{
|
||||
_backendText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string VSyncModeText
|
||||
{
|
||||
get => _vSyncModeText;
|
||||
@@ -679,39 +419,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
_vSyncModeText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string DockedStatusText
|
||||
{
|
||||
get => _dockedStatusText;
|
||||
set
|
||||
{
|
||||
_dockedStatusText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string AspectRatioStatusText
|
||||
{
|
||||
get => _aspectStatusText;
|
||||
set
|
||||
{
|
||||
_aspectStatusText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string VolumeStatusText
|
||||
{
|
||||
get => _volumeStatusText;
|
||||
set
|
||||
{
|
||||
_volumeStatusText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(ShowCustomVSyncIntervalPicker));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,73 +443,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public float VolumeBeforeMute
|
||||
{
|
||||
get => _volumeBeforeMute;
|
||||
set
|
||||
{
|
||||
_volumeBeforeMute = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowStatusSeparator
|
||||
{
|
||||
get => _showStatusSeparator;
|
||||
set
|
||||
{
|
||||
_showStatusSeparator = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowMenuAndStatusBar
|
||||
{
|
||||
get => _showMenuAndStatusBar;
|
||||
set
|
||||
{
|
||||
_showMenuAndStatusBar = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLoadingIndeterminate
|
||||
{
|
||||
get => _isLoadingIndeterminate;
|
||||
set
|
||||
{
|
||||
_isLoadingIndeterminate = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsActive
|
||||
{
|
||||
get => _isActive;
|
||||
set
|
||||
{
|
||||
_isActive = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool ShowContent
|
||||
{
|
||||
get => _showContent;
|
||||
set
|
||||
{
|
||||
_showContent = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsAppletMenuActive
|
||||
{
|
||||
get => _isAppletMenuActive && EnableNonGameRunningControls;
|
||||
@@ -813,39 +454,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public WindowState WindowState
|
||||
{
|
||||
get => _windowState;
|
||||
internal set
|
||||
{
|
||||
_windowState = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public double WindowWidth
|
||||
{
|
||||
get => _windowWidth;
|
||||
set
|
||||
{
|
||||
_windowWidth = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public double WindowHeight
|
||||
{
|
||||
get => _windowHeight;
|
||||
set
|
||||
{
|
||||
_windowHeight = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsGrid => Glyph == Glyph.Grid;
|
||||
public bool IsList => Glyph == Glyph.List;
|
||||
|
||||
@@ -889,17 +497,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public string Title
|
||||
{
|
||||
get => _title;
|
||||
set
|
||||
{
|
||||
_title = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowConsoleVisible
|
||||
{
|
||||
get => ConsoleHelper.SetConsoleWindowStateSupported;
|
||||
@@ -910,27 +507,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
get => FileAssociationHelper.IsTypeAssociationSupported;
|
||||
}
|
||||
|
||||
public bool AreMimeTypesRegistered
|
||||
{
|
||||
get => _areMimeTypesRegistered;
|
||||
set {
|
||||
_areMimeTypesRegistered = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollectionExtended<ApplicationData> Applications
|
||||
{
|
||||
get => _applications;
|
||||
set
|
||||
{
|
||||
_applications = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Glyph Glyph
|
||||
{
|
||||
get => (Glyph)ConfigurationState.Instance.UI.GameListViewMode.Value;
|
||||
@@ -948,7 +524,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public bool ShowNames
|
||||
{
|
||||
get => ConfigurationState.Instance.UI.ShowNames && ConfigurationState.Instance.UI.GridSize > 1; set
|
||||
get => ConfigurationState.Instance.UI.ShowNames && ConfigurationState.Instance.UI.GridSize > 1;
|
||||
set
|
||||
{
|
||||
ConfigurationState.Instance.UI.ShowNames.Value = value;
|
||||
|
||||
@@ -1508,8 +1085,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
|
||||
VSyncModeText = args.VSyncMode == "Custom" ? "Custom" : "VSync";
|
||||
ShowCustomVSyncIntervalPicker =
|
||||
args.VSyncMode == VSyncMode.Custom.ToString();
|
||||
DockedStatusText = args.DockedMode;
|
||||
AspectRatioStatusText = args.AspectRatio;
|
||||
GameStatusText = args.GameStatus;
|
||||
|
||||
@@ -86,10 +86,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
_modJsonPath = Path.Combine(AppDataManager.GamesDirPath, applicationId.ToString("x16"), "mods.json");
|
||||
|
||||
if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
_storageProvider = desktop.MainWindow.StorageProvider;
|
||||
}
|
||||
_storageProvider = RyujinxApp.MainWindow.StorageProvider;
|
||||
|
||||
LoadMods(applicationId);
|
||||
}
|
||||
|
||||
@@ -76,10 +76,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
ApplicationData = applicationData;
|
||||
|
||||
if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
StorageProvider = desktop.MainWindow.StorageProvider;
|
||||
}
|
||||
StorageProvider = RyujinxApp.MainWindow.StorageProvider;
|
||||
|
||||
LoadUpdates();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||
private void VSyncMode_PointerReleased(object sender, PointerReleasedEventArgs e)
|
||||
{
|
||||
Window.ViewModel.ToggleVSyncMode();
|
||||
Logger.Info?.Print(LogClass.Application, $"VSync Mode toggled to: {Window.ViewModel.AppHost.Device.VSyncMode}");
|
||||
Logger.Info?.PrintMsg(LogClass.Application, $"VSync Mode toggled to: {Window.ViewModel.AppHost.Device.VSyncMode}");
|
||||
}
|
||||
|
||||
private void DockedStatus_PointerReleased(object sender, PointerReleasedEventArgs e)
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
||||
public string Path { get; set; }
|
||||
public BlitStruct<ApplicationControlProperty> ControlHolder { get; set; }
|
||||
|
||||
public bool HasControlHolder => ControlHolder.ByteSpan.Length > 0;
|
||||
public bool HasControlHolder => ControlHolder.ByteSpan.Length > 0 && !ControlHolder.ByteSpan.IsZeros();
|
||||
|
||||
public string TimePlayedString => ValueFormatUtils.FormatTimeSpan(TimePlayed);
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
||||
public MemoryManagerMode MemoryManagerMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Expands the RAM amount on the emulated system from 4GiB to 8GiB
|
||||
/// Expands the RAM amount on the emulated system
|
||||
/// </summary>
|
||||
public MemoryConfiguration DramSize { get; set; }
|
||||
|
||||
|
||||
@@ -10,189 +10,198 @@ using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RyuLogger = Ryujinx.Common.Logging.Logger;
|
||||
|
||||
namespace Ryujinx.Ava.Utilities.Configuration
|
||||
{
|
||||
public partial class ConfigurationState
|
||||
{
|
||||
public void Load(ConfigurationFileFormat configurationFileFormat, string configurationFilePath)
|
||||
public void Load(ConfigurationFileFormat cff, string configurationFilePath)
|
||||
{
|
||||
bool configurationFileUpdated = false;
|
||||
|
||||
if (configurationFileFormat.Version is < 0 or > ConfigurationFileFormat.CurrentVersion)
|
||||
if (cff.Version is < 0 or > ConfigurationFileFormat.CurrentVersion)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Unsupported configuration version {configurationFileFormat.Version}, loading default.");
|
||||
RyuLogger.Warning?.Print(LogClass.Application, $"Unsupported configuration version {cff.Version}, loading default.");
|
||||
|
||||
LoadDefault();
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 2)
|
||||
foreach ((int newVersion, Action<ConfigurationFileFormat> migratorFunction)
|
||||
in _migrations.OrderBy(x => x.Key))
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 2.");
|
||||
if (cff.Version >= newVersion)
|
||||
continue;
|
||||
|
||||
configurationFileFormat.SystemRegion = Region.USA;
|
||||
RyuLogger.Warning?.Print(LogClass.Application,
|
||||
$"Outdated configuration version {cff.Version}, migrating to version {newVersion}.");
|
||||
|
||||
migratorFunction(cff);
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 3)
|
||||
EnableDiscordIntegration.Value = cff.EnableDiscordIntegration;
|
||||
CheckUpdatesOnStart.Value = cff.CheckUpdatesOnStart;
|
||||
ShowConfirmExit.Value = cff.ShowConfirmExit;
|
||||
IgnoreApplet.Value = cff.IgnoreApplet;
|
||||
RememberWindowState.Value = cff.RememberWindowState;
|
||||
ShowTitleBar.Value = cff.ShowTitleBar;
|
||||
EnableHardwareAcceleration.Value = cff.EnableHardwareAcceleration;
|
||||
HideCursor.Value = cff.HideCursor;
|
||||
|
||||
Logger.EnableFileLog.Value = cff.EnableFileLog;
|
||||
Logger.EnableDebug.Value = cff.LoggingEnableDebug;
|
||||
Logger.EnableStub.Value = cff.LoggingEnableStub;
|
||||
Logger.EnableInfo.Value = cff.LoggingEnableInfo;
|
||||
Logger.EnableWarn.Value = cff.LoggingEnableWarn;
|
||||
Logger.EnableError.Value = cff.LoggingEnableError;
|
||||
Logger.EnableTrace.Value = cff.LoggingEnableTrace;
|
||||
Logger.EnableGuest.Value = cff.LoggingEnableGuest;
|
||||
Logger.EnableFsAccessLog.Value = cff.LoggingEnableFsAccessLog;
|
||||
Logger.FilteredClasses.Value = cff.LoggingFilteredClasses;
|
||||
Logger.GraphicsDebugLevel.Value = cff.LoggingGraphicsDebugLevel;
|
||||
|
||||
Graphics.ResScale.Value = cff.ResScale;
|
||||
Graphics.ResScaleCustom.Value = cff.ResScaleCustom;
|
||||
Graphics.MaxAnisotropy.Value = cff.MaxAnisotropy;
|
||||
Graphics.AspectRatio.Value = cff.AspectRatio;
|
||||
Graphics.ShadersDumpPath.Value = cff.GraphicsShadersDumpPath;
|
||||
Graphics.BackendThreading.Value = cff.BackendThreading;
|
||||
Graphics.GraphicsBackend.Value = cff.GraphicsBackend;
|
||||
Graphics.PreferredGpu.Value = cff.PreferredGpu;
|
||||
Graphics.AntiAliasing.Value = cff.AntiAliasing;
|
||||
Graphics.ScalingFilter.Value = cff.ScalingFilter;
|
||||
Graphics.ScalingFilterLevel.Value = cff.ScalingFilterLevel;
|
||||
Graphics.VSyncMode.Value = cff.VSyncMode;
|
||||
Graphics.EnableCustomVSyncInterval.Value = cff.EnableCustomVSyncInterval;
|
||||
Graphics.CustomVSyncInterval.Value = cff.CustomVSyncInterval;
|
||||
Graphics.EnableShaderCache.Value = cff.EnableShaderCache;
|
||||
Graphics.EnableTextureRecompression.Value = cff.EnableTextureRecompression;
|
||||
Graphics.EnableMacroHLE.Value = cff.EnableMacroHLE;
|
||||
Graphics.EnableColorSpacePassthrough.Value = cff.EnableColorSpacePassthrough;
|
||||
|
||||
System.Language.Value = cff.SystemLanguage;
|
||||
System.Region.Value = cff.SystemRegion;
|
||||
System.TimeZone.Value = cff.SystemTimeZone;
|
||||
System.SystemTimeOffset.Value = cff.SystemTimeOffset;
|
||||
System.EnableDockedMode.Value = cff.DockedMode;
|
||||
System.EnablePtc.Value = cff.EnablePtc;
|
||||
System.EnableLowPowerPtc.Value = cff.EnableLowPowerPtc;
|
||||
System.EnableInternetAccess.Value = cff.EnableInternetAccess;
|
||||
System.EnableFsIntegrityChecks.Value = cff.EnableFsIntegrityChecks;
|
||||
System.FsGlobalAccessLogMode.Value = cff.FsGlobalAccessLogMode;
|
||||
System.AudioBackend.Value = cff.AudioBackend;
|
||||
System.AudioVolume.Value = cff.AudioVolume;
|
||||
System.MemoryManagerMode.Value = cff.MemoryManagerMode;
|
||||
System.DramSize.Value = cff.DramSize;
|
||||
System.IgnoreMissingServices.Value = cff.IgnoreMissingServices;
|
||||
System.UseHypervisor.Value = cff.UseHypervisor;
|
||||
|
||||
UI.GuiColumns.FavColumn.Value = cff.GuiColumns.FavColumn;
|
||||
UI.GuiColumns.IconColumn.Value = cff.GuiColumns.IconColumn;
|
||||
UI.GuiColumns.AppColumn.Value = cff.GuiColumns.AppColumn;
|
||||
UI.GuiColumns.DevColumn.Value = cff.GuiColumns.DevColumn;
|
||||
UI.GuiColumns.VersionColumn.Value = cff.GuiColumns.VersionColumn;
|
||||
UI.GuiColumns.TimePlayedColumn.Value = cff.GuiColumns.TimePlayedColumn;
|
||||
UI.GuiColumns.LastPlayedColumn.Value = cff.GuiColumns.LastPlayedColumn;
|
||||
UI.GuiColumns.FileExtColumn.Value = cff.GuiColumns.FileExtColumn;
|
||||
UI.GuiColumns.FileSizeColumn.Value = cff.GuiColumns.FileSizeColumn;
|
||||
UI.GuiColumns.PathColumn.Value = cff.GuiColumns.PathColumn;
|
||||
UI.ColumnSort.SortColumnId.Value = cff.ColumnSort.SortColumnId;
|
||||
UI.ColumnSort.SortAscending.Value = cff.ColumnSort.SortAscending;
|
||||
UI.GameDirs.Value = cff.GameDirs;
|
||||
UI.AutoloadDirs.Value = cff.AutoloadDirs ?? [];
|
||||
UI.ShownFileTypes.NSP.Value = cff.ShownFileTypes.NSP;
|
||||
UI.ShownFileTypes.PFS0.Value = cff.ShownFileTypes.PFS0;
|
||||
UI.ShownFileTypes.XCI.Value = cff.ShownFileTypes.XCI;
|
||||
UI.ShownFileTypes.NCA.Value = cff.ShownFileTypes.NCA;
|
||||
UI.ShownFileTypes.NRO.Value = cff.ShownFileTypes.NRO;
|
||||
UI.ShownFileTypes.NSO.Value = cff.ShownFileTypes.NSO;
|
||||
UI.LanguageCode.Value = cff.LanguageCode;
|
||||
UI.BaseStyle.Value = cff.BaseStyle;
|
||||
UI.GameListViewMode.Value = cff.GameListViewMode;
|
||||
UI.ShowNames.Value = cff.ShowNames;
|
||||
UI.IsAscendingOrder.Value = cff.IsAscendingOrder;
|
||||
UI.GridSize.Value = cff.GridSize;
|
||||
UI.ApplicationSort.Value = cff.ApplicationSort;
|
||||
UI.StartFullscreen.Value = cff.StartFullscreen;
|
||||
UI.ShowConsole.Value = cff.ShowConsole;
|
||||
UI.WindowStartup.WindowSizeWidth.Value = cff.WindowStartup.WindowSizeWidth;
|
||||
UI.WindowStartup.WindowSizeHeight.Value = cff.WindowStartup.WindowSizeHeight;
|
||||
UI.WindowStartup.WindowPositionX.Value = cff.WindowStartup.WindowPositionX;
|
||||
UI.WindowStartup.WindowPositionY.Value = cff.WindowStartup.WindowPositionY;
|
||||
UI.WindowStartup.WindowMaximized.Value = cff.WindowStartup.WindowMaximized;
|
||||
|
||||
Hid.EnableKeyboard.Value = cff.EnableKeyboard;
|
||||
Hid.EnableMouse.Value = cff.EnableMouse;
|
||||
Hid.Hotkeys.Value = cff.Hotkeys;
|
||||
Hid.InputConfig.Value = cff.InputConfig ?? [];
|
||||
|
||||
Multiplayer.LanInterfaceId.Value = cff.MultiplayerLanInterfaceId;
|
||||
Multiplayer.Mode.Value = cff.MultiplayerMode;
|
||||
Multiplayer.DisableP2p.Value = cff.MultiplayerDisableP2p;
|
||||
Multiplayer.LdnPassphrase.Value = cff.MultiplayerLdnPassphrase;
|
||||
Multiplayer.LdnServer.Value = cff.LdnServer;
|
||||
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 3.");
|
||||
Hacks.ShowDirtyHacks.Value = cff.ShowDirtyHacks;
|
||||
|
||||
configurationFileFormat.SystemTimeZone = "UTC";
|
||||
DirtyHacks hacks = new (cff.DirtyHacks ?? []);
|
||||
|
||||
configurationFileUpdated = true;
|
||||
Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix);
|
||||
|
||||
Hacks.EnableShaderTranslationDelay.Value = hacks.IsEnabled(DirtyHack.ShaderTranslationDelay);
|
||||
Hacks.ShaderTranslationDelay.Value = hacks[DirtyHack.ShaderTranslationDelay].CoerceAtLeast(0);
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 4)
|
||||
if (configurationFileUpdated)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 4.");
|
||||
ToFileFormat().SaveConfig(configurationFilePath);
|
||||
|
||||
configurationFileFormat.MaxAnisotropy = -1;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
RyuLogger.Notice.Print(LogClass.Application, $"Configuration file updated to version {ConfigurationFileFormat.CurrentVersion}");
|
||||
}
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 5)
|
||||
private static readonly Dictionary<int, Action<ConfigurationFileFormat>> _migrations =
|
||||
Collections.NewDictionary<int, Action<ConfigurationFileFormat>>(
|
||||
(2, static cff => cff.SystemRegion = Region.USA),
|
||||
(3, static cff => cff.SystemTimeZone = "UTC"),
|
||||
(4, static cff => cff.MaxAnisotropy = -1),
|
||||
(5, static cff => cff.SystemTimeOffset = 0),
|
||||
(8, static cff => cff.EnablePtc = true),
|
||||
(9, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 5.");
|
||||
|
||||
configurationFileFormat.SystemTimeOffset = 0;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 8)
|
||||
cff.ColumnSort = new ColumnSort { SortColumnId = 0, SortAscending = false };
|
||||
cff.Hotkeys = new KeyboardHotkeys { ToggleVSyncMode = Key.F1 };
|
||||
}),
|
||||
(10, static cff => cff.AudioBackend = AudioBackend.OpenAl),
|
||||
(11, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 8.");
|
||||
|
||||
configurationFileFormat.EnablePtc = true;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 9)
|
||||
cff.ResScale = 1;
|
||||
cff.ResScaleCustom = 1.0f;
|
||||
}),
|
||||
(12, static cff => cff.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None),
|
||||
// 13 -> LDN1
|
||||
(14, static cff => cff.CheckUpdatesOnStart = true),
|
||||
(16, static cff => cff.EnableShaderCache = true),
|
||||
(17, static cff => cff.StartFullscreen = false),
|
||||
(18, static cff => cff.AspectRatio = AspectRatio.Fixed16x9),
|
||||
// 19 -> LDN2
|
||||
(20, static cff => cff.ShowConfirmExit = true),
|
||||
(21, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 9.");
|
||||
|
||||
configurationFileFormat.ColumnSort = new ColumnSort
|
||||
{
|
||||
SortColumnId = 0,
|
||||
SortAscending = false,
|
||||
};
|
||||
|
||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVSyncMode = Key.F1,
|
||||
};
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 10)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 10.");
|
||||
|
||||
configurationFileFormat.AudioBackend = AudioBackend.OpenAl;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 11)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 11.");
|
||||
|
||||
configurationFileFormat.ResScale = 1;
|
||||
configurationFileFormat.ResScaleCustom = 1.0f;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 12)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 12.");
|
||||
|
||||
configurationFileFormat.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
// configurationFileFormat.Version == 13 -> LDN1
|
||||
|
||||
if (configurationFileFormat.Version < 14)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 14.");
|
||||
|
||||
configurationFileFormat.CheckUpdatesOnStart = true;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 16)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 16.");
|
||||
|
||||
configurationFileFormat.EnableShaderCache = true;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 17)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 17.");
|
||||
|
||||
configurationFileFormat.StartFullscreen = false;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 18)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 18.");
|
||||
|
||||
configurationFileFormat.AspectRatio = AspectRatio.Fixed16x9;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
// configurationFileFormat.Version == 19 -> LDN2
|
||||
|
||||
if (configurationFileFormat.Version < 20)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 20.");
|
||||
|
||||
configurationFileFormat.ShowConfirmExit = true;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 21)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 21.");
|
||||
|
||||
// Initialize network config.
|
||||
|
||||
configurationFileFormat.MultiplayerMode = MultiplayerMode.Disabled;
|
||||
configurationFileFormat.MultiplayerLanInterfaceId = "0";
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 22)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 22.");
|
||||
|
||||
configurationFileFormat.HideCursor = HideCursorMode.Never;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 24)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 24.");
|
||||
|
||||
configurationFileFormat.InputConfig = new List<InputConfig>
|
||||
cff.MultiplayerMode = MultiplayerMode.Disabled;
|
||||
cff.MultiplayerLanInterfaceId = "0";
|
||||
}),
|
||||
(22, static cff => cff.HideCursor = HideCursorMode.Never),
|
||||
(24, static cff =>
|
||||
{
|
||||
cff.InputConfig =
|
||||
[
|
||||
new StandardKeyboardInputConfig
|
||||
{
|
||||
Version = InputConfig.CurrentVersion,
|
||||
@@ -240,532 +249,172 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
||||
StickRight = Key.L,
|
||||
StickButton = Key.H,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 25)
|
||||
];
|
||||
}),
|
||||
(26, static cff => cff.MemoryManagerMode = MemoryManagerMode.HostMappedUnsafe),
|
||||
(27, static cff => cff.EnableMouse = false),
|
||||
(29,
|
||||
static cff =>
|
||||
cff.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 25.");
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 26)
|
||||
ToggleVSyncMode = Key.F1, Screenshot = Key.F8, ShowUI = Key.F4
|
||||
}),
|
||||
(30, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 26.");
|
||||
|
||||
configurationFileFormat.MemoryManagerMode = MemoryManagerMode.HostMappedUnsafe;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 27)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 27.");
|
||||
|
||||
configurationFileFormat.EnableMouse = false;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 28)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 28.");
|
||||
|
||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVSyncMode = Key.F1,
|
||||
Screenshot = Key.F8,
|
||||
};
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 29)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 29.");
|
||||
|
||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVSyncMode = Key.F1,
|
||||
Screenshot = Key.F8,
|
||||
ShowUI = Key.F4,
|
||||
};
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 30)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 30.");
|
||||
|
||||
foreach (InputConfig config in configurationFileFormat.InputConfig)
|
||||
foreach (InputConfig config in cff.InputConfig)
|
||||
{
|
||||
if (config is StandardControllerInputConfig controllerConfig)
|
||||
{
|
||||
controllerConfig.Rumble = new RumbleConfigController
|
||||
{
|
||||
EnableRumble = false,
|
||||
StrongRumble = 1f,
|
||||
WeakRumble = 1f,
|
||||
EnableRumble = false, StrongRumble = 1f, WeakRumble = 1f,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 31)
|
||||
}),
|
||||
(31, static cff => cff.BackendThreading = BackendThreading.Auto),
|
||||
(32, static cff => cff.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 31.");
|
||||
|
||||
configurationFileFormat.BackendThreading = BackendThreading.Auto;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 32)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 32.");
|
||||
|
||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode,
|
||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
||||
ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode,
|
||||
Screenshot = cff.Hotkeys.Screenshot,
|
||||
ShowUI = cff.Hotkeys.ShowUI,
|
||||
Pause = Key.F5,
|
||||
};
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 33)
|
||||
}),
|
||||
(33, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 33.");
|
||||
|
||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||
cff.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode,
|
||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
||||
Pause = configurationFileFormat.Hotkeys.Pause,
|
||||
ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode,
|
||||
Screenshot = cff.Hotkeys.Screenshot,
|
||||
ShowUI = cff.Hotkeys.ShowUI,
|
||||
Pause = cff.Hotkeys.Pause,
|
||||
ToggleMute = Key.F2,
|
||||
};
|
||||
|
||||
configurationFileFormat.AudioVolume = 1;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
cff.AudioVolume = 1;
|
||||
}),
|
||||
(34, static cff => cff.EnableInternetAccess = false),
|
||||
(35, static cff =>
|
||||
{
|
||||
foreach (StandardControllerInputConfig config in cff.InputConfig
|
||||
.OfType<StandardControllerInputConfig>())
|
||||
{
|
||||
config.RangeLeft = 1.0f;
|
||||
config.RangeRight = 1.0f;
|
||||
}
|
||||
}),
|
||||
|
||||
if (configurationFileFormat.Version < 34)
|
||||
(36, static cff => cff.LoggingEnableTrace = false),
|
||||
(37, static cff => cff.ShowConsole = true),
|
||||
(38, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 34.");
|
||||
|
||||
configurationFileFormat.EnableInternetAccess = false;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 35)
|
||||
cff.BaseStyle = "Dark";
|
||||
cff.GameListViewMode = 0;
|
||||
cff.ShowNames = true;
|
||||
cff.GridSize = 2;
|
||||
cff.LanguageCode = "en_US";
|
||||
}),
|
||||
(39,
|
||||
static cff => cff.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 35.");
|
||||
|
||||
foreach (InputConfig config in configurationFileFormat.InputConfig)
|
||||
{
|
||||
if (config is StandardControllerInputConfig controllerConfig)
|
||||
{
|
||||
controllerConfig.RangeLeft = 1.0f;
|
||||
controllerConfig.RangeRight = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 36)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 36.");
|
||||
|
||||
configurationFileFormat.LoggingEnableTrace = false;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 37)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 37.");
|
||||
|
||||
configurationFileFormat.ShowConsole = true;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 38)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 38.");
|
||||
|
||||
configurationFileFormat.BaseStyle = "Dark";
|
||||
configurationFileFormat.GameListViewMode = 0;
|
||||
configurationFileFormat.ShowNames = true;
|
||||
configurationFileFormat.GridSize = 2;
|
||||
configurationFileFormat.LanguageCode = "en_US";
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 39)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 39.");
|
||||
|
||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode,
|
||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
||||
Pause = configurationFileFormat.Hotkeys.Pause,
|
||||
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
|
||||
ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode,
|
||||
Screenshot = cff.Hotkeys.Screenshot,
|
||||
ShowUI = cff.Hotkeys.ShowUI,
|
||||
Pause = cff.Hotkeys.Pause,
|
||||
ToggleMute = cff.Hotkeys.ToggleMute,
|
||||
ResScaleUp = Key.Unbound,
|
||||
ResScaleDown = Key.Unbound,
|
||||
};
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 40)
|
||||
ResScaleDown = Key.Unbound
|
||||
}),
|
||||
(40, static cff => cff.GraphicsBackend = GraphicsBackend.OpenGl),
|
||||
(41,
|
||||
static cff => cff.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 40.");
|
||||
|
||||
configurationFileFormat.GraphicsBackend = GraphicsBackend.OpenGl;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 41)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 41.");
|
||||
|
||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode,
|
||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
||||
Pause = configurationFileFormat.Hotkeys.Pause,
|
||||
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
|
||||
ResScaleUp = configurationFileFormat.Hotkeys.ResScaleUp,
|
||||
ResScaleDown = configurationFileFormat.Hotkeys.ResScaleDown,
|
||||
ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode,
|
||||
Screenshot = cff.Hotkeys.Screenshot,
|
||||
ShowUI = cff.Hotkeys.ShowUI,
|
||||
Pause = cff.Hotkeys.Pause,
|
||||
ToggleMute = cff.Hotkeys.ToggleMute,
|
||||
ResScaleUp = cff.Hotkeys.ResScaleUp,
|
||||
ResScaleDown = cff.Hotkeys.ResScaleDown,
|
||||
VolumeUp = Key.Unbound,
|
||||
VolumeDown = Key.Unbound,
|
||||
};
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 42)
|
||||
VolumeDown = Key.Unbound
|
||||
}),
|
||||
(42, static cff => cff.EnableMacroHLE = true),
|
||||
(43, static cff => cff.UseHypervisor = true),
|
||||
(44, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 42.");
|
||||
|
||||
configurationFileFormat.EnableMacroHLE = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 43)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 43.");
|
||||
|
||||
configurationFileFormat.UseHypervisor = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 44)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 44.");
|
||||
|
||||
configurationFileFormat.AntiAliasing = AntiAliasing.None;
|
||||
configurationFileFormat.ScalingFilter = ScalingFilter.Bilinear;
|
||||
configurationFileFormat.ScalingFilterLevel = 80;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 45)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 45.");
|
||||
|
||||
configurationFileFormat.ShownFileTypes = new ShownFileTypes
|
||||
cff.AntiAliasing = AntiAliasing.None;
|
||||
cff.ScalingFilter = ScalingFilter.Bilinear;
|
||||
cff.ScalingFilterLevel = 80;
|
||||
}),
|
||||
(45,
|
||||
static cff => cff.ShownFileTypes = new ShownFileTypes
|
||||
{
|
||||
NSP = true,
|
||||
PFS0 = true,
|
||||
XCI = true,
|
||||
NCA = true,
|
||||
NRO = true,
|
||||
NSO = true,
|
||||
};
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 46)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 46.");
|
||||
|
||||
configurationFileFormat.MultiplayerLanInterfaceId = "0";
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 47)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 47.");
|
||||
|
||||
configurationFileFormat.WindowStartup = new WindowStartup
|
||||
NSO = true
|
||||
}),
|
||||
(46, static cff => cff.UseHypervisor = OperatingSystem.IsMacOS()),
|
||||
(47,
|
||||
static cff => cff.WindowStartup = new WindowStartup
|
||||
{
|
||||
WindowPositionX = 0,
|
||||
WindowPositionY = 0,
|
||||
WindowSizeHeight = 760,
|
||||
WindowSizeWidth = 1280,
|
||||
WindowMaximized = false,
|
||||
};
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 48)
|
||||
WindowMaximized = false
|
||||
}),
|
||||
(48, static cff => cff.EnableColorSpacePassthrough = false),
|
||||
(49, static _ =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 48.");
|
||||
|
||||
configurationFileFormat.EnableColorSpacePassthrough = false;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 49)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 49.");
|
||||
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
AppDataManager.FixMacOSConfigurationFolders();
|
||||
}
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 50)
|
||||
}),
|
||||
(50, static cff => cff.EnableHardwareAcceleration = true),
|
||||
(51, static cff => cff.RememberWindowState = true),
|
||||
(52, static cff => cff.AutoloadDirs = []),
|
||||
(53, static cff => cff.EnableLowPowerPtc = false),
|
||||
(54, static cff => cff.DramSize = MemoryConfiguration.MemoryConfiguration4GiB),
|
||||
(55, static cff => cff.IgnoreApplet = false),
|
||||
(56, static cff => cff.ShowTitleBar = !OperatingSystem.IsWindows()),
|
||||
(57, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 50.");
|
||||
cff.VSyncMode = VSyncMode.Switch;
|
||||
cff.EnableCustomVSyncInterval = false;
|
||||
|
||||
configurationFileFormat.EnableHardwareAcceleration = true;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 51)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 51.");
|
||||
|
||||
configurationFileFormat.RememberWindowState = true;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 52)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 52.");
|
||||
|
||||
configurationFileFormat.AutoloadDirs = [];
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 53)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 53.");
|
||||
|
||||
configurationFileFormat.EnableLowPowerPtc = false;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 54)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 54.");
|
||||
|
||||
configurationFileFormat.DramSize = MemoryConfiguration.MemoryConfiguration4GiB;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 55)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 55.");
|
||||
|
||||
configurationFileFormat.IgnoreApplet = false;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 56)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 56.");
|
||||
|
||||
configurationFileFormat.ShowTitleBar = !OperatingSystem.IsWindows();
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
if (configurationFileFormat.Version < 57)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 57.");
|
||||
|
||||
configurationFileFormat.VSyncMode = VSyncMode.Switch;
|
||||
configurationFileFormat.EnableCustomVSyncInterval = false;
|
||||
|
||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||
cff.Hotkeys = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVSyncMode = Key.F1,
|
||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
||||
Pause = configurationFileFormat.Hotkeys.Pause,
|
||||
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
|
||||
ResScaleUp = configurationFileFormat.Hotkeys.ResScaleUp,
|
||||
ResScaleDown = configurationFileFormat.Hotkeys.ResScaleDown,
|
||||
VolumeUp = configurationFileFormat.Hotkeys.VolumeUp,
|
||||
VolumeDown = configurationFileFormat.Hotkeys.VolumeDown,
|
||||
Screenshot = cff.Hotkeys.Screenshot,
|
||||
ShowUI = cff.Hotkeys.ShowUI,
|
||||
Pause = cff.Hotkeys.Pause,
|
||||
ToggleMute = cff.Hotkeys.ToggleMute,
|
||||
ResScaleUp = cff.Hotkeys.ResScaleUp,
|
||||
ResScaleDown = cff.Hotkeys.ResScaleDown,
|
||||
VolumeUp = cff.Hotkeys.VolumeUp,
|
||||
VolumeDown = cff.Hotkeys.VolumeDown,
|
||||
CustomVSyncIntervalIncrement = Key.Unbound,
|
||||
CustomVSyncIntervalDecrement = Key.Unbound,
|
||||
};
|
||||
|
||||
configurationFileFormat.CustomVSyncInterval = 120;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
// 58 migration accidentally got skipped but it worked with no issues somehow lol
|
||||
|
||||
if (configurationFileFormat.Version < 59)
|
||||
cff.CustomVSyncInterval = 120;
|
||||
}),
|
||||
// 58 migration accidentally got skipped, but it worked with no issues somehow lol
|
||||
(59, static cff =>
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 59.");
|
||||
cff.ShowDirtyHacks = false;
|
||||
cff.DirtyHacks = [];
|
||||
|
||||
configurationFileFormat.ShowDirtyHacks = false;
|
||||
configurationFileFormat.DirtyHacks = [];
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
||||
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
||||
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
||||
Graphics.MaxAnisotropy.Value = configurationFileFormat.MaxAnisotropy;
|
||||
Graphics.AspectRatio.Value = configurationFileFormat.AspectRatio;
|
||||
Graphics.ShadersDumpPath.Value = configurationFileFormat.GraphicsShadersDumpPath;
|
||||
Graphics.BackendThreading.Value = configurationFileFormat.BackendThreading;
|
||||
Graphics.GraphicsBackend.Value = configurationFileFormat.GraphicsBackend;
|
||||
Graphics.PreferredGpu.Value = configurationFileFormat.PreferredGpu;
|
||||
Graphics.AntiAliasing.Value = configurationFileFormat.AntiAliasing;
|
||||
Graphics.ScalingFilter.Value = configurationFileFormat.ScalingFilter;
|
||||
Graphics.ScalingFilterLevel.Value = configurationFileFormat.ScalingFilterLevel;
|
||||
Logger.EnableDebug.Value = configurationFileFormat.LoggingEnableDebug;
|
||||
Logger.EnableStub.Value = configurationFileFormat.LoggingEnableStub;
|
||||
Logger.EnableInfo.Value = configurationFileFormat.LoggingEnableInfo;
|
||||
Logger.EnableWarn.Value = configurationFileFormat.LoggingEnableWarn;
|
||||
Logger.EnableError.Value = configurationFileFormat.LoggingEnableError;
|
||||
Logger.EnableTrace.Value = configurationFileFormat.LoggingEnableTrace;
|
||||
Logger.EnableGuest.Value = configurationFileFormat.LoggingEnableGuest;
|
||||
Logger.EnableFsAccessLog.Value = configurationFileFormat.LoggingEnableFsAccessLog;
|
||||
Logger.FilteredClasses.Value = configurationFileFormat.LoggingFilteredClasses;
|
||||
Logger.GraphicsDebugLevel.Value = configurationFileFormat.LoggingGraphicsDebugLevel;
|
||||
System.Language.Value = configurationFileFormat.SystemLanguage;
|
||||
System.Region.Value = configurationFileFormat.SystemRegion;
|
||||
System.TimeZone.Value = configurationFileFormat.SystemTimeZone;
|
||||
System.SystemTimeOffset.Value = configurationFileFormat.SystemTimeOffset;
|
||||
System.EnableDockedMode.Value = configurationFileFormat.DockedMode;
|
||||
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
|
||||
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
||||
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
||||
IgnoreApplet.Value = configurationFileFormat.IgnoreApplet;
|
||||
RememberWindowState.Value = configurationFileFormat.RememberWindowState;
|
||||
ShowTitleBar.Value = configurationFileFormat.ShowTitleBar;
|
||||
EnableHardwareAcceleration.Value = configurationFileFormat.EnableHardwareAcceleration;
|
||||
HideCursor.Value = configurationFileFormat.HideCursor;
|
||||
Graphics.VSyncMode.Value = configurationFileFormat.VSyncMode;
|
||||
Graphics.EnableCustomVSyncInterval.Value = configurationFileFormat.EnableCustomVSyncInterval;
|
||||
Graphics.CustomVSyncInterval.Value = configurationFileFormat.CustomVSyncInterval;
|
||||
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
|
||||
Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression;
|
||||
Graphics.EnableMacroHLE.Value = configurationFileFormat.EnableMacroHLE;
|
||||
Graphics.EnableColorSpacePassthrough.Value = configurationFileFormat.EnableColorSpacePassthrough;
|
||||
System.EnablePtc.Value = configurationFileFormat.EnablePtc;
|
||||
System.EnableLowPowerPtc.Value = configurationFileFormat.EnableLowPowerPtc;
|
||||
System.EnableInternetAccess.Value = configurationFileFormat.EnableInternetAccess;
|
||||
System.EnableFsIntegrityChecks.Value = configurationFileFormat.EnableFsIntegrityChecks;
|
||||
System.FsGlobalAccessLogMode.Value = configurationFileFormat.FsGlobalAccessLogMode;
|
||||
System.AudioBackend.Value = configurationFileFormat.AudioBackend;
|
||||
System.AudioVolume.Value = configurationFileFormat.AudioVolume;
|
||||
System.MemoryManagerMode.Value = configurationFileFormat.MemoryManagerMode;
|
||||
System.DramSize.Value = configurationFileFormat.DramSize;
|
||||
System.IgnoreMissingServices.Value = configurationFileFormat.IgnoreMissingServices;
|
||||
System.UseHypervisor.Value = configurationFileFormat.UseHypervisor;
|
||||
UI.GuiColumns.FavColumn.Value = configurationFileFormat.GuiColumns.FavColumn;
|
||||
UI.GuiColumns.IconColumn.Value = configurationFileFormat.GuiColumns.IconColumn;
|
||||
UI.GuiColumns.AppColumn.Value = configurationFileFormat.GuiColumns.AppColumn;
|
||||
UI.GuiColumns.DevColumn.Value = configurationFileFormat.GuiColumns.DevColumn;
|
||||
UI.GuiColumns.VersionColumn.Value = configurationFileFormat.GuiColumns.VersionColumn;
|
||||
UI.GuiColumns.TimePlayedColumn.Value = configurationFileFormat.GuiColumns.TimePlayedColumn;
|
||||
UI.GuiColumns.LastPlayedColumn.Value = configurationFileFormat.GuiColumns.LastPlayedColumn;
|
||||
UI.GuiColumns.FileExtColumn.Value = configurationFileFormat.GuiColumns.FileExtColumn;
|
||||
UI.GuiColumns.FileSizeColumn.Value = configurationFileFormat.GuiColumns.FileSizeColumn;
|
||||
UI.GuiColumns.PathColumn.Value = configurationFileFormat.GuiColumns.PathColumn;
|
||||
UI.ColumnSort.SortColumnId.Value = configurationFileFormat.ColumnSort.SortColumnId;
|
||||
UI.ColumnSort.SortAscending.Value = configurationFileFormat.ColumnSort.SortAscending;
|
||||
UI.GameDirs.Value = configurationFileFormat.GameDirs;
|
||||
UI.AutoloadDirs.Value = configurationFileFormat.AutoloadDirs ?? [];
|
||||
UI.ShownFileTypes.NSP.Value = configurationFileFormat.ShownFileTypes.NSP;
|
||||
UI.ShownFileTypes.PFS0.Value = configurationFileFormat.ShownFileTypes.PFS0;
|
||||
UI.ShownFileTypes.XCI.Value = configurationFileFormat.ShownFileTypes.XCI;
|
||||
UI.ShownFileTypes.NCA.Value = configurationFileFormat.ShownFileTypes.NCA;
|
||||
UI.ShownFileTypes.NRO.Value = configurationFileFormat.ShownFileTypes.NRO;
|
||||
UI.ShownFileTypes.NSO.Value = configurationFileFormat.ShownFileTypes.NSO;
|
||||
UI.LanguageCode.Value = configurationFileFormat.LanguageCode;
|
||||
UI.BaseStyle.Value = configurationFileFormat.BaseStyle;
|
||||
UI.GameListViewMode.Value = configurationFileFormat.GameListViewMode;
|
||||
UI.ShowNames.Value = configurationFileFormat.ShowNames;
|
||||
UI.IsAscendingOrder.Value = configurationFileFormat.IsAscendingOrder;
|
||||
UI.GridSize.Value = configurationFileFormat.GridSize;
|
||||
UI.ApplicationSort.Value = configurationFileFormat.ApplicationSort;
|
||||
UI.StartFullscreen.Value = configurationFileFormat.StartFullscreen;
|
||||
UI.ShowConsole.Value = configurationFileFormat.ShowConsole;
|
||||
UI.WindowStartup.WindowSizeWidth.Value = configurationFileFormat.WindowStartup.WindowSizeWidth;
|
||||
UI.WindowStartup.WindowSizeHeight.Value = configurationFileFormat.WindowStartup.WindowSizeHeight;
|
||||
UI.WindowStartup.WindowPositionX.Value = configurationFileFormat.WindowStartup.WindowPositionX;
|
||||
UI.WindowStartup.WindowPositionY.Value = configurationFileFormat.WindowStartup.WindowPositionY;
|
||||
UI.WindowStartup.WindowMaximized.Value = configurationFileFormat.WindowStartup.WindowMaximized;
|
||||
Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard;
|
||||
Hid.EnableMouse.Value = configurationFileFormat.EnableMouse;
|
||||
Hid.Hotkeys.Value = configurationFileFormat.Hotkeys;
|
||||
Hid.InputConfig.Value = configurationFileFormat.InputConfig ?? [];
|
||||
|
||||
Multiplayer.LanInterfaceId.Value = configurationFileFormat.MultiplayerLanInterfaceId;
|
||||
Multiplayer.Mode.Value = configurationFileFormat.MultiplayerMode;
|
||||
Multiplayer.DisableP2p.Value = configurationFileFormat.MultiplayerDisableP2p;
|
||||
Multiplayer.LdnPassphrase.Value = configurationFileFormat.MultiplayerLdnPassphrase;
|
||||
Multiplayer.LdnServer.Value = configurationFileFormat.LdnServer;
|
||||
|
||||
Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks;
|
||||
|
||||
{
|
||||
DirtyHacks hacks = new (configurationFileFormat.DirtyHacks ?? []);
|
||||
|
||||
Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix);
|
||||
|
||||
Hacks.EnableShaderTranslationDelay.Value = hacks.IsEnabled(DirtyHack.ShaderTranslationDelay);
|
||||
Hacks.ShaderTranslationDelay.Value = hacks[DirtyHack.ShaderTranslationDelay].CoerceAtLeast(0);
|
||||
}
|
||||
|
||||
if (configurationFileUpdated)
|
||||
{
|
||||
ToFileFormat().SaveConfig(configurationFilePath);
|
||||
|
||||
Ryujinx.Common.Logging.Logger.Notice.Print(LogClass.Application, $"Configuration file updated to version {ConfigurationFileFormat.CurrentVersion}");
|
||||
}
|
||||
}
|
||||
// This was accidentally enabled by default when it was PRed. That is not what we want,
|
||||
// so as a compromise users who want to use it will simply need to re-enable it once after updating.
|
||||
cff.IgnoreApplet = false;
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user