Improved Logger (#1292)

* Logger class changes only

Now compile-time checking is possible with the help of Nullable Value
types.

* Misc formatting

* Manual optimizations

PrintGuestLog
PrintGuestStackTrace
Surfaceflinger DequeueBuffer

* Reduce SendVibrationXX log level to Debug

* Add Notice log level

This level is always enabled and used to print system info, etc...
Also, rewrite LogColor to switch expression as colors are static

* Unify unhandled exception event handlers

* Print enabled LogLevels during init

* Re-add App Exit disposes in proper order

nit: switch case spacing

* Revert PrintGuestStackTrace to Info logs due to #1407

PrintGuestStackTrace is now called in some critical error handlers
so revert to old behavior as KThread isn't part of Guest.

* Batch replace Logger statements
This commit is contained in:
mageven 2020-08-04 05:02:53 +05:30 committed by GitHub
parent 60db4c3530
commit a33dc2f491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
120 changed files with 800 additions and 809 deletions

View file

@ -98,9 +98,6 @@ namespace ARMeilleure.Translation.PTC
CachePathBackup = string.Empty; CachePathBackup = string.Empty;
Disable(); Disable();
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
} }
public static void Initialize(string titleIdText, string displayVersion, bool enabled) public static void Initialize(string titleIdText, string displayVersion, bool enabled)
@ -126,7 +123,7 @@ namespace ARMeilleure.Translation.PTC
return; return;
} }
Logger.PrintInfo(LogClass.Ptc, $"Initializing Profiled Persistent Translation Cache (enabled: {enabled})."); Logger.Info?.Print(LogClass.Ptc, $"Initializing Profiled Persistent Translation Cache (enabled: {enabled}).");
TitleIdText = titleIdText; TitleIdText = titleIdText;
DisplayVersion = !String.IsNullOrEmpty(displayVersion) ? displayVersion : DisplayVersionDefault; DisplayVersion = !String.IsNullOrEmpty(displayVersion) ? displayVersion : DisplayVersionDefault;
@ -624,11 +621,11 @@ namespace ARMeilleure.Translation.PTC
do do
{ {
Logger.PrintInfo(LogClass.Ptc, $"{funcsCount + _translateCount} of {ProfiledFuncsCount} functions to translate - {_rejitCount} functions rejited"); Logger.Info?.Print(LogClass.Ptc, $"{funcsCount + _translateCount} of {ProfiledFuncsCount} functions to translate - {_rejitCount} functions rejited");
} }
while (!_loggerEvent.WaitOne(refreshRate * 1000)); while (!_loggerEvent.WaitOne(refreshRate * 1000));
Logger.PrintInfo(LogClass.Ptc, $"{funcsCount + _translateCount} of {ProfiledFuncsCount} functions to translate - {_rejitCount} functions rejited"); Logger.Info?.Print(LogClass.Ptc, $"{funcsCount + _translateCount} of {ProfiledFuncsCount} functions to translate - {_rejitCount} functions rejited");
} }
internal static void WriteInfoCodeReloc(long address, bool highCq, PtcInfo ptcInfo) internal static void WriteInfoCodeReloc(long address, bool highCq, PtcInfo ptcInfo)
@ -732,9 +729,6 @@ namespace ARMeilleure.Translation.PTC
{ {
_disposed = true; _disposed = true;
AppDomain.CurrentDomain.UnhandledException -= CurrentDomain_UnhandledException;
AppDomain.CurrentDomain.ProcessExit -= CurrentDomain_ProcessExit;
Wait(); Wait();
_waitEvent.Dispose(); _waitEvent.Dispose();
@ -746,23 +740,5 @@ namespace ARMeilleure.Translation.PTC
_unwindInfosStream.Dispose(); _unwindInfosStream.Dispose();
} }
} }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Close();
PtcProfiler.Stop();
if (e.IsTerminating)
{
Dispose();
PtcProfiler.Dispose();
}
}
private static void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
Dispose();
PtcProfiler.Dispose();
}
} }
} }

View file

@ -532,7 +532,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 0 || configurationFileFormat.Version > ConfigurationFileFormat.CurrentVersion) if (configurationFileFormat.Version < 0 || configurationFileFormat.Version > ConfigurationFileFormat.CurrentVersion)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Unsupported configuration version {configurationFileFormat.Version}, loading default."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Unsupported configuration version {configurationFileFormat.Version}, loading default.");
LoadDefault(); LoadDefault();
@ -541,7 +541,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 2) if (configurationFileFormat.Version < 2)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 2."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 2.");
configurationFileFormat.SystemRegion = Region.USA; configurationFileFormat.SystemRegion = Region.USA;
@ -550,7 +550,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 3) if (configurationFileFormat.Version < 3)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 3."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 3.");
configurationFileFormat.SystemTimeZone = "UTC"; configurationFileFormat.SystemTimeZone = "UTC";
@ -559,7 +559,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 4) if (configurationFileFormat.Version < 4)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 4."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 4.");
configurationFileFormat.MaxAnisotropy = -1; configurationFileFormat.MaxAnisotropy = -1;
@ -568,7 +568,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 5) if (configurationFileFormat.Version < 5)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 5."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 5.");
configurationFileFormat.SystemTimeOffset = 0; configurationFileFormat.SystemTimeOffset = 0;
@ -577,7 +577,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 6) if (configurationFileFormat.Version < 6)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 6."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 6.");
configurationFileFormat.ControllerConfig = new List<ControllerConfig>(); configurationFileFormat.ControllerConfig = new List<ControllerConfig>();
configurationFileFormat.KeyboardConfig = new List<KeyboardConfig> configurationFileFormat.KeyboardConfig = new List<KeyboardConfig>
@ -630,7 +630,7 @@ namespace Ryujinx.Configuration
// Only needed for version 6 configurations. // Only needed for version 6 configurations.
if (configurationFileFormat.Version == 6) if (configurationFileFormat.Version == 6)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 7."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 7.");
for (int i = 0; i < configurationFileFormat.KeyboardConfig.Count; i++) for (int i = 0; i < configurationFileFormat.KeyboardConfig.Count; i++)
{ {
@ -643,7 +643,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 8) if (configurationFileFormat.Version < 8)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 8."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 8.");
configurationFileFormat.EnablePtc = false; configurationFileFormat.EnablePtc = false;
@ -652,7 +652,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 9) if (configurationFileFormat.Version < 9)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 9."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 9.");
configurationFileFormat.ColumnSort = new ColumnSort configurationFileFormat.ColumnSort = new ColumnSort
{ {
@ -670,7 +670,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 10) if (configurationFileFormat.Version < 10)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 10."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 10.");
configurationFileFormat.AudioBackend = AudioBackend.OpenAl; configurationFileFormat.AudioBackend = AudioBackend.OpenAl;
@ -679,7 +679,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 11) if (configurationFileFormat.Version < 11)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 11."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 11.");
configurationFileFormat.ResScale = 1; configurationFileFormat.ResScale = 1;
configurationFileFormat.ResScaleCustom = 1.0f; configurationFileFormat.ResScaleCustom = 1.0f;
@ -689,7 +689,7 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 12) if (configurationFileFormat.Version < 12)
{ {
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 12."); Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 12.");
configurationFileFormat.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None; configurationFileFormat.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None;
@ -750,7 +750,7 @@ namespace Ryujinx.Configuration
{ {
ToFileFormat().SaveConfig(configurationFilePath); ToFileFormat().SaveConfig(configurationFilePath);
Common.Logging.Logger.PrintWarning(LogClass.Application, "Configuration file has been updated!"); Common.Logging.Logger.Warning?.Print(LogClass.Application, "Configuration file has been updated!");
} }
} }

View file

@ -9,9 +9,6 @@ namespace Ryujinx.Configuration
{ {
public static void Initialize() public static void Initialize()
{ {
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
ConfigurationState.Instance.Logger.EnableDebug.Event += ReloadEnableDebug; ConfigurationState.Instance.Logger.EnableDebug.Event += ReloadEnableDebug;
ConfigurationState.Instance.Logger.EnableStub.Event += ReloadEnableStub; ConfigurationState.Instance.Logger.EnableStub.Event += ReloadEnableStub;
ConfigurationState.Instance.Logger.EnableInfo.Event += ReloadEnableInfo; ConfigurationState.Instance.Logger.EnableInfo.Event += ReloadEnableInfo;
@ -88,22 +85,5 @@ namespace Ryujinx.Configuration
Logger.RemoveTarget("file"); Logger.RemoveTarget("file");
} }
} }
private static void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
Logger.Shutdown();
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var exception = e.ExceptionObject as Exception;
Logger.PrintError(LogClass.Emulation, $"Unhandled exception caught: {exception}");
if (e.IsTerminating)
{
Logger.Shutdown();
}
}
} }
} }

View file

@ -17,7 +17,7 @@ namespace Ryujinx.Common.Logging
sb.Clear(); sb.Clear();
sb.AppendFormat(@"{0:hh\:mm\:ss\.fff}", args.Time); sb.AppendFormat(@"{0:hh\:mm\:ss\.fff}", args.Time);
sb.Append(" | "); sb.Append($" |{args.Level.ToString()[0]}| ");
if (args.ThreadName != null) if (args.ThreadName != null)
{ {
@ -31,7 +31,7 @@ namespace Ryujinx.Common.Logging
{ {
PropertyInfo[] props = args.Data.GetType().GetProperties(); PropertyInfo[] props = args.Data.GetType().GetProperties();
sb.Append(' '); sb.Append(" {");
foreach (var prop in props) foreach (var prop in props)
{ {
@ -40,28 +40,33 @@ namespace Ryujinx.Common.Logging
if (typeof(Array).IsAssignableFrom(prop.PropertyType)) if (typeof(Array).IsAssignableFrom(prop.PropertyType))
{ {
Array enumerable = (Array)prop.GetValue(args.Data); Array array = (Array)prop.GetValue(args.Data);
foreach (var item in enumerable) foreach (var item in array)
{ {
sb.Append(item.ToString()); sb.Append(item.ToString());
sb.Append(", "); sb.Append(", ");
} }
sb.Remove(sb.Length - 2, 2); if (array.Length > 0)
{
sb.Remove(sb.Length - 2, 2);
}
} }
else else
{ {
sb.Append(prop.GetValue(args.Data)); sb.Append(prop.GetValue(args.Data));
} }
sb.Append(" - "); sb.Append(" ; ");
} }
// We remove the final '-' from the string // We remove the final ';' from the string
if (props.Length > 0) if (props.Length > 0)
{ {
sb.Remove(sb.Length - 3, 3); sb.Remove(sb.Length - 3, 3);
} }
sb.Append('}');
} }
return sb.ToString(); return sb.ToString();

View file

@ -4,12 +4,12 @@ namespace Ryujinx.Common.Logging
{ {
public class LogEventArgs : EventArgs public class LogEventArgs : EventArgs
{ {
public LogLevel Level { get; private set; } public readonly LogLevel Level;
public TimeSpan Time { get; private set; } public readonly TimeSpan Time;
public string ThreadName { get; private set; } public readonly string ThreadName;
public string Message { get; private set; } public readonly string Message;
public object Data { get; private set; } public readonly object Data;
public LogEventArgs(LogLevel level, TimeSpan time, string threadName, string message) public LogEventArgs(LogLevel level, TimeSpan time, string threadName, string message)
{ {

View file

@ -8,6 +8,7 @@ namespace Ryujinx.Common.Logging
Warning, Warning,
Error, Error,
Guest, Guest,
AccessLog AccessLog,
Notice
} }
} }

View file

@ -8,27 +8,94 @@ namespace Ryujinx.Common.Logging
{ {
public static class Logger public static class Logger
{ {
private static Stopwatch m_Time; private static readonly Stopwatch m_Time;
private static readonly bool[] m_EnabledLevels;
private static readonly bool[] m_EnabledClasses; private static readonly bool[] m_EnabledClasses;
private static readonly List<ILogTarget> m_LogTargets; private static readonly List<ILogTarget> m_LogTargets;
public static event EventHandler<LogEventArgs> Updated; public static event EventHandler<LogEventArgs> Updated;
public struct Log
{
internal readonly LogLevel Level;
internal Log(LogLevel level)
{
Level = level;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PrintMsg(LogClass logClass, string message)
{
if (m_EnabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, "", message)));
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Print(LogClass logClass, string message, [CallerMemberName] string caller = "")
{
if (m_EnabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, caller, message)));
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Print(LogClass logClass, string message, object data, [CallerMemberName] string caller = "")
{
if (m_EnabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, caller, message), data));
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PrintStub(LogClass logClass, string message = "", [CallerMemberName] string caller = "")
{
if (m_EnabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, caller, "Stubbed. " + message)));
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PrintStub(LogClass logClass, object data, [CallerMemberName] string caller = "")
{
if (m_EnabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, caller, "Stubbed."), data));
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PrintStub(LogClass logClass, string message, object data, [CallerMemberName] string caller = "")
{
if (m_EnabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, caller, "Stubbed. " + message), data));
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static string FormatMessage(LogClass Class, string Caller, string Message) => $"{Class} {Caller}: {Message}";
}
public static Log? Debug { get; private set; }
public static Log? Info { get; private set; }
public static Log? Warning { get; private set; }
public static Log? Error { get; private set; }
public static Log? Guest { get; private set; }
public static Log? AccessLog { get; private set; }
public static Log? Stub { get; private set; }
public static Log Notice { get; } // Always enabled
static Logger() static Logger()
{ {
m_EnabledLevels = new bool[Enum.GetNames(typeof(LogLevel)).Length];
m_EnabledClasses = new bool[Enum.GetNames(typeof(LogClass)).Length]; m_EnabledClasses = new bool[Enum.GetNames(typeof(LogClass)).Length];
m_EnabledLevels[(int)LogLevel.Stub] = true;
m_EnabledLevels[(int)LogLevel.Info] = true;
m_EnabledLevels[(int)LogLevel.Warning] = true;
m_EnabledLevels[(int)LogLevel.Error] = true;
m_EnabledLevels[(int)LogLevel.Guest] = true;
m_EnabledLevels[(int)LogLevel.AccessLog] = true;
for (int index = 0; index < m_EnabledClasses.Length; index++) for (int index = 0; index < m_EnabledClasses.Length; index++)
{ {
m_EnabledClasses[index] = true; m_EnabledClasses[index] = true;
@ -43,6 +110,8 @@ namespace Ryujinx.Common.Logging
new ConsoleLogTarget("console"), new ConsoleLogTarget("console"),
1000, 1000,
AsyncLogTargetOverflowAction.Discard)); AsyncLogTargetOverflowAction.Discard));
Notice = new Log(LogLevel.Notice);
} }
public static void RestartTime() public static void RestartTime()
@ -88,7 +157,7 @@ namespace Ryujinx.Common.Logging
{ {
Updated = null; Updated = null;
foreach(var target in m_LogTargets) foreach (var target in m_LogTargets)
{ {
target.Dispose(); target.Dispose();
} }
@ -96,80 +165,39 @@ namespace Ryujinx.Common.Logging
m_LogTargets.Clear(); m_LogTargets.Clear();
} }
public static IReadOnlyCollection<LogLevel> GetEnabledLevels()
{
var logs = new Log?[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub };
List<LogLevel> levels = new List<LogLevel>(logs.Length);
foreach (var log in logs)
{
if (log.HasValue)
{
levels.Add(log.Value.Level);
}
}
return levels;
}
public static void SetEnable(LogLevel logLevel, bool enabled) public static void SetEnable(LogLevel logLevel, bool enabled)
{ {
m_EnabledLevels[(int)logLevel] = enabled; switch (logLevel)
{
case LogLevel.Debug : Debug = enabled ? new Log(LogLevel.Debug) : new Log?(); break;
case LogLevel.Info : Info = enabled ? new Log(LogLevel.Info) : new Log?(); break;
case LogLevel.Warning : Warning = enabled ? new Log(LogLevel.Warning) : new Log?(); break;
case LogLevel.Error : Error = enabled ? new Log(LogLevel.Error) : new Log?(); break;
case LogLevel.Guest : Guest = enabled ? new Log(LogLevel.Guest) : new Log?(); break;
case LogLevel.AccessLog : AccessLog = enabled ? new Log(LogLevel.AccessLog): new Log?(); break;
case LogLevel.Stub : Stub = enabled ? new Log(LogLevel.Stub) : new Log?(); break;
default: throw new ArgumentException("Unknown Log Level");
}
} }
public static void SetEnable(LogClass logClass, bool enabled) public static void SetEnable(LogClass logClass, bool enabled)
{ {
m_EnabledClasses[(int)logClass] = enabled; m_EnabledClasses[(int)logClass] = enabled;
} }
public static void PrintDebug(LogClass logClass, string message, [CallerMemberName] string caller = "")
{
Print(LogLevel.Debug, logClass, GetFormattedMessage(logClass, message, caller));
}
public static void PrintInfo(LogClass logClass, string message, [CallerMemberName] string Caller = "")
{
Print(LogLevel.Info, logClass, GetFormattedMessage(logClass, message, Caller));
}
public static void PrintWarning(LogClass logClass, string message, [CallerMemberName] string Caller = "")
{
Print(LogLevel.Warning, logClass, GetFormattedMessage(logClass, message, Caller));
}
public static void PrintError(LogClass logClass, string message, [CallerMemberName] string Caller = "")
{
Print(LogLevel.Error, logClass, GetFormattedMessage(logClass, message, Caller));
}
public static void PrintStub(LogClass logClass, string message = "", [CallerMemberName] string caller = "")
{
Print(LogLevel.Stub, logClass, GetFormattedMessage(logClass, "Stubbed. " + message, caller));
}
public static void PrintStub<T>(LogClass logClass, T obj, [CallerMemberName] string caller = "")
{
Print(LogLevel.Stub, logClass, GetFormattedMessage(logClass, "Stubbed.", caller), obj);
}
public static void PrintStub<T>(LogClass logClass, string message, T obj, [CallerMemberName] string caller = "")
{
Print(LogLevel.Stub, logClass, GetFormattedMessage(logClass, "Stubbed. " + message, caller), obj);
}
public static void PrintGuest(LogClass logClass, string message, [CallerMemberName] string caller = "")
{
Print(LogLevel.Guest, logClass, GetFormattedMessage(logClass, message, caller));
}
public static void PrintAccessLog(LogClass logClass, string message)
{
Print(LogLevel.AccessLog, logClass, message);
}
private static void Print(LogLevel logLevel, LogClass logClass, string message)
{
if (m_EnabledLevels[(int)logLevel] && m_EnabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(logLevel, m_Time.Elapsed, Thread.CurrentThread.Name, message));
}
}
private static void Print(LogLevel logLevel, LogClass logClass, string message, object data)
{
if (m_EnabledLevels[(int)logLevel] && m_EnabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(logLevel, m_Time.Elapsed, Thread.CurrentThread.Name, message, data));
}
}
private static string GetFormattedMessage(LogClass Class, string Message, string Caller)
{
return $"{Class} {Caller}: {Message}";
}
} }
} }

View file

@ -5,23 +5,20 @@ namespace Ryujinx.Common.Logging
{ {
public class ConsoleLogTarget : ILogTarget public class ConsoleLogTarget : ILogTarget
{ {
private static readonly ConcurrentDictionary<LogLevel, ConsoleColor> _logColors;
private readonly ILogFormatter _formatter; private readonly ILogFormatter _formatter;
private readonly string _name; private readonly string _name;
string ILogTarget.Name { get => _name; } string ILogTarget.Name { get => _name; }
static ConsoleLogTarget() private static ConsoleColor GetLogColor(LogLevel level) => level switch {
{ LogLevel.Info => ConsoleColor.White,
_logColors = new ConcurrentDictionary<LogLevel, ConsoleColor> { LogLevel.Warning => ConsoleColor.Yellow,
[ LogLevel.Stub ] = ConsoleColor.DarkGray, LogLevel.Error => ConsoleColor.Red,
[ LogLevel.Info ] = ConsoleColor.White, LogLevel.Stub => ConsoleColor.DarkGray,
[ LogLevel.Warning ] = ConsoleColor.Yellow, LogLevel.Notice => ConsoleColor.Cyan,
[ LogLevel.Error ] = ConsoleColor.Red _ => ConsoleColor.Gray,
}; };
}
public ConsoleLogTarget(string name) public ConsoleLogTarget(string name)
{ {
@ -31,18 +28,9 @@ namespace Ryujinx.Common.Logging
public void Log(object sender, LogEventArgs args) public void Log(object sender, LogEventArgs args)
{ {
if (_logColors.TryGetValue(args.Level, out ConsoleColor color)) Console.ForegroundColor = GetLogColor(args.Level);
{ Console.WriteLine(_formatter.Format(args));
Console.ForegroundColor = color; Console.ResetColor();
Console.WriteLine(_formatter.Format(args));
Console.ResetColor();
}
else
{
Console.WriteLine(_formatter.Format(args));
}
} }
public void Dispose() public void Dispose()

View file

@ -75,7 +75,7 @@ namespace Ryujinx.Common.SystemInfo
} }
else else
{ {
Logger.PrintError(LogClass.Application, $"Cannot get memory size, sysctlbyname error: {res}"); Logger.Error?.Print(LogClass.Application, $"Cannot get memory size, sysctlbyname error: {res}");
RamSize = 0; RamSize = 0;
} }
@ -88,7 +88,7 @@ namespace Ryujinx.Common.SystemInfo
} }
else else
{ {
Logger.PrintError(LogClass.Application, $"Cannot get CPU name, sysctlbyname error: {res}"); Logger.Error?.Print(LogClass.Application, $"Cannot get CPU name, sysctlbyname error: {res}");
CpuName = "Unknown"; CpuName = "Unknown";
} }

View file

@ -37,7 +37,7 @@ namespace Ryujinx.Common.SystemInfo
if (wmiNotAvailable) if (wmiNotAvailable)
{ {
Logger.PrintError(LogClass.Application, "WMI isn't available, system informations will use default values."); Logger.Error?.Print(LogClass.Application, "WMI isn't available, system informations will use default values.");
CpuName = "Unknown"; CpuName = "Unknown";
} }

View file

@ -364,7 +364,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.MME
{ {
if (!Fifo.TryDequeue(out int value)) if (!Fifo.TryDequeue(out int value))
{ {
Logger.PrintWarning(LogClass.Gpu, "Macro attempted to fetch an inexistent argument."); Logger.Warning?.Print(LogClass.Gpu, "Macro attempted to fetch an inexistent argument.");
return 0; return 0;
} }

View file

@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.MME
{ {
if (!Fifo.TryDequeue(out int value)) if (!Fifo.TryDequeue(out int value))
{ {
Logger.PrintWarning(LogClass.Gpu, "Macro attempted to fetch an inexistent argument."); Logger.Warning?.Print(LogClass.Gpu, "Macro attempted to fetch an inexistent argument.");
return 0; return 0;
} }

View file

@ -37,7 +37,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
return CounterCompare(condState.Address.Pack(), false); return CounterCompare(condState.Address.Pack(), false);
} }
Logger.PrintWarning(LogClass.Gpu, $"Invalid conditional render condition \"{condState.Condition}\"."); Logger.Warning?.Print(LogClass.Gpu, $"Invalid conditional render condition \"{condState.Condition}\".");
return ConditionalRenderEnabled.True; return ConditionalRenderEnabled.True;
} }

View file

@ -692,7 +692,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
if (!FormatTable.TryGetAttribFormat(vertexAttrib.UnpackFormat(), out Format format)) if (!FormatTable.TryGetAttribFormat(vertexAttrib.UnpackFormat(), out Format format))
{ {
Logger.PrintDebug(LogClass.Gpu, $"Invalid attribute format 0x{vertexAttrib.UnpackFormat():X}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid attribute format 0x{vertexAttrib.UnpackFormat():X}.");
format = Format.R32G32B32A32Float; format = Format.R32G32B32A32Float;
} }
@ -1114,7 +1114,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
return Target.CubemapArray; return Target.CubemapArray;
} }
Logger.PrintWarning(LogClass.Gpu, $"Invalid sampler type \"{type}\"."); Logger.Warning?.Print(LogClass.Gpu, $"Invalid sampler type \"{type}\".");
return Target.Texture2D; return Target.Texture2D;
} }

