From a7dae8dd7df21c6259b00a92cfca5340cf164659 Mon Sep 17 00:00:00 2001 From: ParantezTech <12572227+par274@users.noreply.github.com> Date: Mon, 3 Aug 2026 01:06:36 +0300 Subject: [PATCH] [gui] added renderdoc toggle and debug group --- src/SharpEmu.GUI/Languages/en.json | 3 + src/SharpEmu.GUI/MainWindow.GameOptions.cs | 2 + src/SharpEmu.GUI/MainWindow.axaml | 87 ++++++++++++-------- src/SharpEmu.GUI/MainWindow.axaml.cs | 31 +++++++ src/SharpEmu.GUI/Themes/Styles/Options.axaml | 21 +++++ 5 files changed, 111 insertions(+), 33 deletions(-) diff --git a/src/SharpEmu.GUI/Languages/en.json b/src/SharpEmu.GUI/Languages/en.json index f0b8af9f..d1a54b1d 100644 --- a/src/SharpEmu.GUI/Languages/en.json +++ b/src/SharpEmu.GUI/Languages/en.json @@ -44,6 +44,9 @@ "Options.Env.LogDirectMemory.Desc": "Log direct memory allocations and failures to the console.\nUse when a game aborts or exits during boot.", "Options.Env.LogIo.Desc": "Log file open, read, and path-resolve activity to the console.\nUse when a game cannot find its data files during boot.", "Options.Env.LogNp.Desc": "Log NP (PlayStation Network) library calls to the console.", + "Options.Env.Group.Debug": "Debug", + "Options.Env.Group.General": "General", + "Options.Env.RenderDoc.Desc": "Load the RenderDoc in-application API so frames can be captured from inside the emulator.\nPress F10 while the game runs to capture one frame; captures land in user/logs/capture_logs/.\nRequires RenderDoc to be installed. Slows the GPU down and hangs some titles, so leave it off unless you are debugging.", "Options.Env.GuestImageCpuSync.Desc": "Re-upload guest surfaces the game's own CPU code rewrites.\nLeave off normally. Turn on for titles whose CPU-drawn surfaces never reach the screen.\nCosts performance and regresses some titles, such as GTA V.", "Options.DefaultProfile.Label": "Default profile name", "Options.DefaultProfile.Desc": "Name used when a game asks for text input. Defaults to Sharp.", diff --git a/src/SharpEmu.GUI/MainWindow.GameOptions.cs b/src/SharpEmu.GUI/MainWindow.GameOptions.cs index 00589720..3c32c88c 100644 --- a/src/SharpEmu.GUI/MainWindow.GameOptions.cs +++ b/src/SharpEmu.GUI/MainWindow.GameOptions.cs @@ -22,6 +22,7 @@ public partial class MainWindow "SHARPEMU_LOG_IO", "SHARPEMU_LOG_NP", "SHARPEMU_GUEST_IMAGE_CPU_SYNC", + "SHARPEMU_RENDERDOC", ]; private readonly List _gameEnvironmentPassthrough = new(); @@ -482,6 +483,7 @@ public partial class MainWindow ("SHARPEMU_LOG_IO", GameEnvLogIoToggle), ("SHARPEMU_LOG_NP", GameEnvLogNpToggle), ("SHARPEMU_GUEST_IMAGE_CPU_SYNC", GameEnvGuestImageCpuSyncToggle), + ("SHARPEMU_RENDERDOC", GameEnvRenderDocToggle), ]; private static void SetGameOptionsOpenClass(Control control, bool active) => diff --git a/src/SharpEmu.GUI/MainWindow.axaml b/src/SharpEmu.GUI/MainWindow.axaml index 02d724b3..4feac877 100644 --- a/src/SharpEmu.GUI/MainWindow.axaml +++ b/src/SharpEmu.GUI/MainWindow.axaml @@ -892,28 +892,13 @@ SPDX-License-Identifier: GPL-2.0-or-later + - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + - diff --git a/src/SharpEmu.GUI/MainWindow.axaml.cs b/src/SharpEmu.GUI/MainWindow.axaml.cs index 1d2e37df..ade9f5f1 100644 --- a/src/SharpEmu.GUI/MainWindow.axaml.cs +++ b/src/SharpEmu.GUI/MainWindow.axaml.cs @@ -309,6 +309,35 @@ public partial class MainWindow : Window Closing += (_, _) => BeginWindowClosing(); Closed += (_, _) => CompleteWindowClosing(); + SdlLauncherGamepad.EnsureStarted(); + _gamepadTimer = new DispatcherTimer + { + Interval = TimeSpan.FromMilliseconds(50), + }; + EnvRenderDocToggle.IsCheckedChanged += (_, _) => + + SetEnvironmentToggle( + "SHARPEMU_RENDERDOC", + EnvRenderDocToggle.IsChecked == true); + DefaultProfileBox.TextChanged += (_, _) => + _settings.DefaultProfile = GuiSettings.NormalizeDefaultProfile(DefaultProfileBox.Text); + LanguageBox.SelectionChanged += (_, _) => OnLanguageChanged(); + + GameList.AddHandler(ContextRequestedEvent, OnGameContextRequested, RoutingStrategies.Tunnel); + AddHandler(KeyDownEvent, OnPreviewKeyDown, RoutingStrategies.Tunnel); + CtxLaunch.Click += (_, _) => LaunchSelected(); + CtxOpenFolder.Click += (_, _) => OpenSelectedGameFolder(); + CtxCopyPath.Click += async (_, _) => + await CopyToClipboardAsync((GameList.SelectedItem as GameEntry)?.Path); + CtxCopyTitleId.Click += async (_, _) => + await CopyToClipboardAsync((GameList.SelectedItem as GameEntry)?.TitleId); + CtxGameSettings.Click += (_, _) => OpenSelectedGameSettings(); + CtxRemove.Click += (_, _) => RemoveSelectedFromLibrary(); + + Opened += async (_, _) => await OnOpenedAsync(); + Closing += (_, _) => BeginWindowClosing(); + Closed += (_, _) => CompleteWindowClosing(); + SdlLauncherGamepad.EnsureStarted(); _gamepadTimer = new DispatcherTimer { @@ -1184,6 +1213,8 @@ public partial class MainWindow : Window EnvLogNpToggle.IsChecked = _settings.EnvironmentToggles.Contains("SHARPEMU_LOG_NP"); EnvGuestImageCpuSyncToggle.IsChecked = _settings.EnvironmentToggles.Contains("SHARPEMU_GUEST_IMAGE_CPU_SYNC"); + EnvRenderDocToggle.IsChecked = + _settings.EnvironmentToggles.Contains("SHARPEMU_RENDERDOC"); DefaultProfileBox.Text = _settings.DefaultProfile; WindowModeBox.SelectedIndex = ChoiceIndex(_settings.WindowMode, "Windowed", "Borderless", "Exclusive"); LoadHostDisplayOptions(); diff --git a/src/SharpEmu.GUI/Themes/Styles/Options.axaml b/src/SharpEmu.GUI/Themes/Styles/Options.axaml index 878df3f7..c065c254 100644 --- a/src/SharpEmu.GUI/Themes/Styles/Options.axaml +++ b/src/SharpEmu.GUI/Themes/Styles/Options.axaml @@ -42,6 +42,27 @@ Options page section transitions and content layout + + + +