mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-31 21:13:04 +00:00
fb55f57da7
* Horizon: Migrate wlan and stubs latest services This PR migrate empty wlan services, values are found by RE. Latest firmwares added some other services which are now stubbed and up-to-date. * Fix imports ordering
66 lines
1.6 KiB
C#
66 lines
1.6 KiB
C#
using Ryujinx.Horizon.Bcat;
|
|
using Ryujinx.Horizon.Lbl;
|
|
using Ryujinx.Horizon.LogManager;
|
|
using Ryujinx.Horizon.MmNv;
|
|
using Ryujinx.Horizon.Prepo;
|
|
using Ryujinx.Horizon.Wlan;
|
|
using System.Collections.Generic;
|
|
using System.Threading;
|
|
|
|
namespace Ryujinx.Horizon
|
|
{
|
|
public class ServiceTable
|
|
{
|
|
private int _readyServices;
|
|
private int _totalServices;
|
|
|
|
private readonly ManualResetEvent _servicesReadyEvent = new(false);
|
|
|
|
public IEnumerable<ServiceEntry> GetServices(HorizonOptions options)
|
|
{
|
|
List<ServiceEntry> entries = new();
|
|
|
|
void RegisterService<T>() where T : IService
|
|
{
|
|
entries.Add(new ServiceEntry(T.Main, this, options));
|
|
}
|
|
|
|
RegisterService<BcatMain>();
|
|
RegisterService<LblMain>();
|
|
RegisterService<LmMain>();
|
|
RegisterService<MmNvMain>();
|
|
RegisterService<PrepoMain>();
|
|
RegisterService<WlanMain>();
|
|
|
|
_totalServices = entries.Count;
|
|
|
|
return entries;
|
|
}
|
|
|
|
internal void SignalServiceReady()
|
|
{
|
|
if (Interlocked.Increment(ref _readyServices) == _totalServices)
|
|
{
|
|
_servicesReadyEvent.Set();
|
|
}
|
|
}
|
|
|
|
public void WaitServicesReady()
|
|
{
|
|
_servicesReadyEvent.WaitOne();
|
|
}
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
_servicesReadyEvent.Dispose();
|
|
}
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Dispose(true);
|
|
}
|
|
}
|
|
}
|