using LibHac.Tools.FsSystem;
using Ryujinx.Audio.Integration;
using Ryujinx.Common.Configuration;
using Ryujinx.Graphics.GAL;
using Ryujinx.HLE.FileSystem;
using Ryujinx.HLE.HOS;
using Ryujinx.HLE.HOS.Services.Account.Acc;
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Ui;
using System;
namespace Ryujinx.HLE
{
///
/// HLE configuration.
///
public class HLEConfiguration
{
///
/// The virtual file system used by the FS service.
///
/// This cannot be changed after instantiation.
internal readonly VirtualFileSystem VirtualFileSystem;
///
/// The manager for handling a LibHac Horizon instance.
///
/// This cannot be changed after instantiation.
internal readonly LibHacHorizonManager LibHacHorizonManager;
///
/// The account manager used by the account service.
///
/// This cannot be changed after instantiation.
internal readonly AccountManager AccountManager;
///
/// The content manager used by the NCM service.
///
/// This cannot be changed after instantiation.
internal readonly ContentManager ContentManager;
///
/// The persistent information between run for multi-application capabilities.
///
/// This cannot be changed after instantiation.
public readonly UserChannelPersistence UserChannelPersistence;
///
/// The GPU renderer to use for all GPU operations.
///
/// This cannot be changed after instantiation.
internal readonly IRenderer GpuRenderer;
///
/// The audio device driver to use for all audio operations.
///
/// This cannot be changed after instantiation.
internal readonly IHardwareDeviceDriver AudioDeviceDriver;
///
/// The handler for various UI related operations needed outside of HLE.
///
/// This cannot be changed after instantiation.
internal readonly IHostUiHandler HostUiHandler;
///
/// Control the memory configuration used by the emulation context.
///
/// This cannot be changed after instantiation.
internal readonly MemoryConfiguration MemoryConfiguration;
///
/// The system language to use in the settings service.
///
/// This cannot be changed after instantiation.
internal readonly SystemLanguage SystemLanguage;
///
/// The system region to use in the settings service.
///
/// This cannot be changed after instantiation.
internal readonly RegionCode Region;
///
/// Control the initial state of the vertical sync in the SurfaceFlinger service.
///
internal readonly bool EnableVsync;
///
/// Control the initial state of the docked mode.
///
internal readonly bool EnableDockedMode;
///
/// Control if the Profiled Translation Cache (PTC) should be used.
///
internal readonly bool EnablePtc;
///
/// Control if the guest application should be told that there is a Internet connection available.
///
internal readonly bool EnableInternetAccess;
///
/// Control LibHac's integrity check level.
///
/// This cannot be changed after instantiation.
internal readonly IntegrityCheckLevel FsIntegrityCheckLevel;
///
/// Control LibHac's global access logging level. Value must be between 0 and 3.
///
/// This cannot be changed after instantiation.
internal readonly int FsGlobalAccessLogMode;
///
/// The system time offset to apply to the time service steady and local clocks.
///
/// This cannot be changed after instantiation.
internal readonly long SystemTimeOffset;
///
/// The system timezone used by the time service.
///
/// This cannot be changed after instantiation.
internal readonly string TimeZone;
///
/// Type of the memory manager used on CPU emulation.
///
public MemoryManagerMode MemoryManagerMode { internal get; set; }
///
/// Control the initial state of the ignore missing services setting.
/// If this is set to true, when a missing service is encountered, it will try to automatically handle it instead of throwing an exception.
///
/// TODO: Update this again.
public bool IgnoreMissingServices { internal get; set; }
///
/// Aspect Ratio applied to the renderer window by the SurfaceFlinger service.
///
public AspectRatio AspectRatio { get; set; }
///
/// The audio volume level.
///
public float AudioVolume { get; set; }
///
/// An action called when HLE force a refresh of output after docked mode changed.
///
public Action RefreshInputConfig { internal get; set; }
public HLEConfiguration(VirtualFileSystem virtualFileSystem,
LibHacHorizonManager libHacHorizonManager,
ContentManager contentManager,
AccountManager accountManager,
UserChannelPersistence userChannelPersistence,
IRenderer gpuRenderer,
IHardwareDeviceDriver audioDeviceDriver,
MemoryConfiguration memoryConfiguration,
IHostUiHandler hostUiHandler,
SystemLanguage systemLanguage,
RegionCode region,
bool enableVsync,
bool enableDockedMode,
bool enablePtc,
bool enableInternetAccess,
IntegrityCheckLevel fsIntegrityCheckLevel,
int fsGlobalAccessLogMode,
long systemTimeOffset,
string timeZone,
MemoryManagerMode memoryManagerMode,
bool ignoreMissingServices,
AspectRatio aspectRatio,
float audioVolume)
{
VirtualFileSystem = virtualFileSystem;
LibHacHorizonManager = libHacHorizonManager;
AccountManager = accountManager;
ContentManager = contentManager;
UserChannelPersistence = userChannelPersistence;
GpuRenderer = gpuRenderer;
AudioDeviceDriver = audioDeviceDriver;
MemoryConfiguration = memoryConfiguration;
HostUiHandler = hostUiHandler;
SystemLanguage = systemLanguage;
Region = region;
EnableVsync = enableVsync;
EnableDockedMode = enableDockedMode;
EnablePtc = enablePtc;
EnableInternetAccess = enableInternetAccess;
FsIntegrityCheckLevel = fsIntegrityCheckLevel;
FsGlobalAccessLogMode = fsGlobalAccessLogMode;
SystemTimeOffset = systemTimeOffset;
TimeZone = timeZone;
MemoryManagerMode = memoryManagerMode;
IgnoreMissingServices = ignoreMissingServices;
AspectRatio = aspectRatio;
AudioVolume = audioVolume;
}
}
}