Rename Ns to Device, rename Os to System, rename SystemState to State
This commit is contained in:
parent
924cd56948
commit
ae25ccc4f6
56 changed files with 386 additions and 384 deletions
|
@ -15,13 +15,13 @@ namespace Ryujinx.HLE.OsHle
|
||||||
internal const int HidSize = 0x40000;
|
internal const int HidSize = 0x40000;
|
||||||
internal const int FontSize = 0x1100000;
|
internal const int FontSize = 0x1100000;
|
||||||
|
|
||||||
private Switch Ns;
|
private Switch Device;
|
||||||
|
|
||||||
private KProcessScheduler Scheduler;
|
private KProcessScheduler Scheduler;
|
||||||
|
|
||||||
private ConcurrentDictionary<int, Process> Processes;
|
private ConcurrentDictionary<int, Process> Processes;
|
||||||
|
|
||||||
public SystemStateMgr SystemState { get; private set; }
|
public SystemStateMgr State { get; private set; }
|
||||||
|
|
||||||
internal KSharedMemory HidSharedMem { get; private set; }
|
internal KSharedMemory HidSharedMem { get; private set; }
|
||||||
internal KSharedMemory FontSharedMem { get; private set; }
|
internal KSharedMemory FontSharedMem { get; private set; }
|
||||||
|
@ -30,18 +30,18 @@ namespace Ryujinx.HLE.OsHle
|
||||||
|
|
||||||
internal KEvent VsyncEvent { get; private set; }
|
internal KEvent VsyncEvent { get; private set; }
|
||||||
|
|
||||||
public Horizon(Switch Ns)
|
public Horizon(Switch Device)
|
||||||
{
|
{
|
||||||
this.Ns = Ns;
|
this.Device = Device;
|
||||||
|
|
||||||
Scheduler = new KProcessScheduler(Ns.Log);
|
Scheduler = new KProcessScheduler(Device.Log);
|
||||||
|
|
||||||
Processes = new ConcurrentDictionary<int, Process>();
|
Processes = new ConcurrentDictionary<int, Process>();
|
||||||
|
|
||||||
SystemState = new SystemStateMgr();
|
State = new SystemStateMgr();
|
||||||
|
|
||||||
if (!Ns.Memory.Allocator.TryAllocate(HidSize, out long HidPA) ||
|
if (!Device.Memory.Allocator.TryAllocate(HidSize, out long HidPA) ||
|
||||||
!Ns.Memory.Allocator.TryAllocate(FontSize, out long FontPA))
|
!Device.Memory.Allocator.TryAllocate(FontSize, out long FontPA))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException();
|
throw new InvalidOperationException();
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
HidSharedMem = new KSharedMemory(HidPA, HidSize);
|
HidSharedMem = new KSharedMemory(HidPA, HidSize);
|
||||||
FontSharedMem = new KSharedMemory(FontPA, FontSize);
|
FontSharedMem = new KSharedMemory(FontPA, FontSize);
|
||||||
|
|
||||||
Font = new SharedFontManager(Ns, FontSharedMem.PA);
|
Font = new SharedFontManager(Device, FontSharedMem.PA);
|
||||||
|
|
||||||
VsyncEvent = new KEvent();
|
VsyncEvent = new KEvent();
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
{
|
{
|
||||||
if (RomFsFile != null)
|
if (RomFsFile != null)
|
||||||
{
|
{
|
||||||
Ns.VFs.LoadRomFs(RomFsFile);
|
Device.VFs.LoadRomFs(RomFsFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
string NpdmFileName = Path.Combine(ExeFsDir, "main.npdm");
|
string NpdmFileName = Path.Combine(ExeFsDir, "main.npdm");
|
||||||
|
@ -67,7 +67,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
|
|
||||||
if (File.Exists(NpdmFileName))
|
if (File.Exists(NpdmFileName))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintInfo(LogClass.Loader, $"Loading main.npdm...");
|
Device.Log.PrintInfo(LogClass.Loader, $"Loading main.npdm...");
|
||||||
|
|
||||||
using (FileStream Input = new FileStream(NpdmFileName, FileMode.Open))
|
using (FileStream Input = new FileStream(NpdmFileName, FileMode.Open))
|
||||||
{
|
{
|
||||||
|
@ -76,7 +76,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.Loader, $"NPDM file not found, using default values!");
|
Device.Log.PrintWarning(LogClass.Loader, $"NPDM file not found, using default values!");
|
||||||
}
|
}
|
||||||
|
|
||||||
Process MainProcess = MakeProcess(MetaData);
|
Process MainProcess = MakeProcess(MetaData);
|
||||||
|
@ -90,7 +90,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Log.PrintInfo(LogClass.Loader, $"Loading {Path.GetFileNameWithoutExtension(File)}...");
|
Device.Log.PrintInfo(LogClass.Loader, $"Loading {Path.GetFileNameWithoutExtension(File)}...");
|
||||||
|
|
||||||
using (FileStream Input = new FileStream(File, FileMode.Open))
|
using (FileStream Input = new FileStream(File, FileMode.Open))
|
||||||
{
|
{
|
||||||
|
@ -124,18 +124,20 @@ namespace Ryujinx.HLE.OsHle
|
||||||
bool IsNro = Path.GetExtension(FilePath).ToLower() == ".nro";
|
bool IsNro = Path.GetExtension(FilePath).ToLower() == ".nro";
|
||||||
|
|
||||||
string Name = Path.GetFileNameWithoutExtension(FilePath);
|
string Name = Path.GetFileNameWithoutExtension(FilePath);
|
||||||
string SwitchFilePath = Ns.VFs.SystemPathToSwitchPath(FilePath);
|
string SwitchFilePath = Device.VFs.SystemPathToSwitchPath(FilePath);
|
||||||
|
|
||||||
if (IsNro && (SwitchFilePath == null || !SwitchFilePath.StartsWith("sdmc:/")))
|
if (IsNro && (SwitchFilePath == null || !SwitchFilePath.StartsWith("sdmc:/")))
|
||||||
{
|
{
|
||||||
string SwitchPath = $"sdmc:/switch/{Name}{Homebrew.TemporaryNroSuffix}";
|
string SwitchPath = $"sdmc:/switch/{Name}{Homebrew.TemporaryNroSuffix}";
|
||||||
string TempPath = Ns.VFs.SwitchPathToSystemPath(SwitchPath);
|
string TempPath = Device.VFs.SwitchPathToSystemPath(SwitchPath);
|
||||||
|
|
||||||
string SwitchDir = Path.GetDirectoryName(TempPath);
|
string SwitchDir = Path.GetDirectoryName(TempPath);
|
||||||
|
|
||||||
if (!Directory.Exists(SwitchDir))
|
if (!Directory.Exists(SwitchDir))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(SwitchDir);
|
Directory.CreateDirectory(SwitchDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
File.Copy(FilePath, TempPath, true);
|
File.Copy(FilePath, TempPath, true);
|
||||||
|
|
||||||
FilePath = TempPath;
|
FilePath = TempPath;
|
||||||
|
@ -169,7 +171,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
ProcessId++;
|
ProcessId++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Process = new Process(Ns, Scheduler, ProcessId, MetaData);
|
Process = new Process(Device, Scheduler, ProcessId, MetaData);
|
||||||
|
|
||||||
Processes.TryAdd(ProcessId, Process);
|
Processes.TryAdd(ProcessId, Process);
|
||||||
}
|
}
|
||||||
|
@ -193,7 +195,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
|
|
||||||
if (Processes.Count == 0)
|
if (Processes.Count == 0)
|
||||||
{
|
{
|
||||||
Ns.OnFinish(EventArgs.Empty);
|
Device.OnFinish(EventArgs.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
public KMemoryManager(Process Process)
|
public KMemoryManager(Process Process)
|
||||||
{
|
{
|
||||||
CpuMemory = Process.Memory;
|
CpuMemory = Process.Memory;
|
||||||
Allocator = Process.Ns.Memory.Allocator;
|
Allocator = Process.Device.Memory.Allocator;
|
||||||
|
|
||||||
long CodeRegionSize;
|
long CodeRegionSize;
|
||||||
long MapRegionSize;
|
long MapRegionSize;
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
private Dictionary<int, SvcFunc> SvcFuncs;
|
private Dictionary<int, SvcFunc> SvcFuncs;
|
||||||
|
|
||||||
private Switch Ns;
|
private Switch Device;
|
||||||
private Process Process;
|
private Process Process;
|
||||||
private AMemory Memory;
|
private AMemory Memory;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
private static Random Rng;
|
private static Random Rng;
|
||||||
|
|
||||||
public SvcHandler(Switch Ns, Process Process)
|
public SvcHandler(Switch Device, Process Process)
|
||||||
{
|
{
|
||||||
SvcFuncs = new Dictionary<int, SvcFunc>()
|
SvcFuncs = new Dictionary<int, SvcFunc>()
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
{ 0x34, SvcWaitForAddress }
|
{ 0x34, SvcWaitForAddress }
|
||||||
};
|
};
|
||||||
|
|
||||||
this.Ns = Ns;
|
this.Device = Device;
|
||||||
this.Process = Process;
|
this.Process = Process;
|
||||||
this.Memory = Process.Memory;
|
this.Memory = Process.Memory;
|
||||||
|
|
||||||
|
@ -92,13 +92,13 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (SvcFuncs.TryGetValue(e.Id, out SvcFunc Func))
|
if (SvcFuncs.TryGetValue(e.Id, out SvcFunc Func))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, $"{Func.Method.Name} called.");
|
Device.Log.PrintDebug(LogClass.KernelSvc, $"{Func.Method.Name} called.");
|
||||||
|
|
||||||
Func(ThreadState);
|
Func(ThreadState);
|
||||||
|
|
||||||
Process.Scheduler.Reschedule(Process.GetThread(ThreadState.Tpidr));
|
Process.Scheduler.Reschedule(Process.GetThread(ThreadState.Tpidr));
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, $"{Func.Method.Name} ended.");
|
Device.Log.PrintDebug(LogClass.KernelSvc, $"{Func.Method.Name} ended.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((Size & 0x1fffff) != 0 || Size != (uint)Size)
|
if ((Size & 0x1fffff) != 0 || Size != (uint)Size)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Heap size 0x{Size:x16} is not aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Heap size 0x{Size:x16} is not aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Position))
|
if (!PageAligned(Position))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Size) || Size == 0)
|
if (!PageAligned(Size) || Size == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
if (Attributes != AttributeMask ||
|
if (Attributes != AttributeMask ||
|
||||||
(Attributes | MemoryAttribute.Uncached) != MemoryAttribute.Uncached)
|
(Attributes | MemoryAttribute.Uncached) != MemoryAttribute.Uncached)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, "Invalid memory attributes!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, "Invalid memory attributes!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMaskValue);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMaskValue);
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Result != 0)
|
if (Result != 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -98,7 +98,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Src | Dst))
|
if (!PageAligned(Src | Dst))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, "Addresses are not page aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, "Addresses are not page aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Size) || Size == 0)
|
if (!PageAligned(Size) || Size == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((ulong)(Src + Size) <= (ulong)Src || (ulong)(Dst + Size) <= (ulong)Dst)
|
if ((ulong)(Src + Size) <= (ulong)Src || (ulong)(Dst + Size) <= (ulong)Dst)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, "Addresses outside of range!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, "Addresses outside of range!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!InsideAddrSpace(Src, Size))
|
if (!InsideAddrSpace(Src, Size))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Src address 0x{Src:x16} out of range!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Src address 0x{Src:x16} out of range!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!InsideNewMapRegion(Dst, Size))
|
if (!InsideNewMapRegion(Dst, Size))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Dst address 0x{Dst:x16} out of range!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Dst address 0x{Dst:x16} out of range!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMemRange);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMemRange);
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Result != 0)
|
if (Result != 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadState.X0 = (ulong)Result;
|
ThreadState.X0 = (ulong)Result;
|
||||||
|
@ -159,7 +159,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Src | Dst))
|
if (!PageAligned(Src | Dst))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, "Addresses are not page aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, "Addresses are not page aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Size) || Size == 0)
|
if (!PageAligned(Size) || Size == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((ulong)(Src + Size) <= (ulong)Src || (ulong)(Dst + Size) <= (ulong)Dst)
|
if ((ulong)(Src + Size) <= (ulong)Src || (ulong)(Dst + Size) <= (ulong)Dst)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, "Addresses outside of range!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, "Addresses outside of range!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!InsideAddrSpace(Src, Size))
|
if (!InsideAddrSpace(Src, Size))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Src address 0x{Src:x16} out of range!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Src address 0x{Src:x16} out of range!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!InsideNewMapRegion(Dst, Size))
|
if (!InsideNewMapRegion(Dst, Size))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Dst address 0x{Dst:x16} out of range!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Dst address 0x{Dst:x16} out of range!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMemRange);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMemRange);
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Result != 0)
|
if (Result != 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadState.X0 = (ulong)Result;
|
ThreadState.X0 = (ulong)Result;
|
||||||
|
@ -240,7 +240,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Position))
|
if (!PageAligned(Position))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Size) || Size == 0)
|
if (!PageAligned(Size) || Size == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((ulong)(Position + Size) <= (ulong)Position)
|
if ((ulong)(Position + Size) <= (ulong)Position)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((Permission | MemoryPermission.Write) != MemoryPermission.ReadAndWrite)
|
if ((Permission | MemoryPermission.Write) != MemoryPermission.ReadAndWrite)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid permission {Permission}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid permission {Permission}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidPermission);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidPermission);
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (SharedMemory == null)
|
if (SharedMemory == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid shared memory handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid shared memory handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!InsideAddrSpace(Position, Size) || InsideMapRegion(Position, Size) || InsideHeapRegion(Position, Size))
|
if (!InsideAddrSpace(Position, Size) || InsideMapRegion(Position, Size) || InsideHeapRegion(Position, Size))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} out of range!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} out of range!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (SharedMemory.Size != Size)
|
if (SharedMemory.Size != Size)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} does not match shared memory size 0x{SharedMemory.Size:16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} does not match shared memory size 0x{SharedMemory.Size:16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Result != 0)
|
if (Result != 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadState.X0 = (ulong)Result;
|
ThreadState.X0 = (ulong)Result;
|
||||||
|
@ -323,7 +323,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Position))
|
if (!PageAligned(Position))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Size) || Size == 0)
|
if (!PageAligned(Size) || Size == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((ulong)(Position + Size) <= (ulong)Position)
|
if ((ulong)(Position + Size) <= (ulong)Position)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (SharedMemory == null)
|
if (SharedMemory == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid shared memory handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid shared memory handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!InsideAddrSpace(Position, Size) || InsideMapRegion(Position, Size) || InsideHeapRegion(Position, Size))
|
if (!InsideAddrSpace(Position, Size) || InsideMapRegion(Position, Size) || InsideHeapRegion(Position, Size))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} out of range!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} out of range!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Result != 0)
|
if (Result != 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadState.X0 = (ulong)Result;
|
ThreadState.X0 = (ulong)Result;
|
||||||
|
@ -385,7 +385,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Position))
|
if (!PageAligned(Position))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Size) || Size == 0)
|
if (!PageAligned(Size) || Size == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -403,7 +403,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((ulong)(Position + Size) <= (ulong)Position)
|
if ((ulong)(Position + Size) <= (ulong)Position)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -414,7 +414,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Permission > MemoryPermission.ReadAndWrite || Permission == MemoryPermission.Write)
|
if (Permission > MemoryPermission.ReadAndWrite || Permission == MemoryPermission.Write)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid permission {Permission}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid permission {Permission}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidPermission);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidPermission);
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Position))
|
if (!PageAligned(Position))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Size) || Size == 0)
|
if (!PageAligned(Size) || Size == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((ulong)(Position + Size) <= (ulong)Position)
|
if ((ulong)(Position + Size) <= (ulong)Position)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!InsideAddrSpace(Position, Size))
|
if (!InsideAddrSpace(Position, Size))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid address {Position:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid address {Position:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -476,7 +476,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Result != 0)
|
if (Result != 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadState.X0 = (ulong)Result;
|
ThreadState.X0 = (ulong)Result;
|
||||||
|
@ -489,7 +489,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Position))
|
if (!PageAligned(Position))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Address 0x{Position:x16} is not page aligned!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!PageAligned(Size) || Size == 0)
|
if (!PageAligned(Size) || Size == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Size 0x{Size:x16} is not page aligned or is zero!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidSize);
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((ulong)(Position + Size) <= (ulong)Position)
|
if ((ulong)(Position + Size) <= (ulong)Position)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid region address 0x{Position:x16} / size 0x{Size:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (!InsideAddrSpace(Position, Size))
|
if (!InsideAddrSpace(Position, Size))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid address {Position:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid address {Position:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -527,7 +527,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Result != 0)
|
if (Result != 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Operation failed with error 0x{Result:x}!");
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadState.X0 = (ulong)Result;
|
ThreadState.X0 = (ulong)Result;
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
private void SvcExitProcess(AThreadState ThreadState)
|
private void SvcExitProcess(AThreadState ThreadState)
|
||||||
{
|
{
|
||||||
Ns.Os.ExitProcess(ThreadState.ProcessId);
|
Device.System.ExitProcess(ThreadState.ProcessId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SvcClearEvent(AThreadState ThreadState)
|
private void SvcClearEvent(AThreadState ThreadState)
|
||||||
|
@ -39,7 +39,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Obj == null)
|
if (Obj == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid event handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid event handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
int HandlesCount = (int)ThreadState.X2;
|
int HandlesCount = (int)ThreadState.X2;
|
||||||
ulong Timeout = ThreadState.X3;
|
ulong Timeout = ThreadState.X3;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc,
|
Device.Log.PrintDebug(LogClass.KernelSvc,
|
||||||
"HandlesPtr = " + HandlesPtr .ToString("x16") + ", " +
|
"HandlesPtr = " + HandlesPtr .ToString("x16") + ", " +
|
||||||
"HandlesCount = " + HandlesCount.ToString("x8") + ", " +
|
"HandlesCount = " + HandlesCount.ToString("x8") + ", " +
|
||||||
"Timeout = " + Timeout .ToString("x16"));
|
"Timeout = " + Timeout .ToString("x16"));
|
||||||
|
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (SyncObj == null)
|
if (SyncObj == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Thread == null)
|
if (Thread == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{ThreadHandle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{ThreadHandle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
IpcMessage Cmd = new IpcMessage(CmdData, CmdPtr);
|
IpcMessage Cmd = new IpcMessage(CmdData, CmdPtr);
|
||||||
|
|
||||||
long Result = IpcHandler.IpcCall(Ns, Process, Memory, Session, Cmd, CmdPtr);
|
long Result = IpcHandler.IpcCall(Device, Process, Memory, Session, Cmd, CmdPtr);
|
||||||
|
|
||||||
Thread.Yield();
|
Thread.Yield();
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid session handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid session handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
string Str = AMemoryHelper.ReadAsciiString(Memory, Position, Size);
|
string Str = AMemoryHelper.ReadAsciiString(Memory, Position, Size);
|
||||||
|
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, Str);
|
Device.Log.PrintWarning(LogClass.KernelSvc, Str);
|
||||||
|
|
||||||
ThreadState.X0 = 0;
|
ThreadState.X0 = 0;
|
||||||
}
|
}
|
||||||
|
@ -320,11 +320,11 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
ThreadState.X1 = (ulong)Process.Ns.Memory.Allocator.TotalAvailableSize;
|
ThreadState.X1 = (ulong)Process.Device.Memory.Allocator.TotalAvailableSize;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
ThreadState.X1 = (ulong)Process.Ns.Memory.Allocator.TotalUsedSize;
|
ThreadState.X1 = (ulong)Process.Device.Memory.Allocator.TotalUsedSize;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if ((uint)Priority > 0x3f)
|
if ((uint)Priority > 0x3f)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid priority 0x{Priority:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid priority 0x{Priority:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidPriority);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidPriority);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else if ((uint)ProcessorId > 3)
|
else if ((uint)ProcessorId > 3)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid core id 0x{ProcessorId:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid core id 0x{ProcessorId:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidCoreId);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidCoreId);
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
{
|
{
|
||||||
ulong TimeoutNs = ThreadState.X0;
|
ulong TimeoutNs = ThreadState.X0;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "Timeout = " + TimeoutNs.ToString("x16"));
|
Device.Log.PrintDebug(LogClass.KernelSvc, "Timeout = " + TimeoutNs.ToString("x16"));
|
||||||
|
|
||||||
KThread CurrThread = Process.GetThread(ThreadState.Tpidr);
|
KThread CurrThread = Process.GetThread(ThreadState.Tpidr);
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
int Handle = (int)ThreadState.X0;
|
int Handle = (int)ThreadState.X0;
|
||||||
int Priority = (int)ThreadState.X1;
|
int Priority = (int)ThreadState.X1;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc,
|
Device.Log.PrintDebug(LogClass.KernelSvc,
|
||||||
"Handle = " + Handle .ToString("x8") + ", " +
|
"Handle = " + Handle .ToString("x8") + ", " +
|
||||||
"Priority = " + Priority.ToString("x8"));
|
"Priority = " + Priority.ToString("x8"));
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
{
|
{
|
||||||
int Handle = (int)ThreadState.X2;
|
int Handle = (int)ThreadState.X2;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "Handle = " + Handle.ToString("x8"));
|
Device.Log.PrintDebug(LogClass.KernelSvc, "Handle = " + Handle.ToString("x8"));
|
||||||
|
|
||||||
KThread Thread = GetThread(ThreadState.Tpidr, Handle);
|
KThread Thread = GetThread(ThreadState.Tpidr, Handle);
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
int IdealCore = (int)ThreadState.X1;
|
int IdealCore = (int)ThreadState.X1;
|
||||||
long CoreMask = (long)ThreadState.X2;
|
long CoreMask = (long)ThreadState.X2;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc,
|
Device.Log.PrintDebug(LogClass.KernelSvc,
|
||||||
"Handle = " + Handle .ToString("x8") + ", " +
|
"Handle = " + Handle .ToString("x8") + ", " +
|
||||||
"IdealCore = " + IdealCore.ToString("x8") + ", " +
|
"IdealCore = " + IdealCore.ToString("x8") + ", " +
|
||||||
"CoreMask = " + CoreMask .ToString("x16"));
|
"CoreMask = " + CoreMask .ToString("x16"));
|
||||||
|
@ -192,7 +192,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
{
|
{
|
||||||
if ((IdealCore | 2) != -1)
|
if ((IdealCore | 2) != -1)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid core id 0x{IdealCore:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid core id 0x{IdealCore:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidCoreId);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidCoreId);
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else if ((CoreMask & (1 << IdealCore)) == 0)
|
else if ((CoreMask & (1 << IdealCore)) == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid core mask 0x{CoreMask:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid core mask 0x{CoreMask:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMaskValue);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMaskValue);
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Thread == null)
|
if (Thread == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
//-3 is used as "don't update", the old IdealCore value is kept.
|
//-3 is used as "don't update", the old IdealCore value is kept.
|
||||||
if (IdealCore == -3 && (CoreMask & (1 << Thread.IdealCore)) == 0)
|
if (IdealCore == -3 && (CoreMask & (1 << Thread.IdealCore)) == 0)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid core mask 0x{CoreMask:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid core mask 0x{CoreMask:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMaskValue);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidMaskValue);
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Thread == null)
|
if (Thread == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Process.GetThread(ThreadState.Tpidr) == Thread)
|
if (Process.GetThread(ThreadState.Tpidr) == Thread)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Thread handle 0x{Handle:x8} is current thread!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Thread handle 0x{Handle:x8} is current thread!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidThread);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidThread);
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,14 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
long MutexAddress = (long)ThreadState.X1;
|
long MutexAddress = (long)ThreadState.X1;
|
||||||
int WaitThreadHandle = (int)ThreadState.X2;
|
int WaitThreadHandle = (int)ThreadState.X2;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc,
|
Device.Log.PrintDebug(LogClass.KernelSvc,
|
||||||
"OwnerThreadHandle = " + OwnerThreadHandle.ToString("x8") + ", " +
|
"OwnerThreadHandle = " + OwnerThreadHandle.ToString("x8") + ", " +
|
||||||
"MutexAddress = " + MutexAddress .ToString("x16") + ", " +
|
"MutexAddress = " + MutexAddress .ToString("x16") + ", " +
|
||||||
"WaitThreadHandle = " + WaitThreadHandle .ToString("x8"));
|
"WaitThreadHandle = " + WaitThreadHandle .ToString("x8"));
|
||||||
|
|
||||||
if (IsPointingInsideKernel(MutexAddress))
|
if (IsPointingInsideKernel(MutexAddress))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid mutex address 0x{MutexAddress:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid mutex address 0x{MutexAddress:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (IsWordAddressUnaligned(MutexAddress))
|
if (IsWordAddressUnaligned(MutexAddress))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Unaligned mutex address 0x{MutexAddress:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Unaligned mutex address 0x{MutexAddress:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (OwnerThread == null)
|
if (OwnerThread == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid owner thread handle 0x{OwnerThreadHandle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid owner thread handle 0x{OwnerThreadHandle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (WaitThread == null)
|
if (WaitThread == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid requesting thread handle 0x{WaitThreadHandle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid requesting thread handle 0x{WaitThreadHandle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -72,11 +72,11 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
{
|
{
|
||||||
long MutexAddress = (long)ThreadState.X0;
|
long MutexAddress = (long)ThreadState.X0;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "MutexAddress = " + MutexAddress.ToString("x16"));
|
Device.Log.PrintDebug(LogClass.KernelSvc, "MutexAddress = " + MutexAddress.ToString("x16"));
|
||||||
|
|
||||||
if (IsPointingInsideKernel(MutexAddress))
|
if (IsPointingInsideKernel(MutexAddress))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid mutex address 0x{MutexAddress:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid mutex address 0x{MutexAddress:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (IsWordAddressUnaligned(MutexAddress))
|
if (IsWordAddressUnaligned(MutexAddress))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Unaligned mutex address 0x{MutexAddress:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Unaligned mutex address 0x{MutexAddress:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
int ThreadHandle = (int)ThreadState.X2;
|
int ThreadHandle = (int)ThreadState.X2;
|
||||||
ulong Timeout = ThreadState.X3;
|
ulong Timeout = ThreadState.X3;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc,
|
Device.Log.PrintDebug(LogClass.KernelSvc,
|
||||||
"MutexAddress = " + MutexAddress .ToString("x16") + ", " +
|
"MutexAddress = " + MutexAddress .ToString("x16") + ", " +
|
||||||
"CondVarAddress = " + CondVarAddress.ToString("x16") + ", " +
|
"CondVarAddress = " + CondVarAddress.ToString("x16") + ", " +
|
||||||
"ThreadHandle = " + ThreadHandle .ToString("x8") + ", " +
|
"ThreadHandle = " + ThreadHandle .ToString("x8") + ", " +
|
||||||
|
@ -112,7 +112,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (IsPointingInsideKernel(MutexAddress))
|
if (IsPointingInsideKernel(MutexAddress))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid mutex address 0x{MutexAddress:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid mutex address 0x{MutexAddress:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (IsWordAddressUnaligned(MutexAddress))
|
if (IsWordAddressUnaligned(MutexAddress))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Unaligned mutex address 0x{MutexAddress:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Unaligned mutex address 0x{MutexAddress:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (Thread == null)
|
if (Thread == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{ThreadHandle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{ThreadHandle:x8}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
long CondVarAddress = (long)ThreadState.X0;
|
long CondVarAddress = (long)ThreadState.X0;
|
||||||
int Count = (int)ThreadState.X1;
|
int Count = (int)ThreadState.X1;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc,
|
Device.Log.PrintDebug(LogClass.KernelSvc,
|
||||||
"CondVarAddress = " + CondVarAddress.ToString("x16") + ", " +
|
"CondVarAddress = " + CondVarAddress.ToString("x16") + ", " +
|
||||||
"Count = " + Count .ToString("x8"));
|
"Count = " + Count .ToString("x8"));
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
{
|
{
|
||||||
int MutexValue = Memory.ReadInt32(MutexAddress);
|
int MutexValue = Memory.ReadInt32(MutexAddress);
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "MutexValue = " + MutexValue.ToString("x8"));
|
Device.Log.PrintDebug(LogClass.KernelSvc, "MutexValue = " + MutexValue.ToString("x8"));
|
||||||
|
|
||||||
if (MutexValue != (OwnerThreadHandle | MutexHasListenersMask))
|
if (MutexValue != (OwnerThreadHandle | MutexHasListenersMask))
|
||||||
{
|
{
|
||||||
|
@ -191,7 +191,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
InsertWaitingMutexThreadUnsafe(OwnerThreadHandle, WaitThread);
|
InsertWaitingMutexThreadUnsafe(OwnerThreadHandle, WaitThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "Entering wait state...");
|
Device.Log.PrintDebug(LogClass.KernelSvc, "Entering wait state...");
|
||||||
|
|
||||||
Process.Scheduler.EnterWait(CurrThread);
|
Process.Scheduler.EnterWait(CurrThread);
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
int Value = (int)ThreadState.X2;
|
int Value = (int)ThreadState.X2;
|
||||||
ulong Timeout = ThreadState.X3;
|
ulong Timeout = ThreadState.X3;
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc,
|
Device.Log.PrintDebug(LogClass.KernelSvc,
|
||||||
"Address = " + Address.ToString("x16") + ", " +
|
"Address = " + Address.ToString("x16") + ", " +
|
||||||
"ArbitrationType = " + Type .ToString() + ", " +
|
"ArbitrationType = " + Type .ToString() + ", " +
|
||||||
"Value = " + Value .ToString("x8") + ", " +
|
"Value = " + Value .ToString("x8") + ", " +
|
||||||
|
@ -211,7 +211,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (IsPointingInsideKernel(Address))
|
if (IsPointingInsideKernel(Address))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid address 0x{Address:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid address 0x{Address:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.NoAccessPerm);
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (IsWordAddressUnaligned(Address))
|
if (IsWordAddressUnaligned(Address))
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Unaligned address 0x{Address:x16}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Unaligned address 0x{Address:x16}!");
|
||||||
|
|
||||||
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidAddress);
|
||||||
|
|
||||||
|
@ -281,13 +281,13 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
Process.Scheduler.WakeUp(OwnerThread);
|
Process.Scheduler.WakeUp(OwnerThread);
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "Gave mutex to thread id " + OwnerThread.ThreadId + "!");
|
Device.Log.PrintDebug(LogClass.KernelSvc, "Gave mutex to thread id " + OwnerThread.ThreadId + "!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Memory.WriteInt32ToSharedAddr(MutexAddress, 0);
|
Memory.WriteInt32ToSharedAddr(MutexAddress, 0);
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "No threads waiting mutex!");
|
Device.Log.PrintDebug(LogClass.KernelSvc, "No threads waiting mutex!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
Process.ThreadArbiterList.Add(WaitThread);
|
Process.ThreadArbiterList.Add(WaitThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "Entering wait state...");
|
Device.Log.PrintDebug(LogClass.KernelSvc, "Entering wait state...");
|
||||||
|
|
||||||
if (Timeout != ulong.MaxValue)
|
if (Timeout != ulong.MaxValue)
|
||||||
{
|
{
|
||||||
|
@ -332,7 +332,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
Process.ThreadArbiterList.Remove(WaitThread);
|
Process.ThreadArbiterList.Remove(WaitThread);
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "Timed out...");
|
Device.Log.PrintDebug(LogClass.KernelSvc, "Timed out...");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -360,7 +360,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (WaitThread == null)
|
if (WaitThread == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "No more threads to wake up!");
|
Device.Log.PrintDebug(LogClass.KernelSvc, "No more threads to wake up!");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
MutexValue = Memory.ReadInt32(MutexAddress);
|
MutexValue = Memory.ReadInt32(MutexAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.KernelSvc, "MutexValue = " + MutexValue.ToString("x8"));
|
Device.Log.PrintDebug(LogClass.KernelSvc, "MutexValue = " + MutexValue.ToString("x8"));
|
||||||
|
|
||||||
if (MutexValue == 0)
|
if (MutexValue == 0)
|
||||||
{
|
{
|
||||||
|
@ -436,7 +436,7 @@ namespace Ryujinx.HLE.OsHle.Kernel
|
||||||
|
|
||||||
if (OwnerThread == null)
|
if (OwnerThread == null)
|
||||||
{
|
{
|
||||||
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{OwnerThreadHandle:x8}!");
|
Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{OwnerThreadHandle:x8}!");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
{
|
{
|
||||||
private const int TickFreq = 19_200_000;
|
private const int TickFreq = 19_200_000;
|
||||||
|
|
||||||
public Switch Ns { get; private set; }
|
public Switch Device { get; private set; }
|
||||||
|
|
||||||
public bool NeedsHbAbi { get; private set; }
|
public bool NeedsHbAbi { get; private set; }
|
||||||
|
|
||||||
|
@ -68,14 +68,14 @@ namespace Ryujinx.HLE.OsHle
|
||||||
|
|
||||||
private bool Disposed;
|
private bool Disposed;
|
||||||
|
|
||||||
public Process(Switch Ns, KProcessScheduler Scheduler, int ProcessId, Npdm MetaData)
|
public Process(Switch Device, KProcessScheduler Scheduler, int ProcessId, Npdm MetaData)
|
||||||
{
|
{
|
||||||
this.Ns = Ns;
|
this.Device = Device;
|
||||||
this.Scheduler = Scheduler;
|
this.Scheduler = Scheduler;
|
||||||
this.MetaData = MetaData;
|
this.MetaData = MetaData;
|
||||||
this.ProcessId = ProcessId;
|
this.ProcessId = ProcessId;
|
||||||
|
|
||||||
Memory = new AMemory(Ns.Memory.RamPointer);
|
Memory = new AMemory(Device.Memory.RamPointer);
|
||||||
|
|
||||||
MemoryManager = new KMemoryManager(this);
|
MemoryManager = new KMemoryManager(this);
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
|
|
||||||
AppletState = new AppletStateMgr();
|
AppletState = new AppletStateMgr();
|
||||||
|
|
||||||
SvcHandler = new SvcHandler(Ns, this);
|
SvcHandler = new SvcHandler(Device, this);
|
||||||
|
|
||||||
Threads = new ConcurrentDictionary<long, KThread>();
|
Threads = new ConcurrentDictionary<long, KThread>();
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
throw new ObjectDisposedException(nameof(Process));
|
throw new ObjectDisposedException(nameof(Process));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Log.PrintInfo(LogClass.Loader, $"Image base at 0x{ImageBase:x16}.");
|
Device.Log.PrintInfo(LogClass.Loader, $"Image base at 0x{ImageBase:x16}.");
|
||||||
|
|
||||||
Executable Executable = new Executable(Program, MemoryManager, Memory, ImageBase);
|
Executable Executable = new Executable(Program, MemoryManager, Memory, ImageBase);
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
MemoryState.MappedMemory,
|
MemoryState.MappedMemory,
|
||||||
MemoryPermission.ReadAndWrite);
|
MemoryPermission.ReadAndWrite);
|
||||||
|
|
||||||
string SwitchPath = Ns.VFs.SystemPathToSwitchPath(Executables[0].FilePath);
|
string SwitchPath = Device.VFs.SystemPathToSwitchPath(Executables[0].FilePath);
|
||||||
|
|
||||||
Homebrew.WriteHbAbiData(Memory, HbAbiDataPosition, Handle, SwitchPath);
|
Homebrew.WriteHbAbiData(Memory, HbAbiDataPosition, Handle, SwitchPath);
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Log.PrintDebug(LogClass.Cpu, $"Executing at 0x{e.Position:x16} {e.SubName} {NsoName}");
|
Device.Log.PrintDebug(LogClass.Cpu, $"Executing at 0x{e.Position:x16} {e.SubName} {NsoName}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrintStackTrace(AThreadState ThreadState)
|
public void PrintStackTrace(AThreadState ThreadState)
|
||||||
|
@ -354,7 +354,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
Trace.AppendLine(" " + SubName + " (" + GetNsoNameAndAddress(Position) + ")");
|
Trace.AppendLine(" " + SubName + " (" + GetNsoNameAndAddress(Position) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Log.PrintInfo(LogClass.Cpu, Trace.ToString());
|
Device.Log.PrintInfo(LogClass.Cpu, Trace.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetNsoNameAndAddress(long Position)
|
private string GetNsoNameAndAddress(long Position)
|
||||||
|
@ -394,7 +394,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
Dispose();
|
Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Os.ExitProcess(ProcessId);
|
Device.System.ExitProcess(ProcessId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
{
|
{
|
||||||
ShouldDispose = true;
|
ShouldDispose = true;
|
||||||
|
|
||||||
Ns.Log.PrintInfo(LogClass.Loader, $"Process {ProcessId} waiting all threads terminate...");
|
Device.Log.PrintInfo(LogClass.Loader, $"Process {ProcessId} waiting all threads terminate...");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
|
|
||||||
AppletState.Dispose();
|
AppletState.Dispose();
|
||||||
|
|
||||||
Ns.Log.PrintInfo(LogClass.Loader, $"Process {ProcessId} exiting...");
|
Device.Log.PrintInfo(LogClass.Loader, $"Process {ProcessId} exiting...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
{
|
{
|
||||||
class ServiceCtx
|
class ServiceCtx
|
||||||
{
|
{
|
||||||
public Switch Ns { get; private set; }
|
public Switch Device { get; private set; }
|
||||||
public Process Process { get; private set; }
|
public Process Process { get; private set; }
|
||||||
public AMemory Memory { get; private set; }
|
public AMemory Memory { get; private set; }
|
||||||
public KSession Session { get; private set; }
|
public KSession Session { get; private set; }
|
||||||
|
@ -17,7 +17,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
public BinaryWriter ResponseData { get; private set; }
|
public BinaryWriter ResponseData { get; private set; }
|
||||||
|
|
||||||
public ServiceCtx(
|
public ServiceCtx(
|
||||||
Switch Ns,
|
Switch Device,
|
||||||
Process Process,
|
Process Process,
|
||||||
AMemory Memory,
|
AMemory Memory,
|
||||||
KSession Session,
|
KSession Session,
|
||||||
|
@ -26,7 +26,7 @@ namespace Ryujinx.HLE.OsHle
|
||||||
BinaryReader RequestData,
|
BinaryReader RequestData,
|
||||||
BinaryWriter ResponseData)
|
BinaryWriter ResponseData)
|
||||||
{
|
{
|
||||||
this.Ns = Ns;
|
this.Device = Device;
|
||||||
this.Process = Process;
|
this.Process = Process;
|
||||||
this.Memory = Memory;
|
this.Memory = Memory;
|
||||||
this.Session = Session;
|
this.Session = Session;
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.OsHle.Services.Acc
|
||||||
|
|
||||||
public long GetUserCount(ServiceCtx Context)
|
public long GetUserCount(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(Context.Ns.Os.SystemState.GetUserCount());
|
Context.ResponseData.Write(Context.Device.System.State.GetUserCount());
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -41,19 +41,19 @@ namespace Ryujinx.HLE.OsHle.Services.Acc
|
||||||
Context.RequestData.ReadInt64(),
|
Context.RequestData.ReadInt64(),
|
||||||
Context.RequestData.ReadInt64());
|
Context.RequestData.ReadInt64());
|
||||||
|
|
||||||
Context.ResponseData.Write(Context.Ns.Os.SystemState.TryGetUser(Uuid, out _) ? 1 : 0);
|
Context.ResponseData.Write(Context.Device.System.State.TryGetUser(Uuid, out _) ? 1 : 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long ListAllUsers(ServiceCtx Context)
|
public long ListAllUsers(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
return WriteUserList(Context, Context.Ns.Os.SystemState.GetAllUsers());
|
return WriteUserList(Context, Context.Device.System.State.GetAllUsers());
|
||||||
}
|
}
|
||||||
|
|
||||||
public long ListOpenUsers(ServiceCtx Context)
|
public long ListOpenUsers(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
return WriteUserList(Context, Context.Ns.Os.SystemState.GetOpenUsers());
|
return WriteUserList(Context, Context.Device.System.State.GetOpenUsers());
|
||||||
}
|
}
|
||||||
|
|
||||||
private long WriteUserList(ServiceCtx Context, IEnumerable<UserProfile> Profiles)
|
private long WriteUserList(ServiceCtx Context, IEnumerable<UserProfile> Profiles)
|
||||||
|
@ -83,7 +83,7 @@ namespace Ryujinx.HLE.OsHle.Services.Acc
|
||||||
|
|
||||||
public long GetLastOpenedUser(ServiceCtx Context)
|
public long GetLastOpenedUser(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
UserProfile LastOpened = Context.Ns.Os.SystemState.LastOpenUser;
|
UserProfile LastOpened = Context.Device.System.State.LastOpenUser;
|
||||||
|
|
||||||
LastOpened.Uuid.Write(Context.ResponseData);
|
LastOpened.Uuid.Write(Context.ResponseData);
|
||||||
|
|
||||||
|
@ -96,9 +96,9 @@ namespace Ryujinx.HLE.OsHle.Services.Acc
|
||||||
Context.RequestData.ReadInt64(),
|
Context.RequestData.ReadInt64(),
|
||||||
Context.RequestData.ReadInt64());
|
Context.RequestData.ReadInt64());
|
||||||
|
|
||||||
if (!Context.Ns.Os.SystemState.TryGetUser(Uuid, out UserProfile Profile))
|
if (!Context.Device.System.State.TryGetUser(Uuid, out UserProfile Profile))
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceAcc, $"User 0x{Uuid} not found!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceAcc, $"User 0x{Uuid} not found!");
|
||||||
|
|
||||||
return MakeError(ErrorModule.Account, AccErr.UserNotFound);
|
return MakeError(ErrorModule.Account, AccErr.UserNotFound);
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.OsHle.Services.Acc
|
||||||
|
|
||||||
public long InitializeApplicationInfo(ServiceCtx Context)
|
public long InitializeApplicationInfo(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,14 +21,14 @@ namespace Ryujinx.HLE.OsHle.Services.Acc
|
||||||
|
|
||||||
public long CheckAvailability(ServiceCtx Context)
|
public long CheckAvailability(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetAccountId(ServiceCtx Context)
|
public long GetAccountId(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
||||||
|
|
||||||
Context.ResponseData.Write(0xcafeL);
|
Context.ResponseData.Write(0xcafeL);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace Ryujinx.HLE.OsHle.Services.Acc
|
||||||
|
|
||||||
public long Get(ServiceCtx Context)
|
public long Get(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
||||||
|
|
||||||
long Position = Context.Request.ReceiveBuff[0].Position;
|
long Position = Context.Request.ReceiveBuff[0].Position;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
long UIdLow = Context.RequestData.ReadInt64();
|
long UIdLow = Context.RequestData.ReadInt64();
|
||||||
long UIdHigh = Context.RequestData.ReadInt64();
|
long UIdHigh = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
Context.ResponseData.Write(0L);
|
Context.ResponseData.Write(0L);
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long GetDesiredLanguage(ServiceCtx Context)
|
public long GetDesiredLanguage(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(Context.Ns.Os.SystemState.DesiredLanguageCode);
|
Context.ResponseData.Write(Context.Device.System.State.DesiredLanguageCode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
string Result = GetFormattedErrorCode(ErrorCode);
|
string Result = GetFormattedErrorCode(ErrorCode);
|
||||||
|
|
||||||
Context.Ns.Log.PrintInfo(LogClass.ServiceAm, $"Result = 0x{ErrorCode:x8} ({Result}).");
|
Context.Device.Log.PrintInfo(LogClass.ServiceAm, $"Result = 0x{ErrorCode:x8} ({Result}).");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long GetPseudoDeviceId(ServiceCtx Context)
|
public long GetPseudoDeviceId(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
Context.ResponseData.Write(0L);
|
Context.ResponseData.Write(0L);
|
||||||
Context.ResponseData.Write(0L);
|
Context.ResponseData.Write(0L);
|
||||||
|
@ -100,7 +100,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long InitializeGamePlayRecording(ServiceCtx Context)
|
public long InitializeGamePlayRecording(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
int State = Context.RequestData.ReadInt32();
|
int State = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
float AppletVolume = Context.RequestData.ReadSingle();
|
float AppletVolume = Context.RequestData.ReadSingle();
|
||||||
float LibraryAppletVolume = Context.RequestData.ReadSingle();
|
float LibraryAppletVolume = Context.RequestData.ReadSingle();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(1f);
|
Context.ResponseData.Write(1f);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(1f);
|
Context.ResponseData.Write(1f);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
float Unknown0 = Context.RequestData.ReadSingle();
|
float Unknown0 = Context.RequestData.ReadSingle();
|
||||||
long Unknown1 = Context.RequestData.ReadInt64();
|
long Unknown1 = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
float Unknown0 = Context.RequestData.ReadSingle();
|
float Unknown0 = Context.RequestData.ReadSingle();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long GetOperationMode(ServiceCtx Context)
|
public long GetOperationMode(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
OperationMode Mode = Context.Ns.Os.SystemState.DockedMode
|
OperationMode Mode = Context.Device.System.State.DockedMode
|
||||||
? OperationMode.Docked
|
? OperationMode.Docked
|
||||||
: OperationMode.Handheld;
|
: OperationMode.Handheld;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long GetPerformanceMode(ServiceCtx Context)
|
public long GetPerformanceMode(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Apm.PerformanceMode Mode = Context.Ns.Os.SystemState.DockedMode
|
Apm.PerformanceMode Mode = Context.Device.System.State.DockedMode
|
||||||
? Apm.PerformanceMode.Docked
|
? Apm.PerformanceMode.Docked
|
||||||
: Apm.PerformanceMode.Handheld;
|
: Apm.PerformanceMode.Handheld;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write((byte)0); //Unknown value.
|
Context.ResponseData.Write((byte)0); //Unknown value.
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long RequestToGetForeground(ServiceCtx Context)
|
public long RequestToGetForeground(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,28 +35,28 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long Start(ServiceCtx Context)
|
public long Start(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetResult(ServiceCtx Context)
|
public long GetResult(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long PushInData(ServiceCtx Context)
|
public long PushInData(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,21 +36,21 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long Exit(ServiceCtx Context)
|
public long Exit(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long LockExit(ServiceCtx Context)
|
public long LockExit(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long UnlockExit(ServiceCtx Context)
|
public long UnlockExit(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
bool Flag2 = Context.RequestData.ReadByte() != 0 ? true : false;
|
bool Flag2 = Context.RequestData.ReadByte() != 0 ? true : false;
|
||||||
bool Flag3 = Context.RequestData.ReadByte() != 0 ? true : false;
|
bool Flag3 = Context.RequestData.ReadByte() != 0 ? true : false;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
int Orientation = Context.RequestData.ReadInt32();
|
int Orientation = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
{
|
{
|
||||||
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long GetAppletResourceUserId(ServiceCtx Context)
|
public long GetAppletResourceUserId(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
Context.ResponseData.Write(0L);
|
Context.ResponseData.Write(0L);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.OsHle.Services.Am
|
||||||
|
|
||||||
public long AcquireForegroundRights(ServiceCtx Context)
|
public long AcquireForegroundRights(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace Ryujinx.HLE.OsHle.Services.Apm
|
||||||
|
|
||||||
Context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1);
|
Context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceApm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceApm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,14 +200,14 @@ namespace Ryujinx.HLE.OsHle.Services.Aud.AudioRenderer
|
||||||
|
|
||||||
public long StartAudioRenderer(ServiceCtx Context)
|
public long StartAudioRenderer(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long StopAudioRenderer(ServiceCtx Context)
|
public long StopAudioRenderer(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
if ((Position - BasePosition) + Buffer.Length > Size)
|
if ((Position - BasePosition) + Buffer.Length > Size)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
Context.Device.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -79,14 +79,14 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
string DeviceName = Encoding.ASCII.GetString(DeviceNameBuffer);
|
string DeviceName = Encoding.ASCII.GetString(DeviceNameBuffer);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetActiveAudioDeviceName(ServiceCtx Context)
|
public long GetActiveAudioDeviceName(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
string Name = Context.Ns.Os.SystemState.ActiveAudioOutput;
|
string Name = Context.Device.System.State.ActiveAudioOutput;
|
||||||
|
|
||||||
long Position = Context.Request.ReceiveBuff[0].Position;
|
long Position = Context.Request.ReceiveBuff[0].Position;
|
||||||
long Size = Context.Request.ReceiveBuff[0].Size;
|
long Size = Context.Request.ReceiveBuff[0].Size;
|
||||||
|
@ -99,7 +99,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
Context.Device.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -111,7 +111,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(2);
|
Context.ResponseData.Write(2);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
if ((Position - BasePosition) + Buffer.Length > Size)
|
if ((Position - BasePosition) + Buffer.Length > Size)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
Context.Device.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
string DeviceName = Encoding.UTF8.GetString(DeviceNameBuffer);
|
string DeviceName = Encoding.UTF8.GetString(DeviceNameBuffer);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -173,14 +173,14 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(1f);
|
Context.ResponseData.Write(1f);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetActiveAudioDeviceNameAuto(ServiceCtx Context)
|
public long GetActiveAudioDeviceNameAuto(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
string Name = Context.Ns.Os.SystemState.ActiveAudioOutput;
|
string Name = Context.Device.System.State.ActiveAudioOutput;
|
||||||
|
|
||||||
(long Position, long Size) = Context.Request.GetBufferType0x22();
|
(long Position, long Size) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
Context.Device.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -204,7 +204,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
Context.Device.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {Size} too small!");
|
||||||
}
|
}
|
||||||
|
|
||||||
Context.ResponseData.Write(NameCount);
|
Context.ResponseData.Write(NameCount);
|
||||||
|
@ -108,7 +108,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
if (DeviceName != DefaultAudioOutput)
|
if (DeviceName != DefaultAudioOutput)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.Audio, "Invalid device name!");
|
Context.Device.Log.PrintWarning(LogClass.Audio, "Invalid device name!");
|
||||||
|
|
||||||
return MakeError(ErrorModule.Audio, AudErr.DeviceNotFound);
|
return MakeError(ErrorModule.Audio, AudErr.DeviceNotFound);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {ReceiveSize} too small!");
|
Context.Device.Log.PrintError(LogClass.ServiceAudio, $"Output buffer size {ReceiveSize} too small!");
|
||||||
}
|
}
|
||||||
|
|
||||||
int SampleRate = Context.RequestData.ReadInt32();
|
int SampleRate = Context.RequestData.ReadInt32();
|
||||||
|
@ -134,7 +134,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
if (SampleRate != DefaultSampleRate)
|
if (SampleRate != DefaultSampleRate)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.Audio, "Invalid sample rate!");
|
Context.Device.Log.PrintWarning(LogClass.Audio, "Invalid sample rate!");
|
||||||
|
|
||||||
return MakeError(ErrorModule.Audio, AudErr.UnsupportedSampleRate);
|
return MakeError(ErrorModule.Audio, AudErr.UnsupportedSampleRate);
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
ReleaseEvent.WaitEvent.Set();
|
ReleaseEvent.WaitEvent.Set();
|
||||||
};
|
};
|
||||||
|
|
||||||
IAalOutput AudioOut = Context.Ns.AudioOut;
|
IAalOutput AudioOut = Context.Device.AudioOut;
|
||||||
|
|
||||||
int Track = AudioOut.OpenTrack(SampleRate, Channels, Callback);
|
int Track = AudioOut.OpenTrack(SampleRate, Channels, Callback);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
public long OpenAudioRenderer(ServiceCtx Context)
|
public long OpenAudioRenderer(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
IAalOutput AudioOut = Context.Ns.AudioOut;
|
IAalOutput AudioOut = Context.Device.AudioOut;
|
||||||
|
|
||||||
AudioRendererParameter Params = GetAudioRendererParameter(Context);
|
AudioRendererParameter Params = GetAudioRendererParameter(Context);
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
|
|
||||||
Context.ResponseData.Write(Size);
|
Context.ResponseData.Write(Size);
|
||||||
|
|
||||||
Context.Ns.Log.PrintDebug(LogClass.ServiceAudio, $"WorkBufferSize is 0x{Size:x16}.");
|
Context.Device.Log.PrintDebug(LogClass.ServiceAudio, $"WorkBufferSize is 0x{Size:x16}.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(0L);
|
Context.ResponseData.Write(0L);
|
||||||
|
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceAudio, $"Library Revision 0x{Params.Revision:x8} is not supported!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceAudio, $"Library Revision 0x{Params.Revision:x8} is not supported!");
|
||||||
|
|
||||||
return MakeError(ErrorModule.Audio, AudErr.UnsupportedRevision);
|
return MakeError(ErrorModule.Audio, AudErr.UnsupportedRevision);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace Ryujinx.HLE.OsHle.Services.Friend
|
||||||
Context.RequestData.ReadInt64(),
|
Context.RequestData.ReadInt64(),
|
||||||
Context.RequestData.ReadInt64());
|
Context.RequestData.ReadInt64());
|
||||||
|
|
||||||
if (Context.Ns.Os.SystemState.TryGetUser(Uuid, out UserProfile Profile))
|
if (Context.Device.System.State.TryGetUser(Uuid, out UserProfile Profile))
|
||||||
{
|
{
|
||||||
Profile.OnlinePlayState = OpenCloseState.Closed;
|
Profile.OnlinePlayState = OpenCloseState.Closed;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ namespace Ryujinx.HLE.OsHle.Services.Friend
|
||||||
Context.RequestData.ReadInt64());
|
Context.RequestData.ReadInt64());
|
||||||
|
|
||||||
//TODO.
|
//TODO.
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceFriend, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceFriend, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
long Mode = Context.RequestData.ReadInt64();
|
long Mode = Context.RequestData.ReadInt64();
|
||||||
int Size = Context.RequestData.ReadInt32();
|
int Size = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
string FileName = Context.Ns.VFs.GetFullPath(Path, Name);
|
string FileName = Context.Device.VFs.GetFullPath(Path, Name);
|
||||||
|
|
||||||
if (FileName == null)
|
if (FileName == null)
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
{
|
{
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
string FileName = Context.Ns.VFs.GetFullPath(Path, Name);
|
string FileName = Context.Device.VFs.GetFullPath(Path, Name);
|
||||||
|
|
||||||
if (!File.Exists(FileName))
|
if (!File.Exists(FileName))
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
{
|
{
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
string DirName = Context.Ns.VFs.GetFullPath(Path, Name);
|
string DirName = Context.Device.VFs.GetFullPath(Path, Name);
|
||||||
|
|
||||||
if (DirName == null)
|
if (DirName == null)
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
{
|
{
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
string DirName = Context.Ns.VFs.GetFullPath(Path, Name);
|
string DirName = Context.Device.VFs.GetFullPath(Path, Name);
|
||||||
|
|
||||||
if (!Directory.Exists(DirName))
|
if (!Directory.Exists(DirName))
|
||||||
{
|
{
|
||||||
|
@ -159,8 +159,8 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
string OldName = ReadUtf8String(Context, 0);
|
string OldName = ReadUtf8String(Context, 0);
|
||||||
string NewName = ReadUtf8String(Context, 1);
|
string NewName = ReadUtf8String(Context, 1);
|
||||||
|
|
||||||
string OldFileName = Context.Ns.VFs.GetFullPath(Path, OldName);
|
string OldFileName = Context.Device.VFs.GetFullPath(Path, OldName);
|
||||||
string NewFileName = Context.Ns.VFs.GetFullPath(Path, NewName);
|
string NewFileName = Context.Device.VFs.GetFullPath(Path, NewName);
|
||||||
|
|
||||||
if (!File.Exists(OldFileName))
|
if (!File.Exists(OldFileName))
|
||||||
{
|
{
|
||||||
|
@ -187,8 +187,8 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
string OldName = ReadUtf8String(Context, 0);
|
string OldName = ReadUtf8String(Context, 0);
|
||||||
string NewName = ReadUtf8String(Context, 1);
|
string NewName = ReadUtf8String(Context, 1);
|
||||||
|
|
||||||
string OldDirName = Context.Ns.VFs.GetFullPath(Path, OldName);
|
string OldDirName = Context.Device.VFs.GetFullPath(Path, OldName);
|
||||||
string NewDirName = Context.Ns.VFs.GetFullPath(Path, NewName);
|
string NewDirName = Context.Device.VFs.GetFullPath(Path, NewName);
|
||||||
|
|
||||||
if (!Directory.Exists(OldDirName))
|
if (!Directory.Exists(OldDirName))
|
||||||
{
|
{
|
||||||
|
@ -214,7 +214,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
{
|
{
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
string FileName = Context.Ns.VFs.GetFullPath(Path, Name);
|
string FileName = Context.Device.VFs.GetFullPath(Path, Name);
|
||||||
|
|
||||||
if (File.Exists(FileName))
|
if (File.Exists(FileName))
|
||||||
{
|
{
|
||||||
|
@ -240,7 +240,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
|
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
string FileName = Context.Ns.VFs.GetFullPath(Path, Name);
|
string FileName = Context.Device.VFs.GetFullPath(Path, Name);
|
||||||
|
|
||||||
if (!File.Exists(FileName))
|
if (!File.Exists(FileName))
|
||||||
{
|
{
|
||||||
|
@ -274,7 +274,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
|
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
string DirName = Context.Ns.VFs.GetFullPath(Path, Name);
|
string DirName = Context.Device.VFs.GetFullPath(Path, Name);
|
||||||
|
|
||||||
if (!Directory.Exists(DirName))
|
if (!Directory.Exists(DirName))
|
||||||
{
|
{
|
||||||
|
@ -309,7 +309,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
{
|
{
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
Context.ResponseData.Write(Context.Ns.VFs.GetDrive().AvailableFreeSpace);
|
Context.ResponseData.Write(Context.Device.VFs.GetDrive().AvailableFreeSpace);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
{
|
{
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
Context.ResponseData.Write(Context.Ns.VFs.GetDrive().TotalSize);
|
Context.ResponseData.Write(Context.Device.VFs.GetDrive().TotalSize);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -327,7 +327,7 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
{
|
{
|
||||||
string Name = ReadUtf8String(Context);
|
string Name = ReadUtf8String(Context);
|
||||||
|
|
||||||
string DirName = Context.Ns.VFs.GetFullPath(Path, Name);
|
string DirName = Context.Device.VFs.GetFullPath(Path, Name);
|
||||||
|
|
||||||
if (!Directory.Exists(DirName))
|
if (!Directory.Exists(DirName))
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,35 +31,35 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv
|
||||||
|
|
||||||
public long OpenSdCardFileSystem(ServiceCtx Context)
|
public long OpenSdCardFileSystem(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
MakeObject(Context, new IFileSystem(Context.Ns.VFs.GetSdCardPath()));
|
MakeObject(Context, new IFileSystem(Context.Device.VFs.GetSdCardPath()));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long CreateSaveDataFileSystem(ServiceCtx Context)
|
public long CreateSaveDataFileSystem(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceFs, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceFs, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long OpenSaveDataFileSystem(ServiceCtx Context)
|
public long OpenSaveDataFileSystem(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
MakeObject(Context, new IFileSystem(Context.Ns.VFs.GetGameSavesPath()));
|
MakeObject(Context, new IFileSystem(Context.Device.VFs.GetGameSavesPath()));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long OpenDataStorageByCurrentProcess(ServiceCtx Context)
|
public long OpenDataStorageByCurrentProcess(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
MakeObject(Context, new IStorage(Context.Ns.VFs.RomFs));
|
MakeObject(Context, new IStorage(Context.Device.VFs.RomFs));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long OpenPatchDataStorageByCurrentProcess(ServiceCtx Context)
|
public long OpenPatchDataStorageByCurrentProcess(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
MakeObject(Context, new IStorage(Context.Ns.VFs.RomFs));
|
MakeObject(Context, new IStorage(Context.Device.VFs.RomFs));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,14 +50,14 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
|
|
||||||
public long CreateAppletResource(ServiceCtx Context)
|
public long CreateAppletResource(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
MakeObject(Context, new IAppletResource(Context.Ns.Os.HidSharedMem));
|
MakeObject(Context, new IAppletResource(Context.Device.System.HidSharedMem));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long ActivateDebugPad(ServiceCtx Context)
|
public long ActivateDebugPad(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
{
|
{
|
||||||
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
{
|
{
|
||||||
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
{
|
{
|
||||||
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
|
|
||||||
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
int Unknown = Context.RequestData.ReadInt32();
|
int Unknown = Context.RequestData.ReadInt32();
|
||||||
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(0);
|
Context.ResponseData.Write(0);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
long Unknown0 = Context.RequestData.ReadInt64();
|
long Unknown0 = Context.RequestData.ReadInt64();
|
||||||
long Unknown8 = Context.RequestData.ReadInt64();
|
long Unknown8 = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
{
|
{
|
||||||
long Unknown = Context.RequestData.ReadInt64();
|
long Unknown = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
{
|
{
|
||||||
long Unknown = Context.RequestData.ReadInt64();
|
long Unknown = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
|
|
||||||
Context.ResponseData.Write(0L);
|
Context.ResponseData.Write(0L);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
long Unknown0 = Context.RequestData.ReadInt64();
|
long Unknown0 = Context.RequestData.ReadInt64();
|
||||||
long Unknown8 = Context.RequestData.ReadInt64();
|
long Unknown8 = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(0L);
|
Context.ResponseData.Write(0L);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
|
|
||||||
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
||||||
long NpadJoyDeviceType = Context.RequestData.ReadInt64();
|
long NpadJoyDeviceType = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
|
|
||||||
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
long Unknown8 = Context.RequestData.ReadInt32();
|
long Unknown8 = Context.RequestData.ReadInt32();
|
||||||
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
||||||
long Unknown = Context.RequestData.ReadInt64();
|
long Unknown = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
{
|
{
|
||||||
int VibrationDeviceHandle = Context.RequestData.ReadInt32();
|
int VibrationDeviceHandle = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
Context.ResponseData.Write(0L); //VibrationDeviceInfoForIpc
|
Context.ResponseData.Write(0L); //VibrationDeviceInfoForIpc
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
|
|
||||||
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
long AppletUserResourceId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
|
||||||
|
|
||||||
public long SendVibrationValues(ServiceCtx Context)
|
public long SendVibrationValues(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace Ryujinx.HLE.OsHle.Services
|
||||||
{
|
{
|
||||||
Context.ResponseData.BaseStream.Seek(IsDomain ? 0x20 : 0x10, SeekOrigin.Begin);
|
Context.ResponseData.BaseStream.Seek(IsDomain ? 0x20 : 0x10, SeekOrigin.Begin);
|
||||||
|
|
||||||
Context.Ns.Log.PrintDebug(LogClass.KernelIpc, $"{Service.GetType().Name}: {ProcessRequest.Method.Name}");
|
Context.Device.Log.PrintDebug(LogClass.KernelIpc, $"{Service.GetType().Name}: {ProcessRequest.Method.Name}");
|
||||||
|
|
||||||
long Result = ProcessRequest(Context);
|
long Result = ProcessRequest(Context);
|
||||||
|
|
||||||
|
|
|
@ -72,11 +72,11 @@ namespace Ryujinx.HLE.OsHle.Services.Lm
|
||||||
|
|
||||||
switch((LmLogLevel)Level)
|
switch((LmLogLevel)Level)
|
||||||
{
|
{
|
||||||
case LmLogLevel.Trace: Context.Ns.Log.PrintDebug (LogClass.ServiceLm, Text); break;
|
case LmLogLevel.Trace: Context.Device.Log.PrintDebug (LogClass.ServiceLm, Text); break;
|
||||||
case LmLogLevel.Info: Context.Ns.Log.PrintInfo (LogClass.ServiceLm, Text); break;
|
case LmLogLevel.Info: Context.Device.Log.PrintInfo (LogClass.ServiceLm, Text); break;
|
||||||
case LmLogLevel.Warning: Context.Ns.Log.PrintWarning(LogClass.ServiceLm, Text); break;
|
case LmLogLevel.Warning: Context.Device.Log.PrintWarning(LogClass.ServiceLm, Text); break;
|
||||||
case LmLogLevel.Error: Context.Ns.Log.PrintError (LogClass.ServiceLm, Text); break;
|
case LmLogLevel.Error: Context.Device.Log.PrintError (LogClass.ServiceLm, Text); break;
|
||||||
case LmLogLevel.Critical: Context.Ns.Log.PrintError (LogClass.ServiceLm, Text); break;
|
case LmLogLevel.Critical: Context.Device.Log.PrintError (LogClass.ServiceLm, Text); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,14 @@ namespace Ryujinx.HLE.OsHle.Services.Mm
|
||||||
|
|
||||||
public long Initialize(ServiceCtx Context)
|
public long Initialize(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceMm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceMm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long SetAndWait(ServiceCtx Context)
|
public long SetAndWait(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceMm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceMm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ namespace Ryujinx.HLE.OsHle.Services.Mm
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(0);
|
Context.ResponseData.Write(0);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceMm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceMm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nfp
|
||||||
|
|
||||||
public long Initialize(ServiceCtx Context)
|
public long Initialize(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
||||||
|
|
||||||
State = State.Initialized;
|
State = State.Initialized;
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nfp
|
||||||
|
|
||||||
public long AttachActivateEvent(ServiceCtx Context)
|
public long AttachActivateEvent(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
||||||
|
|
||||||
int Handle = Context.Process.HandleTable.OpenHandle(ActivateEvent);
|
int Handle = Context.Process.HandleTable.OpenHandle(ActivateEvent);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nfp
|
||||||
|
|
||||||
public long AttachDeactivateEvent(ServiceCtx Context)
|
public long AttachDeactivateEvent(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
||||||
|
|
||||||
int Handle = Context.Process.HandleTable.OpenHandle(DeactivateEvent);
|
int Handle = Context.Process.HandleTable.OpenHandle(DeactivateEvent);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nfp
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write((int)State);
|
Context.ResponseData.Write((int)State);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nfp
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write((int)DeviceState);
|
Context.ResponseData.Write((int)DeviceState);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -95,14 +95,14 @@ namespace Ryujinx.HLE.OsHle.Services.Nfp
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write((int)NpadId);
|
Context.ResponseData.Write((int)NpadId);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long AttachAvailabilityChangeEvent(ServiceCtx Context)
|
public long AttachAvailabilityChangeEvent(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
|
||||||
|
|
||||||
int Handle = Context.Process.HandleTable.OpenHandle(AvailabilityChangeEvent);
|
int Handle = Context.Process.HandleTable.OpenHandle(AvailabilityChangeEvent);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nifm
|
||||||
|
|
||||||
MakeObject(Context, new IRequest());
|
MakeObject(Context, new IRequest());
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nifm
|
||||||
|
|
||||||
Context.ResponseData.Write(BitConverter.ToUInt32(Address.GetAddressBytes()));
|
Context.ResponseData.Write(BitConverter.ToUInt32(Address.GetAddressBytes()));
|
||||||
|
|
||||||
Context.Ns.Log.PrintInfo(LogClass.ServiceNifm, $"Console's local IP is {Address.ToString()}");
|
Context.Device.Log.PrintInfo(LogClass.ServiceNifm, $"Console's local IP is {Address.ToString()}");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,14 +35,14 @@ namespace Ryujinx.HLE.OsHle.Services.Nifm
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(1);
|
Context.ResponseData.Write(1);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetResult(ServiceCtx Context)
|
public long GetResult(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -59,21 +59,21 @@ namespace Ryujinx.HLE.OsHle.Services.Nifm
|
||||||
|
|
||||||
public long Cancel(ServiceCtx Context)
|
public long Cancel(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long Submit(ServiceCtx Context)
|
public long Submit(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long SetConnectionConfirmationOption(ServiceCtx Context)
|
public long SetConnectionConfirmationOption(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,14 +23,14 @@ namespace Ryujinx.HLE.OsHle.Services.Ns
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(0);
|
Context.ResponseData.Write(0);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNs, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNs, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long ListAddOnContent(ServiceCtx Context)
|
public static long ListAddOnContent(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNs, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNs, "Stubbed.");
|
||||||
|
|
||||||
//TODO: This is supposed to write a u32 array aswell.
|
//TODO: This is supposed to write a u32 array aswell.
|
||||||
//It's unknown what it contains.
|
//It's unknown what it contains.
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv
|
||||||
|
|
||||||
public long FinishInitialize(ServiceCtx Context)
|
public long FinishInitialize(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -177,14 +177,14 @@ namespace Ryujinx.HLE.OsHle.Services.Nv
|
||||||
{
|
{
|
||||||
if (CmdIn(Cmd) && Context.Request.GetBufferType0x21().Position == 0)
|
if (CmdIn(Cmd) && Context.Request.GetBufferType0x21().Position == 0)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(LogClass.ServiceNv, "Input buffer is null!");
|
Context.Device.Log.PrintError(LogClass.ServiceNv, "Input buffer is null!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CmdOut(Cmd) && Context.Request.GetBufferType0x22().Position == 0)
|
if (CmdOut(Cmd) && Context.Request.GetBufferType0x22().Position == 0)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(LogClass.ServiceNv, "Output buffer is null!");
|
Context.Device.Log.PrintError(LogClass.ServiceNv, "Output buffer is null!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
{
|
{
|
||||||
Args.Offset = 0;
|
Args.Offset = 0;
|
||||||
|
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Failed to allocate size {Size:x16}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Failed to allocate size {Size:x16}!");
|
||||||
|
|
||||||
Result = NvResult.OutOfMemory;
|
Result = NvResult.OutOfMemory;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv,
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv,
|
||||||
$"Failed to free offset 0x{Args.Offset:x16} size 0x{Size:x16}!");
|
$"Failed to free offset 0x{Args.Offset:x16} size 0x{Size:x16}!");
|
||||||
|
|
||||||
Result = NvResult.InvalidInput;
|
Result = NvResult.InvalidInput;
|
||||||
|
@ -145,7 +145,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid buffer offset {Args.Offset:x16}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid buffer offset {Args.Offset:x16}!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
|
|
||||||
if (Map == null)
|
if (Map == null)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap handle 0x{Args.NvMapHandle:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap handle 0x{Args.NvMapHandle:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
{
|
{
|
||||||
string Msg = string.Format(MapErrorMsg, VA, Args.MappingSize);
|
string Msg = string.Format(MapErrorMsg, VA, Args.MappingSize);
|
||||||
|
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, Msg);
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, Msg);
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Address 0x{Args.Offset:x16} not mapped!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Address 0x{Args.Offset:x16} not mapped!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
{
|
{
|
||||||
string Msg = string.Format(MapErrorMsg, Args.Offset, Size);
|
string Msg = string.Format(MapErrorMsg, Args.Offset, Size);
|
||||||
|
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, Msg);
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, Msg);
|
||||||
|
|
||||||
Result = NvResult.InvalidInput;
|
Result = NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
{
|
{
|
||||||
Args.Offset = 0;
|
Args.Offset = 0;
|
||||||
|
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Failed to map size 0x{Size:x16}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Failed to map size 0x{Size:x16}!");
|
||||||
|
|
||||||
Result = NvResult.InvalidInput;
|
Result = NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
|
|
||||||
if (Map == null)
|
if (Map == null)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap handle 0x{Args.NvMapHandle:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap handle 0x{Args.NvMapHandle:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuAS
|
||||||
|
|
||||||
if (Result < 0)
|
if (Result < 0)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv,
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv,
|
||||||
$"Page 0x{Args.Offset:x16} size 0x{Args.Pages:x16} not allocated!");
|
$"Page 0x{Args.Offset:x16} size 0x{Args.Pages:x16} not allocated!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuGpu
|
||||||
|
|
||||||
AMemoryHelper.Write(Context.Memory, OutputPosition, Args);
|
AMemoryHelper.Write(Context.Memory, OutputPosition, Args);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuGpu
|
||||||
|
|
||||||
AMemoryHelper.Write(Context.Memory, OutputPosition, Args);
|
AMemoryHelper.Write(Context.Memory, OutputPosition, Args);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuGpu
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvGpuGpu
|
||||||
|
|
||||||
AMemoryHelper.Write(Context.Memory, OutputPosition, Args);
|
AMemoryHelper.Write(Context.Memory, OutputPosition, Args);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostChannel
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostChannel
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostChannel
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostChannel
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostChannel
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostChannel
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostChannel
|
||||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostChannel
|
||||||
|
|
||||||
NvGpuPBEntry[] PushBuffer = NvGpuPushBuffer.Decode(Data);
|
NvGpuPBEntry[] PushBuffer = NvGpuPushBuffer.Decode(Data);
|
||||||
|
|
||||||
Context.Ns.Gpu.Fifo.PushBuffer(Vmm, PushBuffer);
|
Context.Device.Gpu.Fifo.PushBuffer(Vmm, PushBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NvChannel GetChannel(ServiceCtx Context, NvChannelName Channel)
|
public static NvChannel GetChannel(ServiceCtx Context, NvChannelName Channel)
|
||||||
|
|
|
@ -95,7 +95,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostCtrl
|
||||||
{
|
{
|
||||||
if (StringValue.Length > 0x100)
|
if (StringValue.Length > 0x100)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(Logging.LogClass.ServiceNv, $"{Domain}!{Name} String value size is too big!");
|
Context.Device.Log.PrintError(Logging.LogClass.ServiceNv, $"{Domain}!{Name} String value size is too big!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -118,7 +118,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostCtrl
|
||||||
|
|
||||||
Context.Memory.WriteBytes(OutputPosition + 0x82, SettingBuffer);
|
Context.Memory.WriteBytes(OutputPosition + 0x82, SettingBuffer);
|
||||||
|
|
||||||
Context.Ns.Log.PrintDebug(Logging.LogClass.ServiceNv, $"Got setting {Domain}!{Name}");
|
Context.Device.Log.PrintDebug(Logging.LogClass.ServiceNv, $"Got setting {Domain}!{Name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
|
@ -144,7 +144,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostCtrl
|
||||||
|
|
||||||
int EventId = Context.Memory.ReadInt32(InputPosition);
|
int EventId = Context.Memory.ReadInt32(InputPosition);
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceNv, "Stubbed.");
|
||||||
|
|
||||||
return NvResult.Success;
|
return NvResult.Success;
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostCtrl
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintDebug(LogClass.ServiceNv, "Waiting syncpt with timeout of " + Args.Timeout + "ms...");
|
Context.Device.Log.PrintDebug(LogClass.ServiceNv, "Waiting syncpt with timeout of " + Args.Timeout + "ms...");
|
||||||
|
|
||||||
using (ManualResetEvent WaitEvent = new ManualResetEvent(false))
|
using (ManualResetEvent WaitEvent = new ManualResetEvent(false))
|
||||||
{
|
{
|
||||||
|
@ -232,7 +232,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostCtrl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context.Ns.Log.PrintDebug(LogClass.ServiceNv, "Resuming...");
|
Context.Device.Log.PrintDebug(LogClass.ServiceNv, "Resuming...");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Extended)
|
if (Extended)
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
case 0x010e: return GetId (Context);
|
case 0x010e: return GetId (Context);
|
||||||
}
|
}
|
||||||
|
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Unsupported Ioctl command 0x{Cmd:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Unsupported Ioctl command 0x{Cmd:x8}!");
|
||||||
|
|
||||||
return NvResult.NotSupported;
|
return NvResult.NotSupported;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
|
|
||||||
if (Args.Size == 0)
|
if (Args.Size == 0)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid size 0x{Args.Size:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid size 0x{Args.Size:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
|
|
||||||
Args.Handle = AddNvMap(Context, new NvMapHandle(Size));
|
Args.Handle = AddNvMap(Context, new NvMapHandle(Size));
|
||||||
|
|
||||||
Context.Ns.Log.PrintInfo(LogClass.ServiceNv, $"Created map {Args.Handle} with size 0x{Size:x8}!");
|
Context.Device.Log.PrintInfo(LogClass.ServiceNv, $"Created map {Args.Handle} with size 0x{Size:x8}!");
|
||||||
|
|
||||||
AMemoryHelper.Write(Context.Memory, OutputPosition, Args);
|
AMemoryHelper.Write(Context.Memory, OutputPosition, Args);
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
|
|
||||||
if (Map == null)
|
if (Map == null)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -95,14 +95,14 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
|
|
||||||
if (Map == null)
|
if (Map == null)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Args.Align & (Args.Align - 1)) != 0)
|
if ((Args.Align & (Args.Align - 1)) != 0)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid alignment 0x{Args.Align:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid alignment 0x{Args.Align:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
//When the address is zero, we need to allocate
|
//When the address is zero, we need to allocate
|
||||||
//our own backing memory for the NvMap.
|
//our own backing memory for the NvMap.
|
||||||
//TODO: Is this allocation inside the transfer memory?
|
//TODO: Is this allocation inside the transfer memory?
|
||||||
if (!Context.Ns.Memory.Allocator.TryAllocate((uint)Size, out Address))
|
if (!Context.Device.Memory.Allocator.TryAllocate((uint)Size, out Address))
|
||||||
{
|
{
|
||||||
Result = NvResult.OutOfMemory;
|
Result = NvResult.OutOfMemory;
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
|
|
||||||
if (Map == null)
|
if (Map == null)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
{
|
{
|
||||||
DeleteNvMap(Context, Args.Handle);
|
DeleteNvMap(Context, Args.Handle);
|
||||||
|
|
||||||
Context.Ns.Log.PrintInfo(LogClass.ServiceNv, $"Deleted map {Args.Handle}!");
|
Context.Device.Log.PrintInfo(LogClass.ServiceNv, $"Deleted map {Args.Handle}!");
|
||||||
|
|
||||||
Args.Address = Map.Address;
|
Args.Address = Map.Address;
|
||||||
Args.Flags = 0;
|
Args.Flags = 0;
|
||||||
|
@ -197,7 +197,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
|
|
||||||
if (Map == null)
|
if (Map == null)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
|
||||||
|
|
||||||
if (Map == null)
|
if (Map == null)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
Context.Device.Log.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{Args.Handle:x8}!");
|
||||||
|
|
||||||
return NvResult.InvalidInput;
|
return NvResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace Ryujinx.HLE.OsHle.Services.Pctl
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServicePctl, "Service is already initialized!");
|
Context.Device.Log.PrintWarning(LogClass.ServicePctl, "Service is already initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace Ryujinx.HLE.OsHle.Services.Pl
|
||||||
{
|
{
|
||||||
SharedFontType FontType = (SharedFontType)Context.RequestData.ReadInt32();
|
SharedFontType FontType = (SharedFontType)Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
Context.ResponseData.Write(Context.Ns.Os.Font.GetFontSize(FontType));
|
Context.ResponseData.Write(Context.Device.System.Font.GetFontSize(FontType));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -56,16 +56,16 @@ namespace Ryujinx.HLE.OsHle.Services.Pl
|
||||||
{
|
{
|
||||||
SharedFontType FontType = (SharedFontType)Context.RequestData.ReadInt32();
|
SharedFontType FontType = (SharedFontType)Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
Context.ResponseData.Write(Context.Ns.Os.Font.GetSharedMemoryAddressOffset(FontType));
|
Context.ResponseData.Write(Context.Device.System.Font.GetSharedMemoryAddressOffset(FontType));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetSharedMemoryNativeHandle(ServiceCtx Context)
|
public long GetSharedMemoryNativeHandle(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Os.Font.EnsureInitialized();
|
Context.Device.System.Font.EnsureInitialized();
|
||||||
|
|
||||||
int Handle = Context.Process.HandleTable.OpenHandle(Context.Ns.Os.FontSharedMem);
|
int Handle = Context.Process.HandleTable.OpenHandle(Context.Device.System.FontSharedMem);
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
|
@ -115,9 +115,9 @@ namespace Ryujinx.HLE.OsHle.Services.Pl
|
||||||
|
|
||||||
Context.Memory.WriteInt32(TypesPosition + Offset, (int)FontType);
|
Context.Memory.WriteInt32(TypesPosition + Offset, (int)FontType);
|
||||||
|
|
||||||
Context.Memory.WriteInt32(OffsetsPosition + Offset, Context.Ns.Os.Font.GetSharedMemoryAddressOffset(FontType));
|
Context.Memory.WriteInt32(OffsetsPosition + Offset, Context.Device.System.Font.GetSharedMemoryAddressOffset(FontType));
|
||||||
|
|
||||||
Context.Memory.WriteInt32(FontSizeBufferPosition + Offset, Context.Ns.Os.Font.GetFontSize(FontType));
|
Context.Memory.WriteInt32(FontSizeBufferPosition + Offset, Context.Device.System.Font.GetFontSize(FontType));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Ryujinx.HLE.OsHle.Services.Prepo
|
||||||
|
|
||||||
public static long SaveReportWithUser(ServiceCtx Context)
|
public static long SaveReportWithUser(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServicePrepo, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServicePrepo, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Ryujinx.HLE.OsHle.Services.Set
|
||||||
|
|
||||||
public static long GetLanguageCode(ServiceCtx Context)
|
public static long GetLanguageCode(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(Context.Ns.Os.SystemState.DesiredLanguageCode);
|
Context.ResponseData.Write(Context.Device.System.State.DesiredLanguageCode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace Ryujinx.HLE.OsHle.Services.Set
|
||||||
|
|
||||||
public static long GetColorSetId(ServiceCtx Context)
|
public static long GetColorSetId(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write((int)Context.Ns.Os.SystemState.ThemeColor);
|
Context.ResponseData.Write((int)Context.Device.System.State.ThemeColor);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ namespace Ryujinx.HLE.OsHle.Services.Set
|
||||||
{
|
{
|
||||||
int ColorSetId = Context.RequestData.ReadInt32();
|
int ColorSetId = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
Context.Ns.Os.SystemState.ThemeColor = (ColorSet)ColorSetId;
|
Context.Device.System.State.ThemeColor = (ColorSet)ColorSetId;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ namespace Ryujinx.HLE.OsHle.Services.Set
|
||||||
{
|
{
|
||||||
if (StringValue.Length + 1 > ReplySize)
|
if (StringValue.Length + 1 > ReplySize)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(Logging.LogClass.ServiceSet, $"{AskedSetting} String value size is too big!");
|
Context.Device.Log.PrintError(Logging.LogClass.ServiceSet, $"{AskedSetting} String value size is too big!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -138,11 +138,11 @@ namespace Ryujinx.HLE.OsHle.Services.Set
|
||||||
|
|
||||||
Context.Memory.WriteBytes(ReplyPos, SettingBuffer);
|
Context.Memory.WriteBytes(ReplyPos, SettingBuffer);
|
||||||
|
|
||||||
Context.Ns.Log.PrintDebug(Logging.LogClass.ServiceSet, $"{AskedSetting} set value: {NxSetting} as {NxSetting.GetType()}");
|
Context.Device.Log.PrintDebug(Logging.LogClass.ServiceSet, $"{AskedSetting} set value: {NxSetting} as {NxSetting.GetType()}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintError(Logging.LogClass.ServiceSet, $"{AskedSetting} not found!");
|
Context.Device.Log.PrintError(Logging.LogClass.ServiceSet, $"{AskedSetting} not found!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace Ryujinx.HLE.OsHle.Services.Ssl
|
||||||
{
|
{
|
||||||
int Version = Context.RequestData.ReadInt32();
|
int Version = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceSsl, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceSsl, "Stubbed.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.OsHle.Services.Time
|
||||||
|
|
||||||
if (BufferSize != 0x4000)
|
if (BufferSize != 0x4000)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{BufferSize:x} (expected 0x4000)");
|
Context.Device.Log.PrintWarning(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{BufferSize:x} (expected 0x4000)");
|
||||||
}
|
}
|
||||||
|
|
||||||
long ResultCode = 0;
|
long ResultCode = 0;
|
||||||
|
@ -132,7 +132,7 @@ namespace Ryujinx.HLE.OsHle.Services.Time
|
||||||
}
|
}
|
||||||
catch (TimeZoneNotFoundException)
|
catch (TimeZoneNotFoundException)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceTime, $"Timezone not found for string: {TzID} (len: {TzID.Length})");
|
Context.Device.Log.PrintWarning(LogClass.ServiceTime, $"Timezone not found for string: {TzID} (len: {TzID.Length})");
|
||||||
|
|
||||||
ResultCode = MakeError(ErrorModule.Time, 0x3dd);
|
ResultCode = MakeError(ErrorModule.Time, 0x3dd);
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ namespace Ryujinx.HLE.OsHle.Services.Time
|
||||||
|
|
||||||
if (BufferSize != 0x4000)
|
if (BufferSize != 0x4000)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{BufferSize:x} (expected 0x4000)");
|
Context.Device.Log.PrintWarning(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{BufferSize:x} (expected 0x4000)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Reverse the TZif2 conversion in PCV to make this match with real hardware.
|
// TODO: Reverse the TZif2 conversion in PCV to make this match with real hardware.
|
||||||
|
@ -189,7 +189,7 @@ namespace Ryujinx.HLE.OsHle.Services.Time
|
||||||
}
|
}
|
||||||
catch (TimeZoneNotFoundException)
|
catch (TimeZoneNotFoundException)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceTime, $"Timezone not found for string: {TzID} (len: {TzID.Length})");
|
Context.Device.Log.PrintWarning(LogClass.ServiceTime, $"Timezone not found for string: {TzID} (len: {TzID.Length})");
|
||||||
|
|
||||||
ResultCode = MakeError(ErrorModule.Time, 0x3dd);
|
ResultCode = MakeError(ErrorModule.Time, 0x3dd);
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ namespace Ryujinx.HLE.OsHle.Services.Time
|
||||||
|
|
||||||
if (BufferSize != 0x4000)
|
if (BufferSize != 0x4000)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{BufferSize:x} (expected 0x4000)");
|
Context.Device.Log.PrintWarning(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{BufferSize:x} (expected 0x4000)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Reverse the TZif2 conversion in PCV to make this match with real hardware.
|
// TODO: Reverse the TZif2 conversion in PCV to make this match with real hardware.
|
||||||
|
@ -239,7 +239,7 @@ namespace Ryujinx.HLE.OsHle.Services.Time
|
||||||
}
|
}
|
||||||
catch (TimeZoneNotFoundException)
|
catch (TimeZoneNotFoundException)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintWarning(LogClass.ServiceTime, $"Timezone not found for string: {TzID} (len: {TzID.Length})");
|
Context.Device.Log.PrintWarning(LogClass.ServiceTime, $"Timezone not found for string: {TzID} (len: {TzID.Length})");
|
||||||
|
|
||||||
ResultCode = MakeError(ErrorModule.Time, 0x3dd);
|
ResultCode = MakeError(ErrorModule.Time, 0x3dd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace Ryujinx.HLE.OsHle.Services.Vi
|
||||||
|
|
||||||
public long GetRelayService(ServiceCtx Context)
|
public long GetRelayService(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
MakeObject(Context, new IHOSBinderDriver(Context.Ns.Gpu.Renderer));
|
MakeObject(Context, new IHOSBinderDriver(Context.Device.Gpu.Renderer));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ namespace Ryujinx.HLE.OsHle.Services.Vi
|
||||||
|
|
||||||
public long GetIndirectDisplayTransactionService(ServiceCtx Context)
|
public long GetIndirectDisplayTransactionService(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
MakeObject(Context, new IHOSBinderDriver(Context.Ns.Gpu.Renderer));
|
MakeObject(Context, new IHOSBinderDriver(Context.Device.Gpu.Renderer));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ namespace Ryujinx.HLE.OsHle.Services.Vi
|
||||||
{
|
{
|
||||||
string Name = GetDisplayName(Context);
|
string Name = GetDisplayName(Context);
|
||||||
|
|
||||||
int Handle = Context.Process.HandleTable.OpenHandle(Context.Ns.Os.VsyncEvent);
|
int Handle = Context.Process.HandleTable.OpenHandle(Context.Device.System.VsyncEvent);
|
||||||
|
|
||||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
|
||||||
|
|
||||||
|
|
|
@ -23,26 +23,26 @@ namespace Ryujinx.HLE.OsHle.Services.Vi
|
||||||
|
|
||||||
public static long CreateManagedLayer(ServiceCtx Context)
|
public static long CreateManagedLayer(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
||||||
Context.ResponseData.Write(0L); //LayerId
|
Context.ResponseData.Write(0L); //LayerId
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long DestroyManagedLayer(ServiceCtx Context)
|
public long DestroyManagedLayer(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long AddToLayerStack(ServiceCtx Context)
|
public static long AddToLayerStack(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long SetLayerVisibility(ServiceCtx Context)
|
public static long SetLayerVisibility(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,13 +22,13 @@ namespace Ryujinx.HLE.OsHle.Services.Vi
|
||||||
|
|
||||||
public static long SetLayerZ(ServiceCtx Context)
|
public static long SetLayerZ(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long SetLayerVisibility(ServiceCtx Context)
|
public static long SetLayerVisibility(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceVi, "Stubbed.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ namespace Ryujinx.HLE.OsHle.Services.Android
|
||||||
|
|
||||||
if (Commands.TryGetValue((InterfaceName, Code), out ServiceProcessParcel ProcReq))
|
if (Commands.TryGetValue((InterfaceName, Code), out ServiceProcessParcel ProcReq))
|
||||||
{
|
{
|
||||||
Context.Ns.Log.PrintDebug(LogClass.ServiceVi, $"{InterfaceName} {ProcReq.Method.Name}");
|
Context.Device.Log.PrintDebug(LogClass.ServiceVi, $"{InterfaceName} {ProcReq.Method.Name}");
|
||||||
|
|
||||||
return ProcReq(Context, Reader);
|
return ProcReq(Context, Reader);
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ namespace Ryujinx.HLE.OsHle.Services.Android
|
||||||
|
|
||||||
private long GbpQueueBuffer(ServiceCtx Context, BinaryReader ParcelReader)
|
private long GbpQueueBuffer(ServiceCtx Context, BinaryReader ParcelReader)
|
||||||
{
|
{
|
||||||
Context.Ns.Statistics.RecordGameFrameTime();
|
Context.Device.Statistics.RecordGameFrameTime();
|
||||||
|
|
||||||
//TODO: Errors.
|
//TODO: Errors.
|
||||||
int Slot = ParcelReader.ReadInt32();
|
int Slot = ParcelReader.ReadInt32();
|
||||||
|
@ -307,7 +307,7 @@ namespace Ryujinx.HLE.OsHle.Services.Android
|
||||||
|
|
||||||
//TODO: Support double buffering here aswell, it is broken for GPU
|
//TODO: Support double buffering here aswell, it is broken for GPU
|
||||||
//frame buffers because it seems to be completely out of sync.
|
//frame buffers because it seems to be completely out of sync.
|
||||||
if (Context.Ns.Gpu.Engine3d.IsFrameBufferPosition(FbAddr))
|
if (Context.Device.Gpu.Engine3d.IsFrameBufferPosition(FbAddr))
|
||||||
{
|
{
|
||||||
//Frame buffer is rendered to by the GPU, we can just
|
//Frame buffer is rendered to by the GPU, we can just
|
||||||
//bind the frame buffer texture, it's not necessary to read anything.
|
//bind the frame buffer texture, it's not necessary to read anything.
|
||||||
|
@ -324,7 +324,7 @@ namespace Ryujinx.HLE.OsHle.Services.Android
|
||||||
Renderer.QueueAction(() => Renderer.FrameBuffer.Set(Data, FbWidth, FbHeight));
|
Renderer.QueueAction(() => Renderer.FrameBuffer.Set(Data, FbWidth, FbHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
Context.Ns.Gpu.Renderer.QueueAction(() => ReleaseBuffer(Slot));
|
Context.Device.Gpu.Renderer.QueueAction(() => ReleaseBuffer(Slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReleaseBuffer(int Slot)
|
private void ReleaseBuffer(int Slot)
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Ryujinx.HLE
|
||||||
|
|
||||||
internal VirtualFileSystem VFs { get; private set; }
|
internal VirtualFileSystem VFs { get; private set; }
|
||||||
|
|
||||||
public Horizon Os { get; private set; }
|
public Horizon System { get; private set; }
|
||||||
|
|
||||||
public PerformanceStatistics Statistics { get; private set; }
|
public PerformanceStatistics Statistics { get; private set; }
|
||||||
|
|
||||||
|
@ -51,21 +51,21 @@ namespace Ryujinx.HLE
|
||||||
|
|
||||||
VFs = new VirtualFileSystem();
|
VFs = new VirtualFileSystem();
|
||||||
|
|
||||||
Os = new Horizon(this);
|
System = new Horizon(this);
|
||||||
|
|
||||||
Statistics = new PerformanceStatistics();
|
Statistics = new PerformanceStatistics();
|
||||||
|
|
||||||
Hid = new Hid(this, Os.HidSharedMem.PA);
|
Hid = new Hid(this, System.HidSharedMem.PA);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadCart(string ExeFsDir, string RomFsFile = null)
|
public void LoadCart(string ExeFsDir, string RomFsFile = null)
|
||||||
{
|
{
|
||||||
Os.LoadCart(ExeFsDir, RomFsFile);
|
System.LoadCart(ExeFsDir, RomFsFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadProgram(string FileName)
|
public void LoadProgram(string FileName)
|
||||||
{
|
{
|
||||||
Os.LoadProgram(FileName);
|
System.LoadProgram(FileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool WaitFifo()
|
public bool WaitFifo()
|
||||||
|
@ -80,7 +80,7 @@ namespace Ryujinx.HLE
|
||||||
|
|
||||||
public virtual void OnFinish(EventArgs e)
|
public virtual void OnFinish(EventArgs e)
|
||||||
{
|
{
|
||||||
Os.Dispose();
|
System.Dispose();
|
||||||
Finish?.Invoke(this, e);
|
Finish?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ namespace Ryujinx.HLE
|
||||||
{
|
{
|
||||||
if (Disposing)
|
if (Disposing)
|
||||||
{
|
{
|
||||||
Os.Dispose();
|
System.Dispose();
|
||||||
VFs.Dispose();
|
VFs.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace Ryujinx
|
||||||
Device.Log.SetEnable(LogLevel.Warning, Convert.ToBoolean(Parser.Value("Logging_Enable_Warn")));
|
Device.Log.SetEnable(LogLevel.Warning, Convert.ToBoolean(Parser.Value("Logging_Enable_Warn")));
|
||||||
Device.Log.SetEnable(LogLevel.Error, Convert.ToBoolean(Parser.Value("Logging_Enable_Error")));
|
Device.Log.SetEnable(LogLevel.Error, Convert.ToBoolean(Parser.Value("Logging_Enable_Error")));
|
||||||
|
|
||||||
Device.Os.SystemState.DockedMode = Convert.ToBoolean(Parser.Value("Docked_Mode"));
|
Device.System.State.DockedMode = Convert.ToBoolean(Parser.Value("Docked_Mode"));
|
||||||
|
|
||||||
string[] FilteredLogClasses = Parser.Value("Logging_Filtered_Classes").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
string[] FilteredLogClasses = Parser.Value("Logging_Filtered_Classes").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace Ryujinx
|
||||||
|
|
||||||
private const int TargetFPS = 60;
|
private const int TargetFPS = 60;
|
||||||
|
|
||||||
private Switch Ns;
|
private Switch Device;
|
||||||
|
|
||||||
private IGalRenderer Renderer;
|
private IGalRenderer Renderer;
|
||||||
|
|
||||||
|
@ -34,13 +34,13 @@ namespace Ryujinx
|
||||||
|
|
||||||
private string NewTitle;
|
private string NewTitle;
|
||||||
|
|
||||||
public GLScreen(Switch Ns, IGalRenderer Renderer)
|
public GLScreen(Switch Device, IGalRenderer Renderer)
|
||||||
: base(1280, 720,
|
: base(1280, 720,
|
||||||
new GraphicsMode(), "Ryujinx", 0,
|
new GraphicsMode(), "Ryujinx", 0,
|
||||||
DisplayDevice.Default, 3, 3,
|
DisplayDevice.Default, 3, 3,
|
||||||
GraphicsContextFlags.ForwardCompatible)
|
GraphicsContextFlags.ForwardCompatible)
|
||||||
{
|
{
|
||||||
this.Ns = Ns;
|
this.Device = Device;
|
||||||
this.Renderer = Renderer;
|
this.Renderer = Renderer;
|
||||||
|
|
||||||
Location = new Point(
|
Location = new Point(
|
||||||
|
@ -62,9 +62,9 @@ namespace Ryujinx
|
||||||
|
|
||||||
while (Exists && !IsExiting)
|
while (Exists && !IsExiting)
|
||||||
{
|
{
|
||||||
if (Ns.WaitFifo())
|
if (Device.WaitFifo())
|
||||||
{
|
{
|
||||||
Ns.ProcessFrame();
|
Device.ProcessFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
Renderer.RunActions();
|
Renderer.RunActions();
|
||||||
|
@ -225,23 +225,23 @@ namespace Ryujinx
|
||||||
|
|
||||||
HasTouch = true;
|
HasTouch = true;
|
||||||
|
|
||||||
Ns.Hid.SetTouchPoints(CurrentPoint);
|
Device.Hid.SetTouchPoints(CurrentPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HasTouch)
|
if (!HasTouch)
|
||||||
{
|
{
|
||||||
Ns.Hid.SetTouchPoints();
|
Device.Hid.SetTouchPoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ns.Hid.SetJoyconButton(
|
Device.Hid.SetJoyconButton(
|
||||||
HidControllerId.CONTROLLER_HANDHELD,
|
HidControllerId.CONTROLLER_HANDHELD,
|
||||||
HidControllerLayouts.Handheld_Joined,
|
HidControllerLayouts.Handheld_Joined,
|
||||||
CurrentButton,
|
CurrentButton,
|
||||||
LeftJoystick,
|
LeftJoystick,
|
||||||
RightJoystick);
|
RightJoystick);
|
||||||
|
|
||||||
Ns.Hid.SetJoyconButton(
|
Device.Hid.SetJoyconButton(
|
||||||
HidControllerId.CONTROLLER_HANDHELD,
|
HidControllerId.CONTROLLER_HANDHELD,
|
||||||
HidControllerLayouts.Main,
|
HidControllerLayouts.Main,
|
||||||
CurrentButton,
|
CurrentButton,
|
||||||
|
@ -253,10 +253,10 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
Renderer.FrameBuffer.Render();
|
Renderer.FrameBuffer.Render();
|
||||||
|
|
||||||
Ns.Statistics.RecordSystemFrameTime();
|
Device.Statistics.RecordSystemFrameTime();
|
||||||
|
|
||||||
double HostFps = Ns.Statistics.GetSystemFrameRate();
|
double HostFps = Device.Statistics.GetSystemFrameRate();
|
||||||
double GameFps = Ns.Statistics.GetGameFrameRate();
|
double GameFps = Device.Statistics.GetGameFrameRate();
|
||||||
|
|
||||||
NewTitle = $"Ryujinx | Host FPS: {HostFps:0.0} | Game FPS: {GameFps:0.0}";
|
NewTitle = $"Ryujinx | Host FPS: {HostFps:0.0} | Game FPS: {GameFps:0.0}";
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ namespace Ryujinx
|
||||||
|
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
|
|
||||||
Ns.Os.SignalVsync();
|
Device.System.SignalVsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnUnload(EventArgs e)
|
protected override void OnUnload(EventArgs e)
|
||||||
|
|
|
@ -18,11 +18,11 @@ namespace Ryujinx
|
||||||
|
|
||||||
IAalOutput AudioOut = new OpenALAudioOut();
|
IAalOutput AudioOut = new OpenALAudioOut();
|
||||||
|
|
||||||
Switch Ns = new Switch(Renderer, AudioOut);
|
Switch Device = new Switch(Renderer, AudioOut);
|
||||||
|
|
||||||
Config.Read(Ns);
|
Config.Read(Device);
|
||||||
|
|
||||||
Ns.Log.Updated += ConsoleLog.PrintLog;
|
Device.Log.Updated += ConsoleLog.PrintLog;
|
||||||
|
|
||||||
if (args.Length == 1)
|
if (args.Length == 1)
|
||||||
{
|
{
|
||||||
|
@ -39,20 +39,20 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
Console.WriteLine("Loading as cart with RomFS.");
|
Console.WriteLine("Loading as cart with RomFS.");
|
||||||
|
|
||||||
Ns.LoadCart(args[0], RomFsFiles[0]);
|
Device.LoadCart(args[0], RomFsFiles[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("Loading as cart WITHOUT RomFS.");
|
Console.WriteLine("Loading as cart WITHOUT RomFS.");
|
||||||
|
|
||||||
Ns.LoadCart(args[0]);
|
Device.LoadCart(args[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (File.Exists(args[0]))
|
else if (File.Exists(args[0]))
|
||||||
{
|
{
|
||||||
Console.WriteLine("Loading as homebrew.");
|
Console.WriteLine("Loading as homebrew.");
|
||||||
|
|
||||||
Ns.LoadProgram(args[0]);
|
Device.LoadProgram(args[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -60,15 +60,15 @@ namespace Ryujinx
|
||||||
Console.WriteLine("Please specify the folder with the NSOs/IStorage or a NSO/NRO.");
|
Console.WriteLine("Please specify the folder with the NSOs/IStorage or a NSO/NRO.");
|
||||||
}
|
}
|
||||||
|
|
||||||
using (GLScreen Screen = new GLScreen(Ns, Renderer))
|
using (GLScreen Screen = new GLScreen(Device, Renderer))
|
||||||
{
|
{
|
||||||
Ns.Finish += (Sender, Args) =>
|
Device.Finish += (Sender, Args) =>
|
||||||
{
|
{
|
||||||
Screen.Exit();
|
Screen.Exit();
|
||||||
};
|
};
|
||||||
|
|
||||||
Screen.MainLoop();
|
Screen.MainLoop();
|
||||||
Ns.OnFinish(EventArgs.Empty);
|
Device.OnFinish(EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue