Improved logging (#103)

This commit is contained in:
gdkchan
2018-04-24 15:57:39 -03:00
committed by GitHub
parent 4e24866b47
commit a8ba340dde
57 changed files with 555 additions and 870 deletions

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -13,9 +14,9 @@ namespace Ryujinx.Core.OsHle.Services.Acc
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, GetUserCount },
{ 3, ListOpenUsers },
{ 5, GetProfile },
{ 0, GetUserCount },
{ 3, ListOpenUsers },
{ 5, GetProfile },
{ 100, InitializeApplicationInfo },
{ 101, GetBaasAccountManagerForApplication }
};
@@ -25,14 +26,14 @@ namespace Ryujinx.Core.OsHle.Services.Acc
{
Context.ResponseData.Write(0);
Logging.Stub(LogClass.ServiceAcc, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
return 0;
}
public long ListOpenUsers(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAcc, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
return 0;
}
@@ -46,7 +47,7 @@ namespace Ryujinx.Core.OsHle.Services.Acc
public long InitializeApplicationInfo(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAcc, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -20,14 +21,14 @@ namespace Ryujinx.Core.OsHle.Services.Acc
public long CheckAvailability(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAcc, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
return 0;
}
public long GetAccountId(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAcc, "AccountId = 0xcafeL");
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
Context.ResponseData.Write(0xcafeL);

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -19,7 +20,7 @@ namespace Ryujinx.Core.OsHle.Services.Acc
public long GetBase(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAcc, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
@@ -28,7 +29,7 @@ namespace Ryujinx.Core.OsHle.Services.Acc
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
return 0;
}
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
using System.IO;
@@ -14,7 +15,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 1, PopLaunchParameter },
{ 1, PopLaunchParameter },
{ 20, EnsureSaveData },
{ 21, GetDesiredLanguage },
{ 22, SetTerminateResult },
@@ -38,7 +39,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
long UIdLow = Context.RequestData.ReadInt64();
long UIdHigh = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceAm, $"UidLow = {UIdLow}, UidHigh = {UIdHigh}");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
Context.ResponseData.Write(0L);
@@ -47,7 +48,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
public long GetDesiredLanguage(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAm, "LanguageId = 1");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
//This is an enumerator where each number is a differnet language.
//0 is Japanese and 1 is English, need to figure out the other codes.
@@ -60,14 +61,21 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
int ErrorCode = Context.RequestData.ReadInt32();
int Module = ErrorCode & 0xFF;
int Description = (ErrorCode >> 9) & 0xFFF;
string Result = GetFormattedErrorCode(ErrorCode);
Logging.Info(LogClass.ServiceAm, $"({(ErrorModule)Module}){2000 + Module}-{Description}");
Context.Ns.Log.PrintInfo(LogClass.ServiceAm, $"Result = 0x{ErrorCode:x8} ({Result}).");
return 0;
}
private string GetFormattedErrorCode(int ErrorCode)
{
int Module = (ErrorCode >> 0) & 0x1ff;
int Description = (ErrorCode >> 9) & 0x1fff;
return $"{(2000 + Module):d4}-{Description:d4}";
}
public long GetDisplayVersion(ServiceCtx Context)
{
//FIXME: Need to check correct version on a switch.

View File

@@ -13,13 +13,13 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, GetCommonStateGetter },
{ 1, GetSelfController },
{ 2, GetWindowController },
{ 3, GetAudioController },
{ 4, GetDisplayController },
{ 11, GetLibraryAppletCreator },
{ 20, GetApplicationFunctions },
{ 0, GetCommonStateGetter },
{ 1, GetSelfController },
{ 2, GetWindowController },
{ 3, GetAudioController },
{ 4, GetDisplayController },
{ 11, GetLibraryAppletCreator },
{ 20, GetApplicationFunctions },
{ 1000, GetDebugFunctions }
};
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -16,7 +17,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{ 0, SetExpectedMasterVolume },
{ 1, GetMainAppletExpectedMasterVolume },
{ 2, GetLibraryAppletExpectedMasterVolume },
{ 3, ChangeMainAppletMasterVolume },
{ 3, ChangeMainAppletMasterVolume },
{ 4, SetTransparentVolumeRate }
};
}
@@ -26,7 +27,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
float AppletVolume = Context.RequestData.ReadSingle();
float LibraryAppletVolume = Context.RequestData.ReadSingle();
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -35,7 +36,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
Context.ResponseData.Write(1f);
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -44,7 +45,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
Context.ResponseData.Write(1f);
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -54,7 +55,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
float Unknown0 = Context.RequestData.ReadSingle();
long Unknown1 = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -63,7 +64,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
float Unknown0 = Context.RequestData.ReadSingle();
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -66,7 +67,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
Context.ResponseData.Write((byte)0); //Unknown value.
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -26,7 +27,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
public long RequestToGetForeground(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -37,7 +38,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -33,7 +34,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
Logging.Stub(LogClass.ServiceAm, $"ScreenShot Allowed = {Enable}");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -42,7 +43,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
Logging.Stub(LogClass.ServiceAm, $"OperationMode Changed = {Enable}");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -51,7 +52,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
Logging.Stub(LogClass.ServiceAm, $"PerformanceMode Changed = {Enable}");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -62,7 +63,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
bool Flag2 = Context.RequestData.ReadByte() != 0 ? true : false;
bool Flag3 = Context.RequestData.ReadByte() != 0 ? true : false;
Logging.Stub(LogClass.ServiceAm, $"Focus Handling Mode Flags = {{{Flag1}|{Flag2}|{Flag3}}}");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -71,7 +72,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
Logging.Stub(LogClass.ServiceAm, $"Restart Message Enabled = {Enable}");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -80,7 +81,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
Logging.Stub(LogClass.ServiceAm, $"Out Of Focus Suspending Enabled = {Enable}");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
@@ -89,7 +90,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
Logging.Stub(LogClass.ServiceAm, $"HandlesRequestToDisplay Allowed = {Enable}");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}

