Compare commits

...

9 Commits

Author SHA1 Message Date
GreemDev
1d4928e859 infra: Update LibHac to v0.20.0.
See merge request [ryubing/ryujinx!33](https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/33)
2025-05-14 15:52:14 -05:00
KeatonTheBot
28b8dc14c7 Vulkan: Restrict feedback loop detection to AMD RDNA 3 GPUs
See merge request [ryubing/ryujinx!25](https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/25)
2025-05-13 19:27:24 -05:00
GreemDev
21971a2be7 infra: Switch to [Ryujinx.LibHac](https://git.ryujinx.app/ryubing/libhac)
The original repository disappeared a few days ago, and we had a backup.
2025-05-13 00:33:27 -05:00
WilliamWsyHK
321bdecbc2 Typo for "Verification"
See merge request [ryubing/ryujinx!32](https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/32)
2025-05-11 12:47:54 -05:00
GreemDev
6904d6a461 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.
2025-05-04 03:26:54 -05:00
Hack茶ん
d8e3ab3974 Update Korean translation
See merge request [ryubing/ryujinx!30](https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/30)
2025-04-28 23:29:41 -05:00
LotP
9b429afbb4 fix: PPTC blacklist trigger conditions
See merge request ryubing/ryujinx!28
2025-04-27 16:57:57 -05:00
GreemDev
b71a4cb745 docs: compat: Breakout Beyond & Nikoderiko: The Magical World 2025-04-26 19:14:08 -05:00
shinyoyo
844b1d8b9a Update Simplified Chinese translation.
See merge request ryubing/ryujinx!27
2025-04-25 21:03:27 -05:00
29 changed files with 132 additions and 75 deletions

View File

@@ -23,7 +23,6 @@
<PackageVersion Include="DynamicData" Version="9.0.4" />
<PackageVersion Include="FluentAvaloniaUI" Version="2.0.5" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="LibHac" Version="0.19.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.3.0" />
@@ -41,6 +40,7 @@
<PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" />
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies.AllArch" Version="6.1.2-build3" />
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
<PackageVersion Include="Ryujinx.LibHac" Version="0.20.0-alpha.90" />
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
<PackageVersion Include="Gommon" Version="2.7.1.1" />
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />

View File

@@ -5393,7 +5393,7 @@
"th_TH": "ข้ามหน้าต่างโต้ตอบ 'จัดการโปรไฟล์ผู้ใช้งาน'",
"tr_TR": "'Kullanıcı Profillerini Yönet' iletişim kutusunu atla",
"uk_UA": "Пропустити діалог 'Керувати профілями користувачів'",
"zh_CN": "跳过对话框“管理用户账户”",
"zh_CN": "跳过 “管理用户账户” 对话框",
"zh_TW": "略過對話框「管理使用者設定檔」"
}
},
@@ -7034,7 +7034,7 @@
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "",
"ko_KR": "발견된 구성 :\n\n이름 : \t{0}\n가이드 : \t{1}\n\n 컨트롤러 연결 대기 중...",
"no_NO": "",
"pl_PL": "",
"pt_BR": "",
@@ -7043,7 +7043,7 @@
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_CN": "发现配置:\n\n名称:\t{0}\nGUID:\t{1}\n\n 正在等待控制器连接...",
"zh_TW": ""
}
},
@@ -7393,7 +7393,7 @@
"th_TH": "การควบคุมได้รับการตั้งค่าแล้ว\n\nกำลังรอการเชื่อมต่อคอนโทรลเลอร์...",
"tr_TR": "Kontrol yapılandırıldı.\n\nKontrolcü bağlantısı bekleniyor...",
"uk_UA": "Керування налаштовано.\n\nОчікується підключення контролера...",
"zh_CN": "控制已配置。\n\n等待控制器连接...",
"zh_CN": "已配置控制器。\n\n正在等待控制器连接...",
"zh_TW": "控制已設定。\n\n等待控制器連接..."
}
},
@@ -7418,7 +7418,7 @@
"th_TH": "ยกเลิกการเชื่อมโยง",
"tr_TR": "Bağlantıyı Kes",
"uk_UA": "Відв'язати",
"zh_CN": "解除绑定",
"zh_CN": "取消绑定",
"zh_TW": "解除綁定"
}
},
@@ -16943,7 +16943,7 @@
"th_TH": "ตัวเลือกนี้จะข้ามหน้าต่าง 'จัดการโปรไฟล์ผู้ใช้งาน' ระหว่างเล่นเกม โดยใช้โปรไฟล์ที่เลือกไว้ล่วงหน้า\n\nการสลับโปรไฟล์สามารถพบได้ใน 'ตั้งค่า' - 'จัดการโปรไฟล์ผู้ใช้งาน' เลือกโปรไฟล์ที่คุณต้องการก่อนโหลดเกม",
"tr_TR": "Bu seçenek, oyun sırasında 'Kullanıcı Profillerini Yönet' iletişim kutusunu atlar ve önceden seçilmiş bir profil kullanır.\n\nProfil değiştirme 'Seçenekler' - 'Kullanıcı Profillerini Yönet' bölümünde bulunur. Oyunu yüklemeden önce istediğiniz profili seçin.",
"uk_UA": "Ця опція пропускає діалогове вікно 'Керувати профілями користувачів' під час гри, використовуючи попередньо вибраний профіль.\n\nПеремикання профілів можна знайти в 'Налаштування' - 'Керувати профілями користувачів'. Виберіть потрібний профіль перед завантаженням гри.",
"zh_CN": "此选项跳过游戏过程中“管理用户账户”对话框使用预选的配置。\n\n可以在“设置” - “管理用户账户”中找到配置文件切换。 在加载游戏之前选择所需的配置文件。",
"zh_CN": "此选项跳过游戏过程中出现的 “管理用户账户” 对话框,使用预选的账户。\n\n可以在“设置” - “管理用户账户”中找到账户切换。 在加载游戏之前选择所需的账户。",
"zh_TW": "這個選項跳過遊戲過程中的「管理使用者設定檔」對話框,使用預先選取的設定。\n\n可以在「設定」-「管理使用者設定檔」中找到設定檔切換。 在載入遊戲前選擇您需要的設定檔。"
}
},
@@ -18368,7 +18368,7 @@
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_CN": "{0} FPS ({1}毫秒)",
"zh_TW": ""
}
},
@@ -24484,7 +24484,7 @@
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "불가",
"ko_KR": "불가",
"no_NO": "Ingenting",
"pl_PL": "",
"pt_BR": "Nada",