View file

@ -414,7 +414,7 @@ namespace Ryujinx.Graphics.Gpu.Image
if (ScaleFactor != scale) if (ScaleFactor != scale)
{ {
Logger.PrintDebug(LogClass.Gpu, $"Rescaling {Info.Width}x{Info.Height} {Info.FormatInfo.Format.ToString()} to ({ScaleFactor} to {scale}). "); Logger.Debug?.Print(LogClass.Gpu, $"Rescaling {Info.Width}x{Info.Height} {Info.FormatInfo.Format.ToString()} to ({ScaleFactor} to {scale}). ");
TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities); TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities);
ScaleFactor = scale; ScaleFactor = scale;
@ -430,7 +430,7 @@ namespace Ryujinx.Graphics.Gpu.Image
HostTexture.CopyTo(newStorage, new Extents2D(0, 0, HostTexture.Width, HostTexture.Height), new Extents2D(0, 0, newStorage.Width, newStorage.Height), true); HostTexture.CopyTo(newStorage, new Extents2D(0, 0, HostTexture.Width, HostTexture.Height), new Extents2D(0, 0, newStorage.Width, newStorage.Height), true);
} }
Logger.PrintDebug(LogClass.Gpu, $" Copy performed: {HostTexture.Width}x{HostTexture.Height} to {newStorage.Width}x{newStorage.Height}"); Logger.Debug?.Print(LogClass.Gpu, $" Copy performed: {HostTexture.Width}x{HostTexture.Height} to {newStorage.Width}x{newStorage.Height}");
ReplaceStorage(newStorage); ReplaceStorage(newStorage);
@ -438,7 +438,7 @@ namespace Ryujinx.Graphics.Gpu.Image
foreach (var view in _views) foreach (var view in _views)
{ {
Logger.PrintDebug(LogClass.Gpu, $" Recreating view {Info.Width}x{Info.Height} {Info.FormatInfo.Format.ToString()}."); Logger.Debug?.Print(LogClass.Gpu, $" Recreating view {Info.Width}x{Info.Height} {Info.FormatInfo.Format.ToString()}.");
view.ScaleFactor = scale; view.ScaleFactor = scale;
TextureCreateInfo viewCreateInfo = TextureManager.GetCreateInfo(view.Info, _context.Capabilities); TextureCreateInfo viewCreateInfo = TextureManager.GetCreateInfo(view.Info, _context.Capabilities);
@ -590,7 +590,7 @@ namespace Ryujinx.Graphics.Gpu.Image
{ {
string texInfo = $"{Info.Target} {Info.FormatInfo.Format} {Info.Width}x{Info.Height}x{Info.DepthOrLayers} levels {Info.Levels}"; string texInfo = $"{Info.Target} {Info.FormatInfo.Format} {Info.Width}x{Info.Height}x{Info.DepthOrLayers} levels {Info.Levels}";
Logger.PrintDebug(LogClass.Gpu, $"Invalid ASTC texture at 0x{Info.Address:X} ({texInfo})."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid ASTC texture at 0x{Info.Address:X} ({texInfo}).");
} }
data = decoded; data = decoded;

View file

@ -151,7 +151,7 @@ namespace Ryujinx.Graphics.Gpu.Image
{ {
if ((long)address > 0L && (int)format > 0) if ((long)address > 0L && (int)format > 0)
{ {
Logger.PrintError(LogClass.Gpu, $"Invalid texture format 0x{format:X} (sRGB: {srgb})."); Logger.Error?.Print(LogClass.Gpu, $"Invalid texture format 0x{format:X} (sRGB: {srgb}).");
} }
formatInfo = FormatInfo.Default; formatInfo = FormatInfo.Default;

View file

@ -70,7 +70,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <param name="message">Message to print</param> /// <param name="message">Message to print</param>
public void Log(string message) public void Log(string message)
{ {
Logger.PrintWarning(LogClass.Gpu, $"Shader translator: {message}"); Logger.Warning?.Print(LogClass.Gpu, $"Shader translator: {message}");
} }
/// <summary> /// <summary>

View file

@ -131,7 +131,7 @@ namespace Ryujinx.Graphics.Gpu.Synchronization
if (!signaled && info != null) if (!signaled && info != null)
{ {
Logger.PrintError(LogClass.Gpu, $"Wait on syncpoint {id} for threshold {threshold} took more than {timeout.TotalMilliseconds}ms, resuming execution..."); Logger.Error?.Print(LogClass.Gpu, $"Wait on syncpoint {id} for threshold {threshold} took more than {timeout.TotalMilliseconds}ms, resuming execution...");
_syncpoints[id].UnregisterCallback(info); _syncpoints[id].UnregisterCallback(info);
} }

View file

@ -104,7 +104,7 @@ namespace Ryujinx.Graphics.Host1x
DeviceWrite(_offset, data); DeviceWrite(_offset, data);
break; break;
default: default:
Logger.PrintError(LogClass.Host1x, $"Unsupported opcode \"{opCode}\"."); Logger.Error?.Print(LogClass.Host1x, $"Unsupported opcode \"{opCode}\".");
break; break;
} }
} }

View file

@ -42,7 +42,7 @@ namespace Ryujinx.Graphics.Nvdec
Vp9Decoder.Decode(this, _rm, ref _state.State); Vp9Decoder.Decode(this, _rm, ref _state.State);
break; break;
default: default:
Logger.PrintError(LogClass.Nvdec, $"Unsupported codec \"{codecId}\"."); Logger.Error?.Print(LogClass.Nvdec, $"Unsupported codec \"{codecId}\".");
break; break;
} }
} }

View file

@ -47,7 +47,7 @@ namespace Ryujinx.Graphics.OpenGL
GL.DebugMessageCallback(_debugCallback, IntPtr.Zero); GL.DebugMessageCallback(_debugCallback, IntPtr.Zero);
Logger.PrintWarning(LogClass.Gpu, "OpenGL Debugging is enabled. Performance will be negatively impacted."); Logger.Warning?.Print(LogClass.Gpu, "OpenGL Debugging is enabled. Performance will be negatively impacted.");
} }
private static void GLDebugHandler( private static void GLDebugHandler(
@ -63,18 +63,18 @@ namespace Ryujinx.Graphics.OpenGL
switch (type) switch (type)
{ {
case DebugType.DebugTypeError : Logger.PrintError(LogClass.Gpu, $"{severity}: {msg}\nCallStack={Environment.StackTrace}", "GLERROR"); break; case DebugType.DebugTypeError : Logger.Error?.Print(LogClass.Gpu, $"{severity}: {msg}\nCallStack={Environment.StackTrace}", "GLERROR"); break;
case DebugType.DebugTypePerformance: Logger.PrintWarning(LogClass.Gpu, $"{severity}: {msg}", "GLPERF"); break; case DebugType.DebugTypePerformance: Logger.Warning?.Print(LogClass.Gpu, $"{severity}: {msg}", "GLPERF"); break;
case DebugType.DebugTypePushGroup : Logger.PrintInfo(LogClass.Gpu, $"{{ ({id}) {severity}: {msg}", "GLINFO"); break; case DebugType.DebugTypePushGroup : Logger.Info?.Print(LogClass.Gpu, $"{{ ({id}) {severity}: {msg}", "GLINFO"); break;
case DebugType.DebugTypePopGroup : Logger.PrintInfo(LogClass.Gpu, $"}} ({id}) {severity}: {msg}", "GLINFO"); break; case DebugType.DebugTypePopGroup : Logger.Info?.Print(LogClass.Gpu, $"}} ({id}) {severity}: {msg}", "GLINFO"); break;
default: default:
if (source == DebugSource.DebugSourceApplication) if (source == DebugSource.DebugSourceApplication)
{ {
Logger.PrintInfo(LogClass.Gpu, $"{type} {severity}: {msg}", "GLINFO"); Logger.Info?.Print(LogClass.Gpu, $"{type} {severity}: {msg}", "GLINFO");
} }
else else
{ {
Logger.PrintDebug(LogClass.Gpu, $"{type} {severity}: {msg}", "GLDEBUG"); Logger.Debug?.Print(LogClass.Gpu, $"{type} {severity}: {msg}", "GLDEBUG");
} }
break; break;
} }

View file

@ -28,7 +28,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureWrapMode.ClampToEdge; return TextureWrapMode.ClampToEdge;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(AddressMode)} enum value: {mode}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(AddressMode)} enum value: {mode}.");
return TextureWrapMode.Clamp; return TextureWrapMode.Clamp;
} }
@ -92,7 +92,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.OneMinusConstantAlpha; return All.OneMinusConstantAlpha;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(BlendFactor)} enum value: {factor}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(BlendFactor)} enum value: {factor}.");
return All.Zero; return All.Zero;
} }
@ -118,7 +118,7 @@ namespace Ryujinx.Graphics.OpenGL
return BlendEquationMode.Max; return BlendEquationMode.Max;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(BlendOp)} enum value: {op}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(BlendOp)} enum value: {op}.");
return BlendEquationMode.FuncAdd; return BlendEquationMode.FuncAdd;
} }
@ -133,7 +133,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureCompareMode.CompareRToTexture; return TextureCompareMode.CompareRToTexture;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(CompareMode)} enum value: {mode}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(CompareMode)} enum value: {mode}.");
return TextureCompareMode.None; return TextureCompareMode.None;
} }
@ -168,7 +168,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.Always; return All.Always;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(CompareOp)} enum value: {op}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(CompareOp)} enum value: {op}.");
return All.Never; return All.Never;
} }
@ -183,7 +183,7 @@ namespace Ryujinx.Graphics.OpenGL
return ClipDepthMode.ZeroToOne; return ClipDepthMode.ZeroToOne;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(DepthMode)} enum value: {mode}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(DepthMode)} enum value: {mode}.");
return ClipDepthMode.NegativeOneToOne; return ClipDepthMode.NegativeOneToOne;
} }
@ -198,7 +198,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.StencilIndex; return All.StencilIndex;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}.");
return All.Depth; return All.Depth;
} }
@ -215,7 +215,7 @@ namespace Ryujinx.Graphics.OpenGL
return CullFaceMode.FrontAndBack; return CullFaceMode.FrontAndBack;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}.");
return CullFaceMode.Back; return CullFaceMode.Back;
} }
@ -230,7 +230,7 @@ namespace Ryujinx.Graphics.OpenGL
return FrontFaceDirection.Ccw; return FrontFaceDirection.Ccw;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(FrontFace)} enum value: {frontFace}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(FrontFace)} enum value: {frontFace}.");
return FrontFaceDirection.Cw; return FrontFaceDirection.Cw;
} }
@ -247,7 +247,7 @@ namespace Ryujinx.Graphics.OpenGL
return DrawElementsType.UnsignedInt; return DrawElementsType.UnsignedInt;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(IndexType)} enum value: {type}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(IndexType)} enum value: {type}.");
return DrawElementsType.UnsignedByte; return DrawElementsType.UnsignedByte;
} }
@ -262,7 +262,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureMagFilter.Linear; return TextureMagFilter.Linear;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(MagFilter)} enum value: {filter}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(MagFilter)} enum value: {filter}.");
return TextureMagFilter.Nearest; return TextureMagFilter.Nearest;
} }
@ -285,7 +285,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureMinFilter.LinearMipmapLinear; return TextureMinFilter.LinearMipmapLinear;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(MinFilter)} enum value: {filter}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(MinFilter)} enum value: {filter}.");
return TextureMinFilter.Nearest; return TextureMinFilter.Nearest;
} }
@ -326,7 +326,7 @@ namespace Ryujinx.Graphics.OpenGL
return PrimitiveType.Patches; return PrimitiveType.Patches;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(PrimitiveTopology)} enum value: {topology}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(PrimitiveTopology)} enum value: {topology}.");
return PrimitiveType.Points; return PrimitiveType.Points;
} }
@ -351,7 +351,7 @@ namespace Ryujinx.Graphics.OpenGL
return TransformFeedbackPrimitiveType.Triangles; return TransformFeedbackPrimitiveType.Triangles;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(PrimitiveTopology)} enum value: {topology}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(PrimitiveTopology)} enum value: {topology}.");
return TransformFeedbackPrimitiveType.Points; return TransformFeedbackPrimitiveType.Points;
} }
@ -378,7 +378,7 @@ namespace Ryujinx.Graphics.OpenGL
return OpenTK.Graphics.OpenGL.StencilOp.DecrWrap; return OpenTK.Graphics.OpenGL.StencilOp.DecrWrap;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(GAL.StencilOp)} enum value: {op}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(GAL.StencilOp)} enum value: {op}.");
return OpenTK.Graphics.OpenGL.StencilOp.Keep; return OpenTK.Graphics.OpenGL.StencilOp.Keep;
} }
@ -401,7 +401,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.Alpha; return All.Alpha;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(SwizzleComponent)} enum value: {swizzleComponent}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(SwizzleComponent)} enum value: {swizzleComponent}.");
return All.Zero; return All.Zero;
} }
@ -437,7 +437,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureTarget.TextureBuffer; return TextureTarget.TextureBuffer;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(Target)} enum value: {target}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(Target)} enum value: {target}.");
return TextureTarget.Texture2D; return TextureTarget.Texture2D;
} }
@ -464,7 +464,7 @@ namespace Ryujinx.Graphics.OpenGL
return NvViewportSwizzle.ViewportSwizzleNegativeWNv; return NvViewportSwizzle.ViewportSwizzleNegativeWNv;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(ViewportSwizzle)} enum value: {swizzle}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(ViewportSwizzle)} enum value: {swizzle}.");
return NvViewportSwizzle.ViewportSwizzlePositiveXNv; return NvViewportSwizzle.ViewportSwizzlePositiveXNv;
} }
@ -507,7 +507,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.Set; return All.Set;
} }
Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(LogicalOp)} enum value: {op}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(LogicalOp)} enum value: {op}.");
return All.Never; return All.Never;
} }

View file

@ -140,7 +140,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
break; break;
default: default:
Logger.PrintDebug(LogClass.Gpu, $"Invalid or unsupported texture target: {target}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid or unsupported texture target: {target}.");
break; break;
} }
} }

View file

@ -156,7 +156,7 @@ namespace Ryujinx.Graphics.OpenGL
{ {
if (!_program.IsLinked) if (!_program.IsLinked)
{ {
Logger.PrintDebug(LogClass.Gpu, "Dispatch error, shader not linked."); Logger.Debug?.Print(LogClass.Gpu, "Dispatch error, shader not linked.");
return; return;
} }
@ -169,7 +169,7 @@ namespace Ryujinx.Graphics.OpenGL
{ {
if (!_program.IsLinked) if (!_program.IsLinked)
{ {
Logger.PrintDebug(LogClass.Gpu, "Draw error, shader not linked."); Logger.Debug?.Print(LogClass.Gpu, "Draw error, shader not linked.");
return; return;
} }
@ -287,7 +287,7 @@ namespace Ryujinx.Graphics.OpenGL
{ {
if (!_program.IsLinked) if (!_program.IsLinked)
{ {
Logger.PrintDebug(LogClass.Gpu, "Draw error, shader not linked."); Logger.Debug?.Print(LogClass.Gpu, "Draw error, shader not linked.");
return; return;
} }

View file

@ -256,7 +256,7 @@ namespace Ryujinx.Graphics.OpenGL
if (status == 0) if (status == 0)
{ {
// Use GL.GetProgramInfoLog(Handle), it may be too long to print on the log. // Use GL.GetProgramInfoLog(Handle), it may be too long to print on the log.
Logger.PrintDebug(LogClass.Gpu, "Shader linking failed."); Logger.Debug?.Print(LogClass.Gpu, "Shader linking failed.");
} }
else else
{ {

View file

@ -87,7 +87,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries
if (iterations >= MaxQueryRetries) if (iterations >= MaxQueryRetries)
{ {
Logger.PrintError(LogClass.Gpu, $"Error: Query result timed out. Took more than {MaxQueryRetries} tries."); Logger.Error?.Print(LogClass.Gpu, $"Error: Query result timed out. Took more than {MaxQueryRetries} tries.");
} }
} }

View file

@ -112,7 +112,7 @@ namespace Ryujinx.Graphics.OpenGL
GpuRenderer = GL.GetString(StringName.Renderer); GpuRenderer = GL.GetString(StringName.Renderer);
GpuVersion = GL.GetString(StringName.Version); GpuVersion = GL.GetString(StringName.Version);
Logger.PrintInfo(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})"); Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
} }
public void ResetCounter(CounterType type) public void ResetCounter(CounterType type)

View file

@ -19,7 +19,7 @@ namespace Ryujinx.Graphics.Vic.Image
case PixelFormat.Y8___V8U8_N420: return ReadNv12(rm, ref config, ref offsets); case PixelFormat.Y8___V8U8_N420: return ReadNv12(rm, ref config, ref offsets);
} }
Logger.PrintError(LogClass.Vic, $"Unsupported pixel format \"{config.SlotPixelFormat}\"."); Logger.Error?.Print(LogClass.Vic, $"Unsupported pixel format \"{config.SlotPixelFormat}\".");
int lw = config.SlotLumaWidth + 1; int lw = config.SlotLumaWidth + 1;
int lh = config.SlotLumaHeight + 1; int lh = config.SlotLumaHeight + 1;

View file

@ -24,7 +24,7 @@ namespace Ryujinx.Graphics.Vic.Image
WriteNv12(rm, input, ref config, ref offsets); WriteNv12(rm, input, ref config, ref offsets);
break; break;
default: default:
Logger.PrintError(LogClass.Vic, $"Unsupported pixel format \"{config.OutPixelFormat}\"."); Logger.Error?.Print(LogClass.Vic, $"Unsupported pixel format \"{config.OutPixelFormat}\".");
break; break;
} }
} }

View file