View File

@@ -17,7 +17,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, GetSize },
{ 0, GetSize },
{ 11, Read }
};
@@ -45,7 +45,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
if (Storage.Data.Length > Size)
{
Data = new byte[Size];
Buffer.BlockCopy(Storage.Data, 0, Data, 0, Size);
}
else

View File

@@ -13,15 +13,15 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, GetCommonStateGetter },
{ 1, GetSelfController },
{ 2, GetWindowController },
{ 3, GetAudioController },
{ 4, GetDisplayController },
{ 11, GetLibraryAppletCreator },
{ 20, GetHomeMenuFunctions },
{ 21, GetGlobalStateController },
{ 22, GetApplicationCreator },
{ 0, GetCommonStateGetter },
{ 1, GetSelfController },
{ 2, GetWindowController },
{ 3, GetAudioController },
{ 4, GetDisplayController },
{ 11, GetLibraryAppletCreator },
{ 20, GetHomeMenuFunctions },
{ 21, GetGlobalStateController },
{ 22, GetApplicationCreator },
{ 1000, GetDebugFunctions }
};
}
@@ -45,8 +45,8 @@ namespace Ryujinx.Core.OsHle.Services.Am
MakeObject(Context, new IWindowController());
return 0;
}
}
public long GetAudioController(ServiceCtx Context)
{
MakeObject(Context, new IAudioController());

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -13,14 +14,14 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 1, GetAppletResourceUserId },
{ 1, GetAppletResourceUserId },
{ 10, AcquireForegroundRights }
};
}
public long GetAppletResourceUserId(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAm, $"Applet Resource Id = 0");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
Context.ResponseData.Write(0L);
@@ -29,7 +30,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
public long AcquireForegroundRights(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -32,8 +33,7 @@ namespace Ryujinx.Core.OsHle.Services.Apm
Context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1);
Logging.Stub(LogClass.ServiceApm, $"PerformanceMode = {PerfMode}, PerformanceConfiguration =" +
$" {PerformanceConfiguration.PerformanceConfiguration1}");
Context.Ns.Log.PrintStub(LogClass.ServiceApm, "Stubbed.");
return 0;
}

View File

