Compare commits

...

3 commits

Author SHA1 Message Date
Evan Husted
cb170ab054
Merge branch 'master' into net90 2024-12-04 18:09:28 -06:00
Evan Husted
1d0152b961 UI: Move Shader Compilation hint, graphics backend, and GPU manufacturer to the right side of the status bar, next to firmware version.
Some checks failed
Canary release job / Create tag (push) Has been cancelled
Canary release job / Release for linux-arm64 (push) Has been cancelled
Canary release job / Release for linux-x64 (push) Has been cancelled
Canary release job / Release for win-x64 (push) Has been cancelled
Canary release job / Release MacOS universal (push) Has been cancelled
Removed the "Game:" prefix in front of FPS.
2024-12-04 03:37:21 -06:00
Evan Husted
07690e4527 chore: applets: Cleanup redundant ReadStruct implementations & provide a default implementation for IApplet#GetResult. 2024-12-04 02:24:40 -06:00
36 changed files with 59 additions and 111 deletions

View file

@ -38,7 +38,7 @@
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
<PackageVersion Include="Gommon" Version="2.6.6" />
<PackageVersion Include="Gommon" Version="2.6.8" />
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
<PackageVersion Include="shaderc.net" Version="0.1.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.2" />

View file

@ -24,11 +24,9 @@ namespace Ryujinx.HLE.HOS.Applets
case AppletId.SoftwareKeyboard:
return new SoftwareKeyboardApplet(system);
case AppletId.LibAppletWeb:
return new BrowserApplet(system);
case AppletId.LibAppletShop:
return new BrowserApplet(system);
case AppletId.LibAppletOff:
return new BrowserApplet(system);
return new BrowserApplet();
case AppletId.MiiEdit:
Logger.Warning?.Print(LogClass.Application, $"Please use the MiiEdit inside File/Open Applet");
return new DummyApplet(system);

View file

@ -18,13 +18,6 @@ namespace Ryujinx.HLE.HOS.Applets.Browser
private List<BrowserArgument> _arguments;
private ShimKind _shimKind;
public BrowserApplet(Horizon system) { }
public ResultCode GetResult()
{
return ResultCode.Success;
}
public ResultCode Start(AppletSession normalSession, AppletSession interactiveSession)
{
_normalSession = normalSession;

View file

@ -125,19 +125,6 @@ namespace Ryujinx.HLE.HOS.Applets.Cabinet
return bytes;
}
public static T ReadStruct<T>(byte[] data) where T : unmanaged
{
if (data.Length < Unsafe.SizeOf<T>())
{
throw new ArgumentException("Not enough data to read the struct");
}
fixed (byte* dataPtr = data)
{
return Unsafe.Read<T>(dataPtr);
}
}
#region Structs
[StructLayout(LayoutKind.Sequential, Pack = 1)]

View file

@ -117,11 +117,6 @@ namespace Ryujinx.HLE.HOS.Applets
return ResultCode.Success;
}
public ResultCode GetResult()
{
return ResultCode.Success;
}
private static byte[] BuildResponse(ControllerSupportResultInfo result)
{
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();

View file

@ -11,11 +11,14 @@ namespace Ryujinx.HLE.HOS.Applets.Dummy
{
private readonly Horizon _system;
private AppletSession _normalSession;
public event EventHandler AppletStateChanged;
public DummyApplet(Horizon system)
{
_system = system;
}
public ResultCode Start(AppletSession normalSession, AppletSession interactiveSession)
{
_normalSession = normalSession;
@ -24,10 +27,7 @@ namespace Ryujinx.HLE.HOS.Applets.Dummy
_system.ReturnFocus();
return ResultCode.Success;
}
private static T ReadStruct<T>(byte[] data) where T : struct
{
return MemoryMarshal.Read<T>(data.AsSpan());
}
private static byte[] BuildResponse()
{
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
@ -35,9 +35,5 @@ namespace Ryujinx.HLE.HOS.Applets.Dummy
writer.Write((ulong)ResultCode.Success);
return stream.ToArray();
}
public ResultCode GetResult()
{
return ResultCode.Success;
}
}
}