@ -208,7 +208,7 @@ namespace Ryujinx.HLE.FileSystem.Content
var nca = new Nca(_virtualFileSystem.KeySet, ncaFile.AsStorage()); var nca = new Nca(_virtualFileSystem.KeySet, ncaFile.AsStorage());
if (nca.Header.ContentType != NcaContentType.Meta) if (nca.Header.ContentType != NcaContentType.Meta)
{ {
Logger.PrintWarning(LogClass.Application, $"{ncaPath} is not a valid metadata file"); Logger.Warning?.Print(LogClass.Application, $"{ncaPath} is not a valid metadata file");
continue; continue;
} }
@ -229,11 +229,11 @@ namespace Ryujinx.HLE.FileSystem.Content
string ncaId = BitConverter.ToString(cnmt.ContentEntries[0].NcaId).Replace("-", "").ToLower(); string ncaId = BitConverter.ToString(cnmt.ContentEntries[0].NcaId).Replace("-", "").ToLower();
if (!_aocData.TryAdd(cnmt.TitleId, new AocItem(containerPath, $"{ncaId}.nca", true))) if (!_aocData.TryAdd(cnmt.TitleId, new AocItem(containerPath, $"{ncaId}.nca", true)))
{ {
Logger.PrintWarning(LogClass.Application, $"Duplicate AddOnContent detected. TitleId {cnmt.TitleId:X16}"); Logger.Warning?.Print(LogClass.Application, $"Duplicate AddOnContent detected. TitleId {cnmt.TitleId:X16}");
} }
else else
{ {
Logger.PrintInfo(LogClass.Application, $"Found AddOnContent with TitleId {cnmt.TitleId:X16}"); Logger.Info?.Print(LogClass.Application, $"Found AddOnContent with TitleId {cnmt.TitleId:X16}");
} }
} }
} }
@ -244,11 +244,11 @@ namespace Ryujinx.HLE.FileSystem.Content
{ {
if (!_aocData.TryAdd(titleId, new AocItem(containerPath, ncaPath, enabled))) if (!_aocData.TryAdd(titleId, new AocItem(containerPath, ncaPath, enabled)))
{ {
Logger.PrintWarning(LogClass.Application, $"Duplicate AddOnContent detected. TitleId {titleId:X16}"); Logger.Warning?.Print(LogClass.Application, $"Duplicate AddOnContent detected. TitleId {titleId:X16}");
} }
else else
{ {
Logger.PrintInfo(LogClass.Application, $"Found AddOnContent with TitleId {titleId:X16}"); Logger.Info?.Print(LogClass.Application, $"Found AddOnContent with TitleId {titleId:X16}");
using (FileStream fileStream = File.OpenRead(containerPath)) using (FileStream fileStream = File.OpenRead(containerPath))
using (PartitionFileSystem pfs = new PartitionFileSystem(fileStream.AsStorage())) using (PartitionFileSystem pfs = new PartitionFileSystem(fileStream.AsStorage()))

View file

@ -34,17 +34,17 @@ namespace Ryujinx.HLE.HOS.Applets.Browser
_commonArguments = IApplet.ReadStruct<CommonArguments>(_normalSession.Pop()); _commonArguments = IApplet.ReadStruct<CommonArguments>(_normalSession.Pop());
Logger.PrintStub(LogClass.ServiceAm, $"WebApplet version: 0x{_commonArguments.AppletVersion:x8}"); Logger.Stub?.PrintStub(LogClass.ServiceAm, $"WebApplet version: 0x{_commonArguments.AppletVersion:x8}");
ReadOnlySpan<byte> webArguments = _normalSession.Pop(); ReadOnlySpan<byte> webArguments = _normalSession.Pop();
(_shimKind, _arguments) = BrowserArgument.ParseArguments(webArguments); (_shimKind, _arguments) = BrowserArgument.ParseArguments(webArguments);
Logger.PrintStub(LogClass.ServiceAm, $"Web Arguments: {_arguments.Count}"); Logger.Stub?.PrintStub(LogClass.ServiceAm, $"Web Arguments: {_arguments.Count}");
foreach (BrowserArgument argument in _arguments) foreach (BrowserArgument argument in _arguments)
{ {
Logger.PrintStub(LogClass.ServiceAm, $"{argument.Type}: {argument.GetValue()}"); Logger.Stub?.PrintStub(LogClass.ServiceAm, $"{argument.Type}: {argument.GetValue()}");
} }
if ((_commonArguments.AppletVersion >= 0x80000 && _shimKind == ShimKind.Web) || (_commonArguments.AppletVersion >= 0x30000 && _shimKind == ShimKind.Share)) if ((_commonArguments.AppletVersion >= 0x80000 && _shimKind == ShimKind.Web) || (_commonArguments.AppletVersion >= 0x30000 && _shimKind == ShimKind.Share))

View file

@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS.Applets
byte[] controllerSupportArgPrivate = _normalSession.Pop(); byte[] controllerSupportArgPrivate = _normalSession.Pop();
ControllerSupportArgPrivate privateArg = IApplet.ReadStruct<ControllerSupportArgPrivate>(controllerSupportArgPrivate); ControllerSupportArgPrivate privateArg = IApplet.ReadStruct<ControllerSupportArgPrivate>(controllerSupportArgPrivate);
Logger.PrintStub(LogClass.ServiceHid, $"ControllerApplet ArgPriv {privateArg.PrivateSize} {privateArg.ArgSize} {privateArg.Mode}" + Logger.Stub?.PrintStub(LogClass.ServiceHid, $"ControllerApplet ArgPriv {privateArg.PrivateSize} {privateArg.ArgSize} {privateArg.Mode}" +
$"HoldType:{(NpadJoyHoldType)privateArg.NpadJoyHoldType} StyleSets:{(ControllerType)privateArg.NpadStyleSet}"); $"HoldType:{(NpadJoyHoldType)privateArg.NpadJoyHoldType} StyleSets:{(ControllerType)privateArg.NpadStyleSet}");
if (privateArg.Mode != ControllerSupportMode.ShowControllerSupport) if (privateArg.Mode != ControllerSupportMode.ShowControllerSupport)
@ -55,19 +55,19 @@ namespace Ryujinx.HLE.HOS.Applets
} }
else else
{ {
Logger.PrintStub(LogClass.ServiceHid, $"Unknown revision of ControllerSupportArg."); Logger.Stub?.PrintStub(LogClass.ServiceHid, $"Unknown revision of ControllerSupportArg.");
argHeader = IApplet.ReadStruct<ControllerSupportArgHeader>(controllerSupportArg); // Read just the header argHeader = IApplet.ReadStruct<ControllerSupportArgHeader>(controllerSupportArg); // Read just the header
} }
Logger.PrintStub(LogClass.ServiceHid, $"ControllerApplet Arg {argHeader.PlayerCountMin} {argHeader.PlayerCountMax} {argHeader.EnableTakeOverConnection} {argHeader.EnableSingleMode}"); Logger.Stub?.PrintStub(LogClass.ServiceHid, $"ControllerApplet Arg {argHeader.PlayerCountMin} {argHeader.PlayerCountMax} {argHeader.EnableTakeOverConnection} {argHeader.EnableSingleMode}");
// Currently, the only purpose of this applet is to help // Currently, the only purpose of this applet is to help
// choose the primary input controller for the game // choose the primary input controller for the game
// TODO: Ideally should hook back to HID.Controller. When applet is called, can choose appropriate controller and attach to appropriate id. // TODO: Ideally should hook back to HID.Controller. When applet is called, can choose appropriate controller and attach to appropriate id.
if (argHeader.PlayerCountMin > 1) if (argHeader.PlayerCountMin > 1)
{ {
Logger.PrintWarning(LogClass.ServiceHid, "More than one controller was requested."); Logger.Warning?.Print(LogClass.ServiceHid, "More than one controller was requested.");
} }
ControllerSupportResultInfo result = new ControllerSupportResultInfo ControllerSupportResultInfo result = new ControllerSupportResultInfo
@ -76,7 +76,7 @@ namespace Ryujinx.HLE.HOS.Applets
SelectedId = (uint)GetNpadIdTypeFromIndex(_system.Device.Hid.Npads.PrimaryController) SelectedId = (uint)GetNpadIdTypeFromIndex(_system.Device.Hid.Npads.PrimaryController)
}; };
Logger.PrintStub(LogClass.ServiceHid, $"ControllerApplet ReturnResult {result.PlayerCount} {result.SelectedId}"); Logger.Stub?.PrintStub(LogClass.ServiceHid, $"ControllerApplet ReturnResult {result.PlayerCount} {result.SelectedId}");
_normalSession.Push(BuildResponse(result)); _normalSession.Push(BuildResponse(result));
AppletStateChanged?.Invoke(this, null); AppletStateChanged?.Invoke(this, null);

View file

@ -49,7 +49,7 @@ namespace Ryujinx.HLE.HOS.Applets
if (keyboardConfig.Length < Marshal.SizeOf<SoftwareKeyboardConfig>()) if (keyboardConfig.Length < Marshal.SizeOf<SoftwareKeyboardConfig>())
{ {
Logger.PrintError(LogClass.ServiceAm, $"SoftwareKeyboardConfig size mismatch. Expected {Marshal.SizeOf<SoftwareKeyboardConfig>():x}. Got {keyboardConfig.Length:x}"); Logger.Error?.Print(LogClass.ServiceAm, $"SoftwareKeyboardConfig size mismatch. Expected {Marshal.SizeOf<SoftwareKeyboardConfig>():x}. Got {keyboardConfig.Length:x}");
} }
else else
{ {
@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Applets
if (!_normalSession.TryPop(out _transferMemory)) if (!_normalSession.TryPop(out _transferMemory))
{ {
Logger.PrintError(LogClass.ServiceAm, "SwKbd Transfer Memory is null"); Logger.Error?.Print(LogClass.ServiceAm, "SwKbd Transfer Memory is null");
} }
if (_keyboardConfig.UseUtf8) if (_keyboardConfig.UseUtf8)
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.HOS.Applets
// Call the configured GUI handler to get user's input // Call the configured GUI handler to get user's input
if (_device.UiHandler == null) if (_device.UiHandler == null)
{ {
Logger.PrintWarning(LogClass.Application, $"GUI Handler is not set. Falling back to default"); Logger.Warning?.Print(LogClass.Application, $"GUI Handler is not set. Falling back to default");
_okPressed = true; _okPressed = true;
} }
else else

View file

@ -123,7 +123,7 @@ namespace Ryujinx.HLE.HOS
if (!xci.HasPartition(XciPartitionType.Secure)) if (!xci.HasPartition(XciPartitionType.Secure))
{ {
Logger.PrintError(LogClass.Loader, "Unable to load XCI: Could not find XCI secure partition"); Logger.Error?.Print(LogClass.Loader, "Unable to load XCI: Could not find XCI secure partition");
return; return;
} }
@ -140,14 +140,14 @@ namespace Ryujinx.HLE.HOS
} }
catch (Exception e) catch (Exception e)
{ {
Logger.PrintError(LogClass.Loader, $"Unable to load XCI: {e.Message}"); Logger.Error?.Print(LogClass.Loader, $"Unable to load XCI: {e.Message}");
return; return;
} }
if (mainNca == null) if (mainNca == null)
{ {
Logger.PrintError(LogClass.Loader, "Unable to load XCI: Could not find Main NCA"); Logger.Error?.Print(LogClass.Loader, "Unable to load XCI: Could not find Main NCA");
return; return;
} }
@ -176,14 +176,14 @@ namespace Ryujinx.HLE.HOS
} }
catch (Exception e) catch (Exception e)
{ {
Logger.PrintError(LogClass.Loader, $"Unable to load NSP: {e.Message}"); Logger.Error?.Print(LogClass.Loader, $"Unable to load NSP: {e.Message}");
return; return;
} }
if (mainNca == null) if (mainNca == null)
{ {
Logger.PrintError(LogClass.Loader, "Unable to load NSP: Could not find Main NCA"); Logger.Error?.Print(LogClass.Loader, "Unable to load NSP: Could not find Main NCA");
return; return;
} }
@ -215,7 +215,7 @@ namespace Ryujinx.HLE.HOS
{ {
if (mainNca.Header.ContentType != NcaContentType.Program) if (mainNca.Header.ContentType != NcaContentType.Program)
{ {
Logger.PrintError(LogClass.Loader, "Selected NCA is not a \"Program\" NCA"); Logger.Error?.Print(LogClass.Loader, "Selected NCA is not a \"Program\" NCA");
return; return;
} }
@ -303,7 +303,7 @@ namespace Ryujinx.HLE.HOS
if (codeFs == null) if (codeFs == null)
{ {
Logger.PrintError(LogClass.Loader, "No ExeFS found in NCA"); Logger.Error?.Print(LogClass.Loader, "No ExeFS found in NCA");
return; return;
} }
@ -323,7 +323,7 @@ namespace Ryujinx.HLE.HOS
if (dataStorage == null) if (dataStorage == null)
{ {
Logger.PrintWarning(LogClass.Loader, "No RomFS found in NCA"); Logger.Warning?.Print(LogClass.Loader, "No RomFS found in NCA");
} }
else else
{ {
@ -338,7 +338,7 @@ namespace Ryujinx.HLE.HOS
LoadExeFs(codeFs, metaData); LoadExeFs(codeFs, metaData);
Logger.PrintInfo(LogClass.Loader, $"Application Loaded: {TitleName} v{DisplayVersion} [{TitleIdText}] [{(TitleIs64Bit ? "64-bit" : "32-bit")}]"); Logger.Info?.Print(LogClass.Loader, $"Application Loaded: {TitleName} v{DisplayVersion} [{TitleIdText}] [{(TitleIs64Bit ? "64-bit" : "32-bit")}]");
} }
// Sets TitleId, so be sure to call before using it // Sets TitleId, so be sure to call before using it
@ -349,7 +349,7 @@ namespace Ryujinx.HLE.HOS
if (ResultFs.PathNotFound.Includes(result)) if (ResultFs.PathNotFound.Includes(result))
{ {
Logger.PrintWarning(LogClass.Loader, "NPDM file not found, using default values!"); Logger.Warning?.Print(LogClass.Loader, "NPDM file not found, using default values!");
metaData = GetDefaultNpdm(); metaData = GetDefaultNpdm();
} }
@ -414,7 +414,7 @@ namespace Ryujinx.HLE.HOS
continue; continue;
} }
Logger.PrintInfo(LogClass.Loader, $"Loading {file.Name}..."); Logger.Info?.Print(LogClass.Loader, $"Loading {file.Name}...");
codeFs.OpenFile(out IFile nsoFile, file.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); codeFs.OpenFile(out IFile nsoFile, file.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
@ -435,7 +435,7 @@ namespace Ryujinx.HLE.HOS
if (EnablePtc && modified) if (EnablePtc && modified)
{ {
Logger.PrintWarning(LogClass.Ptc, $"Detected exefs modifications. PPTC disabled."); Logger.Warning?.Print(LogClass.Ptc, $"Detected exefs modifications. PPTC disabled.");
} }
Ptc.Initialize(TitleIdText, DisplayVersion, EnablePtc && !modified); Ptc.Initialize(TitleIdText, DisplayVersion, EnablePtc && !modified);
@ -520,7 +520,7 @@ namespace Ryujinx.HLE.HOS
} }
else else
{ {
Logger.PrintWarning(LogClass.Loader, $"Unsupported ASET header version found \"{asetVersion}\""); Logger.Warning?.Print(LogClass.Loader, $"Unsupported ASET header version found \"{asetVersion}\"");
} }
} }
} }
@ -551,7 +551,7 @@ namespace Ryujinx.HLE.HOS
private Result EnsureSaveData(TitleId titleId) private Result EnsureSaveData(TitleId titleId)
{ {
Logger.PrintInfo(LogClass.Application, "Ensuring required savedata exists."); Logger.Info?.Print(LogClass.Application, "Ensuring required savedata exists.");
Uid user = _device.System.State.Account.LastOpenedUser.UserId.ToLibHacUid(); Uid user = _device.System.State.Account.LastOpenedUser.UserId.ToLibHacUid();
@ -567,7 +567,7 @@ namespace Ryujinx.HLE.HOS
control.UserAccountSaveDataSize = 0x4000; control.UserAccountSaveDataSize = 0x4000;
control.UserAccountSaveDataJournalSize = 0x4000; control.UserAccountSaveDataJournalSize = 0x4000;
Logger.PrintWarning(LogClass.Application, Logger.Warning?.Print(LogClass.Application,
"No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games."); "No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games.");
} }
@ -577,7 +577,7 @@ namespace Ryujinx.HLE.HOS
if (rc.IsFailure()) if (rc.IsFailure())
{ {
Logger.PrintError(LogClass.Application, $"Error calling EnsureApplicationCacheStorage. Result code {rc.ToStringWithName()}"); Logger.Error?.Print(LogClass.Application, $"Error calling EnsureApplicationCacheStorage. Result code {rc.ToStringWithName()}");
return rc; return rc;
} }
@ -586,7 +586,7 @@ namespace Ryujinx.HLE.HOS
if (rc.IsFailure()) if (rc.IsFailure())
{ {
Logger.PrintError(LogClass.Application, $"Error calling EnsureApplicationSaveData. Result code {rc.ToStringWithName()}"); Logger.Error?.Print(LogClass.Application, $"Error calling EnsureApplicationSaveData. Result code {rc.ToStringWithName()}");
} }
return rc; return rc;

View file

@ -1097,7 +1097,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
{ {
KernelContext.Scheduler.GetCurrentThreadOrNull()?.PrintGuestStackTrace(); KernelContext.Scheduler.GetCurrentThreadOrNull()?.PrintGuestStackTrace();
Logger.PrintError(LogClass.Cpu, $"Invalid memory access at virtual address 0x{va:X16}."); Logger.Error?.Print(LogClass.Cpu, $"Invalid memory access at virtual address 0x{va:X16}.");
return false; return false;
} }

View file

@ -153,7 +153,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
else else
{ {
Logger.PrintWarning(LogClass.KernelSvc, $"Invalid session handle 0x{handle:x8}!"); Logger.Warning?.Print(LogClass.KernelSvc, $"Invalid session handle 0x{handle:x8}!");
return KernelResult.InvalidHandle; return KernelResult.InvalidHandle;
} }
@ -1381,7 +1381,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
else else
{ {
Logger.PrintDebug(LogClass.KernelSvc, "Debugger triggered."); Logger.Debug?.Print(LogClass.KernelSvc, "Debugger triggered.");
} }
} }
@ -1391,7 +1391,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
string str = MemoryHelper.ReadAsciiString(process.CpuMemory, (long)strPtr, (long)size); string str = MemoryHelper.ReadAsciiString(process.CpuMemory, (long)strPtr, (long)size);
Logger.PrintWarning(LogClass.KernelSvc, str); Logger.Warning?.Print(LogClass.KernelSvc, str);
} }
public KernelResult GetInfo(uint id, int handle, long subId, out long value) public KernelResult GetInfo(uint id, int handle, long subId, out long value)

View file

@ -441,11 +441,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
{ {
if (argValues != null) if (argValues != null)
{ {
Logger.PrintDebug(LogClass.KernelSvc, string.Format(formatOrSvcName, argValues)); Logger.Debug?.Print(LogClass.KernelSvc, string.Format(formatOrSvcName, argValues));
} }
else else
{ {
Logger.PrintDebug(LogClass.KernelSvc, formatOrSvcName); Logger.Debug?.Print(LogClass.KernelSvc, formatOrSvcName);
} }
} }
@ -456,11 +456,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
result != KernelResult.Cancelled && result != KernelResult.Cancelled &&
result != KernelResult.InvalidState) result != KernelResult.InvalidState)
{ {
Logger.PrintWarning(LogClass.KernelSvc, $"{svcName} returned error {result}."); Logger.Warning?.Print(LogClass.KernelSvc, $"{svcName} returned error {result}.");
} }
else else
{ {
Logger.PrintDebug(LogClass.KernelSvc, $"{svcName} returned result {result}."); Logger.Debug?.Print(LogClass.KernelSvc, $"{svcName} returned result {result}.");
} }
} }
} }

View file

@ -1131,12 +1131,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
public void PrintGuestStackTrace() public void PrintGuestStackTrace()
{ {
StringBuilder trace = new StringBuilder(); Logger.Info?.Print(LogClass.Cpu, $"Guest stack trace:\n{GetGuestStackTrace()}\n");
trace.AppendLine("Guest stack trace:");
trace.AppendLine(GetGuestStackTrace());
Logger.PrintInfo(LogClass.Cpu, trace.ToString());
} }
public void Execute() public void Execute()

View file