@@ -1,4 +1,5 @@
using ChocolArm64.Memory;
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -68,7 +69,7 @@ namespace Ryujinx.Core.OsHle.Services.Aud
string Name = AMemoryHelper.ReadAsciiString(Context.Memory, Position, Size);
Logging.Stub(LogClass.ServiceAudio, $"Volume = {Volume}, Position = {Position}, Size = {Size}");
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
return 0;
}
@@ -93,7 +94,7 @@ namespace Ryujinx.Core.OsHle.Services.Aud
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
Logging.Stub(LogClass.ServiceAudio, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
return 0;
}
@@ -102,7 +103,7 @@ namespace Ryujinx.Core.OsHle.Services.Aud
{
Context.ResponseData.Write(2);
Logging.Stub(LogClass.ServiceAudio, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
return 0;
}

View File

@@ -1,5 +1,6 @@
using ChocolArm64.Memory;
using Ryujinx.Audio;
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System;
@@ -67,7 +68,7 @@ namespace Ryujinx.Core.OsHle.Services.Aud
AudioOutData Data = AMemoryHelper.Read<AudioOutData>(
Context.Memory,
Context.Request.SendBuff[0].Position);
byte[] Buffer = AMemoryHelper.ReadBytes(
Context.Memory,
Data.SampleBufferPtr,
@@ -124,14 +125,14 @@ namespace Ryujinx.Core.OsHle.Services.Aud
public long AppendAudioOutBufferEx(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAudio, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
return 0;
}
public long GetReleasedAudioOutBufferEx(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAudio, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System;
@@ -54,14 +55,14 @@ namespace Ryujinx.Core.OsHle.Services.Aud
public long StartAudioRenderer(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAudio, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
return 0;
}
public long StopAudioRenderer(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceAudio, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -42,7 +43,7 @@ namespace Ryujinx.Core.OsHle.Services.Aud
int Unknown2c = Context.RequestData.ReadInt32();
int Rev1Magic = Context.RequestData.ReadInt32();
Logging.Stub(LogClass.ServiceAudio, "BufferSize = 0x400L");
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
Context.ResponseData.Write(0x400L);

View File

@@ -21,11 +21,11 @@ namespace Ryujinx.Core.OsHle.Services.Bsd
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, Initialize },
{ 1, StartMonitoring },
{ 2, Socket },
{ 6, Poll },
{ 8, Recv },
{ 0, Initialize },
{ 1, StartMonitoring },
{ 2, Socket },
{ 6, Poll },
{ 8, Recv },
{ 10, Send },
{ 11, SendTo },
{ 12, Accept },
@@ -428,9 +428,8 @@ namespace Ryujinx.Core.OsHle.Services.Bsd
Reader.ReadByte().ToString() + "." +
Reader.ReadByte().ToString();
Logging.Debug(LogClass.ServiceBsd, $"Try to connect to {IpAddress}:{Port}");
Sockets[SocketId].IpAddress = IPAddress.Parse(IpAddress);
Sockets[SocketId].RemoteEP = new IPEndPoint(Sockets[SocketId].IpAddress, Port);
}
}

View File

@@ -22,16 +22,16 @@ namespace Ryujinx.Core.OsHle.Services.FspSrv
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, CreateFile },
{ 1, DeleteFile },
{ 2, CreateDirectory },
{ 3, DeleteDirectory },
{ 4, DeleteDirectoryRecursively },
{ 5, RenameFile },
{ 6, RenameDirectory },
{ 7, GetEntryType },
{ 8, OpenFile },
{ 9, OpenDirectory },
{ 0, CreateFile },
{ 1, DeleteFile },
{ 2, CreateDirectory },
{ 3, DeleteDirectory },
{ 4, DeleteDirectoryRecursively },
{ 5, RenameFile },
{ 6, RenameDirectory },
{ 7, GetEntryType },
{ 8, OpenFile },
{ 9, OpenDirectory },
{ 10, Commit },
{ 11, GetFreeSpaceSize },
{ 12, GetTotalSpaceSize },

View File

@@ -13,11 +13,11 @@ namespace Ryujinx.Core.OsHle.Services.FspSrv
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 1, SetCurrentProcess },
{ 18, OpenSdCardFileSystem },
{ 51, OpenSaveDataFileSystem },
{ 200, OpenDataStorageByCurrentProcess },
{ 203, OpenPatchDataStorageByCurrentProcess },
{ 1, SetCurrentProcess },
{ 18, OpenSdCardFileSystem },
{ 51, OpenSaveDataFileSystem },
{ 200, OpenDataStorageByCurrentProcess },
{ 203, OpenPatchDataStorageByCurrentProcess },
{ 1005, GetGlobalAccessLogMode }
};
}

