mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-17 01:30:54 -05:00
Significant changes include LDN functionality from @Vudjun (no more separate build!) and an XCI trimmer from @amurgshere. Merged PRs in this release (in the order they were merged): #183, #150, #105, #160, #188, #98, #158, #13, #216, #73, #217, #122, #228, #65, #226, #236, #247, #243, #249, #242, #260, #273, #272, #262, #259, #241 ## Versioning: There now exists "stable" (release branch) and ["canary" (master branch)](https://github.com/GreemDev/Ryujinx-Canary/releases) versions. Instead of everyone using the same emulator, getting updates for every code change, you now *opt-in* to the more frequent updates by using the Canary version. Use stable and you'll get about an update a week, but that update will be MUCH more significant as it's the entire previous week's changes & PR merges. ## LDN LDN functionality is now merged! Use [this](https://github.com/GreemDev/Ryujinx/wiki/Multiplayer%E2%80%90(LDN%E2%80%90Local%E2%80%90Wireless)%E2%80%90Guide) to get started. Please note that LDN is only for local wireless; **this is not a Nintendo Switch Online emulation feature**. ## UI - Added an XCI trimmer (#105). - You can use this feature to trim dead bytes & the embedded firmware out of your dumped XCIs, to make them smaller. - If you right-click an XCI and the trim button it is greyed out, that means your XCI is already as small as possible. - Fix for fullscreen not being really fullscreen (#150) - Fix window sizing calculations when Show Title Bar is enabled (#247) - The "Install/Uninstall file types" buttons will be enabled/disabled depending on which one you contextually need; install will be clickable when they aren't installed, and vice versa. - Fix for showing default config screen when swapping players in controller settings (#122) - Command-line argument to prevent update checking `--hide-updates` (#272) - # RPC: - Added a LOT of game images to Discord RPC. - Play time will now show the time unit hours at a maximum. ## Localization - Update outdated/incorrect & added missing translations for zh-TW (#158) - Add many missing locale strings to all languages (#160) - Update & improve Korean translation (#226) - Minor fixes & add missing translations to Spanish translation (#242) ## Headless - Added `ignore-controller-applet` as an option you can configure via headless command-line options. ## Graphics Backend - ### Vulkan - fix divide-by-zero when recovering from missed draw (#235) - fixes crash in 'Baldo: The Guardian Owls' opening cutscene ## Horizon - fix crash that occurs when launching an NSP forwarder generated by Nro2Nsp (#237) # Nerd Zone Slightly more technical information. If you don't understand what's under here, no worry. - Updater now uses the release's Tag Name instead of its Name for version checking. - Baked in value change logging into ReactiveObject. - Split ConfigurationState into 3, smaller partial classes of the same name. - Specify if the current version is Canary in the version log line --------- Co-authored-by: James Duarte <GarnetSunset@users.noreply.github.com> Co-authored-by: Luke Warner <65521430+LukeWarnut@users.noreply.github.com> Co-authored-by: TheToid <amurgshere@gmail.com> Co-authored-by: GabCoolGuy <gabrielfreville@proton.me> Co-authored-by: Kekschen <52585984+Kek5chen@users.noreply.github.com> Co-authored-by: WilliamWsyHK <WilliamWsyHK@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacobwasbeast <38381609+Jacobwasbeast@users.noreply.github.com> Co-authored-by: Piplup <100526773+piplup55@users.noreply.github.com> Co-authored-by: Vladimir Sokolov <tehnicalmailone@gmail.com> Co-authored-by: Jonas Henriksson <gr3ger@gmail.com> Co-authored-by: Vudjun <Vudjun@users.noreply.github.com> Co-authored-by: extherian <extherian@gmail.com> Co-authored-by: Hack茶ん <120134269+Hackjjang@users.noreply.github.com> Co-authored-by: EmulationEnjoyer <144477224+EmulationEnjoyer@users.noreply.github.com> Co-authored-by: Nicola <61830443+nicola02nb@users.noreply.github.com> Co-authored-by: jzumaran <juan.zumaran@gitz.cl> Co-authored-by: Pitchoune <yrigaud@icloud.com> Co-authored-by: Narugakuruga <31060534+Narugakuruga@users.noreply.github.com>
319 lines
14 KiB
C#
319 lines
14 KiB
C#
using ARMeilleure;
|
|
using Ryujinx.Common.Configuration;
|
|
using Ryujinx.Common.Configuration.Hid;
|
|
using Ryujinx.Common.Configuration.Hid.Controller;
|
|
using Ryujinx.Common.Configuration.Hid.Keyboard;
|
|
using Ryujinx.Common.Configuration.Multiplayer;
|
|
using Ryujinx.Common.Logging;
|
|
using Ryujinx.Graphics.Vulkan;
|
|
using Ryujinx.HLE;
|
|
using Ryujinx.UI.Common.Configuration.System;
|
|
using Ryujinx.UI.Common.Configuration.UI;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Ryujinx.UI.Common.Configuration
|
|
{
|
|
public partial class ConfigurationState
|
|
{
|
|
public static void Initialize()
|
|
{
|
|
if (Instance != null)
|
|
{
|
|
throw new InvalidOperationException("Configuration is already initialized");
|
|
}
|
|
|
|
Instance = new ConfigurationState();
|
|
}
|
|
|
|
public ConfigurationFileFormat ToFileFormat()
|
|
{
|
|
ConfigurationFileFormat configurationFile = new()
|
|
{
|
|
Version = ConfigurationFileFormat.CurrentVersion,
|
|
BackendThreading = Graphics.BackendThreading,
|
|
EnableFileLog = Logger.EnableFileLog,
|
|
ResScale = Graphics.ResScale,
|
|
ResScaleCustom = Graphics.ResScaleCustom,
|
|
MaxAnisotropy = Graphics.MaxAnisotropy,
|
|
AspectRatio = Graphics.AspectRatio,
|
|
AntiAliasing = Graphics.AntiAliasing,
|
|
ScalingFilter = Graphics.ScalingFilter,
|
|
ScalingFilterLevel = Graphics.ScalingFilterLevel,
|
|
GraphicsShadersDumpPath = Graphics.ShadersDumpPath,
|
|
LoggingEnableDebug = Logger.EnableDebug,
|
|
LoggingEnableStub = Logger.EnableStub,
|
|
LoggingEnableInfo = Logger.EnableInfo,
|
|
LoggingEnableWarn = Logger.EnableWarn,
|
|
LoggingEnableError = Logger.EnableError,
|
|
LoggingEnableTrace = Logger.EnableTrace,
|
|
LoggingEnableGuest = Logger.EnableGuest,
|
|
LoggingEnableFsAccessLog = Logger.EnableFsAccessLog,
|
|
LoggingFilteredClasses = Logger.FilteredClasses,
|
|
LoggingGraphicsDebugLevel = Logger.GraphicsDebugLevel,
|
|
SystemLanguage = System.Language,
|
|
SystemRegion = System.Region,
|
|
SystemTimeZone = System.TimeZone,
|
|
SystemTimeOffset = System.SystemTimeOffset,
|
|
DockedMode = System.EnableDockedMode,
|
|
EnableDiscordIntegration = EnableDiscordIntegration,
|
|
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
|
ShowConfirmExit = ShowConfirmExit,
|
|
IgnoreApplet = IgnoreApplet,
|
|
RememberWindowState = RememberWindowState,
|
|
ShowTitleBar = ShowTitleBar,
|
|
EnableHardwareAcceleration = EnableHardwareAcceleration,
|
|
HideCursor = HideCursor,
|
|
EnableVsync = Graphics.EnableVsync,
|
|
EnableShaderCache = Graphics.EnableShaderCache,
|
|
EnableTextureRecompression = Graphics.EnableTextureRecompression,
|
|
EnableMacroHLE = Graphics.EnableMacroHLE,
|
|
EnableColorSpacePassthrough = Graphics.EnableColorSpacePassthrough,
|
|
EnablePtc = System.EnablePtc,
|
|
EnableLowPowerPtc = System.EnableLowPowerPtc,
|
|
EnableInternetAccess = System.EnableInternetAccess,
|
|
EnableFsIntegrityChecks = System.EnableFsIntegrityChecks,
|
|
FsGlobalAccessLogMode = System.FsGlobalAccessLogMode,
|
|
AudioBackend = System.AudioBackend,
|
|
AudioVolume = System.AudioVolume,
|
|
MemoryManagerMode = System.MemoryManagerMode,
|
|
DramSize = System.DramSize,
|
|
IgnoreMissingServices = System.IgnoreMissingServices,
|
|
UseHypervisor = System.UseHypervisor,
|
|
GuiColumns = new GuiColumns
|
|
{
|
|
FavColumn = UI.GuiColumns.FavColumn,
|
|
IconColumn = UI.GuiColumns.IconColumn,
|
|
AppColumn = UI.GuiColumns.AppColumn,
|
|
DevColumn = UI.GuiColumns.DevColumn,
|
|
VersionColumn = UI.GuiColumns.VersionColumn,
|
|
LdnInfoColumn = UI.GuiColumns.LdnInfoColumn,
|
|
TimePlayedColumn = UI.GuiColumns.TimePlayedColumn,
|
|
LastPlayedColumn = UI.GuiColumns.LastPlayedColumn,
|
|
FileExtColumn = UI.GuiColumns.FileExtColumn,
|
|
FileSizeColumn = UI.GuiColumns.FileSizeColumn,
|
|
PathColumn = UI.GuiColumns.PathColumn,
|
|
},
|
|
ColumnSort = new ColumnSort
|
|
{
|
|
SortColumnId = UI.ColumnSort.SortColumnId,
|
|
SortAscending = UI.ColumnSort.SortAscending,
|
|
},
|
|
GameDirs = UI.GameDirs,
|
|
AutoloadDirs = UI.AutoloadDirs,
|
|
ShownFileTypes = new ShownFileTypes
|
|
{
|
|
NSP = UI.ShownFileTypes.NSP,
|
|
PFS0 = UI.ShownFileTypes.PFS0,
|
|
XCI = UI.ShownFileTypes.XCI,
|
|
NCA = UI.ShownFileTypes.NCA,
|
|
NRO = UI.ShownFileTypes.NRO,
|
|
NSO = UI.ShownFileTypes.NSO,
|
|
},
|
|
WindowStartup = new WindowStartup
|
|
{
|
|
WindowSizeWidth = UI.WindowStartup.WindowSizeWidth,
|
|
WindowSizeHeight = UI.WindowStartup.WindowSizeHeight,
|
|
WindowPositionX = UI.WindowStartup.WindowPositionX,
|
|
WindowPositionY = UI.WindowStartup.WindowPositionY,
|
|
WindowMaximized = UI.WindowStartup.WindowMaximized,
|
|
},
|
|
LanguageCode = UI.LanguageCode,
|
|
BaseStyle = UI.BaseStyle,
|
|
GameListViewMode = UI.GameListViewMode,
|
|
ShowNames = UI.ShowNames,
|
|
GridSize = UI.GridSize,
|
|
ApplicationSort = UI.ApplicationSort,
|
|
IsAscendingOrder = UI.IsAscendingOrder,
|
|
StartFullscreen = UI.StartFullscreen,
|
|
ShowConsole = UI.ShowConsole,
|
|
EnableKeyboard = Hid.EnableKeyboard,
|
|
EnableMouse = Hid.EnableMouse,
|
|
Hotkeys = Hid.Hotkeys,
|
|
KeyboardConfig = [],
|
|
ControllerConfig = [],
|
|
InputConfig = Hid.InputConfig,
|
|
GraphicsBackend = Graphics.GraphicsBackend,
|
|
PreferredGpu = Graphics.PreferredGpu,
|
|
MultiplayerLanInterfaceId = Multiplayer.LanInterfaceId,
|
|
MultiplayerMode = Multiplayer.Mode,
|
|
MultiplayerDisableP2p = Multiplayer.DisableP2p,
|
|
MultiplayerLdnPassphrase = Multiplayer.LdnPassphrase,
|
|
LdnServer = Multiplayer.LdnServer,
|
|
};
|
|
|
|
return configurationFile;
|
|
}
|
|
|
|
public void LoadDefault()
|
|
{
|
|
Logger.EnableFileLog.Value = true;
|
|
Graphics.BackendThreading.Value = BackendThreading.Auto;
|
|
Graphics.ResScale.Value = 1;
|
|
Graphics.ResScaleCustom.Value = 1.0f;
|
|
Graphics.MaxAnisotropy.Value = -1.0f;
|
|
Graphics.AspectRatio.Value = AspectRatio.Fixed16x9;
|
|
Graphics.GraphicsBackend.Value = DefaultGraphicsBackend();
|
|
Graphics.PreferredGpu.Value = string.Empty;
|
|
Graphics.ShadersDumpPath.Value = string.Empty;
|
|
Logger.EnableDebug.Value = false;
|
|
Logger.EnableStub.Value = true;
|
|
Logger.EnableInfo.Value = true;
|
|
Logger.EnableWarn.Value = true;
|
|
Logger.EnableError.Value = true;
|
|
Logger.EnableTrace.Value = false;
|
|
Logger.EnableGuest.Value = true;
|
|
Logger.EnableFsAccessLog.Value = false;
|
|
Logger.FilteredClasses.Value = [];
|
|
Logger.GraphicsDebugLevel.Value = GraphicsDebugLevel.None;
|
|
System.Language.Value = Language.AmericanEnglish;
|
|
System.Region.Value = Region.USA;
|
|
System.TimeZone.Value = "UTC";
|
|
System.SystemTimeOffset.Value = 0;
|
|
System.EnableDockedMode.Value = true;
|
|
EnableDiscordIntegration.Value = true;
|
|
CheckUpdatesOnStart.Value = true;
|
|
ShowConfirmExit.Value = true;
|
|
IgnoreApplet.Value = false;
|
|
RememberWindowState.Value = true;
|
|
ShowTitleBar.Value = !OperatingSystem.IsWindows();
|
|
EnableHardwareAcceleration.Value = true;
|
|
HideCursor.Value = HideCursorMode.OnIdle;
|
|
Graphics.EnableVsync.Value = true;
|
|
Graphics.EnableShaderCache.Value = true;
|
|
Graphics.EnableTextureRecompression.Value = false;
|
|
Graphics.EnableMacroHLE.Value = true;
|
|
Graphics.EnableColorSpacePassthrough.Value = false;
|
|
Graphics.AntiAliasing.Value = AntiAliasing.None;
|
|
Graphics.ScalingFilter.Value = ScalingFilter.Bilinear;
|
|
Graphics.ScalingFilterLevel.Value = 80;
|
|
System.EnablePtc.Value = true;
|
|
System.EnableInternetAccess.Value = false;
|
|
System.EnableFsIntegrityChecks.Value = true;
|
|
System.FsGlobalAccessLogMode.Value = 0;
|
|
System.AudioBackend.Value = AudioBackend.SDL2;
|
|
System.AudioVolume.Value = 1;
|
|
System.MemoryManagerMode.Value = MemoryManagerMode.HostMappedUnsafe;
|
|
System.DramSize.Value = MemoryConfiguration.MemoryConfiguration4GiB;
|
|
System.IgnoreMissingServices.Value = false;
|
|
System.UseHypervisor.Value = true;
|
|
Multiplayer.LanInterfaceId.Value = "0";
|
|
Multiplayer.Mode.Value = MultiplayerMode.Disabled;
|
|
Multiplayer.DisableP2p.Value = false;
|
|
Multiplayer.LdnPassphrase.Value = "";
|
|
Multiplayer.LdnServer.Value = "";
|
|
UI.GuiColumns.FavColumn.Value = true;
|
|
UI.GuiColumns.IconColumn.Value = true;
|
|
UI.GuiColumns.AppColumn.Value = true;
|
|
UI.GuiColumns.DevColumn.Value = true;
|
|
UI.GuiColumns.VersionColumn.Value = true;
|
|
UI.GuiColumns.TimePlayedColumn.Value = true;
|
|
UI.GuiColumns.LastPlayedColumn.Value = true;
|
|
UI.GuiColumns.FileExtColumn.Value = true;
|
|
UI.GuiColumns.FileSizeColumn.Value = true;
|
|
UI.GuiColumns.PathColumn.Value = true;
|
|
UI.ColumnSort.SortColumnId.Value = 0;
|
|
UI.ColumnSort.SortAscending.Value = false;
|
|
UI.GameDirs.Value = [];
|
|
UI.AutoloadDirs.Value = [];
|
|
UI.ShownFileTypes.NSP.Value = true;
|
|
UI.ShownFileTypes.PFS0.Value = true;
|
|
UI.ShownFileTypes.XCI.Value = true;
|
|
UI.ShownFileTypes.NCA.Value = true;
|
|
UI.ShownFileTypes.NRO.Value = true;
|
|
UI.ShownFileTypes.NSO.Value = true;
|
|
UI.LanguageCode.Value = "en_US";
|
|
UI.BaseStyle.Value = "Dark";
|
|
UI.GameListViewMode.Value = 0;
|
|
UI.ShowNames.Value = true;
|
|
UI.GridSize.Value = 2;
|
|
UI.ApplicationSort.Value = 0;
|
|
UI.IsAscendingOrder.Value = true;
|
|
UI.StartFullscreen.Value = false;
|
|
UI.ShowConsole.Value = true;
|
|
UI.WindowStartup.WindowSizeWidth.Value = 1280;
|
|
UI.WindowStartup.WindowSizeHeight.Value = 760;
|
|
UI.WindowStartup.WindowPositionX.Value = 0;
|
|
UI.WindowStartup.WindowPositionY.Value = 0;
|
|
UI.WindowStartup.WindowMaximized.Value = false;
|
|
Hid.EnableKeyboard.Value = false;
|
|
Hid.EnableMouse.Value = false;
|
|
Hid.Hotkeys.Value = new KeyboardHotkeys
|
|
{
|
|
ToggleVsync = Key.F1,
|
|
ToggleMute = Key.F2,
|
|
Screenshot = Key.F8,
|
|
ShowUI = Key.F4,
|
|
Pause = Key.F5,
|
|
ResScaleUp = Key.Unbound,
|
|
ResScaleDown = Key.Unbound,
|
|
VolumeUp = Key.Unbound,
|
|
VolumeDown = Key.Unbound,
|
|
};
|
|
Hid.InputConfig.Value =
|
|
[
|
|
new StandardKeyboardInputConfig
|
|
{
|
|
Version = InputConfig.CurrentVersion,
|
|
Backend = InputBackendType.WindowKeyboard,
|
|
Id = "0",
|
|
PlayerIndex = PlayerIndex.Player1,
|
|
ControllerType = ControllerType.ProController,
|
|
LeftJoycon = new LeftJoyconCommonConfig<Key>
|
|
{
|
|
DpadUp = Key.Up,
|
|
DpadDown = Key.Down,
|
|
DpadLeft = Key.Left,
|
|
DpadRight = Key.Right,
|
|
ButtonMinus = Key.Minus,
|
|
ButtonL = Key.E,
|
|
ButtonZl = Key.Q,
|
|
ButtonSl = Key.Unbound,
|
|
ButtonSr = Key.Unbound,
|
|
},
|
|
LeftJoyconStick = new JoyconConfigKeyboardStick<Key>
|
|
{
|
|
StickUp = Key.W,
|
|
StickDown = Key.S,
|
|
StickLeft = Key.A,
|
|
StickRight = Key.D,
|
|
StickButton = Key.F,
|
|
},
|
|
RightJoycon = new RightJoyconCommonConfig<Key>
|
|
{
|
|
ButtonA = Key.Z,
|
|
ButtonB = Key.X,
|
|
ButtonX = Key.C,
|
|
ButtonY = Key.V,
|
|
ButtonPlus = Key.Plus,
|
|
ButtonR = Key.U,
|
|
ButtonZr = Key.O,
|
|
ButtonSl = Key.Unbound,
|
|
ButtonSr = Key.Unbound,
|
|
},
|
|
RightJoyconStick = new JoyconConfigKeyboardStick<Key>
|
|
{
|
|
StickUp = Key.I,
|
|
StickDown = Key.K,
|
|
StickLeft = Key.J,
|
|
StickRight = Key.L,
|
|
StickButton = Key.H,
|
|
},
|
|
}
|
|
];
|
|
}
|
|
|
|
private static GraphicsBackend DefaultGraphicsBackend()
|
|
{
|
|
// Any system running macOS or returning any amount of valid Vulkan devices should default to Vulkan.
|
|
// Checks for if the Vulkan version and featureset is compatible should be performed within VulkanRenderer.
|
|
if (OperatingSystem.IsMacOS() || VulkanRenderer.GetPhysicalDevices().Length > 0)
|
|
{
|
|
return GraphicsBackend.Vulkan;
|
|
}
|
|
|
|
return GraphicsBackend.OpenGl;
|
|
}
|
|
}
|
|
}
|