@ -126,7 +126,7 @@ namespace Ryujinx.HLE.HOS
if (titleModsPath == null) if (titleModsPath == null)
{ {
Logger.PrintInfo(LogClass.ModLoader, $"Creating mods dir for Title {titleId.ToUpper()}"); Logger.Info?.Print(LogClass.ModLoader, $"Creating mods dir for Title {titleId.ToUpper()}");
titleModsPath = contentsDir.CreateSubdirectory(titleId); titleModsPath = contentsDir.CreateSubdirectory(titleId);
} }
@ -149,7 +149,7 @@ namespace Ryujinx.HLE.HOS
foreach (var modDir in patchDir.EnumerateDirectories()) foreach (var modDir in patchDir.EnumerateDirectories())
{ {
patches.Add(new Mod<DirectoryInfo>(modDir.Name, modDir)); patches.Add(new Mod<DirectoryInfo>(modDir.Name, modDir));
Logger.PrintInfo(LogClass.ModLoader, $"Found {type} patch '{modDir.Name}'"); Logger.Info?.Print(LogClass.ModLoader, $"Found {type} patch '{modDir.Name}'");
} }
} }
@ -202,7 +202,7 @@ namespace Ryujinx.HLE.HOS
} }
} }
if (types.Length > 0) Logger.PrintInfo(LogClass.ModLoader, $"Found mod '{mod.Name}' [{types}]"); if (types.Length > 0) Logger.Info?.Print(LogClass.ModLoader, $"Found mod '{mod.Name}' [{types}]");
} }
} }
@ -210,7 +210,7 @@ namespace Ryujinx.HLE.HOS
{ {
if (!contentsDir.Exists) return; if (!contentsDir.Exists) return;
Logger.PrintInfo(LogClass.ModLoader, $"Searching mods for Title {titleId:X16}"); Logger.Info?.Print(LogClass.ModLoader, $"Searching mods for Title {titleId:X16}");
var titleDir = FindTitleDir(contentsDir, $"{titleId:x16}"); var titleDir = FindTitleDir(contentsDir, $"{titleId:x16}");
@ -252,7 +252,7 @@ namespace Ryujinx.HLE.HOS
var dir = new DirectoryInfo(path); var dir = new DirectoryInfo(path);
if (!dir.Exists) if (!dir.Exists)
{ {
Logger.PrintWarning(LogClass.ModLoader, $"Mod Search Dir '{dir.FullName}' doesn't exist"); Logger.Warning?.Print(LogClass.ModLoader, $"Mod Search Dir '{dir.FullName}' doesn't exist");
continue; continue;
} }
@ -290,7 +290,7 @@ namespace Ryujinx.HLE.HOS
var builder = new RomFsBuilder(); var builder = new RomFsBuilder();
int count = 0; int count = 0;
Logger.PrintInfo(LogClass.ModLoader, $"Applying RomFS mods for Title {titleId:X16}"); Logger.Info?.Print(LogClass.ModLoader, $"Applying RomFS mods for Title {titleId:X16}");
// Prioritize loose files first // Prioritize loose files first
foreach (var mod in mods.RomfsDirs) foreach (var mod in mods.RomfsDirs)
@ -305,7 +305,7 @@ namespace Ryujinx.HLE.HOS
// Then files inside images // Then files inside images
foreach (var mod in mods.RomfsContainers) foreach (var mod in mods.RomfsContainers)
{ {
Logger.PrintInfo(LogClass.ModLoader, $"Found 'romfs.bin' for Title {titleId:X16}"); Logger.Info?.Print(LogClass.ModLoader, $"Found 'romfs.bin' for Title {titleId:X16}");
using (IFileSystem fs = new RomFsFileSystem(mod.Path.OpenRead().AsStorage())) using (IFileSystem fs = new RomFsFileSystem(mod.Path.OpenRead().AsStorage()))
{ {
AddFiles(fs, mod.Name, fileSet, builder); AddFiles(fs, mod.Name, fileSet, builder);
@ -315,12 +315,12 @@ namespace Ryujinx.HLE.HOS
if (fileSet.Count == 0) if (fileSet.Count == 0)
{ {
Logger.PrintInfo(LogClass.ModLoader, "No files found. Using base RomFS"); Logger.Info?.Print(LogClass.ModLoader, "No files found. Using base RomFS");
return baseStorage; return baseStorage;
} }
Logger.PrintInfo(LogClass.ModLoader, $"Replaced {fileSet.Count} file(s) over {count} mod(s). Processing base storage..."); Logger.Info?.Print(LogClass.ModLoader, $"Replaced {fileSet.Count} file(s) over {count} mod(s). Processing base storage...");
// And finally, the base romfs // And finally, the base romfs
var baseRom = new RomFsFileSystem(baseStorage); var baseRom = new RomFsFileSystem(baseStorage);
@ -332,9 +332,9 @@ namespace Ryujinx.HLE.HOS
builder.AddFile(entry.FullPath, file); builder.AddFile(entry.FullPath, file);
} }
Logger.PrintInfo(LogClass.ModLoader, "Building new RomFS..."); Logger.Info?.Print(LogClass.ModLoader, "Building new RomFS...");
IStorage newStorage = builder.Build(); IStorage newStorage = builder.Build();
Logger.PrintInfo(LogClass.ModLoader, "Using modded RomFS"); Logger.Info?.Print(LogClass.ModLoader, "Using modded RomFS");
return newStorage; return newStorage;
} }
@ -352,7 +352,7 @@ namespace Ryujinx.HLE.HOS
} }
else else
{ {
Logger.PrintWarning(LogClass.ModLoader, $" Skipped duplicate file '{entry.FullPath}' from '{modName}'", "ApplyRomFsMods"); Logger.Warning?.Print(LogClass.ModLoader, $" Skipped duplicate file '{entry.FullPath}' from '{modName}'", "ApplyRomFsMods");
} }
} }
} }
@ -366,10 +366,10 @@ namespace Ryujinx.HLE.HOS
if (mods.ExefsContainers.Count > 1) if (mods.ExefsContainers.Count > 1)
{ {
Logger.PrintWarning(LogClass.ModLoader, "Multiple ExeFS partition replacements detected"); Logger.Warning?.Print(LogClass.ModLoader, "Multiple ExeFS partition replacements detected");
} }
Logger.PrintInfo(LogClass.ModLoader, $"Using replacement ExeFS partition"); Logger.Info?.Print(LogClass.ModLoader, $"Using replacement ExeFS partition");
exefs = new PartitionFileSystem(mods.ExefsContainers[0].Path.OpenRead().AsStorage()); exefs = new PartitionFileSystem(mods.ExefsContainers[0].Path.OpenRead().AsStorage());
@ -407,14 +407,14 @@ namespace Ryujinx.HLE.HOS
{ {
if (repls[1 << i]) if (repls[1 << i])
{ {
Logger.PrintWarning(LogClass.ModLoader, $"Multiple replacements to '{nsoName}'"); Logger.Warning?.Print(LogClass.ModLoader, $"Multiple replacements to '{nsoName}'");
continue; continue;
} }
repls[1 << i] = true; repls[1 << i] = true;
nsos[i] = new NsoExecutable(nsoFile.OpenRead().AsStorage(), nsoName); nsos[i] = new NsoExecutable(nsoFile.OpenRead().AsStorage(), nsoName);
Logger.PrintInfo(LogClass.ModLoader, $"NSO '{nsoName}' replaced"); Logger.Info?.Print(LogClass.ModLoader, $"NSO '{nsoName}' replaced");
replaced = true; replaced = true;
@ -429,7 +429,7 @@ namespace Ryujinx.HLE.HOS
{ {
if (stubs[1 << i] && !repls[1 << i]) // Prioritizes replacements over stubs if (stubs[1 << i] && !repls[1 << i]) // Prioritizes replacements over stubs
{ {
Logger.PrintInfo(LogClass.ModLoader, $" NSO '{nsos[i].Name}' stubbed"); Logger.Info?.Print(LogClass.ModLoader, $" NSO '{nsos[i].Name}' stubbed");
nsos.RemoveAt(i); nsos.RemoveAt(i);
replaced = true; replaced = true;
} }
@ -500,7 +500,7 @@ namespace Ryujinx.HLE.HOS
continue; continue;
} }
Logger.PrintInfo(LogClass.ModLoader, $"Matching IPS patch '{patchFile.Name}' in '{mod.Name}' bid={buildId}"); Logger.Info?.Print(LogClass.ModLoader, $"Matching IPS patch '{patchFile.Name}' in '{mod.Name}' bid={buildId}");
using var fs = patchFile.OpenRead(); using var fs = patchFile.OpenRead();
using var reader = new BinaryReader(fs); using var reader = new BinaryReader(fs);
@ -521,7 +521,7 @@ namespace Ryujinx.HLE.HOS
continue; continue;
} }
Logger.PrintInfo(LogClass.ModLoader, $"Matching IPSwitch patch '{patchFile.Name}' in '{mod.Name}' bid={patcher.BuildId}"); Logger.Info?.Print(LogClass.ModLoader, $"Matching IPSwitch patch '{patchFile.Name}' in '{mod.Name}' bid={patcher.BuildId}");
patcher.AddPatches(patches[index]); patcher.AddPatches(patches[index]);
} }

View file

@ -75,7 +75,7 @@ namespace Ryujinx.HLE.HOS
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
Logger.PrintError(LogClass.Loader, $"Process initialization returned error \"{result}\"."); Logger.Error?.Print(LogClass.Loader, $"Process initialization returned error \"{result}\".");
return false; return false;
} }
@ -91,7 +91,7 @@ namespace Ryujinx.HLE.HOS
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
Logger.PrintError(LogClass.Loader, $"Process initialization returned error \"{result}\"."); Logger.Error?.Print(LogClass.Loader, $"Process initialization returned error \"{result}\".");
return false; return false;
} }
@ -100,7 +100,7 @@ namespace Ryujinx.HLE.HOS
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
Logger.PrintError(LogClass.Loader, $"Process initialization returned error \"{result}\"."); Logger.Error?.Print(LogClass.Loader, $"Process initialization returned error \"{result}\".");
return false; return false;
} }
@ -111,7 +111,7 @@ namespace Ryujinx.HLE.HOS
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
Logger.PrintError(LogClass.Loader, $"Process start returned error \"{result}\"."); Logger.Error?.Print(LogClass.Loader, $"Process start returned error \"{result}\".");
return false; return false;
} }
@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
Logger.PrintError(LogClass.Loader, $"Process initialization failed setting resource limit values."); Logger.Error?.Print(LogClass.Loader, $"Process initialization failed setting resource limit values.");
return false; return false;
} }
@ -212,7 +212,7 @@ namespace Ryujinx.HLE.HOS
if (memoryRegion > MemoryRegion.NvServices) if (memoryRegion > MemoryRegion.NvServices)
{ {
Logger.PrintError(LogClass.Loader, $"Process initialization failed due to invalid ACID flags."); Logger.Error?.Print(LogClass.Loader, $"Process initialization failed due to invalid ACID flags.");
return false; return false;
} }
@ -225,20 +225,20 @@ namespace Ryujinx.HLE.HOS
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
Logger.PrintError(LogClass.Loader, $"Process initialization returned error \"{result}\"."); Logger.Error?.Print(LogClass.Loader, $"Process initialization returned error \"{result}\".");
return false; return false;
} }
for (int index = 0; index < executables.Length; index++) for (int index = 0; index < executables.Length; index++)
{ {
Logger.PrintInfo(LogClass.Loader, $"Loading image {index} at 0x{nsoBase[index]:x16}..."); Logger.Info?.Print(LogClass.Loader, $"Loading image {index} at 0x{nsoBase[index]:x16}...");
result = LoadIntoMemory(process, executables[index], nsoBase[index]); result = LoadIntoMemory(process, executables[index], nsoBase[index]);
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
Logger.PrintError(LogClass.Loader, $"Process initialization returned error \"{result}\"."); Logger.Error?.Print(LogClass.Loader, $"Process initialization returned error \"{result}\".");
return false; return false;
} }
@ -250,7 +250,7 @@ namespace Ryujinx.HLE.HOS
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
Logger.PrintError(LogClass.Loader, $"Process start returned error \"{result}\"."); Logger.Error?.Print(LogClass.Loader, $"Process start returned error \"{result}\".");
return false; return false;
} }

View file

@ -101,7 +101,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
if (!context.Device.System.State.Account.TryGetUser(userId, out UserProfile userProfile)) if (!context.Device.System.State.Account.TryGetUser(userId, out UserProfile userProfile))
{ {
Logger.PrintWarning(LogClass.ServiceAcc, $"User 0x{userId} not found!"); Logger.Warning?.Print(LogClass.ServiceAcc, $"User 0x{userId} not found!");
return ResultCode.UserNotFound; return ResultCode.UserNotFound;
} }
@ -143,7 +143,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// This checks something related to baas (online), and then return an invalid UserId if the check in baas returns an error code. // This checks something related to baas (online), and then return an invalid UserId if the check in baas returns an error code.
// In our case, we can just log it for now. // In our case, we can just log it for now.
Logger.PrintStub(LogClass.ServiceAcc, new { baasCheck }); Logger.Stub?.PrintStub(LogClass.ServiceAcc, new { baasCheck });
} }
// As we returned an invalid UserId if there is more than one user earlier, now we can return only the first one. // As we returned an invalid UserId if there is more than one user earlier, now we can return only the first one.
@ -182,7 +182,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
_applicationLaunchProperty = ApplicationLaunchProperty.GetByPid(context); _applicationLaunchProperty = ApplicationLaunchProperty.GetByPid(context);
} }
Logger.PrintStub(LogClass.ServiceAcc, new { unknown }); Logger.Stub?.PrintStub(LogClass.ServiceAcc, new { unknown });
return ResultCode.Success; return ResultCode.Success;
} }
@ -246,7 +246,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// TODO: Store thumbnailBuffer somewhere, in save data 0x8000000000000010 ? // TODO: Store thumbnailBuffer somewhere, in save data 0x8000000000000010 ?
Logger.PrintStub(LogClass.ServiceAcc); Logger.Stub?.PrintStub(LogClass.ServiceAcc);
return ResultCode.Success; return ResultCode.Success;
} }
@ -269,7 +269,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// TODO: Clear the Thumbnail somewhere, in save data 0x8000000000000010 ? // TODO: Clear the Thumbnail somewhere, in save data 0x8000000000000010 ?
Logger.PrintStub(LogClass.ServiceAcc); Logger.Stub?.PrintStub(LogClass.ServiceAcc);
return ResultCode.Success; return ResultCode.Success;
} }
@ -291,7 +291,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
context.ResponseData.Write(context.Device.Application.ControlData.Value.UserAccountSwitchLock); context.ResponseData.Write(context.Device.Application.ControlData.Value.UserAccountSwitchLock);
Logger.PrintStub(LogClass.ServiceAcc); Logger.Stub?.PrintStub(LogClass.ServiceAcc);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// CheckAvailability() // CheckAvailability()
public ResultCode CheckAvailability(ServiceCtx context) public ResultCode CheckAvailability(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAcc); Logger.Stub?.PrintStub(LogClass.ServiceAcc);
return ResultCode.Success; return ResultCode.Success;
} }
@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// GetAccountId() -> nn::account::NetworkServiceAccountId // GetAccountId() -> nn::account::NetworkServiceAccountId
public ResultCode GetAccountId(ServiceCtx context) public ResultCode GetAccountId(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAcc, new { NetworkServiceAccountId }); Logger.Stub?.PrintStub(LogClass.ServiceAcc, new { NetworkServiceAccountId });
context.ResponseData.Write(NetworkServiceAccountId); context.ResponseData.Write(NetworkServiceAccountId);
@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// GetNintendoAccountUserResourceCacheForApplication() -> (nn::account::NintendoAccountId, buffer<nn::account::nas::NasUserBaseForApplication, 0x1a>, buffer<bytes, 6>) // GetNintendoAccountUserResourceCacheForApplication() -> (nn::account::NintendoAccountId, buffer<nn::account::nas::NasUserBaseForApplication, 0x1a>, buffer<bytes, 6>)
public ResultCode GetNintendoAccountUserResourceCacheForApplication(ServiceCtx context) public ResultCode GetNintendoAccountUserResourceCacheForApplication(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAcc, new { NetworkServiceAccountId }); Logger.Stub?.PrintStub(LogClass.ServiceAcc, new { NetworkServiceAccountId });
context.ResponseData.Write(NetworkServiceAccountId); context.ResponseData.Write(NetworkServiceAccountId);

View file

@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// Get() -> (nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x1a>) // Get() -> (nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x1a>)
public ResultCode Get(ServiceCtx context) public ResultCode Get(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAcc); Logger.Stub?.PrintStub(LogClass.ServiceAcc);
long position = context.Request.ReceiveBuff[0].Position; long position = context.Request.ReceiveBuff[0].Position;

View file

@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
_normalSession.DataAvailable += OnNormalOutData; _normalSession.DataAvailable += OnNormalOutData;
_interactiveSession.DataAvailable += OnInteractiveOutData; _interactiveSession.DataAvailable += OnInteractiveOutData;
Logger.PrintInfo(LogClass.ServiceAm, $"Applet '{appletId}' created."); Logger.Info?.Print(LogClass.ServiceAm, $"Applet '{appletId}' created.");
} }
private void OnAppletStateChanged(object sender, EventArgs e) private void OnAppletStateChanged(object sender, EventArgs e)
@ -194,7 +194,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
context.ResponseData.Write(indirectLayerConsumerHandle); context.ResponseData.Write(indirectLayerConsumerHandle);
Logger.PrintStub(LogClass.ServiceAm, new { indirectLayerConsumerHandle }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { indirectLayerConsumerHandle });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
float appletVolume = context.RequestData.ReadSingle(); float appletVolume = context.RequestData.ReadSingle();
float libraryAppletVolume = context.RequestData.ReadSingle(); float libraryAppletVolume = context.RequestData.ReadSingle();
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
context.ResponseData.Write(1f); context.ResponseData.Write(1f);
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -35,7 +35,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
context.ResponseData.Write(1f); context.ResponseData.Write(1f);
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -47,7 +47,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
float unknown0 = context.RequestData.ReadSingle(); float unknown0 = context.RequestData.ReadSingle();
long unknown1 = context.RequestData.ReadInt64(); long unknown1 = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
float unknown0 = context.RequestData.ReadSingle(); float unknown0 = context.RequestData.ReadSingle();
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -76,7 +76,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
context.ResponseData.Write((byte)0); //Unknown value. context.ResponseData.Write((byte)0); //Unknown value.
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -120,7 +120,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// RequestToGetForeground() // RequestToGetForeground()
public ResultCode RequestToGetForeground(ServiceCtx context) public ResultCode RequestToGetForeground(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
if (transferMem == null) if (transferMem == null)
{ {
Logger.PrintWarning(LogClass.ServiceAm, $"Invalid TransferMemory Handle: {handle:X}"); Logger.Warning?.Print(LogClass.ServiceAm, $"Invalid TransferMemory Handle: {handle:X}");
return ResultCode.Success; // TODO: Find correct error code return ResultCode.Success; // TODO: Find correct error code
} }

View file

@ -41,7 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// Exit() // Exit()
public ResultCode Exit(ServiceCtx context) public ResultCode Exit(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -50,7 +50,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// LockExit() // LockExit()
public ResultCode LockExit(ServiceCtx context) public ResultCode LockExit(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -59,7 +59,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// UnlockExit() // UnlockExit()
public ResultCode UnlockExit(ServiceCtx context) public ResultCode UnlockExit(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
bool screenShotPermission = context.RequestData.ReadBoolean(); bool screenShotPermission = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { screenShotPermission }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { screenShotPermission });
_screenShotPermission = screenShotPermission; _screenShotPermission = screenShotPermission;
@ -134,7 +134,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
bool operationModeChangedNotification = context.RequestData.ReadBoolean(); bool operationModeChangedNotification = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { operationModeChangedNotification }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { operationModeChangedNotification });
_operationModeChangedNotification = operationModeChangedNotification; _operationModeChangedNotification = operationModeChangedNotification;
@ -147,7 +147,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
bool performanceModeChangedNotification = context.RequestData.ReadBoolean(); bool performanceModeChangedNotification = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { performanceModeChangedNotification }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { performanceModeChangedNotification });
_performanceModeChangedNotification = performanceModeChangedNotification; _performanceModeChangedNotification = performanceModeChangedNotification;
@ -162,7 +162,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
bool unknownFlag2 = context.RequestData.ReadBoolean(); bool unknownFlag2 = context.RequestData.ReadBoolean();
bool unknownFlag3 = context.RequestData.ReadBoolean(); bool unknownFlag3 = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { unknownFlag1, unknownFlag2, unknownFlag3 }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { unknownFlag1, unknownFlag2, unknownFlag3 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -173,7 +173,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
bool restartMessageEnabled = context.RequestData.ReadBoolean(); bool restartMessageEnabled = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { restartMessageEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { restartMessageEnabled });
_restartMessageEnabled = restartMessageEnabled; _restartMessageEnabled = restartMessageEnabled;
@ -186,7 +186,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
bool outOfFocusSuspendingEnabled = context.RequestData.ReadBoolean(); bool outOfFocusSuspendingEnabled = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { outOfFocusSuspendingEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { outOfFocusSuspendingEnabled });
_outOfFocusSuspendingEnabled = outOfFocusSuspendingEnabled; _outOfFocusSuspendingEnabled = outOfFocusSuspendingEnabled;
@ -199,7 +199,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
uint screenShotImageOrientation = context.RequestData.ReadUInt32(); uint screenShotImageOrientation = context.RequestData.ReadUInt32();
Logger.PrintStub(LogClass.ServiceAm, new { screenShotImageOrientation }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { screenShotImageOrientation });
_screenShotImageOrientation = screenShotImageOrientation; _screenShotImageOrientation = screenShotImageOrientation;
@ -212,7 +212,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
bool handlesRequestToDisplay = context.RequestData.ReadBoolean(); bool handlesRequestToDisplay = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { handlesRequestToDisplay }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { handlesRequestToDisplay });
_handlesRequestToDisplay = handlesRequestToDisplay; _handlesRequestToDisplay = handlesRequestToDisplay;
@ -225,7 +225,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
uint idleTimeDetectionExtension = context.RequestData.ReadUInt32(); uint idleTimeDetectionExtension = context.RequestData.ReadUInt32();
Logger.PrintStub(LogClass.ServiceAm, new { idleTimeDetectionExtension }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { idleTimeDetectionExtension });
_idleTimeDetectionExtension = idleTimeDetectionExtension; _idleTimeDetectionExtension = idleTimeDetectionExtension;
@ -238,7 +238,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
context.ResponseData.Write(_idleTimeDetectionExtension); context.ResponseData.Write(_idleTimeDetectionExtension);
Logger.PrintStub(LogClass.ServiceAm, new { _idleTimeDetectionExtension }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { _idleTimeDetectionExtension });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// GetAppletResourceUserId() -> nn::applet::AppletResourceUserId // GetAppletResourceUserId() -> nn::applet::AppletResourceUserId
public ResultCode GetAppletResourceUserId(ServiceCtx context) public ResultCode GetAppletResourceUserId(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
context.ResponseData.Write(0L); context.ResponseData.Write(0L);
@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// AcquireForegroundRights() // AcquireForegroundRights()
public ResultCode AcquireForegroundRights(ServiceCtx context) public ResultCode AcquireForegroundRights(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -65,7 +65,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
control.UserAccountSaveDataSize = 0x4000; control.UserAccountSaveDataSize = 0x4000;
control.UserAccountSaveDataJournalSize = 0x4000; control.UserAccountSaveDataJournalSize = 0x4000;
Logger.PrintWarning(LogClass.ServiceAm, Logger.Warning?.Print(LogClass.ServiceAm,
"No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games."); "No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games.");
} }
@ -93,7 +93,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
if (firstSupported > (int)SystemState.TitleLanguage.Chinese) if (firstSupported > (int)SystemState.TitleLanguage.Chinese)
{ {
Logger.PrintWarning(LogClass.ServiceAm, "Application has zero supported languages"); Logger.Warning?.Print(LogClass.ServiceAm, "Application has zero supported languages");
context.ResponseData.Write(desiredLanguageCode); context.ResponseData.Write(desiredLanguageCode);
@ -107,7 +107,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
SystemLanguage newLanguage = Enum.Parse<SystemLanguage>(Enum.GetName(typeof(SystemState.TitleLanguage), firstSupported)); SystemLanguage newLanguage = Enum.Parse<SystemLanguage>(Enum.GetName(typeof(SystemState.TitleLanguage), firstSupported));
desiredLanguageCode = SystemStateMgr.GetLanguageCode((int)newLanguage); desiredLanguageCode = SystemStateMgr.GetLanguageCode((int)newLanguage);
Logger.PrintInfo(LogClass.ServiceAm, $"Application doesn't support configured language. Using {newLanguage}"); Logger.Info?.Print(LogClass.ServiceAm, $"Application doesn't support configured language. Using {newLanguage}");
} }
context.ResponseData.Write(desiredLanguageCode); context.ResponseData.Write(desiredLanguageCode);
@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
{ {
Result result = new Result(context.RequestData.ReadUInt32()); Result result = new Result(context.RequestData.ReadUInt32());
Logger.PrintInfo(LogClass.ServiceAm, $"Result = 0x{result.Value:x8} ({result.ToStringWithName()})."); Logger.Info?.Print(LogClass.ServiceAm, $"Result = 0x{result.Value:x8} ({result.ToStringWithName()}).");
return ResultCode.Success; return ResultCode.Success;
} }
@ -149,7 +149,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
// TODO: We return a size of 2GB as we use a directory based save system. This should be enough for most of the games. // TODO: We return a size of 2GB as we use a directory based save system. This should be enough for most of the games.
context.ResponseData.Write(2000000000u); context.ResponseData.Write(2000000000u);
Logger.PrintStub(LogClass.ServiceAm, new { saveDataType, userId }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { saveDataType, userId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -170,7 +170,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
context.ResponseData.Write(0L); context.ResponseData.Write(0L);
context.ResponseData.Write(0L); context.ResponseData.Write(0L);
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -179,7 +179,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
// InitializeGamePlayRecording(u64, handle<copy>) // InitializeGamePlayRecording(u64, handle<copy>)
public ResultCode InitializeGamePlayRecording(ServiceCtx context) public ResultCode InitializeGamePlayRecording(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -190,7 +190,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
{ {
int state = context.RequestData.ReadInt32(); int state = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceAm, new { state }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { state });
return ResultCode.Success; return ResultCode.Success;
} }
@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
{ {
bool applicationCrashReportEnabled = context.RequestData.ReadBoolean(); bool applicationCrashReportEnabled = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { applicationCrashReportEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { applicationCrashReportEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -246,7 +246,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
{ {
// TODO: Initialize buffer and object. // TODO: Initialize buffer and object.
Logger.PrintStub(LogClass.ServiceAm, new { transferMemoryAddress, transferMemorySize, width, height }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { transferMemoryAddress, transferMemorySize, width, height });
resultCode = ResultCode.Success; resultCode = ResultCode.Success;
} }
@ -282,7 +282,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
} }
} }
Logger.PrintStub(LogClass.ServiceAm, new { frameBufferPos, frameBufferSize, x, y, width, height, windowOriginMode }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { frameBufferPos, frameBufferSize, x, y, width, height, windowOriginMode });
return resultCode; return resultCode;
} }
@ -296,7 +296,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
} }
*/ */
Logger.PrintStub(LogClass.ServiceAm, new { x, y, width, height, frameBufferPos, frameBufferSize, windowOriginMode }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { x, y, width, height, frameBufferPos, frameBufferSize, windowOriginMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -307,7 +307,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
{ {
bool visible = context.RequestData.ReadBoolean(); bool visible = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceAm, new { visible }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { visible });
// NOTE: It sets an internal field and return ResultCode.Success in all case. // NOTE: It sets an internal field and return ResultCode.Success in all case.
@ -341,7 +341,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
context.ResponseData.Write(previousProgramIndex); context.ResponseData.Write(previousProgramIndex);
Logger.PrintStub(LogClass.ServiceAm, new { previousProgramIndex }); Logger.Stub?.PrintStub(LogClass.ServiceAm, new { previousProgramIndex });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1); context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1);
Logger.PrintStub(LogClass.ServiceApm); Logger.Stub?.PrintStub(LogClass.ServiceApm);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
if ((position - basePosition) + buffer.Length > size) if ((position - basePosition) + buffer.Length > size)
{ {
Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!");
break; break;
} }
@ -67,7 +67,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
string deviceName = Encoding.ASCII.GetString(deviceNameBuffer); string deviceName = Encoding.ASCII.GetString(deviceNameBuffer);
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
return ResultCode.Success; return ResultCode.Success;
} }
@ -89,7 +89,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
} }
else else
{ {
Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!");
} }
return ResultCode.Success; return ResultCode.Success;
@ -106,7 +106,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
return ResultCode.Success; return ResultCode.Success;
} }
@ -117,7 +117,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
context.ResponseData.Write(2); context.ResponseData.Write(2);
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
return ResultCode.Success; return ResultCode.Success;
} }
@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
if ((position - basePosition) + buffer.Length > size) if ((position - basePosition) + buffer.Length > size)
{ {
Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!");
break; break;
} }
@ -167,7 +167,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
string deviceName = Encoding.UTF8.GetString(deviceNameBuffer); string deviceName = Encoding.UTF8.GetString(deviceNameBuffer);
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
return ResultCode.Success; return ResultCode.Success;
} }
@ -178,7 +178,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
context.ResponseData.Write(1f); context.ResponseData.Write(1f);
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
return ResultCode.Success; return ResultCode.Success;
} }
@ -199,7 +199,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
} }
else else
{ {
Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!");
} }
return ResultCode.Success; return ResultCode.Success;
@ -216,7 +216,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
return ResultCode.Success; return ResultCode.Success;
} }
@ -232,7 +232,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{ {
context.ResponseData.Write((int)_playState); context.ResponseData.Write((int)_playState);
Logger.PrintStub(LogClass.ServiceAudio, new { State = Enum.GetName(typeof(PlayState), _playState) }); Logger.Stub?.PrintStub(LogClass.ServiceAudio, new { State = Enum.GetName(typeof(PlayState), _playState) });
return ResultCode.Success; return ResultCode.Success;
} }
@ -287,7 +287,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
// Start() // Start()
public ResultCode StartAudioRenderer(ServiceCtx context) public ResultCode StartAudioRenderer(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
_playState = PlayState.Playing; _playState = PlayState.Playing;
@ -298,7 +298,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
// Stop() // Stop()
public ResultCode StopAudioRenderer(ServiceCtx context) public ResultCode StopAudioRenderer(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceAudio); Logger.Stub?.PrintStub(LogClass.ServiceAudio);
_playState = PlayState.Stopped; _playState = PlayState.Stopped;

View file

@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
if (performanceMetricsDataFormat != 1) if (performanceMetricsDataFormat != 1)
{ {
Logger.PrintWarning(LogClass.ServiceAudio, $"PerformanceMetricsDataFormat: {performanceMetricsDataFormat} is not supported!"); Logger.Warning?.Print(LogClass.ServiceAudio, $"PerformanceMetricsDataFormat: {performanceMetricsDataFormat} is not supported!");
} }
return (((parameters.VoiceCount + return (((parameters.VoiceCount +

View file

@ -78,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
} }
else else
{ {
Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!");
} }
context.ResponseData.Write(nameCount); context.ResponseData.Write(nameCount);
@ -100,7 +100,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
if (deviceName != DefaultAudioOutput) if (deviceName != DefaultAudioOutput)
{ {
Logger.PrintWarning(LogClass.Audio, "Invalid device name!"); Logger.Warning?.Print(LogClass.Audio, "Invalid device name!");
return ResultCode.DeviceNotFound; return ResultCode.DeviceNotFound;
} }
@ -113,7 +113,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
} }
else else
{ {
Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {receiveSize} too small!"); Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {receiveSize} too small!");
} }
int sampleRate = context.RequestData.ReadInt32(); int sampleRate = context.RequestData.ReadInt32();
@ -126,7 +126,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
if (sampleRate != DefaultSampleRate) if (sampleRate != DefaultSampleRate)
{ {
Logger.PrintWarning(LogClass.Audio, "Invalid sample rate!"); Logger.Warning?.Print(LogClass.Audio, "Invalid sample rate!");
return ResultCode.UnsupportedSampleRate; return ResultCode.UnsupportedSampleRate;
} }

View file

@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
context.ResponseData.Write(size); context.ResponseData.Write(size);
Logger.PrintDebug(LogClass.ServiceAudio, $"WorkBufferSize is 0x{size:x16}."); Logger.Debug?.Print(LogClass.ServiceAudio, $"WorkBufferSize is 0x{size:x16}.");
return ResultCode.Success; return ResultCode.Success;
} }
@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
{ {
context.ResponseData.Write(0L); context.ResponseData.Write(0L);
Logger.PrintWarning(LogClass.ServiceAudio, $"Library Revision REV{AudioRendererCommon.GetRevisionVersion(parameters.Revision)} is not supported!"); Logger.Warning?.Print(LogClass.ServiceAudio, $"Library Revision REV{AudioRendererCommon.GetRevisionVersion(parameters.Revision)} is not supported!");
return ResultCode.UnsupportedRevision; return ResultCode.UnsupportedRevision;
} }
@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
int revisionInfo = context.RequestData.ReadInt32(); int revisionInfo = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceAudio, new { appletResourceUserId, revisionInfo }); Logger.Stub?.PrintStub(LogClass.ServiceAudio, new { appletResourceUserId, revisionInfo });
return GetAudioDeviceService(context); return GetAudioDeviceService(context);
} }