View file

@ -203,10 +203,5 @@ namespace Ryujinx.HLE.HOS.Applets.Error
_horizon.Device.UIHandler.DisplayErrorAppletDialog($"Error Number: {applicationErrorArg.ErrorNumber} (Details)", "\n" + detailsText, buttons.ToArray());
}
}
public ResultCode GetResult()
{
return ResultCode.Success;
}
}
}

View file

@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Applets
ResultCode Start(AppletSession normalSession,
AppletSession interactiveSession);
ResultCode GetResult();
ResultCode GetResult() => ResultCode.Success;
bool DrawTo(RenderingSurfaceInfo surfaceInfo, IVirtualMemoryManager destination, ulong position) => false;

View file

@ -37,11 +37,6 @@ namespace Ryujinx.HLE.HOS.Applets
return ResultCode.Success;
}
public ResultCode GetResult()
{
return ResultCode.Success;
}
private byte[] BuildResponse()
{
UserProfile currentUser = _system.AccountManager.LastOpenedUser;

View file

@ -145,11 +145,6 @@ namespace Ryujinx.HLE.HOS.Applets
}
}
public ResultCode GetResult()
{
return ResultCode.Success;
}
private bool IsKeyboardActive()
{
return _backgroundState >= InlineKeyboardState.Appearing && _backgroundState < InlineKeyboardState.Disappearing;

View file

@ -2,7 +2,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
{
/// <summary>
/// Wraps a type in a class so it gets stored in the GC managed heap. This is used as communication mechanism
/// between classed that need to be disposed and, thus, can't share their references.
/// between classes that need to be disposed and, thus, can't share their references.
/// </summary>
/// <typeparam name="T">The internal type.</typeparam>
class TRef<T>

View file

@ -1,3 +1,5 @@
using Gommon;
using Humanizer;
using NetCoreServer;
using Open.Nat;
using Ryujinx.Common.Logging;
@ -153,7 +155,10 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
if (_publicPort != 0)
{
_ = Task.Delay(PortLeaseRenew * 1000, _disposedCancellation.Token).ContinueWith((task) => Task.Run(RefreshLease));
_ = Executor.ExecuteAfterDelayAsync(
PortLeaseRenew.Seconds(),
_disposedCancellation.Token,
RefreshLease);
}
_natDevice = device;
@ -257,7 +262,10 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
}
_ = Task.Delay(PortLeaseRenew, _disposedCancellation.Token).ContinueWith((task) => Task.Run(RefreshLease));
_ = Executor.ExecuteAfterDelayAsync(
PortLeaseRenew.Milliseconds(),
_disposedCancellation.Token,
RefreshLease);
}
public bool TryRegisterUser(P2pProxySession session, ExternalProxyConfig config)

View file

@ -1137,7 +1137,7 @@ namespace Ryujinx.Ava
LocaleManager.Instance[LocaleKeys.VolumeShort] + $": {(int)(Device.GetVolume() * 100)}%",
dockedMode,
ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(),
LocaleManager.Instance[LocaleKeys.Game] + $": {Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)",
$"{Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)",
$"FIFO: {Device.Statistics.GetFifoPercent():00.00} %",
_displayCount));
}

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "إضافة ملفات جديدة...",
"UpdaterExtracting": "استخراج التحديث...",
"UpdaterDownloading": "تحميل التحديث...",
"Game": "لعبة",
"Docked": "تركيب بالمنصة",
"Handheld": "محمول",
"ConnectionError": "خطأ في الاتصال",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Neue Dateien hinzufügen...",
"UpdaterExtracting": "Update extrahieren...",
"UpdaterDownloading": "Update herunterladen...",
"Game": "Spiel",
"Docked": "Docked",
"Handheld": "Handheld",
"ConnectionError": "Verbindungsfehler.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Προσθήκη Νέων Αρχείων...",
"UpdaterExtracting": "Εξαγωγή Ενημέρωσης...",
"UpdaterDownloading": "Λήψη Ενημέρωσης...",
"Game": "Παιχνίδι",
"Docked": "Προσκολλημένο",
"Handheld": "Χειροκίνητο",
"ConnectionError": "Σφάλμα Σύνδεσης.",

