2019-09-02 12:03:57 -04:00
|
|
|
using System.Collections.Generic;
|
2019-02-11 07:00:32 -05:00
|
|
|
using System.IO;
|
2020-08-02 10:41:24 -04:00
|
|
|
using Ryujinx.Common.Configuration;
|
2020-04-30 08:07:41 -04:00
|
|
|
using Ryujinx.Common.Configuration.Hid;
|
|
|
|
using Ryujinx.Common.Logging;
|
|
|
|
using Ryujinx.Common.Utilities;
|
2019-12-21 14:52:31 -05:00
|
|
|
using Ryujinx.Configuration.System;
|
|
|
|
using Ryujinx.Configuration.Ui;
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2019-12-21 14:52:31 -05:00
|
|
|
namespace Ryujinx.Configuration
|
2019-02-11 07:00:32 -05:00
|
|
|
{
|
2019-12-21 14:52:31 -05:00
|
|
|
public class ConfigurationFileFormat
|
2019-02-11 07:00:32 -05:00
|
|
|
{
|
2020-03-25 18:23:21 -04:00
|
|
|
/// <summary>
|
|
|
|
/// The current version of the file format
|
|
|
|
/// </summary>
|
2021-02-15 16:48:21 -05:00
|
|
|
public const int CurrentVersion = 22;
|
2020-03-25 18:23:21 -04:00
|
|
|
|
2019-12-21 14:52:31 -05:00
|
|
|
public int Version { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2020-07-06 22:41:07 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Resolution Scale. An integer scale applied to applicable render targets. Values 1-4, or -1 to use a custom floating point scale instead.
|
|
|
|
/// </summary>
|
|
|
|
public int ResScale { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Custom Resolution Scale. A custom floating point scale applied to applicable render targets. Only active when Resolution Scale is -1.
|
|
|
|
/// </summary>
|
|
|
|
public float ResScaleCustom { get; set; }
|
|
|
|
|
2020-03-30 17:38:52 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Max Anisotropy. Values range from 0 - 16. Set to -1 to let the game decide.
|
|
|
|
/// </summary>
|
|
|
|
public float MaxAnisotropy { get; set; }
|
2020-12-15 21:19:07 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Aspect Ratio applied to the renderer window.
|
|
|
|
/// </summary>
|
|
|
|
public AspectRatio AspectRatio { get; set; }
|
2020-03-30 17:38:52 -04:00
|
|
|
|
2019-02-11 07:00:32 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Dumps shaders in this local directory
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public string GraphicsShadersDumpPath { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Enables printing debug log messages
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool LoggingEnableDebug { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Enables printing stub log messages
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool LoggingEnableStub { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Enables printing info log messages
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool LoggingEnableInfo { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Enables printing warning log messages
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool LoggingEnableWarn { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Enables printing error log messages
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool LoggingEnableError { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2019-06-15 21:31:18 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Enables printing guest log messages
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool LoggingEnableGuest { get; set; }
|
2019-06-15 21:31:18 -04:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Enables printing FS access log messages
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool LoggingEnableFsAccessLog { get; set; }
|
2019-06-15 21:31:18 -04:00
|
|
|
|
2019-02-11 07:00:32 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Controls which log messages are written to the log targets
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public LogClass[] LoggingFilteredClasses { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2020-08-02 10:41:24 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Change Graphics API debug log level
|
|
|
|
/// </summary>
|
|
|
|
public GraphicsDebugLevel LoggingGraphicsDebugLevel { get; set; }
|
|
|
|
|
2019-02-11 07:00:32 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Enables or disables logging to a file on disk
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool EnableFileLog { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Change System Language
|
|
|
|
/// </summary>
|
2019-12-21 14:52:31 -05:00
|
|
|
public Language SystemLanguage { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2020-03-19 18:37:55 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Change System Region
|
|
|
|
/// </summary>
|
|
|
|
public Region SystemRegion { get; set; }
|
|
|
|
|
2020-03-25 18:23:21 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Change System TimeZone
|
|
|
|
/// </summary>
|
|
|
|
public string SystemTimeZone { get; set; }
|
|
|
|
|
2020-04-16 19:18:54 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Change System Time Offset in seconds
|
|
|
|
/// </summary>
|
|
|
|
public long SystemTimeOffset { get; set; }
|
|
|
|
|
2019-02-11 07:00:32 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Enables or disables Docked Mode
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool DockedMode { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2019-05-30 16:27:43 -04:00
|
|
|
/// <summary>
|
2019-07-01 22:39:22 -04:00
|
|
|
/// Enables or disables Discord Rich Presence
|
2019-05-30 16:27:43 -04:00
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool EnableDiscordIntegration { get; set; }
|
2019-05-30 16:27:43 -04:00
|
|
|
|
2020-09-29 16:05:25 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Checks for updates when Ryujinx starts when enabled
|
|
|
|
/// </summary>
|
|
|
|
public bool CheckUpdatesOnStart { get; set; }
|
|
|
|
|
2021-01-14 17:30:52 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Show "Confirm Exit" Dialog
|
|
|
|
/// </summary>
|
|
|
|
public bool ShowConfirmExit { get; set; }
|
|
|
|
|
2021-02-15 16:48:21 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Hide Cursor on Idle
|
|
|
|
/// </summary>
|
|
|
|
public bool HideCursorOnIdle { get; set; }
|
|
|
|
|
2019-02-11 07:00:32 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Enables or disables Vertical Sync
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool EnableVsync { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2020-11-12 18:15:34 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Enables or disables Shader cache
|
|
|
|
/// </summary>
|
|
|
|
public bool EnableShaderCache { get; set; }
|
|
|
|
|
2019-02-11 07:00:32 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Enables or disables multi-core scheduling of threads
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool EnableMulticoreScheduling { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2020-06-16 14:28:02 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Enables or disables profiled translation cache persistency
|
|
|
|
/// </summary>
|
|
|
|
public bool EnablePtc { get; set; }
|
|
|
|
|
2019-02-11 07:00:32 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Enables integrity checks on Game content files
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool EnableFsIntegrityChecks { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2019-06-15 21:31:18 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Enables FS access log output to the console. Possible modes are 0-3
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public int FsGlobalAccessLogMode { get; set; }
|
2019-06-15 21:31:18 -04:00
|
|
|
|
2020-07-03 19:16:49 -04:00
|
|
|
/// <summary>
|
|
|
|
/// The selected audio backend
|
|
|
|
/// </summary>
|
|
|
|
public AudioBackend AudioBackend { get; set; }
|
|
|
|
|
2019-04-15 19:22:55 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Enable or disable ignoring missing services
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool IgnoreMissingServices { get; set; }
|
2019-04-15 19:22:55 -04:00
|
|
|
|
2019-09-02 12:03:57 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Used to toggle columns in the GUI
|
|
|
|
/// </summary>
|
2019-11-28 23:32:51 -05:00
|
|
|
public GuiColumns GuiColumns { get; set; }
|
2019-09-02 12:03:57 -04:00
|
|
|
|
2020-06-26 06:30:16 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Used to configure column sort settings in the GUI
|
|
|
|
/// </summary>
|
|
|
|
public ColumnSort ColumnSort { get; set; }
|
|
|
|
|
2019-09-02 12:03:57 -04:00
|
|
|
/// <summary>
|
|
|
|
/// A list of directories containing games to be used to load games into the games list
|
|
|
|
/// </summary>
|
|
|
|
public List<string> GameDirs { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Enable or disable custom themes in the GUI
|
|
|
|
/// </summary>
|
|
|
|
public bool EnableCustomTheme { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Path to custom GUI theme
|
|
|
|
/// </summary>
|
|
|
|
public string CustomThemePath { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
2020-12-01 17:02:27 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Start games in fullscreen mode
|
|
|
|
/// </summary>
|
|
|
|
public bool StartFullscreen { get; set; }
|
|
|
|
|
2019-05-02 19:29:01 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Enable or disable keyboard support (Independent from controllers binding)
|
|
|
|
/// </summary>
|
2019-09-02 12:03:57 -04:00
|
|
|
public bool EnableKeyboard { get; set; }
|
2019-05-02 19:29:01 -04:00
|
|
|
|
2020-06-26 06:30:16 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Hotkey Keyboard Bindings
|
|
|
|
/// </summary>
|
|
|
|
public KeyboardHotkeys Hotkeys { get; set; }
|
|
|
|
|
2019-02-11 07:00:32 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Keyboard control bindings
|
|
|
|
/// </summary>
|
2020-05-02 22:00:53 -04:00
|
|
|
public List<KeyboardConfig> KeyboardConfig { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Controller control bindings
|
|
|
|
/// </summary>
|
2020-05-02 22:00:53 -04:00
|
|
|
public List<ControllerConfig> ControllerConfig { get; set; }
|
2019-02-11 07:00:32 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Loads a configuration file from disk
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">The path to the JSON configuration file</param>
|
2021-02-09 04:24:37 -05:00
|
|
|
public static bool TryLoad(string path, out ConfigurationFileFormat configurationFileFormat)
|
2019-02-11 07:00:32 -05:00
|
|
|
{
|
2021-02-09 04:24:37 -05:00
|
|
|
try
|
|
|
|
{
|
|
|
|
configurationFileFormat = JsonHelper.DeserializeFromFile<ConfigurationFileFormat>(path);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
configurationFileFormat = null;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2019-02-11 07:00:32 -05:00
|
|
|
}
|
|
|
|
|
2019-09-02 12:03:57 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Save a configuration file to disk
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">The path to the JSON configuration file</param>
|
2019-12-21 14:52:31 -05:00
|
|
|
public void SaveConfig(string path)
|
2019-09-02 12:03:57 -04:00
|
|
|
{
|
2021-02-09 04:24:37 -05:00
|
|
|
using FileStream fileStream = File.Create(path, 4096, FileOptions.WriteThrough);
|
|
|
|
JsonHelper.Serialize(fileStream, this, true);
|
2019-02-11 07:00:32 -05:00
|
|
|
}
|
|
|
|
}
|
2021-02-15 16:48:21 -05:00
|
|
|
}
|