View file

@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceBcat); Logger.Stub?.PrintStub(LogClass.ServiceBcat);
return ResultCode.Success; return ResultCode.Success;
} }
@ -46,7 +46,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
WriteDeliveryCacheProgressImpl(context, context.Request.RecvListBuff[0], deliveryCacheProgress); WriteDeliveryCacheProgressImpl(context, context.Request.RecvListBuff[0], deliveryCacheProgress);
Logger.PrintStub(LogClass.ServiceBcat); Logger.Stub?.PrintStub(LogClass.ServiceBcat);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
// NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not. // NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not.
Logger.PrintError(LogClass.ServiceBsd, "Out of handles!"); Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!");
} }
} }
@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
// NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not. // NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not.
Logger.PrintError(LogClass.ServiceBsd, "Out of handles!"); Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!");
} }
} }
@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
// NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not. // NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not.
Logger.PrintError(LogClass.ServiceBsd, "Out of handles!"); Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!");
} }
} }
@ -114,7 +114,7 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser
if (result != KernelResult.Success) if (result != KernelResult.Success)
{ {
// NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not. // NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not.
Logger.PrintError(LogClass.ServiceBsd, "Out of handles!"); Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!");
} }
} }

View file

@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
// There are no friends online, so we return 0 because the nn::account::NetworkServiceAccountId array is empty. // There are no friends online, so we return 0 because the nn::account::NetworkServiceAccountId array is empty.
context.ResponseData.Write(0); context.ResponseData.Write(0);
Logger.PrintStub(LogClass.ServiceFriend, new Logger.Stub?.PrintStub(LogClass.ServiceFriend, new
{ {
UserId = userId.ToString(), UserId = userId.ToString(),
offset, offset,
@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
// There are no friends online, so we return 0 because the nn::account::NetworkServiceAccountId array is empty. // There are no friends online, so we return 0 because the nn::account::NetworkServiceAccountId array is empty.
context.ResponseData.Write(0); context.ResponseData.Write(0);
Logger.PrintStub(LogClass.ServiceFriend, new { Logger.Stub?.PrintStub(LogClass.ServiceFriend, new {
UserId = userId.ToString(), UserId = userId.ToString(),
offset, offset,
filter.PresenceStatus, filter.PresenceStatus,
@ -112,7 +112,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
// There are no friends blocked, so we return 0 because the nn::account::NetworkServiceAccountId array is empty. // There are no friends blocked, so we return 0 because the nn::account::NetworkServiceAccountId array is empty.
context.ResponseData.Write(0); context.ResponseData.Write(0);
Logger.PrintStub(LogClass.ServiceFriend, new { offset, UserId = userId.ToString() }); Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { offset, UserId = userId.ToString() });
return ResultCode.Success; return ResultCode.Success;
} }
@ -133,7 +133,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
profile.OnlinePlayState = AccountState.Open; profile.OnlinePlayState = AccountState.Open;
} }
Logger.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), profile.OnlinePlayState }); Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), profile.OnlinePlayState });
return ResultCode.Success; return ResultCode.Success;
} }
@ -154,7 +154,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
profile.OnlinePlayState = AccountState.Closed; profile.OnlinePlayState = AccountState.Closed;
} }
Logger.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), profile.OnlinePlayState }); Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), profile.OnlinePlayState });
return ResultCode.Success; return ResultCode.Success;
} }
@ -186,7 +186,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
{ {
UserPresence[] userPresenceInputArray = bufferReader.ReadStructArray<UserPresence>(elementCount); UserPresence[] userPresenceInputArray = bufferReader.ReadStructArray<UserPresence>(elementCount);
Logger.PrintStub(LogClass.ServiceFriend, new { UserId = uuid.ToString(), userPresenceInputArray }); Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = uuid.ToString(), userPresenceInputArray });
} }
return ResultCode.Success; return ResultCode.Success;

View file

@ -146,7 +146,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
creationInfo.OwnerId = new TitleId(context.Process.TitleId); creationInfo.OwnerId = new TitleId(context.Process.TitleId);
} }
Logger.PrintInfo(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}"); Logger.Info?.Print(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}");
Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref creationInfo, ref metaCreateInfo); Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref creationInfo, ref metaCreateInfo);
@ -359,7 +359,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
[Command(71)] [Command(71)]
public ResultCode ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(ServiceCtx context) public ResultCode ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceFs); Logger.Stub?.PrintStub(LogClass.ServiceFs);
MemoryHelper.FillWithZeros(context.Memory, context.Request.ReceiveBuff[0].Position, (int)context.Request.ReceiveBuff[0].Size); MemoryHelper.FillWithZeros(context.Memory, context.Request.ReceiveBuff[0].Position, (int)context.Request.ReceiveBuff[0].Size);
@ -387,7 +387,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
// This is because AOC can be distributed over multiple containers in the emulator. // This is because AOC can be distributed over multiple containers in the emulator.
if (context.Device.System.ContentManager.GetAocDataStorage((ulong)titleId, out LibHac.Fs.IStorage aocStorage)) if (context.Device.System.ContentManager.GetAocDataStorage((ulong)titleId, out LibHac.Fs.IStorage aocStorage))
{ {
Logger.PrintInfo(LogClass.Loader, $"Opened AddOnContent Data TitleID={titleId:X16}"); Logger.Info?.Print(LogClass.Loader, $"Opened AddOnContent Data TitleID={titleId:X16}");
MakeObject(context, new FileSystemProxy.IStorage(aocStorage)); MakeObject(context, new FileSystemProxy.IStorage(aocStorage));
@ -517,7 +517,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
string message = ReadUtf8StringSend(context); string message = ReadUtf8StringSend(context);
// FS ends each line with a newline. Remove it because Ryujinx logging adds its own newline // FS ends each line with a newline. Remove it because Ryujinx logging adds its own newline
Logger.PrintAccessLog(LogClass.ServiceFs, message.TrimEnd('\n')); Logger.AccessLog?.PrintMsg(LogClass.ServiceFs, message.TrimEnd('\n'));
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
if ((config.ConfiguredType & _supportedStyleSets) == 0) if ((config.ConfiguredType & _supportedStyleSets) == 0)
{ {
Logger.PrintWarning(LogClass.Hid, $"ControllerType {config.ConfiguredType} (connected to {(PlayerIndex)i}) not supported by game. Removing..."); Logger.Warning?.Print(LogClass.Hid, $"ControllerType {config.ConfiguredType} (connected to {(PlayerIndex)i}) not supported by game. Removing...");
config.State = FilterState.Configured; config.State = FilterState.Configured;
_device.Hid.SharedMemory.Npads[i] = new ShMemNpad(); // Zero it _device.Hid.SharedMemory.Npads[i] = new ShMemNpad(); // Zero it
@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
ControllerType controllerType = npadsTypeList[i]; ControllerType controllerType = npadsTypeList[i];
if ((controllerType & _supportedStyleSets) != 0) if ((controllerType & _supportedStyleSets) != 0)
{ {
Logger.PrintWarning(LogClass.Hid, $"No matching controllers found. Reassigning input as ControllerType {controllerType}..."); Logger.Warning?.Print(LogClass.Hid, $"No matching controllers found. Reassigning input as ControllerType {controllerType}...");
InitController(controllerType == ControllerType.Handheld ? PlayerIndex.Handheld : PlayerIndex.Player1, controllerType); InitController(controllerType == ControllerType.Handheld ? PlayerIndex.Handheld : PlayerIndex.Player1, controllerType);
@ -132,7 +132,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
} }
} }
Logger.PrintError(LogClass.Hid, "Couldn't find any appropriate controller."); Logger.Error?.Print(LogClass.Hid, "Couldn't find any appropriate controller.");
} }
} }
@ -226,7 +226,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_styleSetUpdateEvents[(int)player].ReadableEvent.Signal(); _styleSetUpdateEvents[(int)player].ReadableEvent.Signal();
Logger.PrintInfo(LogClass.Hid, $"Connected ControllerType {type} to PlayerIndex {player}"); Logger.Info?.Print(LogClass.Hid, $"Connected ControllerType {type} to PlayerIndex {player}");
} }
private static NpadLayoutsIndex ControllerTypeToLayout(ControllerType controllerType) private static NpadLayoutsIndex ControllerTypeToLayout(ControllerType controllerType)

View file