View file

@ -730,7 +730,6 @@
"UpdaterAddingFiles": "Adding New Files...",
"UpdaterExtracting": "Extracting Update...",
"UpdaterDownloading": "Downloading Update...",
"Game": "Game",
"Docked": "Docked",
"Handheld": "Handheld",
"ConnectionError": "Connection Error.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Añadiendo nuevos archivos...",
"UpdaterExtracting": "Extrayendo actualización...",
"UpdaterDownloading": "Descargando actualización...",
"Game": "Juego",
"Docked": "Dock/TV",
"Handheld": "Portátil",
"ConnectionError": "Error de conexión.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Ajout des nouveaux fichiers...",
"UpdaterExtracting": "Extraction de la mise à jour…",
"UpdaterDownloading": "Téléchargement de la mise à jour...",
"Game": "Jeu",
"Docked": "Mode station d'accueil",
"Handheld": "Mode Portable",
"ConnectionError": "Erreur de connexion.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "מוסיף קבצים חדשים...",
"UpdaterExtracting": "מחלץ עדכון...",
"UpdaterDownloading": "מוריד עדכון...",
"Game": "משחק",
"Docked": "בתחנת עגינה",
"Handheld": "נייד",
"ConnectionError": "שגיאת חיבור",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Aggiunta dei nuovi file...",
"UpdaterExtracting": "Estrazione dell'aggiornamento...",
"UpdaterDownloading": "Download dell'aggiornamento...",
"Game": "Gioco",
"Docked": "TV",
"Handheld": "Portatile",
"ConnectionError": "Errore di connessione.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "新規ファイルを追加中...",
"UpdaterExtracting": "アップデートを展開中...",
"UpdaterDownloading": "アップデートをダウンロード中...",
"Game": "ゲーム",
"Docked": "ドッキング",
"Handheld": "携帯",
"ConnectionError": "接続エラー.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "새 파일 추가...",
"UpdaterExtracting": "업데이트 추출...",
"UpdaterDownloading": "업데이트 내려받기 중...",
"Game": "게임",
"Docked": "도킹",
"Handheld": "휴대",
"ConnectionError": "연결 오류가 발생했습니다.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Dodawanie Nowych Plików...",
"UpdaterExtracting": "Wypakowywanie Aktualizacji...",
"UpdaterDownloading": "Pobieranie Aktualizacji...",
"Game": "Gra",
"Docked": "Zadokowany",
"Handheld": "Przenośny",
"ConnectionError": "Błąd Połączenia.",

View file

@ -717,7 +717,6 @@
"UpdaterAddingFiles": "Adicionando novos arquivos...",
"UpdaterExtracting": "Extraíndo atualização...",
"UpdaterDownloading": "Baixando atualização...",
"Game": "Jogo",
"Docked": "TV",
"Handheld": "Portátil",
"ConnectionError": "Erro de conexão.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Добавление новых файлов...",
"UpdaterExtracting": "Извлечение обновления...",
"UpdaterDownloading": "Загрузка обновления...",
"Game": "Игра",
"Docked": "Стационарный режим",
"Handheld": "Портативный режим",
"ConnectionError": "Ошибка соединения",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "กำลังเพิ่มไฟล์ใหม่...",
"UpdaterExtracting": "กำลังแยกการอัปเดต...",
"UpdaterDownloading": "กำลังดาวน์โหลดอัปเดต...",
"Game": "เกมส์",
"Docked": "ด็อก",
"Handheld": "แฮนด์เฮลด์",
"ConnectionError": "การเชื่อมต่อล้มเหลว",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Yeni Dosyalar Ekleniyor...",
"UpdaterExtracting": "Güncelleme Ayrıştırılıyor...",
"UpdaterDownloading": "Güncelleme İndiriliyor...",
"Game": "Oyun",
"Docked": "Docked",
"Handheld": "El tipi",
"ConnectionError": "Bağlantı Hatası.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "Додавання нових файлів...",
"UpdaterExtracting": "Видобування оновлення...",
"UpdaterDownloading": "Завантаження оновлення...",
"Game": "Гра",
"Docked": "Док-станція",
"Handheld": "Портативний",
"ConnectionError": "Помилка з'єднання.",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "安装更新中...",
"UpdaterExtracting": "正在提取更新...",
"UpdaterDownloading": "下载更新中...",
"Game": "游戏",
"Docked": "主机模式",
"Handheld": "掌机模式",
"ConnectionError": "连接错误。",

