ConfigurationFileFormat.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. using System.Collections.Generic;
  2. using System.IO;
  3. using Ryujinx.Common.Configuration.Hid;
  4. using Ryujinx.Common.Logging;
  5. using Ryujinx.Common.Utilities;
  6. using Ryujinx.Configuration.System;
  7. using Ryujinx.Configuration.Ui;
  8. namespace Ryujinx.Configuration
  9. {
  10. public class ConfigurationFileFormat
  11. {
  12. /// <summary>
  13. /// The current version of the file format
  14. /// </summary>
  15. public const int CurrentVersion = 11;
  16. public int Version { get; set; }
  17. /// <summary>
  18. /// Resolution Scale. An integer scale applied to applicable render targets. Values 1-4, or -1 to use a custom floating point scale instead.
  19. /// </summary>
  20. public int ResScale { get; set; }
  21. /// <summary>
  22. /// Custom Resolution Scale. A custom floating point scale applied to applicable render targets. Only active when Resolution Scale is -1.
  23. /// </summary>
  24. public float ResScaleCustom { get; set; }
  25. /// <summary>
  26. /// Max Anisotropy. Values range from 0 - 16. Set to -1 to let the game decide.
  27. /// </summary>
  28. public float MaxAnisotropy { get; set; }
  29. /// <summary>
  30. /// Dumps shaders in this local directory
  31. /// </summary>
  32. public string GraphicsShadersDumpPath { get; set; }
  33. /// <summary>
  34. /// Enables printing debug log messages
  35. /// </summary>
  36. public bool LoggingEnableDebug { get; set; }
  37. /// <summary>
  38. /// Enables printing stub log messages
  39. /// </summary>
  40. public bool LoggingEnableStub { get; set; }
  41. /// <summary>
  42. /// Enables printing info log messages
  43. /// </summary>
  44. public bool LoggingEnableInfo { get; set; }
  45. /// <summary>
  46. /// Enables printing warning log messages
  47. /// </summary>
  48. public bool LoggingEnableWarn { get; set; }
  49. /// <summary>
  50. /// Enables printing error log messages
  51. /// </summary>
  52. public bool LoggingEnableError { get; set; }
  53. /// <summary>
  54. /// Enables printing guest log messages
  55. /// </summary>
  56. public bool LoggingEnableGuest { get; set; }
  57. /// <summary>
  58. /// Enables printing FS access log messages
  59. /// </summary>
  60. public bool LoggingEnableFsAccessLog { get; set; }
  61. /// <summary>
  62. /// Controls which log messages are written to the log targets
  63. /// </summary>
  64. public LogClass[] LoggingFilteredClasses { get; set; }
  65. /// <summary>
  66. /// Enables or disables logging to a file on disk
  67. /// </summary>
  68. public bool EnableFileLog { get; set; }
  69. /// <summary>
  70. /// Change System Language
  71. /// </summary>
  72. public Language SystemLanguage { get; set; }
  73. /// <summary>
  74. /// Change System Region
  75. /// </summary>
  76. public Region SystemRegion { get; set; }
  77. /// <summary>
  78. /// Change System TimeZone
  79. /// </summary>
  80. public string SystemTimeZone { get; set; }
  81. /// <summary>
  82. /// Change System Time Offset in seconds
  83. /// </summary>
  84. public long SystemTimeOffset { get; set; }
  85. /// <summary>
  86. /// Enables or disables Docked Mode
  87. /// </summary>
  88. public bool DockedMode { get; set; }
  89. /// <summary>
  90. /// Enables or disables Discord Rich Presence
  91. /// </summary>
  92. public bool EnableDiscordIntegration { get; set; }
  93. /// <summary>
  94. /// Enables or disables Vertical Sync
  95. /// </summary>
  96. public bool EnableVsync { get; set; }
  97. /// <summary>
  98. /// Enables or disables multi-core scheduling of threads
  99. /// </summary>
  100. public bool EnableMulticoreScheduling { get; set; }
  101. /// <summary>
  102. /// Enables or disables profiled translation cache persistency
  103. /// </summary>
  104. public bool EnablePtc { get; set; }
  105. /// <summary>
  106. /// Enables integrity checks on Game content files
  107. /// </summary>
  108. public bool EnableFsIntegrityChecks { get; set; }
  109. /// <summary>
  110. /// Enables FS access log output to the console. Possible modes are 0-3
  111. /// </summary>
  112. public int FsGlobalAccessLogMode { get; set; }
  113. /// <summary>
  114. /// The selected audio backend
  115. /// </summary>
  116. public AudioBackend AudioBackend { get; set; }
  117. /// <summary>
  118. /// Enable or disable ignoring missing services
  119. /// </summary>
  120. public bool IgnoreMissingServices { get; set; }
  121. /// <summary>
  122. /// Used to toggle columns in the GUI
  123. /// </summary>
  124. public GuiColumns GuiColumns { get; set; }
  125. /// <summary>
  126. /// Used to configure column sort settings in the GUI
  127. /// </summary>
  128. public ColumnSort ColumnSort { get; set; }
  129. /// <summary>
  130. /// A list of directories containing games to be used to load games into the games list
  131. /// </summary>
  132. public List<string> GameDirs { get; set; }
  133. /// <summary>
  134. /// Enable or disable custom themes in the GUI
  135. /// </summary>
  136. public bool EnableCustomTheme { get; set; }
  137. /// <summary>
  138. /// Path to custom GUI theme
  139. /// </summary>
  140. public string CustomThemePath { get; set; }
  141. /// <summary>
  142. /// Enable or disable keyboard support (Independent from controllers binding)
  143. /// </summary>
  144. public bool EnableKeyboard { get; set; }
  145. /// <summary>
  146. /// Hotkey Keyboard Bindings
  147. /// </summary>
  148. public KeyboardHotkeys Hotkeys { get; set; }
  149. /// <summary>
  150. /// Keyboard control bindings
  151. /// </summary>
  152. public List<KeyboardConfig> KeyboardConfig { get; set; }
  153. /// <summary>
  154. /// Controller control bindings
  155. /// </summary>
  156. public List<ControllerConfig> ControllerConfig { get; set; }
  157. /// <summary>
  158. /// Loads a configuration file from disk
  159. /// </summary>
  160. /// <param name="path">The path to the JSON configuration file</param>
  161. public static ConfigurationFileFormat Load(string path)
  162. {
  163. return JsonHelper.DeserializeFromFile<ConfigurationFileFormat>(path);
  164. }
  165. /// <summary>
  166. /// Save a configuration file to disk
  167. /// </summary>
  168. /// <param name="path">The path to the JSON configuration file</param>
  169. public void SaveConfig(string path)
  170. {
  171. File.WriteAllText(path, JsonHelper.Serialize(this, true));
  172. }
  173. }
  174. }