@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Device.Hid.Touchscreen.Active = true; context.Device.Hid.Touchscreen.Active = true;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Device.Hid.Mouse.Active = true; context.Device.Hid.Mouse.Active = true;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -108,7 +108,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Device.Hid.Keyboard.Active = true; context.Device.Hid.Keyboard.Active = true;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// NOTE: This signal the keyboard driver about lock events. // NOTE: This signal the keyboard driver about lock events.
Logger.PrintStub(LogClass.ServiceHid, new { flags }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { flags });
return ResultCode.Success; return ResultCode.Success;
} }
@ -139,7 +139,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_xpadIdEventHandle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_xpadIdEventHandle);
Logger.PrintStub(LogClass.ServiceHid, new { xpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { xpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -152,7 +152,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Process.HandleTable.CloseHandle(_xpadIdEventHandle); context.Process.HandleTable.CloseHandle(_xpadIdEventHandle);
Logger.PrintStub(LogClass.ServiceHid, new { xpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { xpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -164,7 +164,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int basicXpadId = context.RequestData.ReadInt32(); int basicXpadId = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, basicXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, basicXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -176,7 +176,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// There is any Xpad, so we return 0 and write nothing inside the type-0xa buffer. // There is any Xpad, so we return 0 and write nothing inside the type-0xa buffer.
context.ResponseData.Write(0L); context.ResponseData.Write(0L);
Logger.PrintStub(LogClass.ServiceHid); Logger.Stub?.PrintStub(LogClass.ServiceHid);
return ResultCode.Success; return ResultCode.Success;
} }
@ -187,7 +187,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int joyXpadId = context.RequestData.ReadInt32(); int joyXpadId = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -202,7 +202,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -214,7 +214,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// There is any JoyXpad, so we return 0 and write nothing inside the type-0xa buffer. // There is any JoyXpad, so we return 0 and write nothing inside the type-0xa buffer.
context.ResponseData.Write(0L); context.ResponseData.Write(0L);
Logger.PrintStub(LogClass.ServiceHid); Logger.Stub?.PrintStub(LogClass.ServiceHid);
return ResultCode.Success; return ResultCode.Success;
} }
@ -225,7 +225,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int basicXpadId = context.RequestData.ReadInt32(); int basicXpadId = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { basicXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { basicXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -236,7 +236,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int basicXpadId = context.RequestData.ReadInt32(); int basicXpadId = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { basicXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { basicXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -251,7 +251,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceHid, new { basicXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { basicXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -262,7 +262,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int joyXpadId = context.RequestData.ReadInt32(); int joyXpadId = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -273,7 +273,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int joyXpadId = context.RequestData.ReadInt32(); int joyXpadId = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -288,7 +288,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -300,7 +300,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int sixAxisSensorHandle = context.RequestData.ReadInt32(); int sixAxisSensorHandle = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -312,7 +312,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int sixAxisSensorHandle = context.RequestData.ReadInt32(); int sixAxisSensorHandle = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -326,7 +326,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(_sixAxisSensorFusionEnabled); context.ResponseData.Write(_sixAxisSensorFusionEnabled);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sixAxisSensorFusionEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sixAxisSensorFusionEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -339,7 +339,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int sixAxisSensorHandle = context.RequestData.ReadInt32(); int sixAxisSensorHandle = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sixAxisSensorFusionEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sixAxisSensorFusionEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -358,7 +358,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange });
return ResultCode.Success; return ResultCode.Success;
} }
@ -373,7 +373,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(_sensorFusionParams.RevisePower); context.ResponseData.Write(_sensorFusionParams.RevisePower);
context.ResponseData.Write(_sensorFusionParams.ReviseRange); context.ResponseData.Write(_sensorFusionParams.ReviseRange);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange });
return ResultCode.Success; return ResultCode.Success;
} }
@ -388,7 +388,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_sensorFusionParams.RevisePower = 0; _sensorFusionParams.RevisePower = 0;
_sensorFusionParams.ReviseRange = 0; _sensorFusionParams.ReviseRange = 0;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange });
return ResultCode.Success; return ResultCode.Success;
} }
@ -407,7 +407,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y });
return ResultCode.Success; return ResultCode.Success;
} }
@ -422,7 +422,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(_accelerometerParams.X); context.ResponseData.Write(_accelerometerParams.X);
context.ResponseData.Write(_accelerometerParams.Y); context.ResponseData.Write(_accelerometerParams.Y);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y });
return ResultCode.Success; return ResultCode.Success;
} }
@ -437,7 +437,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_accelerometerParams.X = 0; _accelerometerParams.X = 0;
_accelerometerParams.Y = 0; _accelerometerParams.Y = 0;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y });
return ResultCode.Success; return ResultCode.Success;
} }
@ -450,7 +450,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_accelerometerPlayMode = context.RequestData.ReadUInt32(); _accelerometerPlayMode = context.RequestData.ReadUInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -464,7 +464,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(_accelerometerPlayMode); context.ResponseData.Write(_accelerometerPlayMode);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -478,7 +478,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_accelerometerPlayMode = 0; _accelerometerPlayMode = 0;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -491,7 +491,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_gyroscopeZeroDriftMode = (HidGyroscopeZeroDriftMode)context.RequestData.ReadInt32(); _gyroscopeZeroDriftMode = (HidGyroscopeZeroDriftMode)context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -505,7 +505,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write((int)_gyroscopeZeroDriftMode); context.ResponseData.Write((int)_gyroscopeZeroDriftMode);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -519,7 +519,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_gyroscopeZeroDriftMode = HidGyroscopeZeroDriftMode.Standard; _gyroscopeZeroDriftMode = HidGyroscopeZeroDriftMode.Standard;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -535,7 +535,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(isAtRest); context.ResponseData.Write(isAtRest);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, isAtRest }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, isAtRest });
return ResultCode.Success; return ResultCode.Success;
} }
@ -547,7 +547,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
int unknown0 = context.RequestData.ReadInt32(); int unknown0 = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -559,7 +559,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
ControllerType type = (ControllerType)context.RequestData.ReadInt32(); ControllerType type = (ControllerType)context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { Logger.Stub?.PrintStub(LogClass.ServiceHid, new {
appletResourceUserId, appletResourceUserId,
type type
}); });
@ -577,7 +577,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write((int)context.Device.Hid.Npads.SupportedStyleSets); context.ResponseData.Write((int)context.Device.Hid.Npads.SupportedStyleSets);
Logger.PrintStub(LogClass.ServiceHid, new { Logger.Stub?.PrintStub(LogClass.ServiceHid, new {
appletResourceUserId, appletResourceUserId,
context.Device.Hid.Npads.SupportedStyleSets context.Device.Hid.Npads.SupportedStyleSets
}); });
@ -599,7 +599,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
supportedPlayerIds[i] = context.Memory.Read<NpadIdType>((ulong)(context.Request.PtrBuff[0].Position + i * 4)); supportedPlayerIds[i] = context.Memory.Read<NpadIdType>((ulong)(context.Request.PtrBuff[0].Position + i * 4));
} }
Logger.PrintStub(LogClass.ServiceHid, $"{arraySize} " + string.Join(",", supportedPlayerIds)); Logger.Stub?.PrintStub(LogClass.ServiceHid, $"{arraySize} " + string.Join(",", supportedPlayerIds));
return ResultCode.Success; return ResultCode.Success;
} }
@ -611,7 +611,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
context.Device.Hid.Npads.Active = true; context.Device.Hid.Npads.Active = true;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -623,7 +623,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
context.Device.Hid.Npads.Active = false; context.Device.Hid.Npads.Active = false;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -644,7 +644,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadId, npadStyleSet }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadId, npadStyleSet });
return ResultCode.Success; return ResultCode.Success;
} }
@ -656,7 +656,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
NpadIdType npadIdType = (NpadIdType)context.RequestData.ReadInt32(); NpadIdType npadIdType = (NpadIdType)context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadIdType }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadIdType });
return ResultCode.Success; return ResultCode.Success;
} }
@ -671,7 +671,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(ledPattern); context.ResponseData.Write(ledPattern);
Logger.PrintStub(LogClass.ServiceHid, new { npadId, ledPattern }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, ledPattern });
return ResultCode.Success; return ResultCode.Success;
} }
@ -683,7 +683,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int revision = context.RequestData.ReadInt32(); int revision = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, revision }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, revision });
return ResultCode.Success; return ResultCode.Success;
} }
@ -695,7 +695,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
context.Device.Hid.Npads.JoyHold = (NpadJoyHoldType)context.RequestData.ReadInt64(); context.Device.Hid.Npads.JoyHold = (NpadJoyHoldType)context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { Logger.Stub?.PrintStub(LogClass.ServiceHid, new {
appletResourceUserId, appletResourceUserId,
context.Device.Hid.Npads.JoyHold context.Device.Hid.Npads.JoyHold
}); });
@ -711,7 +711,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write((long)context.Device.Hid.Npads.JoyHold); context.ResponseData.Write((long)context.Device.Hid.Npads.JoyHold);
Logger.PrintStub(LogClass.ServiceHid, new { Logger.Stub?.PrintStub(LogClass.ServiceHid, new {
appletResourceUserId, appletResourceUserId,
context.Device.Hid.Npads.JoyHold context.Device.Hid.Npads.JoyHold
}); });
@ -728,7 +728,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single; _npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, _npadJoyAssignmentMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, _npadJoyAssignmentMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -743,7 +743,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single; _npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, hidNpadJoyDeviceType, _npadJoyAssignmentMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, hidNpadJoyDeviceType, _npadJoyAssignmentMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -757,7 +757,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Dual; _npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Dual;
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, _npadJoyAssignmentMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, _npadJoyAssignmentMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -770,7 +770,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long singleJoyId1 = context.RequestData.ReadInt32(); long singleJoyId1 = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, singleJoyId0, singleJoyId1 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, singleJoyId0, singleJoyId1 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -781,7 +781,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -792,7 +792,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -804,7 +804,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
_npadHandheldActivationMode = (HidNpadHandheldActivationMode)context.RequestData.ReadInt64(); _npadHandheldActivationMode = (HidNpadHandheldActivationMode)context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadHandheldActivationMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadHandheldActivationMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -817,7 +817,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write((long)_npadHandheldActivationMode); context.ResponseData.Write((long)_npadHandheldActivationMode);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadHandheldActivationMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadHandheldActivationMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -830,7 +830,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int newNpadAssignment = context.RequestData.ReadInt32(); int newNpadAssignment = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, oldNpadAssignment, newNpadAssignment }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, oldNpadAssignment, newNpadAssignment });
return ResultCode.Success; return ResultCode.Success;
} }
@ -844,7 +844,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(_unintendedHomeButtonInputProtectionEnabled); context.ResponseData.Write(_unintendedHomeButtonInputProtectionEnabled);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0, _unintendedHomeButtonInputProtectionEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0, _unintendedHomeButtonInputProtectionEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -857,7 +857,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
uint unknown0 = context.RequestData.ReadUInt32(); uint unknown0 = context.RequestData.ReadUInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0, _unintendedHomeButtonInputProtectionEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0, _unintendedHomeButtonInputProtectionEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -875,7 +875,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(0); //Unknown0 context.ResponseData.Write(0); //Unknown0
context.ResponseData.Write(0); //Unknown1 context.ResponseData.Write(0); //Unknown1
Logger.PrintStub(LogClass.ServiceHid, new { Logger.Stub?.PrintStub(LogClass.ServiceHid, new {
appletResourceUserId, appletResourceUserId,
hidControllerId, hidControllerId,
hidNpadJoyDeviceType, hidNpadJoyDeviceType,
@ -902,7 +902,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write((int)deviceInfo.DeviceType); context.ResponseData.Write((int)deviceInfo.DeviceType);
context.ResponseData.Write((int)deviceInfo.Position); context.ResponseData.Write((int)deviceInfo.Position);
Logger.PrintStub(LogClass.ServiceHid, new { vibrationDeviceHandle, deviceInfo.DeviceType, deviceInfo.Position }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { vibrationDeviceHandle, deviceInfo.DeviceType, deviceInfo.Position });
return ResultCode.Success; return ResultCode.Success;
} }
@ -923,7 +923,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { Logger.Debug?.PrintStub(LogClass.ServiceHid, new {
appletResourceUserId, appletResourceUserId,
vibrationDeviceHandle, vibrationDeviceHandle,
_vibrationValue.AmplitudeLow, _vibrationValue.AmplitudeLow,
@ -947,7 +947,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(_vibrationValue.AmplitudeHigh); context.ResponseData.Write(_vibrationValue.AmplitudeHigh);
context.ResponseData.Write(_vibrationValue.FrequencyHigh); context.ResponseData.Write(_vibrationValue.FrequencyHigh);
Logger.PrintStub(LogClass.ServiceHid, new { Logger.Stub?.PrintStub(LogClass.ServiceHid, new {
appletResourceUserId, appletResourceUserId,
vibrationDeviceHandle, vibrationDeviceHandle,
_vibrationValue.AmplitudeLow, _vibrationValue.AmplitudeLow,
@ -974,7 +974,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
_vibrationPermitted = context.RequestData.ReadBoolean(); _vibrationPermitted = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceHid, new { _vibrationPermitted }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _vibrationPermitted });
return ResultCode.Success; return ResultCode.Success;
} }
@ -985,7 +985,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
context.ResponseData.Write(_vibrationPermitted); context.ResponseData.Write(_vibrationPermitted);
Logger.PrintStub(LogClass.ServiceHid, new { _vibrationPermitted }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _vibrationPermitted });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1006,7 +1006,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// TODO: Read all handles and values from buffer. // TODO: Read all handles and values from buffer.
Logger.PrintStub(LogClass.ServiceHid, new { Logger.Debug?.PrintStub(LogClass.ServiceHid, new {
appletResourceUserId, appletResourceUserId,
VibrationDeviceHandleBufferLength = vibrationDeviceHandleBuffer.Length, VibrationDeviceHandleBufferLength = vibrationDeviceHandleBuffer.Length,
VibrationValueBufferLength = vibrationValueBuffer.Length VibrationValueBufferLength = vibrationValueBuffer.Length
@ -1023,7 +1023,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long vibrationGcErmCommand = context.RequestData.ReadInt64(); long vibrationGcErmCommand = context.RequestData.ReadInt64();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, vibrationGcErmCommand }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, vibrationGcErmCommand });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1037,7 +1037,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(_vibrationGcErmCommand); context.ResponseData.Write(_vibrationGcErmCommand);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, _vibrationGcErmCommand }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, _vibrationGcErmCommand });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1048,7 +1048,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1057,7 +1057,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// EndPermitVibrationSession() // EndPermitVibrationSession()
public ResultCode EndPermitVibrationSession(ServiceCtx context) public ResultCode EndPermitVibrationSession(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceHid); Logger.Stub?.PrintStub(LogClass.ServiceHid);
return ResultCode.Success; return ResultCode.Success;
} }
@ -1068,7 +1068,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1080,7 +1080,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int consoleSixAxisSensorHandle = context.RequestData.ReadInt32(); int consoleSixAxisSensorHandle = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, consoleSixAxisSensorHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, consoleSixAxisSensorHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1092,7 +1092,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int consoleSixAxisSensorHandle = context.RequestData.ReadInt32(); int consoleSixAxisSensorHandle = context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, consoleSixAxisSensorHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, consoleSixAxisSensorHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1103,7 +1103,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1114,7 +1114,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1125,7 +1125,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1140,7 +1140,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// TODO: Determine if array<nn::sf::NativeHandle> is a buffer or not... // TODO: Determine if array<nn::sf::NativeHandle> is a buffer or not...
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, counter0, counter1 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, counter0, counter1 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1151,7 +1151,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1163,7 +1163,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_sevenSixAxisSensorFusionStrength = context.RequestData.ReadSingle(); _sevenSixAxisSensorFusionStrength = context.RequestData.ReadSingle();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _sevenSixAxisSensorFusionStrength }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _sevenSixAxisSensorFusionStrength });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1176,7 +1176,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(_sevenSixAxisSensorFusionStrength); context.ResponseData.Write(_sevenSixAxisSensorFusionStrength);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _sevenSixAxisSensorFusionStrength }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _sevenSixAxisSensorFusionStrength });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1187,7 +1187,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
context.ResponseData.Write(_usbFullKeyControllerEnabled); context.ResponseData.Write(_usbFullKeyControllerEnabled);
Logger.PrintStub(LogClass.ServiceHid, new { _usbFullKeyControllerEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _usbFullKeyControllerEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1198,7 +1198,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
_usbFullKeyControllerEnabled = context.RequestData.ReadBoolean(); _usbFullKeyControllerEnabled = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceHid, new { _usbFullKeyControllerEnabled }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _usbFullKeyControllerEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1211,7 +1211,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(true); //FullKeyController is always connected ? context.ResponseData.Write(true); //FullKeyController is always connected ?
Logger.PrintStub(LogClass.ServiceHid, new { unknown0, Connected = true }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { unknown0, Connected = true });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1224,7 +1224,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(true); //Npad always got a battery ? context.ResponseData.Write(true); //Npad always got a battery ?
Logger.PrintStub(LogClass.ServiceHid, new { npadId, HasBattery = true }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, HasBattery = true });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1238,7 +1238,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(true); //Npad always got a left battery ? context.ResponseData.Write(true); //Npad always got a left battery ?
context.ResponseData.Write(true); //Npad always got a right battery ? context.ResponseData.Write(true); //Npad always got a right battery ?
Logger.PrintStub(LogClass.ServiceHid, new { npadId, HasLeftBattery = true, HasRightBattery = true }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, HasLeftBattery = true, HasRightBattery = true });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1251,7 +1251,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write((byte)0); context.ResponseData.Write((byte)0);
Logger.PrintStub(LogClass.ServiceHid, new { npadId, NpadInterfaceType = 0 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, NpadInterfaceType = 0 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1265,7 +1265,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write((byte)0); context.ResponseData.Write((byte)0);
context.ResponseData.Write((byte)0); context.ResponseData.Write((byte)0);
Logger.PrintStub(LogClass.ServiceHid, new { npadId, LeftInterfaceType = 0, RightInterfaceType = 0 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, LeftInterfaceType = 0, RightInterfaceType = 0 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1281,7 +1281,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(palmaConnectionHandle); context.ResponseData.Write(palmaConnectionHandle);
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId , unknown0, palmaConnectionHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId , unknown0, palmaConnectionHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1292,7 +1292,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int palmaConnectionHandle = context.RequestData.ReadInt32(); int palmaConnectionHandle = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle });
_palmaOperationCompleteEvent.ReadableEvent.Signal(); _palmaOperationCompleteEvent.ReadableEvent.Signal();
@ -1312,7 +1312,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1327,7 +1327,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.ResponseData.Write(unknown0); context.ResponseData.Write(unknown0);
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1339,7 +1339,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int palmaConnectionHandle = context.RequestData.ReadInt32(); int palmaConnectionHandle = context.RequestData.ReadInt32();
long unknown0 = context.RequestData.ReadInt64(); long unknown0 = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0 });
_palmaOperationCompleteEvent.ReadableEvent.Signal(); _palmaOperationCompleteEvent.ReadableEvent.Signal();
@ -1353,7 +1353,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int palmaConnectionHandle = context.RequestData.ReadInt32(); int palmaConnectionHandle = context.RequestData.ReadInt32();
long frModeType = context.RequestData.ReadInt64(); long frModeType = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, frModeType }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, frModeType });
_palmaOperationCompleteEvent.ReadableEvent.Signal(); _palmaOperationCompleteEvent.ReadableEvent.Signal();
@ -1366,7 +1366,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int palmaConnectionHandle = context.RequestData.ReadInt32(); int palmaConnectionHandle = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1378,7 +1378,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int palmaConnectionHandle = context.RequestData.ReadInt32(); int palmaConnectionHandle = context.RequestData.ReadInt32();
bool enabledPalmaStep = context.RequestData.ReadBoolean(); bool enabledPalmaStep = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, enabledPalmaStep }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, enabledPalmaStep });
_palmaOperationCompleteEvent.ReadableEvent.Signal(); _palmaOperationCompleteEvent.ReadableEvent.Signal();
@ -1391,7 +1391,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int palmaConnectionHandle = context.RequestData.ReadInt32(); int palmaConnectionHandle = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle });
_palmaOperationCompleteEvent.ReadableEvent.Signal(); _palmaOperationCompleteEvent.ReadableEvent.Signal();
@ -1406,7 +1406,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long unknown0 = context.RequestData.ReadInt64(); long unknown0 = context.RequestData.ReadInt64();
long unknown1 = context.RequestData.ReadInt64(); long unknown1 = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0, unknown1 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0, unknown1 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1420,7 +1420,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long unknown1 = context.RequestData.ReadInt64(); long unknown1 = context.RequestData.ReadInt64();
// nn::hid::PalmaApplicationSectionAccessBuffer cast is unknown // nn::hid::PalmaApplicationSectionAccessBuffer cast is unknown
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0, unknown1 }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0, unknown1 });
_palmaOperationCompleteEvent.ReadableEvent.Signal(); _palmaOperationCompleteEvent.ReadableEvent.Signal();
@ -1433,7 +1433,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int palmaConnectionHandle = context.RequestData.ReadInt32(); int palmaConnectionHandle = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1444,7 +1444,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
int palmaConnectionHandle = context.RequestData.ReadInt32(); int palmaConnectionHandle = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1456,7 +1456,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
long unknownBool = context.RequestData.ReadInt64(); long unknownBool = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknownBool }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknownBool });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1477,7 +1477,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
_npadCommunicationMode = context.RequestData.ReadInt64(); _npadCommunicationMode = context.RequestData.ReadInt64();
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadCommunicationMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadCommunicationMode });
return ResultCode.Success; return ResultCode.Success;
} }
@ -1488,7 +1488,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{ {
context.ResponseData.Write(_npadCommunicationMode); context.ResponseData.Write(_npadCommunicationMode);
Logger.PrintStub(LogClass.ServiceHid, new { _npadCommunicationMode }); Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _npadCommunicationMode });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs
{ {
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId }); Logger.Stub?.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId });
return ResultCode.Success; return ResultCode.Success;
} }
@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs
long appletResourceUserId = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64();
long packedFunctionLevel = context.RequestData.ReadInt64(); long packedFunctionLevel = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId, packedFunctionLevel }); Logger.Stub?.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId, packedFunctionLevel });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services
if (serviceExists) if (serviceExists)
{ {
Logger.PrintDebug(LogClass.KernelIpc, $"{service.GetType().Name}: {processRequest.Name}"); Logger.Debug?.Print(LogClass.KernelIpc, $"{service.GetType().Name}: {processRequest.Name}");
ProfileConfig profile = Profiles.ServiceCall; ProfileConfig profile = Profiles.ServiceCall;
@ -130,7 +130,7 @@ namespace Ryujinx.HLE.HOS.Services
serviceName = (dummyService == null) ? service.GetType().FullName : dummyService.ServiceName; serviceName = (dummyService == null) ? service.GetType().FullName : dummyService.ServiceName;
Logger.PrintWarning(LogClass.KernelIpc, $"Missing service {serviceName}: {commandId} ignored"); Logger.Warning?.Print(LogClass.KernelIpc, $"Missing service {serviceName}: {commandId} ignored");
} }
if (_isDomain) if (_isDomain)

View file

@ -27,7 +27,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn
// If the call failed, it returns the result code. // If the call failed, it returns the result code.
// If the call succeed, it signal and clear an event then start a new thread named nn.ldn.NetworkInterfaceMonitor. // If the call succeed, it signal and clear an event then start a new thread named nn.ldn.NetworkInterfaceMonitor.
Logger.PrintStub(LogClass.ServiceLdn, new { version }); Logger.Stub?.PrintStub(LogClass.ServiceLdn, new { version });
// NOTE: Since we don't support ldn for now, we can return this following result code to make it disabled. // NOTE: Since we don't support ldn for now, we can return this following result code to make it disabled.
return ResultCode.DeviceDisabled; return ResultCode.DeviceDisabled;
@ -51,7 +51,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn
StateChangeEvent.WritableEvent.Signal(); StateChangeEvent.WritableEvent.Signal();
StateChangeEvent.WritableEvent.Clear(); StateChangeEvent.WritableEvent.Clear();
Logger.PrintStub(LogClass.ServiceLdn); Logger.Stub?.PrintStub(LogClass.ServiceLdn);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -8,9 +8,87 @@ namespace Ryujinx.HLE.HOS.Services.Lm.LogService
{ {
public ILogger() { } public ILogger() { }
[Command(0)]
// Log(buffer<unknown, 0x21>)
public ResultCode Log(ServiceCtx context)
{
Logger.Guest?.Print(LogClass.ServiceLm, LogImpl(context));
return ResultCode.Success;
}
private string LogImpl(ServiceCtx context)
{
(long bufPos, long bufSize) = context.Request.GetBufferType0x21();
byte[] logBuffer = new byte[bufSize];
context.Memory.Read((ulong)bufPos, logBuffer);
using MemoryStream ms = new MemoryStream(logBuffer);
BinaryReader reader = new BinaryReader(ms);
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:\n Log level: {(LmLogLevel)level}");
while (ms.Position < ms.Length)
{
int type = ReadEncodedInt(reader);
int size = ReadEncodedInt(reader);
LmLogField field = (LmLogField)type;
string fieldStr = string.Empty;
if (field == LmLogField.Start)
{
reader.ReadBytes(size);
continue;
}
else if (field == LmLogField.Stop)
{
break;
}
else if (field == LmLogField.Line)
{
fieldStr = $"{field}: {reader.ReadInt32()}";
}
else if (field == LmLogField.DropCount)
{
fieldStr = $"{field}: {reader.ReadInt64()}";
}
else if (field == LmLogField.Time)
{
fieldStr = $"{field}: {reader.ReadInt64()}s";
}
else if (field < LmLogField.Count)
{
fieldStr = $"{field}: '{Encoding.UTF8.GetString(reader.ReadBytes(size)).TrimEnd()}'";
}
else
{
fieldStr = $"Field{field}: '{Encoding.UTF8.GetString(reader.ReadBytes(size)).TrimEnd()}'";
}
sb.AppendLine($" {fieldStr}");
}
return sb.ToString();
}
private static int ReadEncodedInt(BinaryReader reader) private static int ReadEncodedInt(BinaryReader reader)
{ {
int result = 0; int result = 0;
int position = 0; int position = 0;
byte encoded; byte encoded;
@ -27,83 +105,5 @@ namespace Ryujinx.HLE.HOS.Services.Lm.LogService
return result; return result;
} }
[Command(0)]
// Log(buffer<unknown, 0x21>)
public ResultCode Log(ServiceCtx context)
{
(long bufPos, long bufSize) = context.Request.GetBufferType0x21();
byte[] logBuffer = new byte[bufSize];
context.Memory.Read((ulong)bufPos, logBuffer);
using (MemoryStream ms = new MemoryStream(logBuffer))
{
BinaryReader reader = new BinaryReader(ms);
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:");
sb.AppendLine($" Log level: {(LmLogLevel)level}");
while (ms.Position < ms.Length)
{
int type = ReadEncodedInt(reader);
int size = ReadEncodedInt(reader);
LmLogField field = (LmLogField)type;
string fieldStr = string.Empty;
if (field == LmLogField.Start)
{
reader.ReadBytes(size);
continue;
}
else if (field == LmLogField.Stop)
{
break;
}
else if (field == LmLogField.Line)
{
fieldStr = $"{field}: {reader.ReadInt32()}";
}
else if (field == LmLogField.DropCount)
{
fieldStr = $"{field}: {reader.ReadInt64()}";
}
else if (field == LmLogField.Time)
{
fieldStr = $"{field}: {reader.ReadInt64()}s";
}
else if (field < LmLogField.Count)
{
fieldStr = $"{field}: '{Encoding.UTF8.GetString(reader.ReadBytes(size)).TrimEnd()}'";
}
else
{
fieldStr = $"Field{field}: '{Encoding.UTF8.GetString(reader.ReadBytes(size)).TrimEnd()}'";
}
sb.AppendLine(" " + fieldStr);
}
string text = sb.ToString();
Logger.PrintGuest(LogClass.ServiceLm, text);
}
return ResultCode.Success;
}
} }
} }

