diff --git a/Ryujinx.Core/Config.cs b/Ryujinx.Core/Config.cs index 7dc2dc79d8..11eb1c1dff 100644 --- a/Ryujinx.Core/Config.cs +++ b/Ryujinx.Core/Config.cs @@ -17,6 +17,7 @@ namespace Ryujinx.Core public static bool LoggingEnableError { get; private set; } public static bool LoggingEnableFatal { get; private set; } public static bool LoggingEnableIpc { get; private set; } + public static bool LoggingEnableStub { get; private set; } public static bool LoggingEnableLogFile { get; private set; } public static bool LoggingEnableFilter { get; private set; } public static bool[] LoggingFilteredClasses { get; private set; } @@ -37,6 +38,7 @@ namespace Ryujinx.Core LoggingEnableError = Convert.ToBoolean(Parser.Value("Logging_Enable_Error")); LoggingEnableFatal = Convert.ToBoolean(Parser.Value("Logging_Enable_Fatal")); LoggingEnableIpc = Convert.ToBoolean(Parser.Value("Logging_Enable_Ipc")); + LoggingEnableStub = Convert.ToBoolean(Parser.Value("Logging_Enable_Stub")); LoggingEnableLogFile = Convert.ToBoolean(Parser.Value("Logging_Enable_LogFile")); LoggingEnableFilter = Convert.ToBoolean(Parser.Value("Logging_Enable_Filter")); LoggingFilteredClasses = new bool[(int)LogClass.Count]; diff --git a/Ryujinx.Core/Logging.cs b/Ryujinx.Core/Logging.cs index 1767e1a021..f650960e9f 100644 --- a/Ryujinx.Core/Logging.cs +++ b/Ryujinx.Core/Logging.cs @@ -20,6 +20,7 @@ namespace Ryujinx.Core private static bool EnableWarn = Config.LoggingEnableWarn; private static bool EnableError = Config.LoggingEnableError; private static bool EnableFatal = Config.LoggingEnableFatal; + private static bool EnableStub = Config.LoggingEnableIpc; private static bool EnableIpc = Config.LoggingEnableIpc; private static bool EnableFilter = Config.LoggingEnableFilter; private static bool EnableLogFile = Config.LoggingEnableLogFile; @@ -27,12 +28,13 @@ namespace Ryujinx.Core private enum LogLevel { - Debug = 1, - Error = 2, - Fatal = 3, - Info = 4, - Trace = 5, - Warn = 6 + Debug, + Error, + Fatal, + Info, + Stub, + Trace, + Warn } static Logging() @@ -68,6 +70,9 @@ namespace Ryujinx.Core case LogLevel.Info: consoleColor = ConsoleColor.White; break; + case LogLevel.Stub: + consoleColor = ConsoleColor.DarkYellow; + break; case LogLevel.Trace: consoleColor = ConsoleColor.DarkGray; break; @@ -129,6 +134,21 @@ namespace Ryujinx.Core } } + public static void Stub(LogClass LogClass, string Message, [CallerMemberName] string CallingMember = "") + { + if (EnableStub) + { + LogMessage(new LogEntry + { + CallingMember = CallingMember, + LogLevel = LogLevel.Stub, + LogClass = LogClass, + Message = Message, + ExecutionTime = GetExecutionTime() + }); + } + } + public static void Debug(LogClass LogClass,string Message, [CallerMemberName] string CallingMember = "") { if (EnableDebug) diff --git a/Ryujinx.Core/OsHle/Services/Acc/IAccountServiceForApplication.cs b/Ryujinx.Core/OsHle/Services/Acc/IAccountServiceForApplication.cs index b6b219ee81..75c7725d6d 100644 --- a/Ryujinx.Core/OsHle/Services/Acc/IAccountServiceForApplication.cs +++ b/Ryujinx.Core/OsHle/Services/Acc/IAccountServiceForApplication.cs @@ -22,6 +22,8 @@ namespace Ryujinx.Core.OsHle.Services.Acc public long ListOpenUsers(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAcc, "Stubbed"); + return 0; } @@ -34,6 +36,8 @@ namespace Ryujinx.Core.OsHle.Services.Acc public long InitializeApplicationInfo(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAcc, "Stubbed"); + return 0; } diff --git a/Ryujinx.Core/OsHle/Services/Acc/IManagerForApplication.cs b/Ryujinx.Core/OsHle/Services/Acc/IManagerForApplication.cs index 57f6895fda..cc72a64c0f 100644 --- a/Ryujinx.Core/OsHle/Services/Acc/IManagerForApplication.cs +++ b/Ryujinx.Core/OsHle/Services/Acc/IManagerForApplication.cs @@ -19,12 +19,16 @@ namespace Ryujinx.Core.OsHle.Services.Acc } public long CheckAvailability(ServiceCtx Context) - { + { + Logging.Stub(LogClass.ServiceAcc, "Stubbed"); + return 0; } public long GetAccountId(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAcc, "AccountId = 0xcafeL"); + Context.ResponseData.Write(0xcafeL); return 0; diff --git a/Ryujinx.Core/OsHle/Services/Acc/IProfile.cs b/Ryujinx.Core/OsHle/Services/Acc/IProfile.cs index 92e73f7881..6f316b1c4a 100644 --- a/Ryujinx.Core/OsHle/Services/Acc/IProfile.cs +++ b/Ryujinx.Core/OsHle/Services/Acc/IProfile.cs @@ -19,6 +19,8 @@ namespace Ryujinx.Core.OsHle.Services.Acc public long GetBase(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAcc, "Stubbed"); + Context.ResponseData.Write(0L); Context.ResponseData.Write(0L); Context.ResponseData.Write(0L); diff --git a/Ryujinx.Core/OsHle/Services/Am/IApplicationFunctions.cs b/Ryujinx.Core/OsHle/Services/Am/IApplicationFunctions.cs index ba41727e69..ca4e368a68 100644 --- a/Ryujinx.Core/OsHle/Services/Am/IApplicationFunctions.cs +++ b/Ryujinx.Core/OsHle/Services/Am/IApplicationFunctions.cs @@ -37,6 +37,8 @@ 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.ResponseData.Write(0L); return 0; @@ -44,6 +46,8 @@ namespace Ryujinx.Core.OsHle.Services.Am public long GetDesiredLanguage(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAm, "LanguageId = 1"); + //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. Context.ResponseData.Write(1L); diff --git a/Ryujinx.Core/OsHle/Services/Am/ISelfController.cs b/Ryujinx.Core/OsHle/Services/Am/ISelfController.cs index bf928f79e0..2fb6d8567b 100644 --- a/Ryujinx.Core/OsHle/Services/Am/ISelfController.cs +++ b/Ryujinx.Core/OsHle/Services/Am/ISelfController.cs @@ -32,6 +32,8 @@ namespace Ryujinx.Core.OsHle.Services.Am { bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + Logging.Stub(LogClass.ServiceAm, $"ScreenShot Allowed = {Enable}"); + return 0; } @@ -39,6 +41,8 @@ namespace Ryujinx.Core.OsHle.Services.Am { bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + Logging.Stub(LogClass.ServiceAm, $"OperationMode Changed = {Enable}"); + return 0; } @@ -46,6 +50,8 @@ namespace Ryujinx.Core.OsHle.Services.Am { bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + Logging.Stub(LogClass.ServiceAm, $"PerformanceMode Changed = {Enable}"); + return 0; } @@ -55,6 +61,8 @@ 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}}}"); + return 0; } @@ -62,6 +70,8 @@ namespace Ryujinx.Core.OsHle.Services.Am { bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + Logging.Stub(LogClass.ServiceAm, $"Restart Message Enabled = {Enable}"); + return 0; } @@ -69,6 +79,8 @@ namespace Ryujinx.Core.OsHle.Services.Am { bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + Logging.Stub(LogClass.ServiceAm, $"Out Of Focus Suspending Enabled = {Enable}"); + return 0; } } diff --git a/Ryujinx.Core/OsHle/Services/Am/IWindowController.cs b/Ryujinx.Core/OsHle/Services/Am/IWindowController.cs index 1c10fb9218..b494a64bbe 100644 --- a/Ryujinx.Core/OsHle/Services/Am/IWindowController.cs +++ b/Ryujinx.Core/OsHle/Services/Am/IWindowController.cs @@ -20,6 +20,8 @@ namespace Ryujinx.Core.OsHle.Services.Am public long GetAppletResourceUserId(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAm, $"Applet Resource Id = 0"); + Context.ResponseData.Write(0L); return 0; @@ -27,6 +29,8 @@ namespace Ryujinx.Core.OsHle.Services.Am public long AcquireForegroundRights(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAm, "Stubbed"); + return 0; } } diff --git a/Ryujinx.Core/OsHle/Services/Apm/ISession.cs b/Ryujinx.Core/OsHle/Services/Apm/ISession.cs index 850ce803f1..bbef100cef 100644 --- a/Ryujinx.Core/OsHle/Services/Apm/ISession.cs +++ b/Ryujinx.Core/OsHle/Services/Apm/ISession.cs @@ -32,6 +32,9 @@ namespace Ryujinx.Core.OsHle.Services.Apm Context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1); + Logging.Stub(LogClass.ServiceApm, $"PerformanceMode = {PerfMode}, PerformanceConfiguration =" + + $" {PerformanceConfiguration.PerformanceConfiguration1}"); + return 0; } } diff --git a/Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs b/Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs index 655881929c..59fc4dd08b 100644 --- a/Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs +++ b/Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs @@ -57,6 +57,8 @@ namespace Ryujinx.Core.OsHle.Services.Aud string Name = AMemoryHelper.ReadAsciiString(Context.Memory, Position, Size); + Logging.Stub(LogClass.ServiceAudio, $"Volume = {Volume}, Position = {Position}, Size = {Size}"); + return 0; } } diff --git a/Ryujinx.Core/OsHle/Services/Aud/IAudioOut.cs b/Ryujinx.Core/OsHle/Services/Aud/IAudioOut.cs index 527b653240..3f7a18c4a7 100644 --- a/Ryujinx.Core/OsHle/Services/Aud/IAudioOut.cs +++ b/Ryujinx.Core/OsHle/Services/Aud/IAudioOut.cs @@ -124,14 +124,14 @@ namespace Ryujinx.Core.OsHle.Services.Aud public long AppendAudioOutBufferEx(ServiceCtx Context) { - Logging.Warn(LogClass.ServiceAudio, "Not implemented!"); + Logging.Stub(LogClass.ServiceAudio, "Stubbed"); return 0; } public long GetReleasedAudioOutBufferEx(ServiceCtx Context) { - Logging.Warn(LogClass.ServiceAudio, "Not implemented!"); + Logging.Stub(LogClass.ServiceAudio, "Stubbed"); return 0; } diff --git a/Ryujinx.Core/OsHle/Services/Aud/IAudioRenderer.cs b/Ryujinx.Core/OsHle/Services/Aud/IAudioRenderer.cs index 54c1e41f87..9a20939e66 100644 --- a/Ryujinx.Core/OsHle/Services/Aud/IAudioRenderer.cs +++ b/Ryujinx.Core/OsHle/Services/Aud/IAudioRenderer.cs @@ -54,11 +54,15 @@ namespace Ryujinx.Core.OsHle.Services.Aud public long StartAudioRenderer(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAudio, "Stubbed"); + return 0; } public long StopAudioRenderer(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceAudio, "Stubbed"); + return 0; } diff --git a/Ryujinx.Core/OsHle/Services/Aud/IAudioRendererManager.cs b/Ryujinx.Core/OsHle/Services/Aud/IAudioRendererManager.cs index 07082da7c2..eee47089ec 100644 --- a/Ryujinx.Core/OsHle/Services/Aud/IAudioRendererManager.cs +++ b/Ryujinx.Core/OsHle/Services/Aud/IAudioRendererManager.cs @@ -42,6 +42,8 @@ namespace Ryujinx.Core.OsHle.Services.Aud int Unknown2c = Context.RequestData.ReadInt32(); int Rev1Magic = Context.RequestData.ReadInt32(); + Logging.Stub(LogClass.ServiceAudio, "BufferSize = 0x400L"); + Context.ResponseData.Write(0x400L); return 0; diff --git a/Ryujinx.Core/OsHle/Services/Hid/IHidServer.cs b/Ryujinx.Core/OsHle/Services/Hid/IHidServer.cs index f03b25dd72..951cec0ef7 100644 --- a/Ryujinx.Core/OsHle/Services/Hid/IHidServer.cs +++ b/Ryujinx.Core/OsHle/Services/Hid/IHidServer.cs @@ -45,6 +45,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid public long ActivateDebugPad(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -52,6 +54,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid { long AppletResourceUserId = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -59,6 +63,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid { long AppletResourceUserId = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -66,6 +72,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid { long AppletResourceUserId = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -75,6 +83,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid long AppletResourceUserId = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -82,6 +92,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid { Context.ResponseData.Write(0); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -90,6 +102,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid long Unknown0 = Context.RequestData.ReadInt64(); long Unknown8 = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -97,6 +111,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid { long Unknown = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -104,6 +120,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid { long Unknown = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -112,6 +130,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid long Unknown0 = Context.RequestData.ReadInt64(); long Unknown8 = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -119,6 +139,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid { Context.ResponseData.Write(0L); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -127,6 +149,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32(); long AppletUserResourseId = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -136,6 +160,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid long AppletUserResourseId = Context.RequestData.ReadInt64(); long NpadJoyDeviceType = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -144,6 +170,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32(); long AppletUserResourseId = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -153,6 +181,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid long Unknown8 = Context.RequestData.ReadInt32(); long AppletUserResourseId = Context.RequestData.ReadInt64(); + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } @@ -160,6 +190,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid { int VibrationDeviceHandle = Context.RequestData.ReadInt32(); + Logging.Stub(LogClass.ServiceHid, $"VibrationDeviceHandle = {VibrationDeviceHandle}, VibrationDeviceInfo = 0"); + Context.ResponseData.Write(0L); //VibrationDeviceInfoForIpc return 0; @@ -174,6 +206,8 @@ namespace Ryujinx.Core.OsHle.Services.Hid public long SendVibrationValues(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceHid, "Stubbed"); + return 0; } } diff --git a/Ryujinx.Core/OsHle/Services/Nifm/IGeneralService.cs b/Ryujinx.Core/OsHle/Services/Nifm/IGeneralService.cs index bda307699f..e40ad9f013 100644 --- a/Ryujinx.Core/OsHle/Services/Nifm/IGeneralService.cs +++ b/Ryujinx.Core/OsHle/Services/Nifm/IGeneralService.cs @@ -24,7 +24,7 @@ namespace Ryujinx.Core.OsHle.Services.Nifm MakeObject(Context, new IRequest()); - //Todo: Stub + Logging.Stub(LogClass.ServiceNifm, "Stubbed"); return 0; } diff --git a/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs b/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs index 929bb26e9b..276183cd46 100644 --- a/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs +++ b/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs @@ -31,14 +31,14 @@ namespace Ryujinx.Core.OsHle.Services.Nifm { Context.ResponseData.Write(0); - //Todo: Stub + Logging.Stub(LogClass.ServiceNifm, "Stubbed"); return 0; } public long GetResult(ServiceCtx Context) { - //Todo: Stub + Logging.Stub(LogClass.ServiceNifm, "Stubbed"); return 0; } @@ -56,14 +56,14 @@ namespace Ryujinx.Core.OsHle.Services.Nifm public long Cancel(ServiceCtx Context) { - //Todo: Stub + Logging.Stub(LogClass.ServiceNifm, "Stubbed"); return 0; } public long Submit(ServiceCtx Context) { - //Todo: Stub + Logging.Stub(LogClass.ServiceNifm, "Stubbed"); return 0; } diff --git a/Ryujinx.Core/OsHle/Services/Ns/IAddOnContentManager.cs b/Ryujinx.Core/OsHle/Services/Ns/IAddOnContentManager.cs index 57fea07721..5c08cd628a 100644 --- a/Ryujinx.Core/OsHle/Services/Ns/IAddOnContentManager.cs +++ b/Ryujinx.Core/OsHle/Services/Ns/IAddOnContentManager.cs @@ -22,11 +22,15 @@ namespace Ryujinx.Core.OsHle.Services.Ns { Context.ResponseData.Write(0); + Logging.Stub(LogClass.ServiceNs, "Stubbed"); + return 0; } public static long ListAddOnContent(ServiceCtx Context) { + Logging.Stub(LogClass.ServiceNs, "Stubbed"); + //TODO: This is supposed to write a u32 array aswell. //It's unknown what it contains. Context.ResponseData.Write(0); diff --git a/Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs b/Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs index 0be465058f..21b737a060 100644 --- a/Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs +++ b/Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs @@ -1,4 +1,5 @@ using Ryujinx.Core.OsHle.Ipc; +using Ryujinx.Core.Settings; using System.Collections.Generic; namespace Ryujinx.Core.OsHle.Services.Set @@ -27,6 +28,9 @@ namespace Ryujinx.Core.OsHle.Services.Set public static long SetColorSetId(ServiceCtx Context) { + int ColorSetId = Context.RequestData.ReadInt32(); + + Context.Ns.Settings.ThemeColor = (ColorSet)ColorSetId; return 0; } } diff --git a/Ryujinx/Ryujinx.conf b/Ryujinx/Ryujinx.conf index 9761c35663..0c88b34b4c 100644 --- a/Ryujinx/Ryujinx.conf +++ b/Ryujinx/Ryujinx.conf @@ -19,6 +19,9 @@ Logging_Enable_Error = true #Enable print fatal logs Logging_Enable_Fatal = true +#Enable print stubbed calls logs +Logging_Enable_Stub = false + #Enable print Ipc logs Logging_Enable_Ipc = false