fix: Prevent loading the Switch Verification homebrew specifically.

Its intended purpose is to be installed on a modded real Switch. It is wholly useless and pointless to use it in the emulator, and this will give those users a hint they might be doing something incorrectly.
This commit is contained in:
GreemDev 2025-05-04 03:26:54 -05:00
parent d8e3ab3974
commit 6904d6a461
3 changed files with 11 additions and 2 deletions

View File

@ -9,6 +9,7 @@ using LibHac.Tools.FsSystem.NcaUtils;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.Gpu; using Ryujinx.Graphics.Gpu;
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Loaders.Executables; using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.HLE.Loaders.Processes.Extensions; using Ryujinx.HLE.Loaders.Processes.Extensions;
using System; using System;
@ -158,7 +159,7 @@ namespace Ryujinx.HLE.Loaders.Processes
return false; return false;
} }
public bool LoadNxo(string path) public bool LoadNxo(string path)
{ {
BlitStruct<ApplicationControlProperty> nacpData = new(1); BlitStruct<ApplicationControlProperty> nacpData = new(1);
@ -195,6 +196,10 @@ namespace Ryujinx.HLE.Loaders.Processes
programName = nacpData.Value.Title[(int)_device.System.State.DesiredTitleLanguage].NameString.ToString(); programName = nacpData.Value.Title[(int)_device.System.State.DesiredTitleLanguage].NameString.ToString();
if ("Switch Verfication" ==
nacpData.Value.Title[(int)TitleLanguage.AmericanEnglish].NameString.ToString())
throw new InvalidOperationException();
if (string.IsNullOrWhiteSpace(programName)) if (string.IsNullOrWhiteSpace(programName))
{ {
programName = Array.Find(nacpData.Value.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString(); programName = Array.Find(nacpData.Value.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString();

View File

@ -489,7 +489,7 @@ namespace Ryujinx.Headless
return false; return false;
} }
} }
catch (ArgumentOutOfRangeException) catch
{ {
Logger.Error?.Print(LogClass.Application, "The specified file is not supported by Ryujinx."); Logger.Error?.Print(LogClass.Application, "The specified file is not supported by Ryujinx.");

View File

@ -421,6 +421,10 @@ namespace Ryujinx.Ava.Systems.AppLibrary
Read(assetOffset + (int)nacpOffset, (int)nacpSize).AsSpan().CopyTo(controlHolder.ByteSpan); Read(assetOffset + (int)nacpOffset, (int)nacpSize).AsSpan().CopyTo(controlHolder.ByteSpan);
GetApplicationInformation(ref controlHolder.Value, ref application); GetApplicationInformation(ref controlHolder.Value, ref application);
if ("Switch Verification" == controlHolder.Value
.Title[(int)TitleLanguage.AmericanEnglish].NameString.ToString())
return false;
} }
else else
{ {