View file

@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm
int fgmId = context.RequestData.ReadInt32(); int fgmId = context.RequestData.ReadInt32();
bool isAutoClearEvent = context.RequestData.ReadInt32() != 0; bool isAutoClearEvent = context.RequestData.ReadInt32() != 0;
Logger.PrintStub(LogClass.ServiceMm, new { operationType, fgmId, isAutoClearEvent }); Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType, fgmId, isAutoClearEvent });
Register(operationType, fgmId, isAutoClearEvent); Register(operationType, fgmId, isAutoClearEvent);
@ -35,7 +35,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm
{ {
MultiMediaOperationType operationType = (MultiMediaOperationType)context.RequestData.ReadUInt32(); MultiMediaOperationType operationType = (MultiMediaOperationType)context.RequestData.ReadUInt32();
Logger.PrintStub(LogClass.ServiceMm, new { operationType }); Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType });
lock (_sessionListLock) lock (_sessionListLock)
{ {
@ -53,7 +53,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm
uint value = context.RequestData.ReadUInt32(); uint value = context.RequestData.ReadUInt32();
int timeout = context.RequestData.ReadInt32(); int timeout = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceMm, new { operationType, value, timeout }); Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType, value, timeout });
lock (_sessionListLock) lock (_sessionListLock)
{ {
@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm
{ {
MultiMediaOperationType operationType = (MultiMediaOperationType)context.RequestData.ReadUInt32(); MultiMediaOperationType operationType = (MultiMediaOperationType)context.RequestData.ReadUInt32();
Logger.PrintStub(LogClass.ServiceMm, new { operationType }); Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType });
lock (_sessionListLock) lock (_sessionListLock)
{ {
@ -91,7 +91,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm
int fgmId = context.RequestData.ReadInt32(); int fgmId = context.RequestData.ReadInt32();
bool isAutoClearEvent = context.RequestData.ReadInt32() != 0; bool isAutoClearEvent = context.RequestData.ReadInt32() != 0;
Logger.PrintStub(LogClass.ServiceMm, new { operationType, fgmId, isAutoClearEvent }); Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType, fgmId, isAutoClearEvent });
uint id = Register(operationType, fgmId, isAutoClearEvent); uint id = Register(operationType, fgmId, isAutoClearEvent);
@ -106,7 +106,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm
{ {
uint id = context.RequestData.ReadUInt32(); uint id = context.RequestData.ReadUInt32();
Logger.PrintStub(LogClass.ServiceMm, new { id }); Logger.Stub?.PrintStub(LogClass.ServiceMm, new { id });
lock (_sessionListLock) lock (_sessionListLock)
{ {
@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm
uint value = context.RequestData.ReadUInt32(); uint value = context.RequestData.ReadUInt32();
int timeout = context.RequestData.ReadInt32(); int timeout = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceMm, new { id, value, timeout }); Logger.Stub?.PrintStub(LogClass.ServiceMm, new { id, value, timeout });
lock (_sessionListLock) lock (_sessionListLock)
{ {
@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm
{ {
uint id = context.RequestData.ReadUInt32(); uint id = context.RequestData.ReadUInt32();
Logger.PrintStub(LogClass.ServiceMm, new { id }); Logger.Stub?.PrintStub(LogClass.ServiceMm, new { id });
lock (_sessionListLock) lock (_sessionListLock)
{ {

View file

@ -50,7 +50,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
// Doesn't occur in our case. // Doesn't occur in our case.
// return ResultCode.ObjectIsNull; // return ResultCode.ObjectIsNull;
Logger.PrintStub(LogClass.ServiceNifm, new { version }); Logger.Stub?.PrintStub(LogClass.ServiceNifm, new { version });
return ResultCode.Success; return ResultCode.Success;
} }
@ -68,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
context.ResponseData.WriteStruct(new IpV4Address(unicastAddress.Address)); context.ResponseData.WriteStruct(new IpV4Address(unicastAddress.Address));
Logger.PrintInfo(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\"."); Logger.Info?.Print(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\".");
return ResultCode.Success; return ResultCode.Success;
} }
@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
return ResultCode.NoInternetConnection; return ResultCode.NoInternetConnection;
} }
Logger.PrintInfo(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\"."); Logger.Info?.Print(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\".");
context.ResponseData.WriteStruct(new IpAddressSetting(interfaceProperties, unicastAddress)); context.ResponseData.WriteStruct(new IpAddressSetting(interfaceProperties, unicastAddress));
context.ResponseData.WriteStruct(new DnsSetting(interfaceProperties)); context.ResponseData.WriteStruct(new DnsSetting(interfaceProperties));

View file

@ -27,7 +27,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
{ {
context.ResponseData.Write(1); context.ResponseData.Write(1);
Logger.PrintStub(LogClass.ServiceNifm); Logger.Stub?.PrintStub(LogClass.ServiceNifm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
// GetResult() // GetResult()
public ResultCode GetResult(ServiceCtx context) public ResultCode GetResult(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceNifm); Logger.Stub?.PrintStub(LogClass.ServiceNifm);
return GetResultImpl(); return GetResultImpl();
} }
@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
// Cancel() // Cancel()
public ResultCode Cancel(ServiceCtx context) public ResultCode Cancel(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceNifm); Logger.Stub?.PrintStub(LogClass.ServiceNifm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -78,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
// Submit() // Submit()
public ResultCode Submit(ServiceCtx context) public ResultCode Submit(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceNifm); Logger.Stub?.PrintStub(LogClass.ServiceNifm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
// SetConnectionConfirmationOption(i8) // SetConnectionConfirmationOption(i8)
public ResultCode SetConnectionConfirmationOption(ServiceCtx context) public ResultCode SetConnectionConfirmationOption(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceNifm); Logger.Stub?.PrintStub(LogClass.ServiceNifm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -98,7 +98,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
{ {
uint themeColor = context.RequestData.ReadUInt32(); uint themeColor = context.RequestData.ReadUInt32();
Logger.PrintStub(LogClass.ServiceNifm); Logger.Stub?.PrintStub(LogClass.ServiceNifm);
ResultCode result = GetResultImpl(); ResultCode result = GetResultImpl();

View file

@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface
{ {
MakeObject(context, new IShopServiceAccessor(context.Device.System)); MakeObject(context, new IShopServiceAccessor(context.Device.System));
Logger.PrintStub(LogClass.ServiceNim); Logger.Stub?.PrintStub(LogClass.ServiceNim);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -14,7 +14,7 @@ namespace Ryujinx.HLE.HOS.Services.Nim
{ {
MakeObject(context, new IShopServiceAccessServer()); MakeObject(context, new IShopServiceAccessServer());
Logger.PrintStub(LogClass.ServiceNim); Logger.Stub?.PrintStub(LogClass.ServiceNim);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface.ShopServ
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceNim); Logger.Stub?.PrintStub(LogClass.ServiceNim);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -28,14 +28,14 @@ namespace Ryujinx.HLE.HOS.Services.Ns
byte runtimeAddOnContentInstall = context.Device.Application.ControlData.Value.RuntimeAddOnContentInstall; byte runtimeAddOnContentInstall = context.Device.Application.ControlData.Value.RuntimeAddOnContentInstall;
if (runtimeAddOnContentInstall != 0) if (runtimeAddOnContentInstall != 0)
{ {
Logger.PrintWarning(LogClass.ServiceNs, $"RuntimeAddOnContentInstall is true. Some DLC may be missing"); Logger.Warning?.Print(LogClass.ServiceNs, $"RuntimeAddOnContentInstall is true. Some DLC may be missing");
} }
uint aocCount = CountAddOnContentImpl(context); uint aocCount = CountAddOnContentImpl(context);
context.ResponseData.Write(aocCount); context.ResponseData.Write(aocCount);
Logger.PrintStub(LogClass.ServiceNs, new { aocCount, runtimeAddOnContentInstall }); Logger.Stub?.PrintStub(LogClass.ServiceNs, new { aocCount, runtimeAddOnContentInstall });
return ResultCode.Success; return ResultCode.Success;
} }
@ -77,7 +77,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
context.Memory.Write(bufAddr + (ulong)i * 4, (int)(aocTitleIds[i + (int)startIndex] - aocBaseId)); context.Memory.Write(bufAddr + (ulong)i * 4, (int)(aocTitleIds[i + (int)startIndex] - aocBaseId));
} }
Logger.PrintStub(LogClass.ServiceNs, new { bufferSize, startIndex, aocCount }); Logger.Stub?.PrintStub(LogClass.ServiceNs, new { bufferSize, startIndex, aocCount });
return ResultCode.Success; return ResultCode.Success;
} }
@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
context.ResponseData.Write(aocBaseId); context.ResponseData.Write(aocBaseId);
Logger.PrintStub(LogClass.ServiceNs, $"aocBaseId={aocBaseId:X16}"); Logger.Stub?.PrintStub(LogClass.ServiceNs, $"aocBaseId={aocBaseId:X16}");
// ResultCode will be error code of GetApplicationLaunchProperty if it fails // ResultCode will be error code of GetApplicationLaunchProperty if it fails
return ResultCode.Success; return ResultCode.Success;
@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
// Ideally, this should probably initialize the AocData values for the specified index // Ideally, this should probably initialize the AocData values for the specified index
Logger.PrintStub(LogClass.ServiceNs, new { aocIndex }); Logger.Stub?.PrintStub(LogClass.ServiceNs, new { aocIndex });
return ResultCode.Success; return ResultCode.Success;
} }
@ -142,7 +142,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceNs); Logger.Stub?.PrintStub(LogClass.ServiceNs);
return ResultCode.Success; return ResultCode.Success;
} }
@ -156,7 +156,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
// which gives 0x874 (2000+164). 164 being Module ID of `EC (Shop)` // which gives 0x874 (2000+164). 164 being Module ID of `EC (Shop)`
context.ResponseData.Write(2164L); context.ResponseData.Write(2164L);
Logger.PrintStub(LogClass.ServiceNs); Logger.Stub?.PrintStub(LogClass.ServiceNs);
return ResultCode.Success; return ResultCode.Success;
} }
@ -167,7 +167,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
{ {
MakeObject(context, new IPurchaseEventManager(context.Device.System)); MakeObject(context, new IPurchaseEventManager(context.Device.System));
Logger.PrintStub(LogClass.ServiceNs); Logger.Stub?.PrintStub(LogClass.ServiceNs);
return ResultCode.Success; return ResultCode.Success;
} }
@ -180,7 +180,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
MakeObject(context, new IPurchaseEventManager(context.Device.System)); MakeObject(context, new IPurchaseEventManager(context.Device.System));
Logger.PrintStub(LogClass.ServiceNs); Logger.Stub?.PrintStub(LogClass.ServiceNs);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
// Then it seems to use the buffer content and compare it with a stored linked instrusive list. // Then it seems to use the buffer content and compare it with a stored linked instrusive list.
// Since we don't support purchase from eShop, we can stub it. // Since we don't support purchase from eShop, we can stub it.
Logger.PrintStub(LogClass.ServiceNs); Logger.Stub?.PrintStub(LogClass.ServiceNs);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -66,7 +66,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
} }
else else
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Cannot find file device \"{path}\"!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Cannot find file device \"{path}\"!");
} }
} }
@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
{ {
arguments = null; arguments = null;
Logger.PrintWarning(LogClass.ServiceNv, "Ioctl size inconsistency found!"); Logger.Warning?.Print(LogClass.ServiceNv, "Ioctl size inconsistency found!");
return NvResult.InvalidSize; return NvResult.InvalidSize;
} }
@ -99,7 +99,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
{ {
arguments = null; arguments = null;
Logger.PrintWarning(LogClass.ServiceNv, "Ioctl size inconsistency found!"); Logger.Warning?.Print(LogClass.ServiceNv, "Ioctl size inconsistency found!");
return NvResult.InvalidSize; return NvResult.InvalidSize;
} }
@ -145,7 +145,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
if (deviceFile == null) if (deviceFile == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid file descriptor {fd}"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid file descriptor {fd}");
return NvResult.NotImplemented; return NvResult.NotImplemented;
} }
@ -162,7 +162,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
{ {
if (_owner == null) if (_owner == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, "INvDrvServices is not initialized!"); Logger.Warning?.Print(LogClass.ServiceNv, "INvDrvServices is not initialized!");
return NvResult.NotInitialized; return NvResult.NotInitialized;
} }
@ -411,7 +411,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
context.ResponseData.WriteStruct(nvStatus); context.ResponseData.WriteStruct(nvStatus);
context.ResponseData.Write((uint)NvResult.Success); context.ResponseData.Write((uint)NvResult.Success);
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
} }
else else
{ {
@ -443,7 +443,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
// DumpGraphicsMemoryInfo() // DumpGraphicsMemoryInfo()
public ResultCode DumpGraphicsMemoryInfo(ServiceCtx context) public ResultCode DumpGraphicsMemoryInfo(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return ResultCode.Success; return ResultCode.Success;
} }
@ -558,7 +558,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
// FinishInitialize(unknown<8>) // FinishInitialize(unknown<8>)
public ResultCode FinishInitialize(ServiceCtx context) public ResultCode FinishInitialize(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -56,7 +56,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices
private static NvInternalResult PrintResult(MethodInfo info, NvInternalResult result) private static NvInternalResult PrintResult(MethodInfo info, NvInternalResult result)
{ {
Logger.PrintDebug(LogClass.ServiceNv, $"{info.Name} returned result {result}"); Logger.Debug?.Print(LogClass.ServiceNv, $"{info.Name} returned result {result}");
return result; return result;
} }

View file

@ -72,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
private NvInternalResult BindChannel(ref BindChannelArguments arguments) private NvInternalResult BindChannel(ref BindChannelArguments arguments)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
{ {
arguments.Offset = 0; arguments.Offset = 0;
Logger.PrintWarning(LogClass.ServiceNv, $"Failed to allocate size {size:x16}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Failed to allocate size {size:x16}!");
result = NvInternalResult.OutOfMemory; result = NvInternalResult.OutOfMemory;
} }
@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
} }
else else
{ {
Logger.PrintWarning(LogClass.ServiceNv, Logger.Warning?.Print(LogClass.ServiceNv,
$"Failed to free offset 0x{arguments.Offset:x16} size 0x{size:x16}!"); $"Failed to free offset 0x{arguments.Offset:x16} size 0x{size:x16}!");
result = NvInternalResult.InvalidInput; result = NvInternalResult.InvalidInput;
@ -156,7 +156,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
} }
else else
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid buffer offset {arguments.Offset:x16}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid buffer offset {arguments.Offset:x16}!");
} }
} }
@ -173,7 +173,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap handle 0x{arguments.NvMapHandle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid NvMap handle 0x{arguments.NvMapHandle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
{ {
string message = string.Format(mapErrorMsg, virtualAddress, arguments.MappingSize, pageSize); string message = string.Format(mapErrorMsg, virtualAddress, arguments.MappingSize, pageSize);
Logger.PrintWarning(LogClass.ServiceNv, message); Logger.Warning?.Print(LogClass.ServiceNv, message);
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -210,7 +210,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
} }
else else
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Address 0x{arguments.Offset:x16} not mapped!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Address 0x{arguments.Offset:x16} not mapped!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -244,7 +244,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
{ {
string message = string.Format(mapErrorMsg, arguments.Offset, size, pageSize); string message = string.Format(mapErrorMsg, arguments.Offset, size, pageSize);
Logger.PrintWarning(LogClass.ServiceNv, message); Logger.Warning?.Print(LogClass.ServiceNv, message);
result = NvInternalResult.InvalidInput; result = NvInternalResult.InvalidInput;
} }
@ -258,7 +258,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
{ {
arguments.Offset = 0; arguments.Offset = 0;
Logger.PrintWarning(LogClass.ServiceNv, $"Failed to map size 0x{size:x16}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Failed to map size 0x{size:x16}!");
result = NvInternalResult.InvalidInput; result = NvInternalResult.InvalidInput;
} }
@ -273,14 +273,14 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
private NvInternalResult GetVaRegions(ref GetVaRegionsArguments arguments) private NvInternalResult GetVaRegions(ref GetVaRegionsArguments arguments)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
private NvInternalResult InitializeEx(ref InitializeExArguments arguments) private NvInternalResult InitializeEx(ref InitializeExArguments arguments)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -295,7 +295,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap handle 0x{arguments[index].NvMapHandle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid NvMap handle 0x{arguments[index].NvMapHandle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -307,7 +307,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
if (result < 0) if (result < 0)
{ {
Logger.PrintWarning(LogClass.ServiceNv, Logger.Warning?.Print(LogClass.ServiceNv,
$"Page 0x{arguments[index].GpuOffset:x16} size 0x{arguments[index].Pages:x16} not allocated!"); $"Page 0x{arguments[index].GpuOffset:x16} size 0x{arguments[index].Pages:x16} not allocated!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;

View file

@ -208,7 +208,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{ {
arguments.Value = 0; arguments.Value = 0;
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -217,7 +217,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{ {
_submitTimeout = submitTimeout; _submitTimeout = submitTimeout;
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -235,7 +235,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{commandBufferEntry.MapHandle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{commandBufferEntry.MapHandle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -267,7 +267,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{commandBufferEntry.MapHandle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{commandBufferEntry.MapHandle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -292,7 +292,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
private NvInternalResult SetNvMapFd(ref int nvMapFd) private NvInternalResult SetNvMapFd(ref int nvMapFd)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -301,7 +301,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{ {
_timeout = timeout; _timeout = timeout;
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -317,21 +317,21 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
private NvInternalResult AllocObjCtx(ref AllocObjCtxArguments arguments) private NvInternalResult AllocObjCtx(ref AllocObjCtxArguments arguments)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
private NvInternalResult ZcullBind(ref ZcullBindArguments arguments) private NvInternalResult ZcullBind(ref ZcullBindArguments arguments)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
private NvInternalResult SetErrorNotifier(ref SetErrorNotifierArguments arguments) private NvInternalResult SetErrorNotifier(ref SetErrorNotifierArguments arguments)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -353,7 +353,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
// TODO: disable and preempt channel when GPU scheduler will be implemented. // TODO: disable and preempt channel when GPU scheduler will be implemented.
@ -366,7 +366,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
arguments.Fence = _channelSyncpoint; arguments.Fence = _channelSyncpoint;
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -377,7 +377,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
arguments.Fence = _channelSyncpoint; arguments.Fence = _channelSyncpoint;
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -391,7 +391,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
_timeslice = timeslice; // in micro-seconds _timeslice = timeslice; // in micro-seconds
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
// TODO: disable and preempt channel when GPU scheduler will be implemented. // TODO: disable and preempt channel when GPU scheduler will be implemented.
@ -400,7 +400,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
private NvInternalResult SetUserData(ref ulong userData) private NvInternalResult SetUserData(ref ulong userData)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }

View file

@ -185,7 +185,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{ {
if (stringValue.Length > 0x100) if (stringValue.Length > 0x100)
{ {
Logger.PrintError(LogClass.ServiceNv, $"{arguments.Domain}!{arguments.Parameter} String value size is too big!"); Logger.Error?.Print(LogClass.ServiceNv, $"{arguments.Domain}!{arguments.Parameter} String value size is too big!");
} }
else else
{ {
@ -205,7 +205,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
throw new NotImplementedException(nvSetting.GetType().Name); throw new NotImplementedException(nvSetting.GetType().Name);
} }
Logger.PrintDebug(LogClass.ServiceNv, $"Got setting {arguments.Domain}!{arguments.Parameter}"); Logger.Debug?.Print(LogClass.ServiceNv, $"Got setting {arguments.Domain}!{arguments.Parameter}");
arguments.Configuration = settingBuffer; arguments.Configuration = settingBuffer;
@ -451,11 +451,11 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
} }
else else
{ {
Logger.PrintError(LogClass.ServiceNv, $"Invalid Event at index {eventIndex} (isWaitEventAsyncCmd: {isWaitEventAsyncCmd}, isWaitEventCmd: {isWaitEventCmd})"); Logger.Error?.Print(LogClass.ServiceNv, $"Invalid Event at index {eventIndex} (isWaitEventAsyncCmd: {isWaitEventAsyncCmd}, isWaitEventCmd: {isWaitEventCmd})");
if (hostEvent != null) if (hostEvent != null)
{ {
Logger.PrintError(LogClass.ServiceNv, hostEvent.DumpState(_device.Gpu)); Logger.Error?.Print(LogClass.ServiceNv, hostEvent.DumpState(_device.Gpu));
} }
result = NvInternalResult.InvalidInput; result = NvInternalResult.InvalidInput;
@ -464,7 +464,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
} }
else else
{ {
Logger.PrintError(LogClass.ServiceNv, $"Invalid Event at index {eventIndex} (isWaitEventAsyncCmd: {isWaitEventAsyncCmd}, isWaitEventCmd: {isWaitEventCmd})"); Logger.Error?.Print(LogClass.ServiceNv, $"Invalid Event at index {eventIndex} (isWaitEventAsyncCmd: {isWaitEventAsyncCmd}, isWaitEventCmd: {isWaitEventCmd})");
result = NvInternalResult.InvalidInput; result = NvInternalResult.InvalidInput;
} }
@ -522,7 +522,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
public override void Close() public override void Close()
{ {
Logger.PrintWarning(LogClass.ServiceNv, "Closing channel"); Logger.Warning?.Print(LogClass.ServiceNv, "Closing channel");
lock (_events) lock (_events)
{ {

View file

@ -119,7 +119,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
// This allows to keep GPU and CPU in sync when we are slow. // This allows to keep GPU and CPU in sync when we are slow.
if (_failingCount == FailingCountMax) if (_failingCount == FailingCountMax)
{ {
Logger.PrintWarning(LogClass.ServiceNv, "GPU processing thread is too slow, waiting on CPU..."); Logger.Warning?.Print(LogClass.ServiceNv, "GPU processing thread is too slow, waiting on CPU...");
bool timedOut = Fence.Wait(gpuContext, Timeout.InfiniteTimeSpan); bool timedOut = Fence.Wait(gpuContext, Timeout.InfiniteTimeSpan);

View file

@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
} }
} }
Logger.PrintError(LogClass.ServiceNv, "Cannot allocate a new syncpoint!"); Logger.Error?.Print(LogClass.ServiceNv, "Cannot allocate a new syncpoint!");
return 0; return 0;
} }

View file

@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrlGpu
private NvInternalResult ZbcSetTable(ref ZbcSetTableArguments arguments) private NvInternalResult ZbcSetTable(ref ZbcSetTableArguments arguments)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -213,7 +213,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrlGpu
private NvInternalResult GetActiveSlotMask(ref GetActiveSlotMaskArguments arguments) private NvInternalResult GetActiveSlotMask(ref GetActiveSlotMaskArguments arguments)
{ {
Logger.PrintStub(LogClass.ServiceNv); Logger.Stub?.PrintStub(LogClass.ServiceNv);
arguments.Slot = 0x07; arguments.Slot = 0x07;
arguments.Mask = 0x01; arguments.Mask = 0x01;

View file

@ -68,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{ {
if (arguments.Size == 0) if (arguments.Size == 0)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid size 0x{arguments.Size:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid size 0x{arguments.Size:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -77,7 +77,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
arguments.Handle = CreateHandleFromMap(new NvMapHandle(size)); arguments.Handle = CreateHandleFromMap(new NvMapHandle(size));
Logger.PrintInfo(LogClass.ServiceNv, $"Created map {arguments.Handle} with size 0x{size:x8}!"); Logger.Info?.Print(LogClass.ServiceNv, $"Created map {arguments.Handle} with size 0x{size:x8}!");
return NvInternalResult.Success; return NvInternalResult.Success;
} }
@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -106,14 +106,14 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
if ((arguments.Align & (arguments.Align - 1)) != 0) if ((arguments.Align & (arguments.Align - 1)) != 0)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid alignment 0x{arguments.Align:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid alignment 0x{arguments.Align:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -160,7 +160,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -187,7 +187,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -214,7 +214,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
if (map == null) if (map == null)
{ {
Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!");
return NvInternalResult.InvalidInput; return NvInternalResult.InvalidInput;
} }
@ -272,7 +272,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{ {
DeleteMapWithHandle(process, handle); DeleteMapWithHandle(process, handle);
Logger.PrintInfo(LogClass.ServiceNv, $"Deleted map {handle}!"); Logger.Info?.Print(LogClass.ServiceNv, $"Deleted map {handle}!");
return true; return true;
} }

View file

@ -56,7 +56,7 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory
{ {
// TODO: Service store TitleId and FreeCommunicationEnabled in another static object. // TODO: Service store TitleId and FreeCommunicationEnabled in another static object.
// When it's done it signal an event in this static object. // When it's done it signal an event in this static object.
Logger.PrintStub(LogClass.ServicePctl); Logger.Stub?.PrintStub(LogClass.ServicePctl);
} }
} }
@ -70,7 +70,7 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory
// CheckFreeCommunicationPermission() // CheckFreeCommunicationPermission()
public ResultCode CheckFreeCommunicationPermission(ServiceCtx context) public ResultCode CheckFreeCommunicationPermission(ServiceCtx context)
{ {
Logger.PrintStub(LogClass.ServicePctl); Logger.Stub?.PrintStub(LogClass.ServicePctl);
if (!_freeCommunicationEnabled) if (!_freeCommunicationEnabled)
{ {

View file

@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Prepo
context.Memory.Read((ulong)inputPosition, inputBuffer); context.Memory.Read((ulong)inputPosition, inputBuffer);
Logger.PrintInfo(LogClass.ServicePrepo, ReadReportBuffer(inputBuffer, gameRoom, userId)); Logger.Info?.Print(LogClass.ServicePrepo, ReadReportBuffer(inputBuffer, gameRoom, userId));
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
context.ResponseData.Write(chargePercentage); context.ResponseData.Write(chargePercentage);
Logger.PrintStub(LogClass.ServicePsm, new { chargePercentage }); Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargePercentage });
return ResultCode.Success; return ResultCode.Success;
} }
@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
context.ResponseData.Write((int)chargerType); context.ResponseData.Write((int)chargerType);
Logger.PrintStub(LogClass.ServicePsm, new { chargerType }); Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargerType });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_stateChangeEventHandle); context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_stateChangeEventHandle);
Logger.PrintStub(LogClass.ServicePsm); Logger.Stub?.PrintStub(LogClass.ServicePsm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -47,7 +47,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
_stateChangeEventHandle = -1; _stateChangeEventHandle = -1;
} }
Logger.PrintStub(LogClass.ServicePsm); Logger.Stub?.PrintStub(LogClass.ServicePsm);
return ResultCode.Success; return ResultCode.Success;
} }
@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
{ {
bool chargerTypeChangeEventEnabled = context.RequestData.ReadBoolean(); bool chargerTypeChangeEventEnabled = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServicePsm, new { chargerTypeChangeEventEnabled }); Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargerTypeChangeEventEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
{ {
bool powerSupplyChangeEventEnabled = context.RequestData.ReadBoolean(); bool powerSupplyChangeEventEnabled = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServicePsm, new { powerSupplyChangeEventEnabled }); Logger.Stub?.PrintStub(LogClass.ServicePsm, new { powerSupplyChangeEventEnabled });
return ResultCode.Success; return ResultCode.Success;
} }
@ -80,7 +80,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
{ {
bool batteryVoltageStateChangeEventEnabled = context.RequestData.ReadBoolean(); bool batteryVoltageStateChangeEventEnabled = context.RequestData.ReadBoolean();
Logger.PrintStub(LogClass.ServicePsm, new { batteryVoltageStateChangeEventEnabled }); Logger.Stub?.PrintStub(LogClass.ServicePsm, new { batteryVoltageStateChangeEventEnabled });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Ts
{ {
Location location = (Location)context.RequestData.ReadByte(); Location location = (Location)context.RequestData.ReadByte();
Logger.PrintStub(LogClass.ServicePtm, new { location }); Logger.Stub?.PrintStub(LogClass.ServicePtm, new { location });
context.ResponseData.Write(DefaultTemperature); context.ResponseData.Write(DefaultTemperature);

View file

@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
{ {
context.ResponseData.Write(false); context.ResponseData.Write(false);
Logger.PrintStub(LogClass.ServiceSet); Logger.Stub?.PrintStub(LogClass.ServiceSet);
return ResultCode.Success; return ResultCode.Success;
} }
@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
{ {
if (context.Request.ReceiveBuff[0].Size != 0x1000) if (context.Request.ReceiveBuff[0].Size != 0x1000)
{ {
Logger.PrintWarning(LogClass.ServiceSet, "Bad size"); Logger.Warning?.Print(LogClass.ServiceSet, "Bad size");
} }
byte[] keyCodeMap; byte[] keyCodeMap;

View file

@ -186,7 +186,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
{ {
if (stringValue.Length + 1 > replySize) if (stringValue.Length + 1 > replySize)
{ {
Logger.PrintError(LogClass.ServiceSet, $"{askedSetting} String value size is too big!"); Logger.Error?.Print(LogClass.ServiceSet, $"{askedSetting} String value size is too big!");
} }
else else
{ {
@ -209,11 +209,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
context.Memory.Write((ulong)replyPos, settingBuffer); context.Memory.Write((ulong)replyPos, settingBuffer);
Logger.PrintDebug(LogClass.ServiceSet, $"{askedSetting} set value: {nxSetting} as {nxSetting.GetType()}"); Logger.Debug?.Print(LogClass.ServiceSet, $"{askedSetting} set value: {nxSetting} as {nxSetting.GetType()}");
} }
else else
{ {
Logger.PrintError(LogClass.ServiceSet, $"{askedSetting} not found!"); Logger.Error?.Print(LogClass.ServiceSet, $"{askedSetting} not found!");
} }
return ResultCode.Success; return ResultCode.Success;

View file

@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm
{ {
if (ServiceConfiguration.IgnoreMissingServices) if (ServiceConfiguration.IgnoreMissingServices)
{ {
Logger.PrintWarning(LogClass.Service, $"Missing service {name} ignored"); Logger.Warning?.Print(LogClass.Service, $"Missing service {name} ignored");
session.ClientSession.Service = new DummyService(name); session.ClientSession.Service = new DummyService(name);
} }
@ -136,7 +136,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm
return ResultCode.InvalidName; return ResultCode.InvalidName;
} }
Logger.PrintInfo(LogClass.ServiceSm, $"Register \"{name}\"."); Logger.Info?.Print(LogClass.ServiceSm, $"Register \"{name}\".");
KPort port = new KPort(context.Device.System.KernelContext, maxSessions, isLight, 0); KPort port = new KPort(context.Device.System.KernelContext, maxSessions, isLight, 0);

View file

@ -245,7 +245,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
// bsd_error // bsd_error
context.ResponseData.Write(0); context.ResponseData.Write(0);
Logger.PrintStub(LogClass.ServiceBsd); Logger.Stub?.PrintStub(LogClass.ServiceBsd);
return ResultCode.Success; return ResultCode.Success;
} }
@ -256,7 +256,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
{ {
ulong unknown0 = context.RequestData.ReadUInt64(); ulong unknown0 = context.RequestData.ReadUInt64();
Logger.PrintStub(LogClass.ServiceBsd, new { unknown0 }); Logger.Stub?.PrintStub(LogClass.ServiceBsd, new { unknown0 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -291,7 +291,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP);
Logger.PrintStub(LogClass.ServiceBsd, new { path, flags }); Logger.Stub?.PrintStub(LogClass.ServiceBsd, new { path, flags });
return ResultCode.Success; return ResultCode.Success;
} }
@ -302,7 +302,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
{ {
WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP);
Logger.PrintStub(LogClass.ServiceBsd); Logger.Stub?.PrintStub(LogClass.ServiceBsd);
return ResultCode.Success; return ResultCode.Success;
} }
@ -380,7 +380,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
if (!isValidEvent) if (!isValidEvent)
{ {
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Poll input event type: {Event.InputEvents}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Poll input event type: {Event.InputEvents}");
return WriteBsdResult(context, -1, LinuxError.EINVAL); return WriteBsdResult(context, -1, LinuxError.EINVAL);
} }
} }
@ -452,7 +452,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
{ {
WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP);
Logger.PrintStub(LogClass.ServiceBsd); Logger.Stub?.PrintStub(LogClass.ServiceBsd);
return ResultCode.Success; return ResultCode.Success;
} }
@ -475,7 +475,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
if (socketFlags != SocketFlags.None && (socketFlags & SocketFlags.OutOfBand) == 0 if (socketFlags != SocketFlags.None && (socketFlags & SocketFlags.OutOfBand) == 0
&& (socketFlags & SocketFlags.Peek) == 0) && (socketFlags & SocketFlags.Peek) == 0)
{ {
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Recv flags: {socketFlags}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Recv flags: {socketFlags}");
return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP);
} }
@ -516,7 +516,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
if (socketFlags != SocketFlags.None && (socketFlags & SocketFlags.OutOfBand) == 0 if (socketFlags != SocketFlags.None && (socketFlags & SocketFlags.OutOfBand) == 0
&& (socketFlags & SocketFlags.Peek) == 0) && (socketFlags & SocketFlags.Peek) == 0)
{ {
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Recv flags: {socketFlags}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Recv flags: {socketFlags}");
return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP);
} }
@ -559,7 +559,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
if (socketFlags != SocketFlags.None && socketFlags != SocketFlags.OutOfBand if (socketFlags != SocketFlags.None && socketFlags != SocketFlags.OutOfBand
&& socketFlags != SocketFlags.Peek && socketFlags != SocketFlags.DontRoute) && socketFlags != SocketFlags.Peek && socketFlags != SocketFlags.DontRoute)
{ {
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Send flags: {socketFlags}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Send flags: {socketFlags}");
return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP);
} }
@ -602,7 +602,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
if (socketFlags != SocketFlags.None && socketFlags != SocketFlags.OutOfBand if (socketFlags != SocketFlags.None && socketFlags != SocketFlags.OutOfBand
&& socketFlags != SocketFlags.Peek && socketFlags != SocketFlags.DontRoute) && socketFlags != SocketFlags.Peek && socketFlags != SocketFlags.DontRoute)
{ {
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Send flags: {socketFlags}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Send flags: {socketFlags}");
return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP);
} }
@ -811,7 +811,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
} }
else else
{ {
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported GetSockOpt Level: {(SocketOptionLevel)level}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported GetSockOpt Level: {(SocketOptionLevel)level}");
} }
} }
@ -872,7 +872,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
default: default:
errno = LinuxError.EOPNOTSUPP; errno = LinuxError.EOPNOTSUPP;
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Ioctl Cmd: {cmd}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Ioctl Cmd: {cmd}");
break; break;
} }
} }
@ -946,7 +946,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
return LinuxError.SUCCESS; return LinuxError.SUCCESS;
default: default:
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {optionName}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {optionName}");
return LinuxError.EOPNOTSUPP; return LinuxError.EOPNOTSUPP;
} }
@ -991,7 +991,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
return LinuxError.SUCCESS; return LinuxError.SUCCESS;
default: default:
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {optionName}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {optionName}");
return LinuxError.EOPNOTSUPP; return LinuxError.EOPNOTSUPP;
} }
@ -1025,7 +1025,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
} }
else else
{ {
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt Level: {(SocketOptionLevel)level}"); Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported SetSockOpt Level: {(SocketOptionLevel)level}");
} }
} }