View File

@@ -601,6 +601,7 @@
010060200A4BE000,"Brawlout",ldn-untested;online,playable,2021-06-04 17:35:35
0100C1B00E1CA000,"Brawlout Demo",demo,playable,2021-02-13 22:46:53
010022C016DC8000,"Breakout: Recharged",slow,ingame,2022-11-06 15:32:57
010048A021C40000,"Breakout Beyond",,playable,2025-04-26 19:11:35
01000AA013A5E000,"Breathedge",UE4;nvdec,playable,2021-05-06 15:44:28
01003D50100F4000,"Breathing Fear",,playable,2020-07-14 15:12:29
010026800BB06000,"Brick Breaker",nvdec;online,playable,2020-12-15 18:26:23
@@ -2028,6 +2029,7 @@
0100628004BCE000,"Nights of Azure 2: Bride of the New Moon",crash;nvdec;regression,menus,2022-11-24 16:00:39
010042300C4F6000,"Nightshade百花百狼",nvdec,playable,2020-05-10 19:43:31
0100AA0008736000,"Nihilumbra",,playable,2020-05-10 16:00:12
01009FA01FF6C000,"Nikoderiko: The Magical World",gpu,ingame,2025-04-26 19:13:31
0100D03003F0E000,"Nine Parchments",ldn-untested,playable,2022-08-07 12:32:08
0100E2F014F46000,"NINJA GAIDEN Σ",nvdec,playable,2022-11-13 16:27:02
0100696014F4A000,"NINJA GAIDEN Σ2",nvdec,playable,2024-07-31 21:53:48
1 title_id game_name labels status last_updated
601 010060200A4BE000 Brawlout ldn-untested;online playable 2021-06-04 17:35:35
602 0100C1B00E1CA000 Brawlout Demo demo playable 2021-02-13 22:46:53
603 010022C016DC8000 Breakout: Recharged slow ingame 2022-11-06 15:32:57
604 010048A021C40000 Breakout Beyond playable 2025-04-26 19:11:35
605 01000AA013A5E000 Breathedge UE4;nvdec playable 2021-05-06 15:44:28
606 01003D50100F4000 Breathing Fear playable 2020-07-14 15:12:29
607 010026800BB06000 Brick Breaker nvdec;online playable 2020-12-15 18:26:23
2029 0100628004BCE000 Nights of Azure 2: Bride of the New Moon crash;nvdec;regression menus 2022-11-24 16:00:39
2030 010042300C4F6000 Nightshade/百花百狼 nvdec playable 2020-05-10 19:43:31
2031 0100AA0008736000 Nihilumbra playable 2020-05-10 16:00:12
2032 01009FA01FF6C000 Nikoderiko: The Magical World gpu ingame 2025-04-26 19:13:31
2033 0100D03003F0E000 Nine Parchments ldn-untested playable 2022-08-07 12:32:08
2034 0100E2F014F46000 NINJA GAIDEN Σ nvdec playable 2022-11-13 16:27:02
2035 0100696014F4A000 NINJA GAIDEN Σ2 nvdec playable 2024-07-31 21:53:48

