From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 8 Apr 2023 01:22:00 +0200 Subject: Move solution and projects to src --- Ryujinx.Common/Configuration/AntiAliasing.cs | 16 --- Ryujinx.Common/Configuration/AppDataManager.cs | 149 --------------------- .../Configuration/AspectRatioExtensions.cs | 63 --------- Ryujinx.Common/Configuration/BackendThreading.cs | 13 -- .../Configuration/DownloadableContentContainer.cs | 13 -- .../DownloadableContentJsonSerializerContext.cs | 11 -- .../Configuration/DownloadableContentNca.cs | 14 -- Ryujinx.Common/Configuration/GraphicsBackend.cs | 12 -- Ryujinx.Common/Configuration/GraphicsDebugLevel.cs | 14 -- .../Configuration/Hid/Controller/GamepadInputId.cs | 58 -------- .../Hid/Controller/GenericControllerInputConfig.cs | 82 ------------ .../Hid/Controller/JoyconConfigControllerStick.cs | 11 -- .../Motion/CemuHookMotionConfigController.cs | 30 ----- .../Motion/JsonMotionConfigControllerConverter.cs | 79 ----------- .../Controller/Motion/MotionConfigController.cs | 25 ---- .../Motion/MotionConfigJsonSerializerContext.cs | 12 -- .../Controller/Motion/MotionInputBackendType.cs | 13 -- .../Motion/StandardMotionConfigController.cs | 4 - .../Hid/Controller/RumbleConfigController.cs | 20 --- .../Controller/StandardControllerInputConfig.cs | 4 - .../Configuration/Hid/Controller/StickInputId.cs | 15 --- Ryujinx.Common/Configuration/Hid/ControllerType.cs | 23 ---- .../Hid/GenericInputConfigurationCommon.cs | 15 --- .../Configuration/Hid/InputBackendType.cs | 13 -- Ryujinx.Common/Configuration/Hid/InputConfig.cs | 41 ------ .../Hid/InputConfigJsonSerializerContext.cs | 14 -- .../Configuration/Hid/JsonInputConfigConverter.cs | 81 ----------- Ryujinx.Common/Configuration/Hid/Key.cs | 143 -------------------- .../Hid/Keyboard/GenericKeyboardInputConfig.cs | 15 --- .../Hid/Keyboard/JoyconConfigKeyboardStick.cs | 11 -- .../Hid/Keyboard/StandardKeyboardInputConfig.cs | 4 - .../Configuration/Hid/KeyboardHotkeys.cs | 17 --- .../Configuration/Hid/LeftJoyconCommonConfig.cs | 15 --- Ryujinx.Common/Configuration/Hid/PlayerIndex.cs | 22 --- .../Configuration/Hid/RightJoyconCommonConfig.cs | 15 --- Ryujinx.Common/Configuration/MemoryManagerMode.cs | 13 -- Ryujinx.Common/Configuration/ScalingFilter.cs | 13 -- .../Configuration/TitleUpdateMetadata.cs | 10 -- .../TitleUpdateMetadataJsonSerializerContext.cs | 10 -- 39 files changed, 1133 deletions(-) delete mode 100644 Ryujinx.Common/Configuration/AntiAliasing.cs delete mode 100644 Ryujinx.Common/Configuration/AppDataManager.cs delete mode 100644 Ryujinx.Common/Configuration/AspectRatioExtensions.cs delete mode 100644 Ryujinx.Common/Configuration/BackendThreading.cs delete mode 100644 Ryujinx.Common/Configuration/DownloadableContentContainer.cs delete mode 100644 Ryujinx.Common/Configuration/DownloadableContentJsonSerializerContext.cs delete mode 100644 Ryujinx.Common/Configuration/DownloadableContentNca.cs delete mode 100644 Ryujinx.Common/Configuration/GraphicsBackend.cs delete mode 100644 Ryujinx.Common/Configuration/GraphicsDebugLevel.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/GamepadInputId.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/GenericControllerInputConfig.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/JoyconConfigControllerStick.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/Motion/CemuHookMotionConfigController.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/Motion/JsonMotionConfigControllerConverter.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/Motion/MotionConfigController.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/Motion/MotionConfigJsonSerializerContext.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/Motion/MotionInputBackendType.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/Motion/StandardMotionConfigController.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/RumbleConfigController.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/StandardControllerInputConfig.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Controller/StickInputId.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/ControllerType.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/GenericInputConfigurationCommon.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/InputBackendType.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/InputConfig.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/InputConfigJsonSerializerContext.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/JsonInputConfigConverter.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Key.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Keyboard/GenericKeyboardInputConfig.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Keyboard/JoyconConfigKeyboardStick.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/Keyboard/StandardKeyboardInputConfig.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/KeyboardHotkeys.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/LeftJoyconCommonConfig.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/PlayerIndex.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/RightJoyconCommonConfig.cs delete mode 100644 Ryujinx.Common/Configuration/MemoryManagerMode.cs delete mode 100644 Ryujinx.Common/Configuration/ScalingFilter.cs delete mode 100644 Ryujinx.Common/Configuration/TitleUpdateMetadata.cs delete mode 100644 Ryujinx.Common/Configuration/TitleUpdateMetadataJsonSerializerContext.cs (limited to 'Ryujinx.Common/Configuration') diff --git a/Ryujinx.Common/Configuration/AntiAliasing.cs b/Ryujinx.Common/Configuration/AntiAliasing.cs deleted file mode 100644 index 159108ae..00000000 --- a/Ryujinx.Common/Configuration/AntiAliasing.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Ryujinx.Common.Utilities; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration -{ - [JsonConverter(typeof(TypedStringEnumConverter))] - public enum AntiAliasing - { - None, - Fxaa, - SmaaLow, - SmaaMedium, - SmaaHigh, - SmaaUltra - } -} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/AppDataManager.cs b/Ryujinx.Common/Configuration/AppDataManager.cs deleted file mode 100644 index d6e77843..00000000 --- a/Ryujinx.Common/Configuration/AppDataManager.cs +++ /dev/null @@ -1,149 +0,0 @@ -using Ryujinx.Common.Logging; -using System; -using System.IO; - -namespace Ryujinx.Common.Configuration -{ - public static class AppDataManager - { - public const string DefaultBaseDir = "Ryujinx"; - public const string DefaultPortableDir = "portable"; - - // The following 3 are always part of Base Directory - private const string GamesDir = "games"; - private const string ProfilesDir = "profiles"; - private const string KeysDir = "system"; - - public enum LaunchMode - { - UserProfile, - Portable, - Custom - } - - public static LaunchMode Mode { get; private set; } - - public static string BaseDirPath { get; private set; } - public static string GamesDirPath { get; private set; } - public static string ProfilesDirPath { get; private set; } - public static string KeysDirPath { get; private set; } - public static string KeysDirPathUser { get; } - - public const string DefaultNandDir = "bis"; - public const string DefaultSdcardDir = "sdcard"; - private const string DefaultModsDir = "mods"; - - public static string CustomModsPath { get; set; } - public static string CustomSdModsPath {get; set; } - public static string CustomNandPath { get; set; } // TODO: Actually implement this into VFS - public static string CustomSdCardPath { get; set; } // TODO: Actually implement this into VFS - - static AppDataManager() - { - KeysDirPathUser = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".switch"); - } - - public static void Initialize(string baseDirPath) - { - string appDataPath; - if (OperatingSystem.IsMacOS()) - { - appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Library", "Application Support"); - } - else - { - appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - } - - if (appDataPath.Length == 0) - { - appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); - } - - string userProfilePath = Path.Combine(appDataPath, DefaultBaseDir); - string portablePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, DefaultPortableDir); - - if (Directory.Exists(portablePath)) - { - BaseDirPath = portablePath; - Mode = LaunchMode.Portable; - } - else - { - BaseDirPath = userProfilePath; - Mode = LaunchMode.UserProfile; - } - - if (baseDirPath != null && baseDirPath != userProfilePath) - { - if (!Directory.Exists(baseDirPath)) - { - Logger.Error?.Print(LogClass.Application, $"Custom Data Directory '{baseDirPath}' does not exist. Falling back to {Mode}..."); - } - else - { - BaseDirPath = baseDirPath; - Mode = LaunchMode.Custom; - } - } - - BaseDirPath = Path.GetFullPath(BaseDirPath); // convert relative paths - - // NOTE: Moves the Ryujinx folder in `~/.config` to `~/Library/Application Support` if one is found - // and a Ryujinx folder does not already exist in Application Support. - // Also creates a symlink from `~/.config/Ryujinx` to `~/Library/Application Support/Ryujinx` to preserve backwards compatibility. - // This should be removed in the future. - if (OperatingSystem.IsMacOS() && Mode == LaunchMode.UserProfile) - { - string oldConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), DefaultBaseDir); - if (Path.Exists(oldConfigPath) && !Path.Exists(BaseDirPath)) - { - CopyDirectory(oldConfigPath, BaseDirPath); - Directory.Delete(oldConfigPath, true); - Directory.CreateSymbolicLink(oldConfigPath, BaseDirPath); - } - } - - SetupBasePaths(); - } - - private static void SetupBasePaths() - { - Directory.CreateDirectory(BaseDirPath); - Directory.CreateDirectory(GamesDirPath = Path.Combine(BaseDirPath, GamesDir)); - Directory.CreateDirectory(ProfilesDirPath = Path.Combine(BaseDirPath, ProfilesDir)); - Directory.CreateDirectory(KeysDirPath = Path.Combine(BaseDirPath, KeysDir)); - } - - private static void CopyDirectory(string sourceDir, string destinationDir) - { - var dir = new DirectoryInfo(sourceDir); - - if (!dir.Exists) - { - throw new DirectoryNotFoundException($"Source directory not found: {dir.FullName}"); - } - - DirectoryInfo[] subDirs = dir.GetDirectories(); - Directory.CreateDirectory(destinationDir); - - foreach (FileInfo file in dir.GetFiles()) - { - if (file.Name == ".DS_Store") - { - continue; - } - - file.CopyTo(Path.Combine(destinationDir, file.Name)); - } - - foreach (DirectoryInfo subDir in subDirs) - { - CopyDirectory(subDir.FullName, Path.Combine(destinationDir, subDir.Name)); - } - } - - public static string GetModsPath() => CustomModsPath ?? Directory.CreateDirectory(Path.Combine(BaseDirPath, DefaultModsDir)).FullName; - public static string GetSdModsPath() => CustomSdModsPath ?? Directory.CreateDirectory(Path.Combine(BaseDirPath, DefaultSdcardDir, "atmosphere")).FullName; - } -} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/AspectRatioExtensions.cs b/Ryujinx.Common/Configuration/AspectRatioExtensions.cs deleted file mode 100644 index 5e97ed19..00000000 --- a/Ryujinx.Common/Configuration/AspectRatioExtensions.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Ryujinx.Common.Utilities; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration -{ - [JsonConverter(typeof(TypedStringEnumConverter))] - public enum AspectRatio - { - Fixed4x3, - Fixed16x9, - Fixed16x10, - Fixed21x9, - Fixed32x9, - Stretched - } - - public static class AspectRatioExtensions - { - public static float ToFloat(this AspectRatio aspectRatio) - { - return aspectRatio.ToFloatX() / aspectRatio.ToFloatY(); - } - - public static float ToFloatX(this AspectRatio aspectRatio) - { - return aspectRatio switch - { - AspectRatio.Fixed4x3 => 4.0f, - AspectRatio.Fixed16x9 => 16.0f, - AspectRatio.Fixed16x10 => 16.0f, - AspectRatio.Fixed21x9 => 21.0f, - AspectRatio.Fixed32x9 => 32.0f, - _ => 16.0f - }; - } - - public static float ToFloatY(this AspectRatio aspectRatio) - { - return aspectRatio switch - { - AspectRatio.Fixed4x3 => 3.0f, - AspectRatio.Fixed16x9 => 9.0f, - AspectRatio.Fixed16x10 => 10.0f, - AspectRatio.Fixed21x9 => 9.0f, - AspectRatio.Fixed32x9 => 9.0f, - _ => 9.0f - }; - } - - public static string ToText(this AspectRatio aspectRatio) - { - return aspectRatio switch - { - AspectRatio.Fixed4x3 => "4:3", - AspectRatio.Fixed16x9 => "16:9", - AspectRatio.Fixed16x10 => "16:10", - AspectRatio.Fixed21x9 => "21:9", - AspectRatio.Fixed32x9 => "32:9", - _ => "Stretched" - }; - } - } -} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/BackendThreading.cs b/Ryujinx.Common/Configuration/BackendThreading.cs deleted file mode 100644 index 8833b3f0..00000000 --- a/Ryujinx.Common/Configuration/BackendThreading.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Ryujinx.Common.Utilities; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration -{ - [JsonConverter(typeof(TypedStringEnumConverter))] - public enum BackendThreading - { - Auto, - Off, - On - } -} diff --git a/Ryujinx.Common/Configuration/DownloadableContentContainer.cs b/Ryujinx.Common/Configuration/DownloadableContentContainer.cs deleted file mode 100644 index b6ae2f3f..00000000 --- a/Ryujinx.Common/Configuration/DownloadableContentContainer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration -{ - public struct DownloadableContentContainer - { - [JsonPropertyName("path")] - public string ContainerPath { get; set; } - [JsonPropertyName("dlc_nca_list")] - public List DownloadableContentNcaList { get; set; } - } -} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/DownloadableContentJsonSerializerContext.cs b/Ryujinx.Common/Configuration/DownloadableContentJsonSerializerContext.cs deleted file mode 100644 index 132c45a4..00000000 --- a/Ryujinx.Common/Configuration/DownloadableContentJsonSerializerContext.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration -{ - [JsonSourceGenerationOptions(WriteIndented = true)] - [JsonSerializable(typeof(List))] - public partial class DownloadableContentJsonSerializerContext : JsonSerializerContext - { - } -} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/DownloadableContentNca.cs b/Ryujinx.Common/Configuration/DownloadableContentNca.cs deleted file mode 100644 index 80b67300..00000000 --- a/Ryujinx.Common/Configuration/DownloadableContentNca.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration -{ - public struct DownloadableContentNca - { - [JsonPropertyName("path")] - public string FullPath { get; set; } - [JsonPropertyName("title_id")] - public ulong TitleId { get; set; } - [JsonPropertyName("is_enabled")] - public bool Enabled { get; set; } - } -} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/GraphicsBackend.cs b/Ryujinx.Common/Configuration/GraphicsBackend.cs deleted file mode 100644 index d74dd6e1..00000000 --- a/Ryujinx.Common/Configuration/GraphicsBackend.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Ryujinx.Common.Utilities; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration -{ - [JsonConverter(typeof(TypedStringEnumConverter))] - public enum GraphicsBackend - { - Vulkan, - OpenGl - } -} diff --git a/Ryujinx.Common/Configuration/GraphicsDebugLevel.cs b/Ryujinx.Common/Configuration/GraphicsDebugLevel.cs deleted file mode 100644 index ad12302a..00000000 --- a/Ryujinx.Common/Configuration/GraphicsDebugLevel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Ryujinx.Common.Utilities; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration -{ - [JsonConverter(typeof(TypedStringEnumConverter))] - public enum GraphicsDebugLevel - { - None, - Error, - Slowdowns, - All - } -} diff --git a/Ryujinx.Common/Configuration/Hid/Controller/GamepadInputId.cs b/Ryujinx.Common/Configuration/Hid/Controller/GamepadInputId.cs deleted file mode 100644 index ad1fa667..00000000 --- a/Ryujinx.Common/Configuration/Hid/Controller/GamepadInputId.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Ryujinx.Common.Utilities; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration.Hid.Controller -{ - [JsonConverter(typeof(TypedStringEnumConverter))] - public enum GamepadInputId : byte - { - Unbound, - A, - B, - X, - Y, - LeftStick, - RightStick, - LeftShoulder, - RightShoulder, - - // Likely axis - LeftTrigger, - // Likely axis - RightTrigger, - - DpadUp, - DpadDown, - DpadLeft, - DpadRight, - - // Special buttons - - Minus, - Plus, - - Back = Minus, - Start = Plus, - - Guide, - Misc1, - - // Xbox Elite paddle - Paddle1, - Paddle2, - Paddle3, - Paddle4, - - // PS5 touchpad button - Touchpad, - - // Virtual buttons for single joycon - SingleLeftTrigger0, - SingleRightTrigger0, - - SingleLeftTrigger1, - SingleRightTrigger1, - - Count - } -} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/Controller/GenericControllerInputConfig.cs b/Ryujinx.Common/Configuration/Hid/Controller/GenericControllerInputConfig.cs deleted file mode 100644 index d7f0e788..00000000 --- a/Ryujinx.Common/Configuration/Hid/Controller/GenericControllerInputConfig.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Ryujinx.Common.Configuration.Hid.Controller.Motion; -using System; -using System.Text.Json.Serialization; - -namespace Ryujinx.Common.Configuration.Hid.Controller -{ - public class GenericControllerInputConfig : GenericInputConfigurationCommon