Horizon: Implement arp:r and arp:w services (#5802)

* Horizon: Implement arp:r and arp:w services

* Fix formatting

* Remove HLE arp services

* Revert "Remove HLE arp services"

This reverts commit c576fcccadb963db56b96bacabd1c1ac7abfb1ab.

* Keep LibHac impl since it's used in bcat

* Addresses gdkchan's feedback

* ArpApi in PrepoIpcServer and remove LmApi

* Fix 2

* Fixes ArpApi init

* Fix encoding

* Update PrepoService.cs

* Fix prepo
This commit is contained in:
Ac_K
2024-01-25 23:06:53 +01:00
committed by GitHub
parent 43705c2320
commit cd37c75b82
40 changed files with 1415 additions and 37 deletions

View File

@ -1,4 +1,5 @@
using Ryujinx.Horizon.Prepo.Types;
using Ryujinx.Horizon.Sdk.Arp;
using Ryujinx.Horizon.Sdk.Sf.Hipc;
using Ryujinx.Horizon.Sdk.Sm;
@ -17,16 +18,19 @@ namespace Ryujinx.Horizon.Prepo
private static readonly ManagerOptions _managerOptions = new(PointerBufferSize, MaxDomains, MaxDomainObjects, false);
private SmApi _sm;
private ArpApi _arp;
private PrepoServerManager _serverManager;
public void Initialize()
{
HeapAllocator allocator = new();
_arp = new ArpApi(allocator);
_sm = new SmApi();
_sm.Initialize().AbortOnFailure();
_serverManager = new PrepoServerManager(allocator, _sm, MaxPortsCount, _managerOptions, TotalMaxSessionsCount);
_serverManager = new PrepoServerManager(allocator, _sm, _arp, MaxPortsCount, _managerOptions, TotalMaxSessionsCount);
#pragma warning disable IDE0055 // Disable formatting
_serverManager.RegisterServer((int)PrepoPortIndex.Admin, ServiceName.Encode("prepo:a"), MaxSessionsCount); // 1.0.0-5.1.0
@ -45,6 +49,7 @@ namespace Ryujinx.Horizon.Prepo
public void Shutdown()
{
_arp.Dispose();
_serverManager.Dispose();
}
}