View File

@@ -33,7 +33,7 @@ namespace ARMeilleure.Translation.PTC
private const string OuterHeaderMagicString = "PTCohd\0\0";
private const string InnerHeaderMagicString = "PTCihd\0\0";
private const uint InternalVersion = 7007; //! To be incremented manually for each change to the ARMeilleure project.
private const uint InternalVersion = 7008; //! To be incremented manually for each change to the ARMeilleure project.
private const string ActualDir = "0";
private const string BackupDir = "1";
@@ -873,7 +873,7 @@ namespace ARMeilleure.Translation.PTC
Debug.Assert(Profiler.IsAddressInStaticCodeRange(address));
TranslatedFunction func = translator.Translate(address, executionMode, highCq);
TranslatedFunction func = translator.Translate(address, executionMode, highCq, pptcTranslation: true);
if (func == null)
{

View File

@@ -219,7 +219,7 @@ namespace ARMeilleure.Translation
}
}
internal TranslatedFunction Translate(ulong address, ExecutionMode mode, bool highCq, bool singleStep = false)
internal TranslatedFunction Translate(ulong address, ExecutionMode mode, bool highCq, bool singleStep = false, bool pptcTranslation = false)
{
ArmEmitterContext context = new(
Memory,
@@ -246,7 +246,7 @@ namespace ARMeilleure.Translation
context.Branch(context.GetLabel(address));
}
ControlFlowGraph cfg = EmitAndGetCFG(context, blocks, out Range funcRange, out Counter<uint> counter);
ControlFlowGraph cfg = EmitAndGetCFG(context, blocks, out Range funcRange, out Counter<uint> counter, pptcTranslation);
if (cfg == null)
{
@@ -326,7 +326,8 @@ namespace ARMeilleure.Translation
ArmEmitterContext context,
Block[] blocks,
out Range range,
out Counter<uint> counter)
out Counter<uint> counter,
bool pptcTranslation)
{
counter = null;
@@ -411,7 +412,10 @@ namespace ARMeilleure.Translation
if (opCode.Instruction.Emitter != null)
{
opCode.Instruction.Emitter(context);
if (opCode.Instruction.Name == InstName.Und && blkIndex == 0)
// if we're pre-compiling PPTC functions, and we hit an Undefined instruction as the first
// instruction in the block, mark the function as blacklisted
// this way, we don't pre-compile Exlaunch hooks, which allows ExeFS mods to run with PPTC
if (pptcTranslation && opCode.Instruction.Name == InstName.Und && blkIndex == 0)
{
range = new Range(rangeStart, rangeEnd);
return null;

View File

@@ -9,6 +9,7 @@ namespace Ryujinx.Common.Helper
public static readonly Regex Numeric = NumericRegex();
public static readonly Regex AmdGcn = AmdGcnRegex();
public static readonly Regex AmdRdna3 = AmdRdna3Regex();
public static readonly Regex NvidiaConsumerClass = NvidiaConsumerClassRegex();
public static readonly Regex DomainLp1Ns = DomainLp1NsRegex();
@@ -46,6 +47,9 @@ namespace Ryujinx.Common.Helper
"Radeon (((HD|R(5|7|9|X)) )?((M?[2-6]\\d{2}(\\D|$))|([7-8]\\d{3}(\\D|$))|Fury|Nano))|(Pro Duo)")]
internal static partial Regex AmdGcnRegex();
[GeneratedRegex("Radeon ([7-8](\\d{2}\\d?)[MS]|PRO [VW]7(\\d{2}\\d?)|RX 7\\d{3}([MS]?| XTX?| GRE)?)")]
public static partial Regex AmdRdna3Regex();
[GeneratedRegex("NVIDIA GeForce (R|G)?TX? (\\d{3}\\d?)M?")]
internal static partial Regex NvidiaConsumerClassRegex();

View File

@@ -1527,24 +1527,28 @@ namespace Ryujinx.Graphics.Vulkan
private bool ChangeFeedbackLoop(FeedbackLoopAspects aspects)
{
if (_feedbackLoop != aspects)
// AMD RDNA 3 GPUs only
if (Gd.IsAmdRdna3)
{
if (Gd.Capabilities.SupportsDynamicAttachmentFeedbackLoop)
if (_feedbackLoop != aspects)
{
DynamicState.SetFeedbackLoop(aspects);
}
else
{
_newState.FeedbackLoopAspects = aspects;
}
if (Gd.Capabilities.SupportsDynamicAttachmentFeedbackLoop)
{
DynamicState.SetFeedbackLoop(aspects);
}
else
{
_newState.FeedbackLoopAspects = aspects;
}
_feedbackLoop = aspects;
_feedbackLoop = aspects;
return true;
return true;
}
}
return false;
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool UpdateFeedbackLoop()

View File

@@ -1,6 +1,7 @@
using Ryujinx.Common.Memory;
using Silk.NET.Vulkan;
using Silk.NET.Vulkan.Extensions.EXT;
using System;
namespace Ryujinx.Graphics.Vulkan
{
@@ -27,6 +28,7 @@ namespace Ryujinx.Graphics.Vulkan
public uint ViewportsCount;
public Array16<Viewport> Viewports;
[Flags]
private enum DirtyFlags
{
None = 0,
@@ -190,14 +192,14 @@ namespace Ryujinx.Graphics.Vulkan
private readonly void RecordFeedbackLoop(ExtAttachmentFeedbackLoopDynamicState api, CommandBuffer commandBuffer)
{
ImageAspectFlags aspects = (_feedbackLoopAspects & FeedbackLoopAspects.Color) != 0 ? ImageAspectFlags.ColorBit : 0;
ImageAspectFlags aspects = (_feedbackLoopAspects & FeedbackLoopAspects.Color) != 0 ? ImageAspectFlags.ColorBit : 0;
if ((_feedbackLoopAspects & FeedbackLoopAspects.Depth) != 0)
{
aspects |= ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit;
}
if ((_feedbackLoopAspects & FeedbackLoopAspects.Depth) != 0)
{
aspects |= ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit;
}
api.CmdSetAttachmentFeedbackLoopEnable(commandBuffer, aspects);
api.CmdSetAttachmentFeedbackLoopEnable(commandBuffer, aspects);
}
}
}

View File

@@ -92,6 +92,7 @@ namespace Ryujinx.Graphics.Vulkan
internal bool IsAmdWindows { get; private set; }
internal bool IsIntelWindows { get; private set; }
internal bool IsAmdGcn { get; private set; }
internal bool IsAmdRdna3 { get; private set; }
internal bool IsNvidiaPreTuring { get; private set; }
internal bool IsIntelArc { get; private set; }
internal bool IsQualcommProprietary { get; private set; }
@@ -377,6 +378,10 @@ namespace Ryujinx.Graphics.Vulkan
GpuVersion = $"Vulkan v{ParseStandardVulkanVersion(properties.ApiVersion)}, Driver v{ParseDriverVersion(ref properties)}";
IsAmdGcn = !IsMoltenVk && Vendor == Vendor.Amd && Patterns.AmdGcn.IsMatch(GpuRenderer);
IsAmdRdna3 = Vendor == Vendor.Amd && (Patterns.AmdRdna3.IsMatch(GpuRenderer)
// ROG Ally (X) Device IDs
|| properties.DeviceID is 0x15BF or 0x15C8);
if (Vendor == Vendor.Nvidia)
{

View File

@@ -3,13 +3,14 @@ using LibHac.Common;
using LibHac.Fs;
using LibHac.Fs.Fsa;
using LibHac.FsSrv.FsCreator;
using System.Runtime.CompilerServices;
namespace Ryujinx.HLE.FileSystem
{
public class EncryptedFileSystemCreator : IEncryptedFileSystemCreator
{
public Result Create(ref SharedRef<IFileSystem> outEncryptedFileSystem,
ref SharedRef<IFileSystem> baseFileSystem, IEncryptedFileSystemCreator.KeyId idIndex,
ref readonly SharedRef<IFileSystem> baseFileSystem, IEncryptedFileSystemCreator.KeyId idIndex,
in EncryptionSeed encryptionSeed)
{
if (idIndex < IEncryptedFileSystemCreator.KeyId.Save || idIndex > IEncryptedFileSystemCreator.KeyId.CustomStorage)
@@ -18,7 +19,7 @@ namespace Ryujinx.HLE.FileSystem
}
// TODO: Reenable when AesXtsFileSystem is fixed.
outEncryptedFileSystem = SharedRef<IFileSystem>.CreateMove(ref baseFileSystem);
outEncryptedFileSystem = SharedRef<IFileSystem>.CreateMove(ref baseFileSystem.Ref);
return Result.Success;
}

View File

@@ -791,7 +791,7 @@ namespace Ryujinx.HLE.HOS
{
string buildId = p switch
{
NsoExecutable nso => Convert.ToHexString(nso.BuildId.ItemsRo.ToArray()).TrimEnd('0'),
NsoExecutable nso => Convert.ToHexString(nso.BuildId).TrimEnd('0'),
NroExecutable nro => Convert.ToHexString(nro.Header.BuildId).TrimEnd('0'),
_ => string.Empty,
};

View File

@@ -16,6 +16,7 @@ using Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy;
using Ryujinx.Memory;
using System;
using System.IO;
using System.Text;
using static Ryujinx.HLE.Utilities.StringUtils;
using GameCardHandle = System.UInt32;
using IFile = Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy.IFile;
@@ -753,17 +754,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs
public ResultCode OpenCloudBackupWorkStorageFileSystem(ServiceCtx context)
{
CloudBackupWorkStorageId storageId = (CloudBackupWorkStorageId)context.RequestData.ReadInt32();
using SharedRef<IFileSystem> fileSystem = new();
Result result = _baseFileSystemProxy.Get.OpenCloudBackupWorkStorageFileSystem(ref fileSystem.Ref, storageId);
if (result.IsFailure())
{
return (ResultCode)result.Value;
}
MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref));
return ResultCode.Success;
Logger.Stub?.PrintStub(LogClass.ServiceFs, new { storageId });
throw new NotImplementedException(); // reimplementing behavior from LibHac 0.19.0
}
[CommandCmif(130)]
@@ -1028,7 +1021,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
{
ref readonly FspPath path = ref FileSystemProxyHelper.GetFspPath(context);
Result result = _baseFileSystemProxy.Get.GetRightsIdByPath(out RightsId rightsId, in path);
Result result = _baseFileSystemProxy.Get.GetRightsIdAndKeyGenerationByPath(out RightsId rightsId, out byte _, in path, ContentAttributes.All);
if (result.IsFailure())
{
return (ResultCode)result.Value;
@@ -1044,7 +1037,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
{
ref readonly FspPath path = ref FileSystemProxyHelper.GetFspPath(context);
Result result = _baseFileSystemProxy.Get.GetRightsIdAndKeyGenerationByPath(out RightsId rightsId, out byte keyGeneration, in path);
Result result = _baseFileSystemProxy.Get.GetRightsIdAndKeyGenerationByPath(out RightsId rightsId, out byte keyGeneration, in path, ContentAttributes.All);
if (result.IsFailure())
{
return (ResultCode)result.Value;
@@ -1240,8 +1233,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs
{
BisPartitionId partitionId = (BisPartitionId)context.RequestData.ReadInt32();
ref readonly FspPath path = ref FileSystemProxyHelper.GetFspPath(context);
return (ResultCode)_baseFileSystemProxy.Get.SetBisRootForHost(partitionId, in path).Value;
Logger.Stub?.PrintStub(LogClass.ServiceFs, new { partitionId, path });
throw new NotImplementedException(); // reimplementing behavior from LibHac 0.19.0
}
[CommandCmif(1001)]

View File

@@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
NetworkError ConnectPrivate(ConnectPrivateRequest request);
ResultCode Reject(DisconnectReason disconnectReason, uint nodeId);
NetworkInfo[] Scan(ushort channel, ScanFilter scanFilter);
void SetGameVersion(byte[] versionString);
void SetGameVersion(ReadOnlySpan<byte> versionString);
void SetStationAcceptPolicy(AcceptPolicy acceptPolicy);
void SetAdvertiseData(byte[] data);
bool CreateNetwork(CreateAccessPointRequest request, byte[] advertiseData);

View File

@@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
// TODO: Call nn::arp::GetApplicationControlProperty here when implemented.
ApplicationControlProperty controlProperty = context.Device.Processes.ActiveApplication.ApplicationControlProperties;
foreach (ulong localCommunicationId in controlProperty.LocalCommunicationId.ItemsRo)
foreach (ulong localCommunicationId in controlProperty.LocalCommunicationId)
{
if (localCommunicationId == localCommunicationIdChecked)
{
@@ -1114,7 +1114,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
}
// TODO: Call nn::arp::GetApplicationLaunchProperty here when implemented.
NetworkClient.SetGameVersion(context.Device.Processes.ActiveApplication.ApplicationControlProperties.DisplayVersion.Items.ToArray());
NetworkClient.SetGameVersion(context.Device.Processes.ActiveApplication.ApplicationControlProperties.DisplayVersion);
resultCode = ResultCode.Success;

View File

@@ -61,7 +61,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
public void SetAdvertiseData(byte[] data) { }
public void SetGameVersion(byte[] versionString) { }
public void SetGameVersion(ReadOnlySpan<byte> versionString) { }
public void SetStationAcceptPolicy(AcceptPolicy acceptPolicy) { }

View File

@@ -85,7 +85,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
_lanDiscovery.SetAdvertiseData(data);
}
public void SetGameVersion(byte[] versionString)
public void SetGameVersion(ReadOnlySpan<byte> versionString)
{
// NOTE: This method is not implemented in ldn_mitm
Logger.Stub?.PrintMsg(LogClass.ServiceLdn, "LdnMitmClient SetGameVersion");

View File

@@ -346,9 +346,9 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
}
}
public void SetGameVersion(byte[] versionString)
public void SetGameVersion(ReadOnlySpan<byte> versionString)
{
_gameVersion = versionString;
_gameVersion = versionString.ToArray();
if (_gameVersion.Length < 0x10)
{

View File

@@ -55,7 +55,16 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory
_titleId = titleId;
// TODO: Call nn::arp::GetApplicationControlProperty here when implemented, if it return ResultCode.Success we assign fields.
_ratingAge = Array.ConvertAll(context.Device.Processes.ActiveApplication.ApplicationControlProperties.RatingAge.ItemsRo.ToArray(), Convert.ToInt32);
int[] tempRatingAge = new int[32];
for (int i = 0; i < 32; i++)
{
tempRatingAge[i] = Convert.ToInt32(context.Device.Processes.ActiveApplication.ApplicationControlProperties.RatingAge[i]);
}
Array.Copy(tempRatingAge, _ratingAge, tempRatingAge.Length);
_parentalControlFlag = context.Device.Processes.ActiveApplication.ApplicationControlProperties.ParentalControlFlag;
}
}

View File

@@ -45,7 +45,10 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pdm.QueryService
// Check if input title ids are in the whitelist.
foreach (ulong titleId in titleIds)
{
if (!context.Device.Processes.ActiveApplication.ApplicationControlProperties.PlayLogQueryableApplicationId.ItemsRo.Contains(titleId))
ReadOnlySpan<ulong> temp = context.Device.Processes.ActiveApplication
.ApplicationControlProperties.PlayLogQueryableApplicationId;
if (!temp.Contains(titleId))
{
return (ResultCode)Am.ResultCode.ObjectInvalid;
}

View File

@@ -91,7 +91,13 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
if (string.IsNullOrWhiteSpace(programName))
{
programName = Array.Find(nacpData.Value.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString();
foreach (ApplicationControlProperty.ApplicationTitle nacpTitles in nacpData.Value.Title)
{
if (nacpTitles.Name[0] != 0)
continue;
programName = nacpTitles.NameString.ToString();
}
}
}

View File

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

View File

@@ -258,7 +258,7 @@ namespace Ryujinx.HLE.Loaders.Processes
{
buildIds[i] = (executables[i] switch
{
NsoExecutable nso => Convert.ToHexString(nso.BuildId.ItemsRo.ToArray()),
NsoExecutable nso => Convert.ToHexString(nso.BuildId),
NroExecutable nro => Convert.ToHexString(nro.Header.BuildId),
_ => string.Empty
}).ToUpper();

View File

@@ -59,7 +59,13 @@ namespace Ryujinx.HLE.Loaders.Processes
if (string.IsNullOrWhiteSpace(Name))
{
Name = Array.Find(ApplicationControlProperties.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString();
foreach (ApplicationControlProperty.ApplicationTitle nacpTitles in ApplicationControlProperties.Title)
{
if (nacpTitles.Name[0] != 0)
continue;
Name = nacpTitles.NameString.ToString();
}
}
DisplayVersion = ApplicationControlProperties.DisplayVersionString.ToString();

View File

@@ -23,7 +23,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="LibHac" />
<PackageReference Include="Ryujinx.LibHac" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" />
<PackageReference Include="MsgPack.Cli" />
<PackageReference Include="SkiaSharp" />

View File

@@ -14,6 +14,6 @@
<ItemGroup>
<PackageReference Include="Concentus" />
<PackageReference Include="LibHac" />
<PackageReference Include="Ryujinx.LibHac" />
</ItemGroup>
</Project>

View File

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

View File

@@ -221,7 +221,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary
NsoReader reader = new();
reader.Initialize(nsoFile.Release().AsStorage().AsFile(OpenMode.Read)).ThrowIfFailure();
return Convert.ToHexString(reader.Header.ModuleId.ItemsRo.ToArray()).Replace("-", string.Empty).ToUpper()[..16];
return Convert.ToHexString(reader.Header.ModuleId).Replace("-", string.Empty).ToUpper()[..16];
}
}
}

View File

@@ -421,6 +421,10 @@ namespace Ryujinx.Ava.Systems.AppLibrary
Read(assetOffset + (int)nacpOffset, (int)nacpSize).AsSpan().CopyTo(controlHolder.ByteSpan);
GetApplicationInformation(ref controlHolder.Value, ref application);
if ("Switch Verification" == controlHolder.Value
.Title[(int)TitleLanguage.AmericanEnglish].NameString.ToString())
return false;
}
else
{
@@ -1363,7 +1367,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary
{
_ = Enum.TryParse(DesiredLanguage.ToString(), out TitleLanguage desiredTitleLanguage);
if (controlData.Title.ItemsRo.Length > (int)desiredTitleLanguage)
if (controlData.Title.Length > (int)desiredTitleLanguage)
{
data.Name = controlData.Title[(int)desiredTitleLanguage].NameString.ToString();
data.Developer = controlData.Title[(int)desiredTitleLanguage].PublisherString.ToString();
@@ -1376,7 +1380,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary
if (string.IsNullOrWhiteSpace(data.Name))
{
foreach (ref readonly ApplicationControlProperty.ApplicationTitle controlTitle in controlData.Title.ItemsRo)
foreach (ref readonly ApplicationControlProperty.ApplicationTitle controlTitle in controlData.Title)
{
if (!controlTitle.NameString.IsEmpty())
{
@@ -1389,7 +1393,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary
if (string.IsNullOrWhiteSpace(data.Developer))
{
foreach (ref readonly ApplicationControlProperty.ApplicationTitle controlTitle in controlData.Title.ItemsRo)
foreach (ref readonly ApplicationControlProperty.ApplicationTitle controlTitle in controlData.Title)
{
if (!controlTitle.PublisherString.IsEmpty())
{

View File

@@ -20,10 +20,11 @@ namespace Ryujinx.Ava.Systems.AppLibrary
public static Array GetArrayForApp(
LdnGameData[] receivedData, ref ApplicationControlProperty acp)
{
LibHac.Common.FixedArrays.Array8<ulong> communicationId = acp.LocalCommunicationId;
ReadOnlySpan<ulong> communicationId = acp.LocalCommunicationId;
ulong[] allowedTitleIds = communicationId.ToArray();
return new Array(receivedData.Where(game =>
communicationId.Items.Contains(game.TitleId.ToULong())
allowedTitleIds.Contains(game.TitleId.ToULong())
));
}