View File

@@ -1,4 +1,5 @@
using Ryujinx.Core.Input;
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -14,13 +15,13 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, CreateAppletResource },
{ 1, ActivateDebugPad },
{ 11, ActivateTouchScreen },
{ 21, ActivateMouse },
{ 31, ActivateKeyboard },
{ 66, StartSixAxisSensor },
{ 79, SetGyroscopeZeroDriftMode },
{ 0, CreateAppletResource },
{ 1, ActivateDebugPad },
{ 11, ActivateTouchScreen },
{ 21, ActivateMouse },
{ 31, ActivateKeyboard },
{ 66, StartSixAxisSensor },
{ 79, SetGyroscopeZeroDriftMode },
{ 100, SetSupportedNpadStyleSet },
{ 101, GetSupportedNpadStyleSet },
{ 102, SetSupportedNpadIdType },
@@ -49,7 +50,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
public long ActivateDebugPad(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -58,7 +59,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
long AppletResourceUserId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -67,7 +68,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
long AppletResourceUserId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -76,7 +77,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
long AppletResourceUserId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -87,18 +88,18 @@ namespace Ryujinx.Core.OsHle.Services.Hid
long AppletResourceUserId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
public long SetGyroscopeZeroDriftMode(ServiceCtx Context)
{
int Handle = Context.RequestData.ReadInt32();
int Unknown = Context.RequestData.ReadInt32();
int Handle = Context.RequestData.ReadInt32();
int Unknown = Context.RequestData.ReadInt32();
long AppletResourceUserId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -107,7 +108,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
Context.ResponseData.Write(0);
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -117,7 +118,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
long Unknown0 = Context.RequestData.ReadInt64();
long Unknown8 = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -126,7 +127,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
long Unknown = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -135,7 +136,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
long Unknown = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -146,7 +147,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
Context.ResponseData.Write(0L);
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -156,7 +157,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
long Unknown0 = Context.RequestData.ReadInt64();
long Unknown8 = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -165,7 +166,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
Context.ResponseData.Write(0L);
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -173,9 +174,10 @@ namespace Ryujinx.Core.OsHle.Services.Hid
public long SetNpadJoyAssignmentModeSingleByDefault(ServiceCtx Context)
{
HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
long AppletUserResourceId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -183,10 +185,11 @@ namespace Ryujinx.Core.OsHle.Services.Hid
public long SetNpadJoyAssignmentModeSingle(ServiceCtx Context)
{
HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
long AppletUserResourceId = Context.RequestData.ReadInt64();
long NpadJoyDeviceType = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
long AppletUserResourceId = Context.RequestData.ReadInt64();
long NpadJoyDeviceType = Context.RequestData.ReadInt64();
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -194,20 +197,21 @@ namespace Ryujinx.Core.OsHle.Services.Hid
public long SetNpadJoyAssignmentModeDual(ServiceCtx Context)
{
HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
long AppletUserResourceId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
public long MergeSingleJoyAsDualJoy(ServiceCtx Context)
{
long Unknown0 = Context.RequestData.ReadInt32();
long Unknown8 = Context.RequestData.ReadInt32();
long Unknown0 = Context.RequestData.ReadInt32();
long Unknown8 = Context.RequestData.ReadInt32();
long AppletUserResourceId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -215,9 +219,9 @@ namespace Ryujinx.Core.OsHle.Services.Hid
public long SetNpadHandheldActivationMode(ServiceCtx Context)
{
long AppletUserResourceId = Context.RequestData.ReadInt64();
long Unknown = Context.RequestData.ReadInt64();
long Unknown = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -226,7 +230,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
{
int VibrationDeviceHandle = Context.RequestData.ReadInt32();
Logging.Stub(LogClass.ServiceHid, $"VibrationDeviceHandle = {VibrationDeviceHandle}, VibrationDeviceInfo = 0");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
Context.ResponseData.Write(0L); //VibrationDeviceInfoForIpc
@@ -244,7 +248,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
long AppletUserResourceId = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}
@@ -258,7 +262,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid
public long SendVibrationValues(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceHid, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System;
@@ -81,7 +82,7 @@ namespace Ryujinx.Core.OsHle.Services
{
Context.ResponseData.BaseStream.Seek(IsDomain ? 0x20 : 0x10, SeekOrigin.Begin);
Logging.Trace(LogClass.KernelIpc, $"{Service.GetType().Name}: {ProcessRequest.Method.Name}");
Context.Ns.Log.PrintDebug(LogClass.KernelIpc, $"{Service.GetType().Name}: {ProcessRequest.Method.Name}");
long Result = ProcessRequest(Context);

View File

@@ -1,6 +1,6 @@
using ChocolArm64.Memory;
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
@@ -21,123 +21,68 @@ namespace Ryujinx.Core.OsHle.Services.Lm
};
}
enum Flags
{
Padding,
IsHead,
IsTail
}
enum Severity
{
Trace,
Info,
Warning,
Error,
Critical
}
enum Field
{
Padding,
Skip,
Message,
Line,
Filename,
Function,
Module,
Thread
}
public long Log(ServiceCtx Context)
{
long BufferPosition = Context.Request.PtrBuff[0].Position;
long BufferLen = Context.Request.PtrBuff[0].Size;
byte[] LogBuffer = AMemoryHelper.ReadBytes(
Context.Memory,
Context.Request.PtrBuff[0].Position,
Context.Request.PtrBuff[0].Size);
byte[] LogBuffer = AMemoryHelper.ReadBytes(Context.Memory, BufferPosition, BufferLen);
MemoryStream LogMessage = new MemoryStream(LogBuffer);
BinaryReader bReader = new BinaryReader(LogMessage);
//Header reading.
long Pid = bReader.ReadInt64();
long ThreadCxt = bReader.ReadInt64();
int Infos = bReader.ReadInt32();
int PayloadLen = bReader.ReadInt32();
int iFlags = Infos & 0xFFFF;
int iSeverity = (Infos >> 17) & 0x7F;
int iVerbosity = (Infos >> 25) & 0x7F;
//ToDo: For now we don't care about Head or Tail Log.
bool IsHeadLog = Convert.ToBoolean(iFlags & (int)Flags.IsHead);
bool IsTailLog = Convert.ToBoolean(iFlags & (int)Flags.IsTail);
string LogString = "nn::diag::detail::LogImpl()" + Environment.NewLine + Environment.NewLine +
"Header:" + Environment.NewLine +
$" Pid: {Pid}" + Environment.NewLine +
$" ThreadContext: {ThreadCxt}" + Environment.NewLine +
$" Flags: {IsHeadLog}/{IsTailLog}" + Environment.NewLine +
$" Severity: {Enum.GetName(typeof(Severity), iSeverity)}" + Environment.NewLine +
$" Verbosity: {iVerbosity}";
LogString += Environment.NewLine + Environment.NewLine + "Message:" + Environment.NewLine;
string StrMessage = "", StrLine = "", StrFilename = "", StrFunction = "",
StrModule = "", StrThread = "";
do
using (MemoryStream MS = new MemoryStream(LogBuffer))
{
byte FieldType = bReader.ReadByte();
byte FieldSize = bReader.ReadByte();
BinaryReader Reader = new BinaryReader(MS);
if ((Field)FieldType != Field.Skip || FieldSize != 0)
long Pid = Reader.ReadInt64();
long ThreadContext = Reader.ReadInt64();
short Flags = Reader.ReadInt16();
byte Level = Reader.ReadByte();
byte Verbosity = Reader.ReadByte();
int PayloadLength = Reader.ReadInt32();
StringBuilder SB = new StringBuilder();
SB.AppendLine("Guest log:");
while (MS.Position < MS.Length)
{
byte[] Message = bReader.ReadBytes(FieldSize);
switch ((Field)FieldType)
byte Type = Reader.ReadByte();
byte Size = Reader.ReadByte();
LmLogField Field = (LmLogField)Type;
string FieldStr = string.Empty;
if (Field == LmLogField.Skip)
{
case Field.Message:
StrMessage = Encoding.UTF8.GetString(Message);
break;
Reader.ReadByte();
case Field.Line:
StrLine = BitConverter.ToInt32(Message, 0).ToString();
break;
case Field.Filename:
StrFilename = Encoding.UTF8.GetString(Message);
break;
case Field.Function:
StrFunction = Encoding.UTF8.GetString(Message);
break;
case Field.Module:
StrModule = Encoding.UTF8.GetString(Message);
break;
case Field.Thread:
StrThread = Encoding.UTF8.GetString(Message);
break;
continue;
}
else if (Field == LmLogField.Line)
{
FieldStr = Field + ": " + Reader.ReadInt32();
}
else
{
FieldStr = Field + ": \"" + Encoding.UTF8.GetString(Reader.ReadBytes(Size)) + "\"";
}
SB.AppendLine(" " + FieldStr);
}
}
while (LogMessage.Position != PayloadLen + 0x18); // 0x18 - Size of Header LogMessage.
LogString += StrModule + " > " + StrThread + ": " + StrFilename + "@" + StrFunction + "(" + StrLine + ") '" + StrMessage + "'" + Environment.NewLine;
string Text = SB.ToString();
switch((Severity)iSeverity)
{
case Severity.Trace: Logging.Trace(LogClass.ServiceLm, LogString); break;
case Severity.Info: Logging.Info(LogClass.ServiceLm, LogString); break;
case Severity.Warning: Logging.Warn(LogClass.ServiceLm, LogString); break;
case Severity.Error: Logging.Error(LogClass.ServiceLm, LogString); break;
case Severity.Critical: Logging.Fatal(LogClass.ServiceLm, LogString); break;
switch((LmLogLevel)Level)
{
case LmLogLevel.Trace: Context.Ns.Log.PrintDebug (LogClass.ServiceLm, Text); break;
case LmLogLevel.Info: Context.Ns.Log.PrintInfo (LogClass.ServiceLm, Text); break;
case LmLogLevel.Warning: Context.Ns.Log.PrintWarning(LogClass.ServiceLm, Text); break;
case LmLogLevel.Error: Context.Ns.Log.PrintError (LogClass.ServiceLm, Text); break;
case LmLogLevel.Critical: Context.Ns.Log.PrintError (LogClass.ServiceLm, Text); break;
}
}
return 0;
}
}
}

View File

@@ -0,0 +1,13 @@
namespace Ryujinx.Core.OsHle.Services.Lm
{
enum LmLogField
{
Skip = 1,
Message = 2,
Line = 3,
Filename = 4,
Function = 5,
Module = 6,
Thread = 7
}
}

View File

@@ -0,0 +1,11 @@
namespace Ryujinx.Core.OsHle.Services.Lm
{
enum LmLogLevel
{
Trace,
Info,
Warning,
Error,
Critical
}
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -24,7 +25,7 @@ namespace Ryujinx.Core.OsHle.Services.Nifm
MakeObject(Context, new IRequest());
Logging.Stub(LogClass.ServiceNifm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System;
@@ -31,14 +32,14 @@ namespace Ryujinx.Core.OsHle.Services.Nifm
{
Context.ResponseData.Write(0);
Logging.Stub(LogClass.ServiceNifm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
return 0;
}
public long GetResult(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceNifm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
return 0;
}
@@ -56,14 +57,14 @@ namespace Ryujinx.Core.OsHle.Services.Nifm
public long Cancel(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceNifm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
return 0;
}
public long Submit(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceNifm, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
return 0;
}

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
@@ -22,14 +23,14 @@ namespace Ryujinx.Core.OsHle.Services.Ns
{
Context.ResponseData.Write(0);
Logging.Stub(LogClass.ServiceNs, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceNs, "Stubbed.");
return 0;
}
public static long ListAddOnContent(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceNs, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceNs, "Stubbed.");
//TODO: This is supposed to write a u32 array aswell.
//It's unknown what it contains.

View File

@@ -1,4 +1,5 @@
using ChocolArm64.Memory;
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using Ryujinx.Core.OsHle.Utilities;
@@ -228,7 +229,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}
@@ -634,7 +635,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
Context.Memory.WriteInt32(Position + 4, Map.Handle);
Logging.Info(LogClass.ServiceNv, $"NvMap {Map.Id} created with size {Size:x8}!");
Context.Ns.Log.PrintInfo(LogClass.ServiceNv, $"NvMap {Map.Id} created with size {Size:x8}!");
return 0;
}
@@ -649,7 +650,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Id {Id}!");
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap Id {Id}!");
return -1; //TODO: Corrent error code.
}
@@ -676,7 +677,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}
@@ -695,14 +696,14 @@ namespace Ryujinx.Core.OsHle.Services.Nv
MemReader Reader = new MemReader(Context.Memory, Position);
MemWriter Writer = new MemWriter(Context.Memory, Position + 8);
int Handle = Reader.ReadInt32();
int Padding = Reader.ReadInt32();
int Handle = Reader.ReadInt32();
int Padding = Reader.ReadInt32();
NvMap Map = NvMaps.GetData<NvMap>(Context.Process, Handle);
if (Map == null)
{
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}
@@ -727,7 +728,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}
@@ -757,7 +758,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}

View File

@@ -103,6 +103,9 @@ namespace Ryujinx.Core.OsHle.Services
case "pl:u":
return new ISharedFontManager();
case "prepo:a":
return new IPrepoService();
case "prepo:u":
return new IPrepoService();

View File

@@ -17,7 +17,7 @@ namespace Ryujinx.Core.OsHle.Services.Set
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 4, GetFirmwareVersion2 },
{ 4, GetFirmwareVersion2 },
{ 23, GetColorSetId },
{ 24, SetColorSetId }
};

View File

@@ -1,3 +1,4 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System;
using System.Collections.Generic;
@@ -16,14 +17,14 @@ namespace Ryujinx.Core.OsHle.Services.Time
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, GetDeviceLocationName },
{ 0, GetDeviceLocationName },
{ 101, ToCalendarTimeWithMyRule }
};
}
public long GetDeviceLocationName(ServiceCtx Context)
{
Logging.Stub(LogClass.ServiceTime, "Stubbed");
Context.Ns.Log.PrintStub(LogClass.ServiceTime, "Stubbed.");
for (int Index = 0; Index < 0x24; Index++)
{
@@ -60,7 +61,7 @@ namespace Ryujinx.Core.OsHle.Services.Time
*/
Context.ResponseData.Write((int)CurrentTime.DayOfWeek);
Context.ResponseData.Write(CurrentTime.DayOfYear);
Context.ResponseData.Write(CurrentTime.DayOfYear - 1);
//TODO: Find out the names used.
Context.ResponseData.Write(new byte[8]);

View File

@@ -19,10 +19,10 @@ namespace Ryujinx.Core.OsHle.Services.Vi
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 100, GetRelayService },
{ 101, GetSystemDisplayService },
{ 102, GetManagerDisplayService },
{ 103, GetIndirectDisplayTransactionService },
{ 100, GetRelayService },
{ 101, GetSystemDisplayService },
{ 102, GetManagerDisplayService },
{ 103, GetIndirectDisplayTransactionService },
{ 1010, OpenDisplay },
{ 1020, CloseDisplay },
{ 1102, GetDisplayResolution },

View File

@@ -1,4 +1,5 @@
using ChocolArm64.Memory;
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Services.Nv;
using Ryujinx.Graphics.Gal;
@@ -112,7 +113,7 @@ namespace Ryujinx.Core.OsHle.Services.Android
if (Commands.TryGetValue((InterfaceName, Code), out ServiceProcessParcel ProcReq))
{
Logging.Debug(LogClass.ServiceNv, $"{InterfaceName} {ProcReq.Method.Name}");
Context.Ns.Log.PrintDebug(LogClass.ServiceVi, $"{InterfaceName} {ProcReq.Method.Name}");
return ProcReq(Context, Reader);
}
@@ -412,8 +413,6 @@ namespace Ryujinx.Core.OsHle.Services.Android
break;
}
Logging.Debug(LogClass.ServiceNv, "Waiting for a free BufferQueue slot...");
if (Disposed)
{
break;
@@ -426,8 +425,6 @@ namespace Ryujinx.Core.OsHle.Services.Android
}
while (!Disposed);
Logging.Debug(LogClass.ServiceNv, $"Found free BufferQueue slot {Slot}!");
return Slot;
}