Refactoring HOS folder structure (#771)

* Refactoring HOS folder structure

Refactoring HOS folder structure:

- Added some subfolders when needed (Following structure decided in private).
- Added some `Types` folders when needed.
- Little cleanup here and there.
- Add services placeholders for every HOS services (close #766 and #753).

* Remove Types namespaces
This commit is contained in:
Ac_K 2019-09-19 02:45:11 +02:00 committed by jduncanator
parent 4af3101b22
commit a0720b5681
393 changed files with 2540 additions and 1299 deletions

View file

@ -8,6 +8,7 @@ using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.HOS.Kernel.Memory;
using Ryujinx.HLE.HOS.Kernel.Process; using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using Ryujinx.HLE.HOS.Services.Settings;
using Ryujinx.HLE.HOS.Services.Sm; using Ryujinx.HLE.HOS.Services.Sm;
using Ryujinx.HLE.HOS.Services.Time.Clock; using Ryujinx.HLE.HOS.Services.Time.Clock;
using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.HOS.SystemState;
@ -203,7 +204,7 @@ namespace Ryujinx.HLE.HOS
// TODO: use "time!standard_steady_clock_rtc_update_interval_minutes" and implement a worker thread to be accurate. // TODO: use "time!standard_steady_clock_rtc_update_interval_minutes" and implement a worker thread to be accurate.
StandardSteadyClockCore.Instance.ConfigureSetupValue(); StandardSteadyClockCore.Instance.ConfigureSetupValue();
if (Services.Set.NxSettings.Settings.TryGetValue("time!standard_network_clock_sufficient_accuracy_minutes", out object standardNetworkClockSufficientAccuracyMinutes)) if (NxSettings.Settings.TryGetValue("time!standard_network_clock_sufficient_accuracy_minutes", out object standardNetworkClockSufficientAccuracyMinutes))
{ {
TimeSpanType standardNetworkClockSufficientAccuracy = new TimeSpanType((int)standardNetworkClockSufficientAccuracyMinutes * 60000000000); TimeSpanType standardNetworkClockSufficientAccuracy = new TimeSpanType((int)standardNetworkClockSufficientAccuracyMinutes * 60000000000);

View file

@ -1,10 +1,9 @@
using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.Utilities;
using Ryujinx.HLE.Utilities;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace Ryujinx.HLE.HOS.Services.Acc namespace Ryujinx.HLE.HOS.Services.Account.Acc
{ {
public class AccountUtils public class AccountUtils
{ {

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Account.Acc
{
[Service("acc:su")]
class IAccountServiceForAdministrator : IpcService
{
public IAccountServiceForAdministrator(ServiceCtx context) { }
}
}

View file

@ -1,22 +1,18 @@
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.HOS.Services.Arp;
using Ryujinx.HLE.HOS.Services.Glue;
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Utilities; using Ryujinx.HLE.Utilities;
using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Services.Acc namespace Ryujinx.HLE.HOS.Services.Account.Acc
{ {
[Service("acc:u0")] [Service("acc:u0")]
[Service("acc:u1")] class IAccountServiceForApplication : IpcService
class IAccountService : IpcService
{ {
private bool _userRegistrationRequestPermitted = false; private bool _userRegistrationRequestPermitted = false;
private ApplicationLaunchProperty _applicationLaunchProperty; private ApplicationLaunchProperty _applicationLaunchProperty;
public IAccountService(ServiceCtx context) { } public IAccountServiceForApplication(ServiceCtx context) { }
[Command(0)] [Command(0)]
// GetUserCount() -> i32 // GetUserCount() -> i32

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Account.Acc
{
[Service("acc:u1")]
class IAccountServiceForSystemService : IpcService
{
public IAccountServiceForSystemService(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Account.Acc
{
[Service("acc:aa")]
class IBaasAccessTokenAccessor : IpcService
{
public IBaasAccessTokenAccessor(ServiceCtx context) { }
}
}

View file

@ -1,8 +1,8 @@
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Glue; using Ryujinx.HLE.HOS.Services.Arp;
using Ryujinx.HLE.Utilities; using Ryujinx.HLE.Utilities;
namespace Ryujinx.HLE.HOS.Services.Acc namespace Ryujinx.HLE.HOS.Services.Account.Acc
{ {
class IManagerForApplication : IpcService class IManagerForApplication : IpcService
{ {

View file

@ -1,12 +1,11 @@
using ARMeilleure.Memory; using ARMeilleure.Memory;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Utilities; using Ryujinx.HLE.Utilities;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
namespace Ryujinx.HLE.HOS.Services.Acc namespace Ryujinx.HLE.HOS.Services.Account.Acc
{ {
class IProfile : IpcService class IProfile : IpcService
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.SystemState namespace Ryujinx.HLE.HOS.Services.Account.Acc
{ {
public enum AccountState public enum AccountState
{ {

View file

@ -1,7 +1,7 @@
using Ryujinx.HLE.Utilities; using Ryujinx.HLE.Utilities;
using System; using System;
namespace Ryujinx.HLE.HOS.SystemState namespace Ryujinx.HLE.HOS.Services.Account.Acc
{ {
class UserProfile class UserProfile
{ {

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Account.Dauth
{
[Service("dauth:0")] // 5.0.0+
class IService : IpcService
{
public IService(ServiceCtx context) { }
}
}

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Acc namespace Ryujinx.HLE.HOS.Services.Account
{ {
enum ResultCode enum ResultCode
{ {

View file

@ -1,4 +1,6 @@
namespace Ryujinx.HLE.HOS.Services.Am using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
{ {
class ISystemAppletProxy : IpcService class ISystemAppletProxy : IpcService
{ {

View file

@ -2,9 +2,10 @@
using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using Ryujinx.HLE.HOS.Services.Am.AppletAE.Storage;
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletCreator
{ {
class ILibraryAppletAccessor : IpcService class ILibraryAppletAccessor : IpcService
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class IApplicationCreator : IpcService class IApplicationCreator : IpcService
{ {

View file

@ -1,6 +1,6 @@
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class IAudioController : IpcService class IAudioController : IpcService
{ {

View file

@ -2,15 +2,16 @@ using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using Ryujinx.HLE.HOS.Services.Apm;
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class ICommonStateGetter : IpcService class ICommonStateGetter : IpcService
{ {
private KEvent _displayResolutionChangeEvent; private KEvent _displayResolutionChangeEvent;
private Apm.CpuBoostMode _cpuBoostMode = Apm.CpuBoostMode.Disabled; private CpuBoostMode _cpuBoostMode = CpuBoostMode.Disabled;
public ICommonStateGetter(Horizon system) public ICommonStateGetter(Horizon system)
{ {
@ -64,9 +65,9 @@ namespace Ryujinx.HLE.HOS.Services.Am
// GetPerformanceMode() -> u32 // GetPerformanceMode() -> u32
public ResultCode GetPerformanceMode(ServiceCtx context) public ResultCode GetPerformanceMode(ServiceCtx context)
{ {
Apm.PerformanceMode mode = context.Device.System.State.DockedMode PerformanceMode mode = context.Device.System.State.DockedMode
? Apm.PerformanceMode.Docked ? PerformanceMode.Docked
: Apm.PerformanceMode.Handheld; : PerformanceMode.Handheld;
context.ResponseData.Write((int)mode); context.ResponseData.Write((int)mode);
@ -130,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
return ResultCode.CpuBoostModeInvalid; return ResultCode.CpuBoostModeInvalid;
} }
_cpuBoostMode = (Apm.CpuBoostMode)cpuBoostMode; _cpuBoostMode = (CpuBoostMode)cpuBoostMode;
// NOTE: There is a condition variable after the assignment, probably waiting something with apm:sys service (SetCpuBoostMode call?). // NOTE: There is a condition variable after the assignment, probably waiting something with apm:sys service (SetCpuBoostMode call?).
// Since we will probably never support CPU boost things, it's not needed to implement more. // Since we will probably never support CPU boost things, it's not needed to implement more.

View file

@ -0,0 +1,7 @@
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{
class IDebugFunctions : IpcService
{
public IDebugFunctions() { }
}
}

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class IDisplayController : IpcService class IDisplayController : IpcService
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class IGlobalStateController : IpcService class IGlobalStateController : IpcService
{ {

View file

@ -4,7 +4,7 @@ using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class IHomeMenuFunctions : IpcService class IHomeMenuFunctions : IpcService
{ {

View file

@ -1,4 +1,6 @@
namespace Ryujinx.HLE.HOS.Services.Am using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletCreator;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class ILibraryAppletCreator : IpcService class ILibraryAppletCreator : IpcService
{ {

View file

@ -4,7 +4,7 @@ using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class ISelfController : IpcService class ISelfController : IpcService
{ {

View file

@ -1,6 +1,6 @@
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
class IWindowController : IpcService class IWindowController : IpcService
{ {

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{
enum FocusState
{
InFocus = 1,
OutOfFocus = 2
}
}

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{ {
enum MessageInfo enum MessageInfo
{ {

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{
enum OperationMode
{
Handheld = 0,
Docked = 1
}
}

View file

@ -1,4 +1,6 @@
namespace Ryujinx.HLE.HOS.Services.Am using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
{ {
[Service("appletAE")] [Service("appletAE")]
class IAllSystemAppletProxiesService : IpcService class IAllSystemAppletProxiesService : IpcService

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
{ {
class IStorage : IpcService class IStorage : IpcService
{ {

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
{ {
class IStorageAccessor : IpcService class IStorageAccessor : IpcService
{ {

View file

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.Storage
{ {
class StorageHelper class StorageHelper
{ {
@ -16,9 +16,9 @@ namespace Ryujinx.HLE.HOS.Services.Am
ms.SetLength(0x88); ms.SetLength(0x88);
writer.Write(LaunchParamsMagic); writer.Write(LaunchParamsMagic);
writer.Write(1); //IsAccountSelected? Only lower 8 bits actually used. writer.Write(1); // IsAccountSelected? Only lower 8 bits actually used.
writer.Write(1L); //User Id Low (note: User Id needs to be != 0) writer.Write(1L); // User Id Low (note: User Id needs to be != 0)
writer.Write(0L); //User Id High writer.Write(0L); // User Id High
return ms.ToArray(); return ms.ToArray();
} }

View file

@ -1,6 +1,8 @@
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
using Ryujinx.HLE.HOS.Services.Am.AppletAE.Storage;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy
{ {
class IApplicationFunctions : IpcService class IApplicationFunctions : IpcService
{ {

View file

@ -1,4 +1,7 @@
namespace Ryujinx.HLE.HOS.Services.Am using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy;
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy;
namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
{ {
class IApplicationProxy : IpcService class IApplicationProxy : IpcService
{ {

View file

@ -1,3 +1,6 @@
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService;
namespace Ryujinx.HLE.HOS.Services.Am namespace Ryujinx.HLE.HOS.Services.Am
{ {
[Service("appletOE")] [Service("appletOE")]

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Am
{
enum FocusState
{
InFocus = 1,
OutOfFocus = 2
}
}

View file

@ -1,7 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Am
{
class IDebugFunctions : IpcService
{
public IDebugFunctions() { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Am.Idle
{
[Service("idle:sys")]
class IPolicyManagerSystem : IpcService
{
public IPolicyManagerSystem(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Am.Omm
{
[Service("omm")]
class IOperationModeManager : IpcService
{
public IOperationModeManager(ServiceCtx context) { }
}
}

View file

@ -1,8 +0,0 @@
namespace Ryujinx.HLE.HOS.Services.Am
{
enum OperationMode
{
Handheld = 0,
Docked = 1
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Am.Spsm
{
[Service("spsm")]
class IPowerStateInterface : IpcService
{
public IPowerStateInterface(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Am.Tcap
{
[Service("tcap")]
class IManager : IpcService
{
public IManager(ServiceCtx context) { }
}
}

View file

@ -2,8 +2,8 @@ using Ryujinx.Common.Logging;
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using Ryujinx.Graphics.Memory; using Ryujinx.Graphics.Memory;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using Ryujinx.HLE.HOS.Services.Nv.NvGpuAS; using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS;
using Ryujinx.HLE.HOS.Services.Nv.NvMap; using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -28,101 +28,6 @@ namespace Ryujinx.HLE.HOS.Services.Android
private const int BufferQueueCount = 0x40; private const int BufferQueueCount = 0x40;
private const int BufferQueueMask = BufferQueueCount - 1; private const int BufferQueueMask = BufferQueueCount - 1;
[Flags]
private enum HalTransform
{
FlipX = 1,
FlipY = 2,
Rotate90 = 4,
Rotate180 = FlipX | FlipY,
Rotate270 = Rotate90 | Rotate180,
}
private enum BufferState
{
Free,
Dequeued,
Queued,
Acquired
}
[StructLayout(LayoutKind.Sequential, Size = 0x8)]
private struct Fence
{
public int id;
public int value;
}
[StructLayout(LayoutKind.Explicit, Size = 0x24)]
private struct MultiFence
{
[FieldOffset(0x0)]
public int FenceCount;
[FieldOffset(0x4)]
public Fence Fence0;
[FieldOffset(0xC)]
public Fence Fence1;
[FieldOffset(0x14)]
public Fence Fence2;
[FieldOffset(0x1C)]
public Fence Fence3;
}
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
private struct Rect
{
public int Top;
public int Left;
public int Right;
public int Bottom;
}
[StructLayout(LayoutKind.Explicit)]
private struct QueueBufferObject
{
[FieldOffset(0x0)]
public long Timestamp;
[FieldOffset(0x8)]
public int IsAutoTimestamp;
[FieldOffset(0xC)]
public Rect Crop;
[FieldOffset(0x1C)]
public int ScalingMode;
[FieldOffset(0x20)]
public HalTransform Transform;
[FieldOffset(0x24)]
public int StickyTransform;
[FieldOffset(0x28)]
public int Unknown;
[FieldOffset(0x2C)]
public int SwapInterval;
[FieldOffset(0x30)]
public MultiFence Fence;
}
private struct BufferEntry
{
public BufferState State;
public HalTransform Transform;
public Rect Crop;
public GbpBuffer Data;
}
private BufferEntry[] _bufferQueue; private BufferEntry[] _bufferQueue;
private AutoResetEvent _waitBufferFree; private AutoResetEvent _waitBufferFree;

View file

@ -0,0 +1,13 @@
namespace Ryujinx.HLE.HOS.Services.Android
{
struct BufferEntry
{
public BufferState State;
public HalTransform Transform;
public Rect Crop;
public GbpBuffer Data;
}
}

View file

@ -0,0 +1,10 @@
namespace Ryujinx.HLE.HOS.Services.Android
{
enum BufferState
{
Free,
Dequeued,
Queued,
Acquired
}
}

View file

@ -0,0 +1,17 @@
namespace Ryujinx.HLE.HOS.Services.Android
{
enum ColorBytePerPixel
{
Bpp1 = 1,
Bpp2 = 2,
Bpp4 = 4,
Bpp8 = 8,
Bpp16 = 16,
Bpp24 = 24,
Bpp32 = 32,
Bpp48 = 48,
Bpp64 = 64,
Bpp96 = 96,
Bpp128 = 128
}
}

View file

@ -0,0 +1,42 @@
namespace Ryujinx.HLE.HOS.Services.Android
{
enum ColorComponent : uint
{
X1 = (0x01 << ColorShift.Component) | ColorBytePerPixel.Bpp1,
X2 = (0x02 << ColorShift.Component) | ColorBytePerPixel.Bpp2,
X4 = (0x03 << ColorShift.Component) | ColorBytePerPixel.Bpp4,
X8 = (0x04 << ColorShift.Component) | ColorBytePerPixel.Bpp8,
Y4X4 = (0x05 << ColorShift.Component) | ColorBytePerPixel.Bpp8,
X3Y3Z2 = (0x06 << ColorShift.Component) | ColorBytePerPixel.Bpp8,
X8Y8 = (0x07 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X8Y8X8Z8 = (0x08 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y8X8Z8X8 = (0x09 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X16 = (0x0A << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y2X14 = (0x0B << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y4X12 = (0x0C << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y6X10 = (0x0D << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y8X8 = (0x0E << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X10 = (0x0F << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X12 = (0x10 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Z5Y5X6 = (0x11 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X5Y6Z5 = (0x12 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X6Y5Z5 = (0x13 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X1Y5Z5W5 = (0x14 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X4Y4Z4W4 = (0x15 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X5Y1Z5W5 = (0x16 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X5Y5Z1W5 = (0x17 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X5Y5Z5W1 = (0x18 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X8Y8Z8 = (0x19 << ColorShift.Component) | ColorBytePerPixel.Bpp24,
X24 = (0x1A << ColorShift.Component) | ColorBytePerPixel.Bpp24,
X32 = (0x1C << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X16Y16 = (0x1D << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X11Y11Z10 = (0x1E << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X2Y10Z10W10 = (0x20 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X8Y8Z8W8 = (0x21 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
Y10X10 = (0x22 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X10Y10Z10W2 = (0x23 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
Y12X12 = (0x24 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X20Y20Z20 = (0x26 << ColorShift.Component) | ColorBytePerPixel.Bpp64,
X16Y16Z16W16 = (0x27 << ColorShift.Component) | ColorBytePerPixel.Bpp64,
}
}

View file

@ -0,0 +1,9 @@
namespace Ryujinx.HLE.HOS.Services.Android
{
enum ColorDataType
{
Integer = 0x0 << ColorShift.DataType,
Float = 0x1 << ColorShift.DataType,
Stencil = 0x2 << ColorShift.DataType
}
}

View file

@ -1,136 +1,5 @@
// ReSharper disable InconsistentNaming namespace Ryujinx.HLE.HOS.Services.Android
namespace Ryujinx.HLE.HOS.Services.Android
{ {
class ColorShift
{
public const int Swizzle = 16;
public const int DataType = 14;
public const int Space = 32;
public const int Component = 8;
}
enum ColorSwizzle
{
XYZW = 0x688 << ColorShift.Swizzle,
ZYXW = 0x60a << ColorShift.Swizzle,
WZYX = 0x053 << ColorShift.Swizzle,
YZWX = 0x0d1 << ColorShift.Swizzle,
XYZ1 = 0xa88 << ColorShift.Swizzle,
YZW1 = 0xad1 << ColorShift.Swizzle,
XXX1 = 0xa00 << ColorShift.Swizzle,
XZY1 = 0xa50 << ColorShift.Swizzle,
ZYX1 = 0xa0a << ColorShift.Swizzle,
WZY1 = 0xa53 << ColorShift.Swizzle,
X000 = 0x920 << ColorShift.Swizzle,
Y000 = 0x921 << ColorShift.Swizzle,
XY01 = 0xb08 << ColorShift.Swizzle,
X001 = 0xb20 << ColorShift.Swizzle,
X00X = 0x121 << ColorShift.Swizzle,
X00Y = 0x320 << ColorShift.Swizzle,
_0YX0 = 0x80c << ColorShift.Swizzle,
_0ZY0 = 0x814 << ColorShift.Swizzle,
_0XZ0 = 0x884 << ColorShift.Swizzle,
_0X00 = 0x904 << ColorShift.Swizzle,
_00X0 = 0x824 << ColorShift.Swizzle,
_000X = 0x124 << ColorShift.Swizzle,
_0XY0 = 0x844 << ColorShift.Swizzle,
XXXY = 0x200 << ColorShift.Swizzle,
YYYX = 0x049 << ColorShift.Swizzle
}
enum ColorBytePerPixel
{
Bpp1 = 1,
Bpp2 = 2,
Bpp4 = 4,
Bpp8 = 8,
Bpp16 = 16,
Bpp24 = 24,
Bpp32 = 32,
Bpp48 = 48,
Bpp64 = 64,
Bpp96 = 96,
Bpp128 = 128
}
enum ColorComponent : uint
{
X1 = (0x01 << ColorShift.Component) | ColorBytePerPixel.Bpp1,
X2 = (0x02 << ColorShift.Component) | ColorBytePerPixel.Bpp2,
X4 = (0x03 << ColorShift.Component) | ColorBytePerPixel.Bpp4,
X8 = (0x04 << ColorShift.Component) | ColorBytePerPixel.Bpp8,
Y4X4 = (0x05 << ColorShift.Component) | ColorBytePerPixel.Bpp8,
X3Y3Z2 = (0x06 << ColorShift.Component) | ColorBytePerPixel.Bpp8,
X8Y8 = (0x07 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X8Y8X8Z8 = (0x08 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y8X8Z8X8 = (0x09 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X16 = (0x0A << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y2X14 = (0x0B << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y4X12 = (0x0C << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y6X10 = (0x0D << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Y8X8 = (0x0E << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X10 = (0x0F << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X12 = (0x10 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
Z5Y5X6 = (0x11 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X5Y6Z5 = (0x12 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X6Y5Z5 = (0x13 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X1Y5Z5W5 = (0x14 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X4Y4Z4W4 = (0x15 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X5Y1Z5W5 = (0x16 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X5Y5Z1W5 = (0x17 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X5Y5Z5W1 = (0x18 << ColorShift.Component) | ColorBytePerPixel.Bpp16,
X8Y8Z8 = (0x19 << ColorShift.Component) | ColorBytePerPixel.Bpp24,
X24 = (0x1A << ColorShift.Component) | ColorBytePerPixel.Bpp24,
X32 = (0x1C << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X16Y16 = (0x1D << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X11Y11Z10 = (0x1E << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X2Y10Z10W10 = (0x20 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X8Y8Z8W8 = (0x21 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
Y10X10 = (0x22 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X10Y10Z10W2 = (0x23 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
Y12X12 = (0x24 << ColorShift.Component) | ColorBytePerPixel.Bpp32,
X20Y20Z20 = (0x26 << ColorShift.Component) | ColorBytePerPixel.Bpp64,
X16Y16Z16W16 = (0x27 << ColorShift.Component) | ColorBytePerPixel.Bpp64,
}
enum ColorDataType
{
Integer = 0x0 << ColorShift.DataType,
Float = 0x1 << ColorShift.DataType,
Stencil = 0x2 << ColorShift.DataType
}
enum ColorSpace : ulong
{
NonColor = 0x0L << ColorShift.Space,
LinearRGBA = 0x1L << ColorShift.Space,
SRGB = 0x2L << ColorShift.Space,
RGB709 = 0x3L << ColorShift.Space,
LinearRGB709 = 0x4L << ColorShift.Space,
LinearScRGB = 0x5L << ColorShift.Space,
RGB2020 = 0x6L << ColorShift.Space,
LinearRGB2020 = 0x7L << ColorShift.Space,
RGB2020_PQ = 0x8L << ColorShift.Space,
ColorIndex = 0x9L << ColorShift.Space,
YCbCr601 = 0xAL << ColorShift.Space,
YCbCr601_RR = 0xBL << ColorShift.Space,
YCbCr601_ER = 0xCL << ColorShift.Space,
YCbCr709 = 0xDL << ColorShift.Space,
YCbCr709_ER = 0xEL << ColorShift.Space,
BayerRGGB = 0x10L << ColorShift.Space,
BayerBGGR = 0x11L << ColorShift.Space,
BayerGRBG = 0x12L << ColorShift.Space,
BayerGBRG = 0x13L << ColorShift.Space,
XYZ = 0x14L << ColorShift.Space,
}
enum ColorFormat : ulong enum ColorFormat : ulong
{ {
NonColor8 = ColorSpace.NonColor | ColorSwizzle.X000 | ColorComponent.X8 | ColorDataType.Integer, NonColor8 = ColorSpace.NonColor | ColorSwizzle.X000 | ColorComponent.X8 | ColorDataType.Integer,

View file

@ -0,0 +1,10 @@
namespace Ryujinx.HLE.HOS.Services.Android
{
class ColorShift
{
public const int Swizzle = 16;
public const int DataType = 14;
public const int Space = 32;
public const int Component = 8;
}
}

View file

@ -0,0 +1,33 @@
namespace Ryujinx.HLE.HOS.Services.Android
{
enum ColorSpace : ulong
{
NonColor = 0x0L << ColorShift.Space,
LinearRGBA = 0x1L << ColorShift.Space,
SRGB = 0x2L << ColorShift.Space,
RGB709 = 0x3L << ColorShift.Space,
LinearRGB709 = 0x4L << ColorShift.Space,
LinearScRGB = 0x5L << ColorShift.Space,
RGB2020 = 0x6L << ColorShift.Space,
LinearRGB2020 = 0x7L << ColorShift.Space,
RGB2020_PQ = 0x8L << ColorShift.Space,
ColorIndex = 0x9L << ColorShift.Space,
YCbCr601 = 0xAL << ColorShift.Space,
YCbCr601_RR = 0xBL << ColorShift.Space,
YCbCr601_ER = 0xCL << ColorShift.Space,
YCbCr709 = 0xDL << ColorShift.Space,
YCbCr709_ER = 0xEL << ColorShift.Space,
BayerRGGB = 0x10L << ColorShift.Space,
BayerBGGR = 0x11L << ColorShift.Space,
BayerGRBG = 0x12L << ColorShift.Space,
BayerGBRG = 0x13L << ColorShift.Space,
XYZ = 0x14L << ColorShift.Space,
}
}

View file

@ -0,0 +1,31 @@
namespace Ryujinx.HLE.HOS.Services.Android
{
enum ColorSwizzle
{
XYZW = 0x688 << ColorShift.Swizzle,
ZYXW = 0x60a << ColorShift.Swizzle,
WZYX = 0x053 << ColorShift.Swizzle,
YZWX = 0x0d1 << ColorShift.Swizzle,
XYZ1 = 0xa88 << ColorShift.Swizzle,
YZW1 = 0xad1 << ColorShift.Swizzle,
XXX1 = 0xa00 << ColorShift.Swizzle,
XZY1 = 0xa50 << ColorShift.Swizzle,
ZYX1 = 0xa0a << ColorShift.Swizzle,
WZY1 = 0xa53 << ColorShift.Swizzle,
X000 = 0x920 << ColorShift.Swizzle,
Y000 = 0x921 << ColorShift.Swizzle,
XY01 = 0xb08 << ColorShift.Swizzle,
X001 = 0xb20 << ColorShift.Swizzle,
X00X = 0x121 << ColorShift.Swizzle,
X00Y = 0x320 << ColorShift.Swizzle,
_0YX0 = 0x80c << ColorShift.Swizzle,
_0ZY0 = 0x814 << ColorShift.Swizzle,
_0XZ0 = 0x884 << ColorShift.Swizzle,
_0X00 = 0x904 << ColorShift.Swizzle,
_00X0 = 0x824 << ColorShift.Swizzle,
_000X = 0x124 << ColorShift.Swizzle,
_0XY0 = 0x844 << ColorShift.Swizzle,
XXXY = 0x200 << ColorShift.Swizzle,
YYYX = 0x049 << ColorShift.Swizzle
}
}

View file

@ -0,0 +1,11 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
[StructLayout(LayoutKind.Sequential, Size = 0x8)]
struct Fence
{
public int Id;
public int Value;
}
}

View file

@ -0,0 +1,37 @@
using Ryujinx.Common;
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
struct GbpBuffer
{
public GraphicBufferHeader Header { get; private set; }
public NvGraphicBuffer Buffer { get; private set; }
public int Size => Marshal.SizeOf<NvGraphicBuffer>() + Marshal.SizeOf<GraphicBufferHeader>();
public GbpBuffer(BinaryReader reader)
{
Header = reader.ReadStruct<GraphicBufferHeader>();
// ignore fds
// TODO: check if that is used in official implementation
reader.BaseStream.Position += Header.FdsCount * 4;
if (Header.IntsCount != 0x51)
{
throw new NotImplementedException($"Unexpected Graphic Buffer ints count (expected 0x51, found 0x{Header.IntsCount:x}");
}
Buffer = reader.ReadStruct<NvGraphicBuffer>();
}
public void Write(BinaryWriter writer)
{
writer.WriteStruct(Header);
writer.WriteStruct(Buffer);
}
}
}

View file

@ -0,0 +1,21 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
[StructLayout(LayoutKind.Sequential, Size = 0x28)]
struct GraphicBufferHeader
{
public int Magic;
public int Width;
public int Height;
public int Stride;
public int Format;
public int Usage;
public int Pid;
public int RefCount;
public int FdsCount;
public int IntsCount;
}
}

View file

@ -0,0 +1,14 @@
using System;
namespace Ryujinx.HLE.HOS.Services.Android
{
[Flags]
enum HalTransform
{
FlipX = 1,
FlipY = 2,
Rotate90 = 4,
Rotate180 = FlipX | FlipY,
Rotate270 = Rotate90 | Rotate180
}
}

View file

@ -0,0 +1,23 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
[StructLayout(LayoutKind.Explicit, Size = 0x24)]
struct MultiFence
{
[FieldOffset(0x0)]
public int FenceCount;
[FieldOffset(0x4)]
public Fence Fence0;
[FieldOffset(0xC)]
public Fence Fence1;
[FieldOffset(0x14)]
public Fence Fence2;
[FieldOffset(0x1C)]
public Fence Fence3;
}
}

View file

@ -0,0 +1,41 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
[StructLayout(LayoutKind.Explicit, Size = 0x144)]
struct NvGraphicBuffer
{
[FieldOffset(0x4)]
public int NvMapId;
[FieldOffset(0xC)]
public int Magic;
[FieldOffset(0x10)]
public int Pid;
[FieldOffset(0x14)]
public int Type;
[FieldOffset(0x18)]
public int Usage;
[FieldOffset(0x1C)]
public int PixelFormat;
[FieldOffset(0x20)]
public int ExternalPixelFormat;
[FieldOffset(0x24)]
public int Stride;
[FieldOffset(0x28)]
public int FrameBufferSize;
[FieldOffset(0x2C)]
public int PlanesCount;
[FieldOffset(0x34)]
public NvGraphicBufferSurfaceArray Surfaces;
}
}

View file

@ -0,0 +1,44 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
[StructLayout(LayoutKind.Explicit, Size = 0x58)]
struct NvGraphicBufferSurface
{
[FieldOffset(0)]
public uint Width;
[FieldOffset(0x4)]
public uint Height;
[FieldOffset(0x8)]
public ColorFormat ColorFormat;
[FieldOffset(0x10)]
public int Layout;
[FieldOffset(0x14)]
public int Pitch;
[FieldOffset(0x18)]
public int NvMapHandle;
[FieldOffset(0x1C)]
public int Offset;
[FieldOffset(0x20)]
public int Kind;
[FieldOffset(0x24)]
public int BlockHeightLog2;
[FieldOffset(0x28)]
public int ScanFormat;
[FieldOffset(0x30)]
public long Flags;
[FieldOffset(0x38)]
public long Size;
}
}

View file

@ -0,0 +1,39 @@
using System;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
[StructLayout(LayoutKind.Explicit)]
struct NvGraphicBufferSurfaceArray
{
[FieldOffset(0x0)]
private NvGraphicBufferSurface Surface0;
[FieldOffset(0x58)]
private NvGraphicBufferSurface Surface1;
[FieldOffset(0xb0)]
private NvGraphicBufferSurface Surface2;
public NvGraphicBufferSurface this[int index]
{
get
{
if (index == 0)
{
return Surface0;
}
else if (index == 1)
{
return Surface1;
}
else if (index == 2)
{
return Surface2;
}
throw new IndexOutOfRangeException();
}
}
}
}

View file

@ -0,0 +1,35 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
[StructLayout(LayoutKind.Explicit)]
struct QueueBufferObject
{
[FieldOffset(0x0)]
public long Timestamp;
[FieldOffset(0x8)]
public int IsAutoTimestamp;
[FieldOffset(0xC)]
public Rect Crop;
[FieldOffset(0x1C)]
public int ScalingMode;
[FieldOffset(0x20)]
public HalTransform Transform;
[FieldOffset(0x24)]
public int StickyTransform;
[FieldOffset(0x28)]
public int Unknown;
[FieldOffset(0x2C)]
public int SwapInterval;
[FieldOffset(0x30)]
public MultiFence Fence;
}
}

View file

@ -0,0 +1,13 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Android
{
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
struct Rect
{
public int Top;
public int Left;
public int Right;
public int Bottom;
}
}

View file

@ -1,7 +1,6 @@
namespace Ryujinx.HLE.HOS.Services.Apm namespace Ryujinx.HLE.HOS.Services.Apm
{ {
[Service("apm")] [Service("apm")] // 8.0.0+
[Service("apm:p")]
class IManager : IpcService class IManager : IpcService
{ {
public IManager(ServiceCtx context) { } public IManager(ServiceCtx context) { }

View file

@ -2,7 +2,7 @@
using Ryujinx.HLE.Utilities; using Ryujinx.HLE.Utilities;
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Glue namespace Ryujinx.HLE.HOS.Services.Arp
{ {
class ApplicationLaunchProperty class ApplicationLaunchProperty
{ {

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Hid
{
[Service("arp:r")]
class IReader : IpcService
{
public IReader(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Arp
{
[Service("arp:w")]
class IWriter : IpcService
{
public IWriter(ServiceCtx context) { }
}
}

View file

@ -5,7 +5,7 @@ using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut namespace Ryujinx.HLE.HOS.Services.Audio.AudioOutManager
{ {
class IAudioOut : IpcService, IDisposable class IAudioOut : IpcService, IDisposable
{ {

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut namespace Ryujinx.HLE.HOS.Services.Audio.AudioOutManager
{ {
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
struct AudioOutData struct AudioOutData

View file

@ -6,7 +6,7 @@ using Ryujinx.HLE.HOS.SystemState;
using System; using System;
using System.Text; using System.Text;
namespace Ryujinx.HLE.HOS.Services.Aud namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
class IAudioDevice : IpcService class IAudioDevice : IpcService
{ {

View file

@ -11,7 +11,7 @@ using System.Runtime.InteropServices;
using System.Runtime.Intrinsics; using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86; using System.Runtime.Intrinsics.X86;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
class IAudioRenderer : IpcService, IDisposable class IAudioRenderer : IpcService, IDisposable
{ {
@ -280,9 +280,10 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
return null; return null;
} }
AdpcmDecoderContext context = new AdpcmDecoderContext(); AdpcmDecoderContext context = new AdpcmDecoderContext
{
context.Coefficients = new short[size >> 1]; Coefficients = new short[size >> 1]
};
for (int offset = 0; offset < size; offset += 2) for (int offset = 0; offset < size; offset += 2)
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
class MemoryPoolContext class MemoryPoolContext
{ {

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
static class Resampler static class Resampler
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
static class AudioConsts static class AudioConsts
{ {

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
struct AudioRendererParameter struct AudioRendererParameter

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 4)] [StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 4)]
struct BehaviorIn struct BehaviorIn

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential, Size = 0xc, Pack = 1)] [StructLayout(LayoutKind.Sequential, Size = 0xc, Pack = 1)]
struct BiquadFilter struct BiquadFilter

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential, Size = 0x20, Pack = 4)] [StructLayout(LayoutKind.Sequential, Size = 0x20, Pack = 4)]
struct MemoryPoolIn struct MemoryPoolIn

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 4)] [StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 4)]
struct MemoryPoolOut struct MemoryPoolOut

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
enum MemoryPoolState enum MemoryPoolState
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
enum PlayState : byte enum PlayState : byte
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
struct UpdateDataHeader struct UpdateDataHeader
{ {

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential, Size = 0x70, Pack = 1)] [StructLayout(LayoutKind.Sequential, Size = 0x70, Pack = 1)]
struct VoiceChannelResourceIn struct VoiceChannelResourceIn

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential, Size = 0x170, Pack = 1)] [StructLayout(LayoutKind.Sequential, Size = 0x170, Pack = 1)]
struct VoiceIn struct VoiceIn

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 4)] [StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 4)]
struct VoiceOut struct VoiceOut

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
[StructLayout(LayoutKind.Sequential, Size = 0x38, Pack = 1)] [StructLayout(LayoutKind.Sequential, Size = 0x38, Pack = 1)]
struct WaveBuffer struct WaveBuffer

View file

@ -2,7 +2,7 @@ using ARMeilleure.Memory;
using Ryujinx.Audio.Adpcm; using Ryujinx.Audio.Adpcm;
using System; using System;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
class VoiceContext class VoiceContext
{ {

View file

@ -1,6 +1,6 @@
using Concentus.Structs; using Concentus.Structs;
namespace Ryujinx.HLE.HOS.Services.Aud namespace Ryujinx.HLE.HOS.Services.Audio.HardwareOpusDecoderManager
{ {
class IHardwareOpusDecoder : IpcService class IHardwareOpusDecoder : IpcService
{ {

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Audio
{
[Service("audctl")]
class IAudioController : IpcService
{
public IAudioController(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Audio
{
[Service("audin:u")]
class IAudioInManager : IpcService
{
public IAudioInManager(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Audio
{
[Service("audin:a")]
class IAudioInManagerForApplet : IpcService
{
public IAudioInManagerForApplet(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Audio
{
[Service("audin:d")]
class IAudioInManagerForDebugger : IpcService
{
public IAudioInManagerForDebugger(ServiceCtx context) { }
}
}

View file

@ -2,10 +2,10 @@ using ARMeilleure.Memory;
using Ryujinx.Audio; using Ryujinx.Audio;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using Ryujinx.HLE.HOS.Services.Aud.AudioOut; using Ryujinx.HLE.HOS.Services.Audio.AudioOutManager;
using System.Text; using System.Text;
namespace Ryujinx.HLE.HOS.Services.Aud namespace Ryujinx.HLE.HOS.Services.Audio
{ {
[Service("audout:u")] [Service("audout:u")]
class IAudioOutManager : IpcService class IAudioOutManager : IpcService

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Audio
{
[Service("audout:a")]
class IAudioOutManagerForApplet : IpcService
{
public IAudioOutManagerForApplet(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Audio
{
[Service("audout:d")]
class IAudioOutManagerForDebugger : IpcService
{
public IAudioOutManagerForDebugger(ServiceCtx context) { }
}
}

View file

@ -1,9 +1,9 @@
using Ryujinx.Audio; using Ryujinx.Audio;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Aud.AudioRenderer; using Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager;
using Ryujinx.HLE.Utilities; using Ryujinx.HLE.Utilities;
namespace Ryujinx.HLE.HOS.Services.Aud namespace Ryujinx.HLE.HOS.Services.Audio
{ {
[Service("audren:u")] [Service("audren:u")]
class IAudioRendererManager : IpcService class IAudioRendererManager : IpcService
@ -123,21 +123,22 @@ namespace Ryujinx.HLE.HOS.Services.Aud
private AudioRendererParameter GetAudioRendererParameter(ServiceCtx context) private AudioRendererParameter GetAudioRendererParameter(ServiceCtx context)
{ {
AudioRendererParameter Params = new AudioRendererParameter(); AudioRendererParameter Params = new AudioRendererParameter
{
Params.SampleRate = context.RequestData.ReadInt32(); SampleRate = context.RequestData.ReadInt32(),
Params.SampleCount = context.RequestData.ReadInt32(); SampleCount = context.RequestData.ReadInt32(),
Params.Unknown8 = context.RequestData.ReadInt32(); Unknown8 = context.RequestData.ReadInt32(),
Params.MixCount = context.RequestData.ReadInt32(); MixCount = context.RequestData.ReadInt32(),
Params.VoiceCount = context.RequestData.ReadInt32(); VoiceCount = context.RequestData.ReadInt32(),
Params.SinkCount = context.RequestData.ReadInt32(); SinkCount = context.RequestData.ReadInt32(),
Params.EffectCount = context.RequestData.ReadInt32(); EffectCount = context.RequestData.ReadInt32(),
Params.PerformanceManagerCount = context.RequestData.ReadInt32(); PerformanceManagerCount = context.RequestData.ReadInt32(),
Params.VoiceDropEnable = context.RequestData.ReadInt32(); VoiceDropEnable = context.RequestData.ReadInt32(),
Params.SplitterCount = context.RequestData.ReadInt32(); SplitterCount = context.RequestData.ReadInt32(),
Params.SplitterDestinationDataCount = context.RequestData.ReadInt32(); SplitterDestinationDataCount = context.RequestData.ReadInt32(),
Params.Unknown2C = context.RequestData.ReadInt32(); Unknown2C = context.RequestData.ReadInt32(),
Params.Revision = context.RequestData.ReadInt32(); Revision = context.RequestData.ReadInt32()
};
return Params; return Params;
} }

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Audio
{
[Service("audren:a")]
class IAudioRendererManagerForApplet : IpcService
{
public IAudioRendererManagerForApplet(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Audio
{
[Service("audren:d")]
class IAudioRendererManagerForDebugger : IpcService
{
public IAudioRendererManagerForDebugger(ServiceCtx context) { }
}
}

Some files were not shown because too many files have changed in this diff Show more