View file

@ -221,7 +221,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Nsd
// TODO: Call nn::nsd::detail::fs::ReadSaveDataWithOffset() at offset 0 to write the // TODO: Call nn::nsd::detail::fs::ReadSaveDataWithOffset() at offset 0 to write the
// whole savedata inside the buffer. // whole savedata inside the buffer.
Logger.PrintStub(LogClass.ServiceNsd); Logger.Stub?.PrintStub(LogClass.ServiceNsd);
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -147,7 +147,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
long bufferSize = context.Request.SendBuff[0].Size; long bufferSize = context.Request.SendBuff[0].Size;
// TODO: This is stubbed in 2.0.0+, reverse 1.0.0 version for the sake completeness. // TODO: This is stubbed in 2.0.0+, reverse 1.0.0 version for the sake completeness.
Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 });
return ResultCode.NotAllocated; return ResultCode.NotAllocated;
} }
@ -159,7 +159,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
uint unknown0 = context.RequestData.ReadUInt32(); uint unknown0 = context.RequestData.ReadUInt32();
// TODO: This is stubbed in 2.0.0+, reverse 1.0.0 version for the sake completeness. // TODO: This is stubbed in 2.0.0+, reverse 1.0.0 version for the sake completeness.
Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 });
return ResultCode.NotAllocated; return ResultCode.NotAllocated;
} }
@ -361,7 +361,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
context.ResponseData.Write(0); context.ResponseData.Write(0);
Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -373,7 +373,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
uint unknown0 = context.RequestData.ReadUInt32(); uint unknown0 = context.RequestData.ReadUInt32();
ulong unknown1 = context.RequestData.ReadUInt64(); ulong unknown1 = context.RequestData.ReadUInt64();
Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0, unknown1 }); Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0, unknown1 });
return ResultCode.Success; return ResultCode.Success;
} }
@ -384,7 +384,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
{ {
uint unknown0 = context.RequestData.ReadUInt32(); uint unknown0 = context.RequestData.ReadUInt32();
Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
int sslVersion = context.RequestData.ReadInt32(); int sslVersion = context.RequestData.ReadInt32();
long unknown = context.RequestData.ReadInt64(); long unknown = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceSsl, new { sslVersion, unknown }); Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { sslVersion, unknown });
MakeObject(context, new ISslContext(context)); MakeObject(context, new ISslContext(context));
@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
{ {
int version = context.RequestData.ReadInt32(); int version = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceSsl, new { version }); Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { version });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
context.ResponseData.Write(certificateId); context.ResponseData.Write(certificateId);
Logger.PrintStub(LogClass.ServiceSsl, new { certificateFormat, certificateDataPosition, certificateDataSize }); Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { certificateFormat, certificateDataPosition, certificateDataSize });
return ResultCode.Success; return ResultCode.Success;
} }

View file

@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
{ {
bufferItem = null; bufferItem = null;
Logger.PrintDebug(LogClass.SurfaceFlinger, $"Max acquired buffer count reached: {numAcquiredBuffers} (max: {Core.MaxAcquiredBufferCount})"); Logger.Debug?.Print(LogClass.SurfaceFlinger, $"Max acquired buffer count reached: {numAcquiredBuffers} (max: {Core.MaxAcquiredBufferCount})");
return Status.InvalidOperation; return Status.InvalidOperation;
} }
@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
if (!Core.Slots[slot].RequestBufferCalled) if (!Core.Slots[slot].RequestBufferCalled)
{ {
Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} was detached without requesting a buffer"); Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} was detached without requesting a buffer");
return Status.BadValue; return Status.BadValue;
} }
@ -141,7 +141,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
{ {
slot = BufferSlotArray.InvalidBufferSlot; slot = BufferSlotArray.InvalidBufferSlot;
Logger.PrintError(LogClass.SurfaceFlinger, $"Max acquired buffer count reached: {numAcquiredBuffers} (max: {Core.MaxAcquiredBufferCount})"); Logger.Error?.Print(LogClass.SurfaceFlinger, $"Max acquired buffer count reached: {numAcquiredBuffers} (max: {Core.MaxAcquiredBufferCount})");
return Status.InvalidOperation; return Status.InvalidOperation;
} }

View file

@ -290,7 +290,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
{ {
if (Slots[slot].BufferState != BufferState.Acquired) if (Slots[slot].BufferState != BufferState.Acquired)
{ {
Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} is not owned by the consumer (state = {Slots[slot].BufferState})"); Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} is not owned by the consumer (state = {Slots[slot].BufferState})");
return false; return false;
} }
@ -302,7 +302,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
{ {
if (Slots[slot].BufferState != BufferState.Dequeued) if (Slots[slot].BufferState != BufferState.Dequeued)
{ {
Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} is not owned by the producer (state = {Slots[slot].BufferState})"); Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} is not owned by the producer (state = {Slots[slot].BufferState})");
return false; return false;
} }

View file

@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
} }
else if (preallocatedBufferCount < bufferCount) else if (preallocatedBufferCount < bufferCount)
{ {
Logger.PrintError(LogClass.SurfaceFlinger, "Not enough buffers. Try with more pre-allocated buffers"); Logger.Error?.Print(LogClass.SurfaceFlinger, "Not enough buffers. Try with more pre-allocated buffers");
return Status.Success; return Status.Success;
} }
@ -163,7 +163,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
{ {
fence = AndroidFence.NoFence; fence = AndroidFence.NoFence;
Logger.PrintError(LogClass.SurfaceFlinger, "No available buffer slots"); Logger.Error?.Print(LogClass.SurfaceFlinger, "No available buffer slots");
return Status.Busy; return Status.Busy;
} }
@ -193,11 +193,10 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
} }
else else
{ {
string formattedError = $"Preallocated buffer mismatch - slot {slot}\n" + Logger.Error?.Print(LogClass.SurfaceFlinger,
$"available: Width = {graphicBuffer.Width} Height = {graphicBuffer.Height} Format = {graphicBuffer.Format} Usage = {graphicBuffer.Usage:x} " + $"Preallocated buffer mismatch - slot {slot}\n" +
$"requested: Width = {width} Height = {height} Format = {format} Usage = {usage:x}"; $"available: Width = {graphicBuffer.Width} Height = {graphicBuffer.Height} Format = {graphicBuffer.Format} Usage = {graphicBuffer.Usage:x} " +
$"requested: Width = {width} Height = {height} Format = {format} Usage = {usage:x}");
Logger.PrintError(LogClass.SurfaceFlinger, formattedError);
slot = BufferSlotArray.InvalidBufferSlot; slot = BufferSlotArray.InvalidBufferSlot;
fence = AndroidFence.NoFence; fence = AndroidFence.NoFence;
@ -243,7 +242,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
if (!Core.Slots[slot].RequestBufferCalled) if (!Core.Slots[slot].RequestBufferCalled)
{ {
Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} was detached without requesting a buffer"); Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} was detached without requesting a buffer");
return Status.BadValue; return Status.BadValue;
} }
@ -314,7 +313,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
if (slot == BufferSlotArray.InvalidBufferSlot) if (slot == BufferSlotArray.InvalidBufferSlot)
{ {
Logger.PrintError(LogClass.SurfaceFlinger, "No available buffer slots"); Logger.Error?.Print(LogClass.SurfaceFlinger, "No available buffer slots");
return Status.Busy; return Status.Busy;
} }
@ -373,7 +372,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
if (!Core.Slots[slot].RequestBufferCalled) if (!Core.Slots[slot].RequestBufferCalled)
{ {
Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} was queued without requesting a buffer"); Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} was queued without requesting a buffer");
return Status.BadValue; return Status.BadValue;
} }
@ -797,7 +796,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
if (newUndequeuedCount < minUndequeuedCount) if (newUndequeuedCount < minUndequeuedCount)
{ {
Logger.PrintError(LogClass.SurfaceFlinger, $"Min undequeued buffer count ({minUndequeuedCount}) exceeded (dequeued = {dequeuedCount} undequeued = {newUndequeuedCount})"); Logger.Error?.Print(LogClass.SurfaceFlinger, $"Min undequeued buffer count ({minUndequeuedCount}) exceeded (dequeued = {dequeuedCount} undequeued = {newUndequeuedCount})");
return Status.InvalidOperation; return Status.InvalidOperation;
} }

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