View file

@ -718,7 +718,6 @@
"UpdaterAddingFiles": "正在加入新檔案...",
"UpdaterExtracting": "正在提取更新...",
"UpdaterDownloading": "正在下載更新...",
"Game": "遊戲",
"Docked": "底座模式",
"Handheld": "手提模式",
"ConnectionError": "連線錯誤。",

View file

@ -70,7 +70,7 @@ namespace Ryujinx.Ava.UI.ViewModels
private string _gpuStatusText;
private string _shaderCountText;
private bool _isAmiiboRequested;
private bool _showRightmostSeparator;
private bool _showShaderCompilationHint;
private bool _isGameRunning;
private bool _isFullScreen;
private int _progressMaximum;
@ -275,12 +275,12 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool ShowFirmwareStatus => !ShowLoadProgress;
public bool ShowRightmostSeparator
public bool ShowShaderCompilationHint
{
get => _showRightmostSeparator;
get => _showShaderCompilationHint;
set
{
_showRightmostSeparator = value;
_showShaderCompilationHint = value;
OnPropertyChanged();
}
@ -1497,7 +1497,7 @@ namespace Ryujinx.Ava.UI.ViewModels
VolumeStatusText = args.VolumeStatus;
FifoStatusText = args.FifoStatus;
ShaderCountText = (ShowRightmostSeparator = args.ShaderCount > 0)
ShaderCountText = (ShowShaderCompilationHint = args.ShaderCount > 0)
? $"{LocaleManager.Instance[LocaleKeys.CompilingShaders]}: {args.ShaderCount}"
: string.Empty;

View file

@ -200,7 +200,6 @@ namespace Ryujinx.Ava.UI.Views.Main
await Dispatcher.UIThread.InvokeAsync(() =>
{
ViewModel.WindowState = WindowState.Normal;
Window.Arrange(new Rect(Window.Position.X, Window.Position.Y, windowWidthScaled, windowHeightScaled));
@ -210,7 +209,7 @@ namespace Ryujinx.Ava.UI.Views.Main
public async void CheckForUpdates(object sender, RoutedEventArgs e)
{
if (Updater.CanUpdate(true))
await Window.BeginUpdateAsync(true);
await Updater.BeginUpdateAsync(true);
}
public async void OpenXCITrimmerWindow(object sender, RoutedEventArgs e) => await XCITrimmerWindow.Show(ViewModel);

View file

@ -23,7 +23,7 @@
Background="{DynamicResource ThemeContentBackgroundColor}"
DockPanel.Dock="Bottom"
IsVisible="{Binding ShowMenuAndStatusBar}"
ColumnDefinitions="Auto,Auto,*,Auto">
ColumnDefinitions="Auto,Auto,*,Auto,Auto">
<StackPanel
Grid.Column="0"
Margin="5"
@ -284,14 +284,27 @@
IsVisible="{Binding !ShowLoadProgress}"
Text="{Binding FifoStatusText}"
TextAlignment="Start" />
</StackPanel>
<StackPanel
Grid.Column="3"
Margin="0, 0, 5, 0"
IsVisible="{Binding IsGameRunning}"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock
Name="ShaderCount"
Margin="5,0,5,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsVisible="{Binding ShowShaderCompilationHint}"
Text="{Binding ShaderCountText}" />
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
Background="Gray"
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />
IsVisible="{Binding ShowShaderCompilationHint}" />
<TextBlock
Margin="5,0,5,0"
HorizontalAlignment="Left"
@ -308,35 +321,29 @@
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />
<TextBlock
Margin="5,0,5,0"
Margin="5,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsVisible="{Binding !ShowLoadProgress}"
Text="{Binding GpuNameText}"
TextAlignment="Start" />
</StackPanel>
<StackPanel
Grid.Column="4"
Margin="0,0,5,0"
VerticalAlignment="Center"
IsVisible="{Binding ShowFirmwareStatus}"
Orientation="Horizontal">
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
BorderThickness="1"
IsVisible="{Binding ShowRightmostSeparator}" />
<TextBlock
Name="ShaderCount"
Margin="5,0,5,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding ShaderCountText}" />
</StackPanel>
<StackPanel
Grid.Column="3"
Margin="0,0,5,0"
VerticalAlignment="Center"
IsVisible="{Binding ShowFirmwareStatus}"
Orientation="Horizontal">
IsVisible="{Binding IsGameRunning}" />
<TextBlock
Name="FirmwareStatus"
Margin="0"
Margin="5, 0, 0, 0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="{ext:Locale StatusBarSystemVersion}" />

View file

@ -7,6 +7,7 @@ using Avalonia.Threading;
using DynamicData;
using FluentAvalonia.UI.Controls;
using FluentAvalonia.UI.Windowing;
using Gommon;
using LibHac.Tools.FsSystem;
using Ryujinx.Ava.Common;
using Ryujinx.Ava.Common.Locale;
@ -387,10 +388,8 @@ namespace Ryujinx.Ava.UI.Windows
if (ConfigurationState.Instance.CheckUpdatesOnStart && !CommandLineState.HideAvailableUpdates && Updater.CanUpdate())
{
await this.BeginUpdateAsync()
.ContinueWith(
task => Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}"),
TaskContinuationOptions.OnlyOnFaulted);
await Updater.BeginUpdateAsync()
.Catch(task => Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}"));
}
}

View file

@ -1,4 +1,3 @@
using Avalonia.Controls;
using Avalonia.Threading;
using FluentAvalonia.UI.Controls;
using Gommon;
@ -51,7 +50,7 @@ namespace Ryujinx.Ava
private static readonly string[] _windowsDependencyDirs = [];
public static async Task BeginUpdateAsync(this Window mainWindow, bool showVersionUpToDate = false)
public static async Task BeginUpdateAsync(bool showVersionUpToDate = false)
{
if (_running)
{
@ -225,7 +224,7 @@ namespace Ryujinx.Ava
? $"Canary {currentVersion} -> Canary {newVersion}"
: $"{currentVersion} -> {newVersion}";
RequestUserToUpdate:
RequestUserToUpdate:
// Show a message asking the user if they want to update
UserResult shouldUpdate = await ContentDialogHelper.CreateUpdaterChoiceDialog(
LocaleManager.Instance[LocaleKeys.RyujinxUpdater],
@ -235,7 +234,7 @@ namespace Ryujinx.Ava
switch (shouldUpdate)
{
case UserResult.Yes:
await UpdateRyujinx(mainWindow, _buildUrl);
await UpdateRyujinx(_buildUrl);
break;
// Secondary button maps to no, which in this case is the show changelog button.
case UserResult.No:
@ -258,7 +257,7 @@ namespace Ryujinx.Ava
return result;
}
private static async Task UpdateRyujinx(Window parent, string downloadUrl)
private static async Task UpdateRyujinx(string downloadUrl)
{
_updateSuccessful = false;
@ -278,7 +277,7 @@ namespace Ryujinx.Ava
SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading],
IconSource = new SymbolIconSource { Symbol = Symbol.Download },
ShowProgressBar = true,
XamlRoot = parent,
XamlRoot = App.MainWindow,
};
taskDialog.Opened += (s, e) =>