diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2019-07-01 21:39:22 -0500 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2019-07-02 04:39:22 +0200 |
| commit | b2b736abc2569ab5d8199da666aef8d8394844a0 (patch) | |
| tree | 88bcc2ae4fb0d4161c95df2cd7edb12388de922a /Ryujinx.HLE/HOS | |
| parent | 10c74182babaf8cf6bedaeffd64c3109df4ea816 (diff) | |
Misc cleanup (#708)
* Fix typos
* Remove unneeded using statements
* Enforce var style more
* Remove redundant qualifiers
* Fix some indentation
* Disable naming warnings on files with external enum names
* Fix build
* Mass find & replace for comments with no spacing
* Standardize todo capitalization and for/if spacing
Diffstat (limited to 'Ryujinx.HLE/HOS')
75 files changed, 294 insertions, 300 deletions
diff --git a/Ryujinx.HLE/HOS/Diagnostics/Demangler/Demangler.cs b/Ryujinx.HLE/HOS/Diagnostics/Demangler/Demangler.cs index b654ba79..1e621121 100644 --- a/Ryujinx.HLE/HOS/Diagnostics/Demangler/Demangler.cs +++ b/Ryujinx.HLE/HOS/Diagnostics/Demangler/Demangler.cs @@ -546,7 +546,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler _position += 2; // FIXME: GNU c++flit returns this but that is not what is supposed to be returned. return new NameType("half"); - //return new NameType("decimal16"); + // return new NameType("decimal16"); case 'i': _position += 2; return new NameType("char32_t"); @@ -560,7 +560,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler _position += 2; // FIXME: GNU c++flit returns this but that is not what is supposed to be returned. return new NameType("decltype(nullptr)"); - //return new NameType("std::nullptr_t"); + // return new NameType("std::nullptr_t"); case 't': case 'T': _position += 2; @@ -1314,7 +1314,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler if (result != null) { // TODO: ABI Tags - //throw new Exception("ABI Tags not implemented"); + // throw new Exception("ABI Tags not implemented"); } return result; } @@ -2909,7 +2909,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler } } while (!ConsumeIf("E")); } - // ::= sr <unresolved-type> [tempate-args] <base-unresolved-name> # T::x / decltype(p)::x + // ::= sr <unresolved-type> [template-args] <base-unresolved-name> # T::x / decltype(p)::x else { result = ParseUnresolvedType(); diff --git a/Ryujinx.HLE/HOS/Homebrew.cs b/Ryujinx.HLE/HOS/Homebrew.cs index b0e05554..b11a4640 100644 --- a/Ryujinx.HLE/HOS/Homebrew.cs +++ b/Ryujinx.HLE/HOS/Homebrew.cs @@ -7,26 +7,26 @@ namespace Ryujinx.HLE.HOS { public const string TemporaryNroSuffix = ".ryu_tmp.nro"; - //http://switchbrew.org/index.php?title=Homebrew_ABI + // http://switchbrew.org/index.php?title=Homebrew_ABI public static void WriteHbAbiData(MemoryManager memory, long position, int mainThreadHandle, string switchPath) { - //MainThreadHandle. + // MainThreadHandle. WriteConfigEntry(memory, ref position, 1, 0, mainThreadHandle); - //NextLoadPath. + // NextLoadPath. WriteConfigEntry(memory, ref position, 2, 0, position + 0x200, position + 0x400); - //Argv. + // Argv. long argvPosition = position + 0xC00; memory.WriteBytes(argvPosition, Encoding.ASCII.GetBytes(switchPath + "\0")); WriteConfigEntry(memory, ref position, 5, 0, 0, argvPosition); - //AppletType. + // AppletType. WriteConfigEntry(memory, ref position, 7); - //EndOfList. + // EndOfList. WriteConfigEntry(memory, ref position, 0); } diff --git a/Ryujinx.HLE/HOS/HomebrewRomFsStream.cs b/Ryujinx.HLE/HOS/HomebrewRomFsStream.cs index f39faf4d..59bc881f 100644 --- a/Ryujinx.HLE/HOS/HomebrewRomFsStream.cs +++ b/Ryujinx.HLE/HOS/HomebrewRomFsStream.cs @@ -53,7 +53,7 @@ namespace Ryujinx.HLE.HOS offset += _positionOffset; } - return _baseStream.Seek(offset, origin); + return _baseStream.Seek(offset, origin); } public override void SetLength(long value) diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 95cd30f0..496fbdbe 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -156,8 +156,8 @@ namespace Ryujinx.HLE.HOS AutoObjectNames = new ConcurrentDictionary<string, KAutoObject>(); - //Note: This is not really correct, but with HLE of services, the only memory - //region used that is used is Application, so we can use the other ones for anything. + // Note: This is not really correct, but with HLE of services, the only memory + // region used that is used is Application, so we can use the other ones for anything. KMemoryRegionManager region = MemoryRegions[(int)MemoryRegion.NvServices]; ulong hidPa = region.Address; @@ -660,7 +660,7 @@ namespace Ryujinx.HLE.HOS { if (disposing) { - //Force all threads to exit. + // Force all threads to exit. lock (Processes) { foreach (KProcess process in Processes.Values) @@ -669,8 +669,8 @@ namespace Ryujinx.HLE.HOS } } - //It's only safe to release resources once all threads - //have exited. + // It's only safe to release resources once all threads + // have exited. ThreadCounter.Signal(); ThreadCounter.Wait(); diff --git a/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs b/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs index 9f087a1a..e940d774 100644 --- a/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs +++ b/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs @@ -72,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Ipc break; } - //TODO: Whats the difference between IpcDuplicateSession/Ex? + // TODO: Whats the difference between IpcDuplicateSession/Ex? case 2: case 4: { @@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Ipc } else if (request.Type == IpcMessageType.CloseSession) { - //TODO + // TODO } else { diff --git a/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs b/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs index 85b6820a..012c3167 100644 --- a/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs +++ b/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs @@ -133,9 +133,9 @@ namespace Ryujinx.HLE.HOS.Ipc int pad0 = (int)GetPadSize16(cmdPtr + 8 + handleData.Length); - //Apparently, padding after Raw Data is 16 bytes, however when there is - //padding before Raw Data too, we need to subtract the size of this padding. - //This is the weirdest padding I've seen so far... + // Apparently, padding after Raw Data is 16 bytes, however when there is + // padding before Raw Data too, we need to subtract the size of this padding. + // This is the weirdest padding I've seen so far... int pad1 = 0x10 - pad0; dataLength = (dataLength + pad0 + pad1) / 4; diff --git a/Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs b/Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs index 2a2aa743..bbb75f18 100644 --- a/Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs +++ b/Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs @@ -114,9 +114,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Common nvServicesRg = new KMemoryArrangeRegion(nvServicesRgEnd - nvServicesRgSize, nvServicesRgSize); appletRg = new KMemoryArrangeRegion(nvServicesRgEnd, appletRgSize); - //Note: There is an extra region used by the kernel, however - //since we are doing HLE we are not going to use that memory, so give all - //the remaining memory space to services. + // Note: There is an extra region used by the kernel, however + // since we are doing HLE we are not going to use that memory, so give all + // the remaining memory space to services. ulong serviceRgSize = nvServicesRg.Address - DramMemoryMap.SlabHeapEnd; serviceRg = new KMemoryArrangeRegion(DramMemoryMap.SlabHeapEnd, serviceRgSize); diff --git a/Ryujinx.HLE/HOS/Kernel/Common/MersenneTwister.cs b/Ryujinx.HLE/HOS/Kernel/Common/MersenneTwister.cs index 6b686901..7f767c1c 100644 --- a/Ryujinx.HLE/HOS/Kernel/Common/MersenneTwister.cs +++ b/Ryujinx.HLE/HOS/Kernel/Common/MersenneTwister.cs @@ -34,16 +34,16 @@ namespace Ryujinx.HLE.HOS.Kernel.Common if (range == -1) { - //Increment would cause a overflow, special case. + // Increment would cause a overflow, special case. return GenRandomNumber(2, 2, 32, 0xffffffffu, 0xffffffffu); } range++; - //This is log2(Range) plus one. + // This is log2(Range) plus one. int nextRangeLog2 = 64 - BitUtils.CountLeadingZeros64(range); - //If Range is already power of 2, subtract one to use log2(Range) directly. + // If Range is already power of 2, subtract one to use log2(Range) directly. int rangeLog2 = nextRangeLog2 - (BitUtils.IsPowerOfTwo64(range) ? 1 : 0); int parts = rangeLog2 > 32 ? 2 : 1; diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KBufferDescriptorTable.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KBufferDescriptorTable.cs index ac805bee..6aa211dd 100644 --- a/Ryujinx.HLE/HOS/Kernel/Ipc/KBufferDescriptorTable.cs +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KBufferDescriptorTable.cs @@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc ulong clientAddrTruncated = BitUtils.AlignDown(desc.ClientAddress, KMemoryManager.PageSize); ulong clientAddrRounded = BitUtils.AlignUp (desc.ClientAddress, KMemoryManager.PageSize); - //Check if address is not aligned, in this case we need to perform 2 copies. + // Check if address is not aligned, in this case we need to perform 2 copies. if (clientAddrTruncated != clientAddrRounded) { ulong copySize = clientAddrRounded - desc.ClientAddress; diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs index eaa4322d..901b0222 100644 --- a/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs @@ -16,8 +16,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc private object _countIncLock; - //TODO: Remove that, we need it for now to allow HLE - //SM implementation to work with the new IPC system. + // TODO: Remove that, we need it for now to allow HLE + // SM implementation to work with the new IPC system. public IpcService Service { get; set; } public KClientPort(Horizon system, KPort parent, int maxSessions) : base(system) diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KClientSession.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KClientSession.cs index f139d3d4..a5109e96 100644 --- a/Ryujinx.HLE/HOS/Kernel/Ipc/KClientSession.cs +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KClientSession.cs @@ -13,8 +13,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc public ChannelState State { get; set; } - //TODO: Remove that, we need it for now to allow HLE - //services implementation to work with the new IPC system. + // TODO: Remove that, we need it for now to allow HLE + // services implementation to work with the new IPC system. public IpcService Service { get; set; } public KClientSession(Horizon system, KSession parent) : base(system) diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs index 5a45ff4a..7fba645f 100644 --- a/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs @@ -327,7 +327,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc uint offset; - //Copy handles. + // Copy handles. if (clientHeader.HasHandles) { if (clientHeader.MoveHandlesCount != 0) @@ -399,7 +399,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc offset = 2; } - //Copy pointer/receive list buffers. + // Copy pointer/receive list buffers. uint recvListDstOffset = 0; for (int index = 0; index < clientHeader.PointerBuffersCount; index++) @@ -455,7 +455,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc offset += 2; } - //Copy send, receive and exchange buffers. + // Copy send, receive and exchange buffers. uint totalBuffersCount = clientHeader.SendBuffersCount + clientHeader.ReceiveBuffersCount + @@ -551,7 +551,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc offset += 3; } - //Copy raw data. + // Copy raw data. if (clientHeader.RawDataSizeInWords != 0) { ulong copySrc = clientMsg.Address + offset * 4; @@ -683,13 +683,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc return KernelResult.InvalidCombination; } - //Read receive list. + // Read receive list. ulong[] receiveList = GetReceiveList( clientMsg, clientHeader.ReceiveListType, clientHeader.ReceiveListOffset); - //Copy receive and exchange buffers. + // Copy receive and exchange buffers. clientResult = request.BufferDescriptorTable.CopyBuffersToClient(clientProcess.MemoryManager); if (clientResult != KernelResult.Success) @@ -699,11 +699,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc return serverResult; } - //Copy header. + // Copy header. System.Device.Memory.WriteUInt32((long)clientMsg.DramAddress + 0, serverHeader.Word0); System.Device.Memory.WriteUInt32((long)clientMsg.DramAddress + 4, serverHeader.Word1); - //Copy handles. + // Copy handles. uint offset; if (serverHeader.HasHandles) @@ -763,7 +763,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc offset = 2; } - //Copy pointer/receive list buffers. + // Copy pointer/receive list buffers. uint recvListDstOffset = 0; for (int index = 0; index < serverHeader.PointerBuffersCount; index++) @@ -811,7 +811,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc offset += 2; } - //Set send, receive and exchange buffer descriptors to zero. + // Set send, receive and exchange buffer descriptors to zero. uint totalBuffersCount = serverHeader.SendBuffersCount + serverHeader.ReceiveBuffersCount + @@ -828,7 +828,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc offset += 3; } - //Copy raw data. + // Copy raw data. if (serverHeader.RawDataSizeInWords != 0) { ulong copyDst = clientMsg.Address + offset * 4; @@ -861,7 +861,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc } } - //Unmap buffers from server. + // Unmap buffers from server. clientResult = request.BufferDescriptorTable.UnmapServerBuffers(serverProcess.MemoryManager); if (clientResult != KernelResult.Success) @@ -1125,9 +1125,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc continue; } - //Client sessions can only be disconnected on async requests (because - //the client would be otherwise blocked waiting for the response), so - //we only need to handle the async case here. + // Client sessions can only be disconnected on async requests (because + // the client would be otherwise blocked waiting for the response), so + // we only need to handle the async case here. if (request.AsyncEvent != null) { SendResultToAsyncRequestClient(request, KernelResult.PortRemoteClosed); @@ -1204,7 +1204,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc private void WakeClientThread(KSessionRequest request, KernelResult result) { - //Wait client thread waiting for a response for the given request. + // Wait client thread waiting for a response for the given request. if (request.AsyncEvent != null) { SendResultToAsyncRequestClient(request, result); @@ -1237,7 +1237,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc private void WakeServerThreads(KernelResult result) { - //Wake all server threads waiting for requests. + // Wake all server threads waiting for requests. System.CriticalSection.Enter(); foreach (KThread thread in WaitingThreads) diff --git a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs index 7a40139c..448ae54c 100644 --- a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs +++ b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs @@ -23,8 +23,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory private const int KMemoryBlockSize = 0x40; - //We need 2 blocks for the case where a big block - //needs to be split in 2, plus one block that will be the new one inserted. + // We need 2 blocks for the case where a big block + // needs to be split in 2, plus one block that will be the new one inserted. private const int MaxBlocksNeededForInsertion = 2; private LinkedList<KMemoryBlock> _blocks; @@ -215,13 +215,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory if (CodeRegionStart - baseAddress >= addrSpaceEnd - CodeRegionEnd) { - //Has more space before the start of the code region. + // Has more space before the start of the code region. mapBaseAddress = baseAddress; mapAvailableSize = CodeRegionStart - baseAddress; } else { - //Has more space after the end of the code region. + // Has more space after the end of the code region. mapBaseAddress = CodeRegionEnd; mapAvailableSize = addrSpaceEnd - CodeRegionEnd; } @@ -250,8 +250,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory tlsIoRegion.AslrOffset = GetRandomValue(0, aslrMaxOffset >> 21) << 21; } - //Regions are sorted based on ASLR offset. - //When ASLR is disabled, the order is Map, Heap, NewMap and TlsIo. + // Regions are sorted based on ASLR offset. + // When ASLR is disabled, the order is Map, Heap, NewMap and TlsIo. aliasRegion.Start = mapBaseAddress + aliasRegion.AslrOffset; aliasRegion.End = aliasRegion.Start + aliasRegion.Size; heapRegion.Start = mapBaseAddress + heapRegion.AslrOffset; @@ -336,8 +336,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory private KernelResult InitializeBlocks(ulong addrSpaceStart, ulong addrSpaceEnd) { - //First insertion will always need only a single block, - //because there's nothing else to split. + // First insertion will always need only a single block, + // because there's nothing else to split. if (!_blockAllocator.CanAllocate(1)) { return KernelResult.OutOfResource; @@ -466,13 +466,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory public KernelResult MapNormalMemory(long address, long size, MemoryPermission permission) { - //TODO. + // TODO. return KernelResult.Success; } public KernelResult MapIoMemory(long address, long size, MemoryPermission permission) { - //TODO. + // TODO. return KernelResult.Success; } @@ -696,7 +696,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory return result; } - //TODO: Missing some checks here. + // TODO: Missing some checks here. if (!_blockAllocator.CanAllocate(MaxBlocksNeededForInsertion * 2)) { @@ -730,7 +730,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory if (currentHeapSize <= size) { - //Expand. + // Expand. ulong diffSize = size - currentHeapSize; lock (_blocks) @@ -800,7 +800,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory } else { - //Shrink. + // Shrink. ulong freeAddr = HeapRegionStart + size; ulong diffSize = currentHeapSize - size; @@ -1147,7 +1147,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory out _, out MemoryAttribute attribute)) { - //TODO: Missing checks. + // TODO: Missing checks. if (!_blockAllocator.CanAllocate(MaxBlocksNeededForInsertion)) { @@ -1225,8 +1225,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory { MemoryState newState = oldState; - //If writing into the code region is allowed, then we need - //to change it to mutable. + // If writing into the code region is allowed, then we need + // to change it to mutable. if ((permission & MemoryPermission.Write) != 0) { if (oldState == MemoryState.CodeStatic) @@ -1362,8 +1362,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory lock (_blocks) { - //Scan, ensure that the region can be unmapped (all blocks are heap or - //already unmapped), fill pages list for freeing memory. + // Scan, ensure that the region can be unmapped (all blocks are heap or + // already unmapped), fill pages list for freeing memory. ulong heapMappedSize = 0; KPageList pageList = new KPageList(); @@ -1400,7 +1400,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory return KernelResult.OutOfResource; } - //Try to unmap all the heap mapped memory inside range. + // Try to unmap all the heap mapped memory inside range. KernelResult result = KernelResult.Success; foreach (KMemoryInfo info in IterateOverRange(address, endAddr)) @@ -1416,7 +1416,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory if (result != KernelResult.Success) { - //If we failed to unmap, we need to remap everything back again. + // If we failed to unmap, we need to remap everything back again. MapPhysicalMemory(pageList, address, blockAddress + blockSize); break; @@ -1508,7 +1508,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory MemoryAttribute attributeMask, MemoryAttribute attributeExpected) { - //Client -> server. + // Client -> server. return CopyDataFromOrToCurrentProcess( size, src, @@ -1531,7 +1531,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory MemoryAttribute attributeExpected, ulong src) { - //Server -> client. + // Server -> client. return CopyDataFromOrToCurrentProcess( size, dst, @@ -1731,7 +1731,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory foreach (KMemoryInfo info in IterateOverRange(address, endAddrRounded)) { - //Check if the block state matches what we expect. + // Check if the block state matches what we expect. if ((info.State & stateMask) != stateMask || (info.Permission & permission) != permission || (info.Attribute & attributeMask) != MemoryAttribute.None) @@ -1830,12 +1830,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory ulong unusedSizeAfter; - //When the start address is unaligned, we can't safely map the - //first page as it would expose other undesirable information on the - //target process. So, instead we allocate new pages, copy the data - //inside the range, and then clear the remaining space. - //The same also holds for the last page, if the end address - //(address + size) is also not aligned. + // When the start address is unaligned, we can't safely map the + // first page as it would expose other undesirable information on the + // target process. So, instead we allocate new pages, copy the data + // inside the range, and then clear the remaining space. + // The same also holds for the last page, if the end address + // (address + size) is also not aligned. if (copyData) { ulong unusedSizeBefore = address - addressTruncated; @@ -1883,7 +1883,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory if (endAddrTruncated != endAddrRounded) { - //End is also not aligned... + // End is also not aligned... dstLastPagePa = AllocateSinglePage(region, aslrDisabled); if (dstLastPagePa == 0) @@ -1980,9 +1980,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory for (int unit = MappingUnitSizes.Length - 1; unit >= 0 && va == 0; unit--) { - int alignemnt = MappingUnitSizes[unit]; + int alignment = MappingUnitSizes[unit]; - va = AllocateVa(AliasRegionStart, regionPagesCount, neededPagesCount, alignemnt); + va = AllocateVa(AliasRegionStart, regionPagesCount, neededPagesCount, alignment); } if (va == 0) @@ -2109,7 +2109,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory { foreach (KMemoryInfo info in IterateOverRange(address, endAddrTruncated)) { - //Check if the block state matches what we expect. + // Check if the block state matches what we expect. if ((info.State & stateMask) != stateMask || (info.Attribute & attributeMask) != MemoryAttribute.IpcMapped) { @@ -2331,7 +2331,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory { info = node.Value.GetInfo(); - //Check if the block state matches what we expect. + // Check if the block state matches what we expect. if ( firstState != info.State || firstPermission != info.Permission || (info.Attribute & attributeMask) != attributeExpected || @@ -2367,7 +2367,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory { foreach (KMemoryInfo info in IterateOverRange(address, address + size)) { - //Check if the block state matches what we expect. + // Check if the block state matches what we expect. if ((info.State & stateMask) != stateExpected || (info.Permission & permissionMask) != permissionExpected || (info.Attribute & attributeMask) != attributeExpected) @@ -2404,9 +2404,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory MemoryPermission newPermission, MemoryAttribute newAttribute) { - //Insert new block on the list only on areas where the state - //of the block matches the state specified on the old* state - //arguments, otherwise leave it as is. + // Insert new block on the list only on areas where the state + // of the block matches the state specified on the old* state + // arguments, otherwise leave it as is. int oldCount = _blocks.Count; oldAttribute |= MemoryAttribute.IpcAndDeviceMapped; @@ -2451,7 +2451,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory newNode.Value.SetState(newPermission, newState, newAttribute); - MergeEqualStateNeighbours(newNode); + MergeEqualStateNeighbors(newNode); } if (currEndAddr - 1 >= endAddr - 1) @@ -2472,8 +2472,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory MemoryPermission permission = MemoryPermission.None, MemoryAttribute attribute = MemoryAttribute.None) { - //Inserts new block at the list, replacing and spliting - //existing blocks as needed. + // Inserts new block at the list, replacing and splitting + // existing blocks as needed. int oldCount = _blocks.Count; ulong endAddr = baseAddress + pagesCount * PageSize; @@ -2505,7 +2505,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory newNode.Value.SetState(permission, state, attribute); - MergeEqualStateNeighbours(newNode); + MergeEqualStateNeighbors(newNode); } if (currEndAddr - 1 >= endAddr - 1) @@ -2537,9 +2537,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory BlockMutator blockMutate, MemoryPermission permission = MemoryPermission.None) { - //Inserts new block at the list, replacing and spliting - //existing blocks as needed, then calling the callback - //function on the new block. + // Inserts new block at the list, replacing and splitting + // existing blocks as needed, then calling the callback + // function on the new block. int oldCount = _blocks.Count; ulong endAddr = baseAddress + pagesCount * PageSize; @@ -2573,7 +2573,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory blockMutate(newBlock, permission); - MergeEqualStateNeighbours(newNode); + MergeEqualStateNeighbors(newNode); } if (currEndAddr - 1 >= endAddr - 1) @@ -2587,7 +2587,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory _blockAllocator.Count += _blocks.Count - oldCount; } - private void MergeEqualStateNeighbours(LinkedListNode<KMemoryBlock> node) + private void MergeEqualStateNeighbors(LinkedListNode<KMemoryBlock> node) { KMemoryBlock block = node.Value; diff --git a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs index 92cef559..bb4989fc 100644 --- a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs +++ b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs @@ -126,21 +126,21 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory ulong blockPagesCount = bestFitBlockSize / KMemoryManager.PageSize; - //Check if this is the best fit for this page size. - //If so, try allocating as much requested pages as possible. + // Check if this is the best fit for this page size. + // If so, try allocating as much requested pages as possible. while (blockPagesCount <= pagesCount) { ulong address = AllocatePagesForOrder(blockIndex, backwards, bestFitBlockSize); - //The address being zero means that no free space was found on that order, - //just give up and try with the next one. + // The address being zero means that no free space was found on that order, + // just give up and try with the next one. if (address == 0) { break; } - //Add new allocated page(s) to the pages list. - //If an error occurs, then free all allocated pages and fail. + // Add new allocated page(s) to the pages list. + // If an error occurs, then free all allocated pages and fail. KernelResult result = pageList.AddRange(address, blockPagesCount); if (result != KernelResult.Success) @@ -159,13 +159,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory } } - //Success case, all requested pages were allocated successfully. + // Success case, all requested pages were allocated successfully. if (pagesCount == 0) { return KernelResult.Success; } - //Error case, free allocated pages and return out of memory. + // Error case, free allocated pages and return out of memory. foreach (KPageNode pageNode in pageList) { FreePages(pageNode.Address, pageNode.PagesCount); @@ -321,8 +321,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory if (address != 0) { - //If we are using a larger order than best fit, then we should - //split it into smaller blocks. + // If we are using a larger order than best fit, then we should + // split it into smaller blocks. ulong firstFreeBlockSize = 1UL << block.Order; if (firstFreeBlockSize > bestFitBlockSize) @@ -416,7 +416,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory } } - //Free inside aligned region. + // Free inside aligned region. ulong baseAddress = addressRounded; while (baseAddress < endAddrTruncated) @@ -430,7 +430,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory int nextBlockIndex = blockIndex - 1; - //Free region between Address and aligned region start. + // Free region between Address and aligned region start. baseAddress = addressRounded; for (blockIndex = nextBlockIndex; blockIndex >= 0; blockIndex--) @@ -445,7 +445,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory } } - //Free region between aligned region end and End Address. + // Free region between aligned region end and End Address. baseAddress = endAddrTruncated; for (blockIndex = nextBlockIndex; blockIndex >= 0; blockIndex--) diff --git a/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs b/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs index d31f95b4..223bf5da 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs @@ -1,10 +1,8 @@ using ChocolArm64.Memory; using ChocolArm64.State; -using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Diagnostics.Demangler; using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.Loaders.Elf; -using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -75,7 +73,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } } - //TODO: ARM32. + // TODO: ARM32. long framePointer = (long)threadState.X29; trace.AppendLine($"Process: {_owner.Name}, PID: {_owner.Pid}"); @@ -89,8 +87,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process break; } - //Note: This is the return address, we need to subtract one instruction - //worth of bytes to get the branch instruction address. + // Note: This is the return address, we need to subtract one instruction + // worth of bytes to get the branch instruction address. AppendTrace(_owner.CpuMemory.ReadInt64(framePointer + 8) - 4); framePointer = _owner.CpuMemory.ReadInt64(framePointer); @@ -245,7 +243,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process long ehHdrEndOffset = memory.ReadInt32(mod0Offset + 0x14) + mod0Offset; long modObjOffset = memory.ReadInt32(mod0Offset + 0x18) + mod0Offset; - //TODO: Elf32. + // TODO: Elf32. while (true) { long tagVal = memory.ReadInt64(dynamicOffset + 0); diff --git a/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs b/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs index 909f6333..1b5a6772 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs @@ -350,7 +350,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process private KernelResult ParseProcessInfo(ProcessCreationInfo creationInfo) { - //Ensure that the current kernel version is equal or above to the minimum required. + // Ensure that the current kernel version is equal or above to the minimum required. uint requiredKernelVersionMajor = (uint)Capabilities.KernelReleaseVersion >> 19; uint requiredKernelVersionMinor = ((uint)Capabilities.KernelReleaseVersion >> 15) & 0xf; @@ -429,7 +429,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process if (_freeTlsPages.Count > 0) { - //If we have free TLS pages available, just use the first one. + // If we have free TLS pages available, just use the first one. KTlsPageInfo pageInfo = _freeTlsPages.Values.First(); if (!pageInfo.TryGetFreePage(out address)) @@ -448,7 +448,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } else { - //Otherwise, we need to create a new one. + // Otherwise, we need to create a new one. result = AllocateTlsPage(out KTlsPageInfo pageInfo); if (result == KernelResult.Success) @@ -522,7 +522,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process if (_fullTlsPages.TryGetValue(tlsPageAddr, out pageInfo)) { - //TLS page was full, free slot and move to free pages tree. + // TLS page was full, free slot and move to free pages tree. _fullTlsPages.Remove(tlsPageAddr); _freeTlsPages.Add(tlsPageAddr, pageInfo); @@ -538,8 +538,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process if (pageInfo.IsEmpty()) { - //TLS page is now empty, we should ensure it is removed - //from all trees, and free the memory it was using. + // TLS page is now empty, we should ensure it is removed + // from all trees, and free the memory it was using. _freeTlsPages.Remove(tlsPageAddr); System.CriticalSection.Leave(); @@ -574,7 +574,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process private void GenerateRandomEntropy() { - //TODO. + // TODO. } public KernelResult Start(int mainThreadPriority, ulong stackSize) @@ -603,9 +603,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Process ulong neededSize = stackSizeRounded + _imageSize; - //Check if the needed size for the code and the stack will fit on the - //memory usage capacity of this Process. Also check for possible overflow - //on the above addition. + // Check if the needed size for the code and the stack will fit on the + // memory usage capacity of this Process. Also check for possible overflow + // on the above addition. if (neededSize > _memoryUsageCapacity || neededSize < stackSizeRounded) { @@ -742,10 +742,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Process SetState(newState); - //TODO: We can't call KThread.Start from a non-guest thread. - //We will need to make some changes to allow the creation of - //dummy threads that will be used to initialize the current - //thread on KCoreContext so that GetCurrentThread doesn't fail. + // TODO: We can't call KThread.Start from a non-guest thread. + // We will need to make some changes to allow the creation of + // dummy threads that will be used to initialize the current + // thread on KCoreContext so that GetCurrentThread doesn't fail. /* Result = MainThread.Start(); if (Result != KernelResult.Success) @@ -935,7 +935,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process if (shallTerminate) { - //UnpauseAndTerminateAllThreadsExcept(System.Scheduler.GetCurrentThread()); + // UnpauseAndTerminateAllThreadsExcept(System.Scheduler.GetCurrentThread()); HandleTable.Destroy(); @@ -948,12 +948,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Process private void UnpauseAndTerminateAllThreadsExcept(KThread thread) { - //TODO. + // TODO. } private void SignalExitForDebugEvent() { - //TODO: Debug events. + // TODO: Debug events. } private void SignalExit() diff --git a/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs b/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs index 964762bb..2396aea8 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs @@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process int codeMask = 1 << (32 - BitUtils.CountLeadingZeros32(code + 1)); - //Check if the property was already set. + // Check if the property was already set. if (((mask0 & codeMask) & 0x1e008) != 0) { return KernelResult.InvalidCombination; @@ -223,7 +223,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process case 0x800: { - //TODO: GIC distributor check. + // TODO: GIC distributor check. int irq0 = (cap >> 12) & 0x3ff; int irq1 = (cap >> 22) & 0x3ff; @@ -256,7 +256,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process case 0x4000: { - //Note: This check is bugged on kernel too, we are just replicating the bug here. + // Note: This check is bugged on kernel too, we are just replicating the bug here. if ((KernelReleaseVersion >> 17) != 0 || cap < 0x80000) { return KernelResult.ReservedValue; diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcSystem.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcSystem.cs index efc10512..5f971131 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcSystem.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcSystem.cs @@ -161,7 +161,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall process = thread.Owner; } - //TODO: KDebugEvent. + // TODO: KDebugEvent. } pid = process?.Pid ?? 0; @@ -549,10 +549,10 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall switch (id) { - //Memory region capacity. + // Memory region capacity. case 0: value = (long)region.Size; break; - //Memory region free space. + // Memory region free space. case 1: { ulong freePagesCount = region.GetFreePages(); diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs index dd98e8a0..23934649 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs @@ -151,10 +151,10 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } } - //For functions returning output values, the first registers - //are used to hold pointers where the value will be stored, - //so they can't be used to pass argument and we must - //skip them. + // For functions returning output values, the first registers + // are used to hold pointers where the value will be stored, + // so they can't be used to pass argument and we must + // skip them. int byRefArgsCount = 0; for (int index = 0; index < methodArgs.Length; index++) @@ -165,7 +165,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } } - //Print all the arguments for debugging purposes. + // Print all the arguments for debugging purposes. int inputArgsCount = methodArgs.Length - byRefArgsCount; generator.Emit(OpCodes.Ldc_I4_S, inputArgsCount); @@ -200,7 +200,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Call, printArgsMethod); - //Call the SVC function handler. + // Call the SVC function handler. generator.Emit(OpCodes.Ldarg_0); List<LocalBuilder> locals = new List<LocalBuilder>(); @@ -239,7 +239,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall Type retType = methodInfo.ReturnType; - //Print result code. + // Print result code. if (retType == typeof(KernelResult)) { MethodInfo printResultMethod = typeof(SvcTable).GetMethod(nameof(PrintResult), staticNonPublic); @@ -249,7 +249,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Call, printResultMethod); } - //Save return value into register X0 (when the method has a return value). + // Save return value into register X0 (when the method has a return value). if (retType != typeof(void)) { CheckIfTypeIsSupported(retType, svcName); @@ -275,7 +275,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Stfld, GetStateFieldX(outRegIndex++)); } - //Zero out the remaining unused registers. + // Zero out the remaining unused registers. while (outRegIndex < SvcFuncMaxArguments) { generator.Emit(OpCodes.Ldarg_1); diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs index fa0b3a6c..e1f018c1 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs @@ -175,7 +175,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall public KernelResult SetThreadPriority(int handle, int priority) { - //TODO: NPDM check. + // TODO: NPDM check. KThread thread = _process.HandleTable.GetKThread(handle); diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/HleScheduler.cs b/Ryujinx.HLE/HOS/Kernel/Threading/HleScheduler.cs index d5dbb4d8..42eed26a 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/HleScheduler.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/HleScheduler.cs @@ -68,8 +68,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (hasThreadExecuting) { - //If this is not the thread that is currently executing, we need - //to request an interrupt to allow safely starting another thread. + // If this is not the thread that is currently executing, we need + // to request an interrupt to allow safely starting another thread. if (!currentThread.Context.IsCurrentThread()) { currentThread.Context.RequestInterrupt(); @@ -80,8 +80,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading CoreManager.Reset(currentThread.Context.Work); } - //Advance current core and try picking a thread, - //keep advancing if it is null. + // Advance current core and try picking a thread, + // keep advancing if it is null. for (int core = 0; core < 4; core++) { _currentCore = (_currentCore + 1) % CpuCoresCount; @@ -100,8 +100,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } } - //If nothing was running before, then we are on a "external" - //HLE thread, we don't need to wait. + // If nothing was running before, then we are on a "external" + // HLE thread, we don't need to wait. if (!hasThreadExecuting) { return; @@ -114,9 +114,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading private void PreemptCurrentThread() { - //Preempts current thread every 10 milliseconds on a round-robin fashion, - //when multi core scheduling is disabled, to try ensuring that all threads - //gets a chance to run. + // Preempts current thread every 10 milliseconds on a round-robin fashion, + // when multi core scheduling is disabled, to try ensuring that all threads + // gets a chance to run. while (_keepPreempting) { lock (CoreContexts) diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs index b11df61e..166cf064 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs @@ -207,7 +207,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading signaledThreads.Enqueue(thread); - //If the count is <= 0, we should signal all threads waiting. + // If the count is <= 0, we should signal all threads waiting. if (count >= 1 && --count == 0) { break; @@ -234,7 +234,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading { if (!KernelTransfer.UserToKernelInt32(_system, address, out mutexValue)) { - //Invalid address. + // Invalid address. requester.SignaledObj = null; requester.ObjSyncResult = KernelResult.InvalidMemState; @@ -243,12 +243,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (mutexValue != 0) { - //Update value to indicate there is a mutex waiter now. + // Update value to indicate there is a mutex waiter now. newMutexValue = mutexValue | HasListenersMask; } else { - //No thread owning the mutex, assign to requesting thread. + // No thread owning the mutex, assign to requesting thread. newMutexValue = requester.ThreadHandleForUserMutex; } } @@ -256,7 +256,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (mutexValue == 0) { - //We now own the mutex. + // We now own the mutex. requester.SignaledObj = null; requester.ObjSyncResult = KernelResult.Success; @@ -271,12 +271,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (mutexOwner != null) { - //Mutex already belongs to another thread, wait for it. + // Mutex already belongs to another thread, wait for it. mutexOwner.AddMutexWaiter(requester); } else { - //Invalid mutex owner. + // Invalid mutex owner. requester.SignaledObj = null; requester.ObjSyncResult = KernelResult.InvalidHandle; @@ -513,9 +513,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading int offset; - //The value is decremented if the number of threads waiting is less - //or equal to the Count of threads to be signaled, or Count is zero - //or negative. It is incremented if there are no threads waiting. + // The value is decremented if the number of threads waiting is less + // or equal to the Count of threads to be signaled, or Count is zero + // or negative. It is incremented if there are no threads waiting. int waitingCount = 0; foreach (KThread thread in ArbiterThreads.Where(x => x.MutexAddress == address)) @@ -572,7 +572,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading { signaledThreads.Enqueue(thread); - //If the count is <= 0, we should signal all threads waiting. + // If the count is <= 0, we should signal all threads waiting. if (count >= 1 && --count == 0) { break; diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs index 841d0d69..39c857b5 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs @@ -57,17 +57,17 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (currentHleThread == null) { - //Nothing is running, we can perform the context switch immediately. + // Nothing is running, we can perform the context switch immediately. coreContext.ContextSwitch(); } else if (currentHleThread.IsCurrentThread()) { - //Thread running on the current core, context switch will block. + // Thread running on the current core, context switch will block. doContextSwitch = true; } else { - //Thread running on another core, request a interrupt. + // Thread running on another core, request a interrupt. currentHleThread.RequestInterrupt(); } } diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs index c9686df3..8d2cdfce 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs @@ -55,7 +55,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading KThread selectedThread = scheduledThreads.FirstOrDefault(x => x.DynamicPriority == prio); - //Yield priority queue. + // Yield priority queue. if (selectedThread != null) { SchedulingData.Reschedule(prio, core, selectedThread); @@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } } - //If the candidate was scheduled after the current thread, then it's not worth it. + // If the candidate was scheduled after the current thread, then it's not worth it. if (selectedThread == null || selectedThread.LastScheduledTime >= thread.LastScheduledTime) { yield return thread; @@ -90,8 +90,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } } - //Select candidate threads that could run on this core. - //Only take into account threads that are not yet selected. + // Select candidate threads that could run on this core. + // Only take into account threads that are not yet selected. KThread dst = SuitableCandidates().FirstOrDefault(x => x.DynamicPriority == prio); if (dst != null) @@ -101,8 +101,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading selectedThread = dst; } - //If the priority of the currently selected thread is lower than preemption priority, - //then allow threads with lower priorities to be selected aswell. + // If the priority of the currently selected thread is lower than preemption priority, + // then allow threads with lower priorities to be selected aswell. if (selectedThread != null && selectedThread.DynamicPriority > prio) { Func<KThread, bool> predicate = x => x.DynamicPriority >= selectedThread.DynamicPriority; @@ -131,8 +131,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading for (int core = 0; core < CpuCoresCount; core++) { - //If the core is not idle (there's already a thread running on it), - //then we don't need to attempt load balancing. + // If the core is not idle (there's already a thread running on it), + // then we don't need to attempt load balancing. if (SchedulingData.ScheduledThreads(core).Any()) { continue; @@ -144,8 +144,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading KThread dst = null; - //Select candidate threads that could run on this core. - //Give preference to threads that are not yet selected. + // Select candidate threads that could run on this core. + // Give preference to threads that are not yet selected. foreach (KThread thread in SchedulingData.SuggestedThreads(core)) { if (thread.CurrentCore < 0 || thread != CoreContexts[thread.CurrentCore].SelectedThread) @@ -158,11 +158,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading srcCoresHighestPrioThreads[srcCoresHighestPrioThreadsCount++] = thread.CurrentCore; } - //Not yet selected candidate found. + // Not yet selected candidate found. if (dst != null) { - //Priorities < 2 are used for the kernel message dispatching - //threads, we should skip load balancing entirely. + // Priorities < 2 are used for the kernel message dispatching + // threads, we should skip load balancing entirely. if (dst.DynamicPriority >= 2) { SchedulingData.TransferToCore(dst.DynamicPriority, core, dst); @@ -173,8 +173,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading continue; } - //All candiates are already selected, choose the best one - //(the first one that doesn't make the source core idle if moved). + // All candidates are already selected, choose the best one + // (the first one that doesn't make the source core idle if moved). for (int index = 0; index < srcCoresHighestPrioThreadsCount; index++) { int srcCore = srcCoresHighestPrioThreads[index]; @@ -183,8 +183,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (src != null) { - //Run the second thread on the queue on the source core, - //move the first one to the current core. + // Run the second thread on the queue on the source core, + // move the first one to the current core. KThread origSelectedCoreSrc = CoreContexts[srcCore].SelectedThread; CoreContexts[srcCore].SelectThread(src); diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KSynchronization.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KSynchronization.cs index 327b0418..865551a2 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KSynchronization.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KSynchronization.cs @@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading _system.CriticalSection.Enter(); - //Check if objects are already signaled before waiting. + // Check if objects are already signaled before waiting. for (int index = 0; index < syncObjs.Length; index++) { if (!syncObjs[index].IsSignaled()) diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs index ebde34ba..50c71ea9 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs @@ -276,7 +276,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading public void Exit() { - //TODO: Debug event. + // TODO: Debug event. if (Owner != null) { @@ -352,7 +352,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (DynamicPriority < KScheduler.PrioritiesCount) { - //Move current thread to the end of the queue. + // Move current thread to the end of the queue. _schedulingData.Reschedule(DynamicPriority, CurrentCore, this); } @@ -383,7 +383,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (DynamicPriority < KScheduler.PrioritiesCount) { - //Move current thread to the end of the queue. + // Move current thread to the end of the queue. _schedulingData.Reschedule(prio, core, this); Func<KThread, bool> predicate = x => x.DynamicPriority == prio; @@ -407,8 +407,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } } - //If the candidate was scheduled after the current thread, then it's not worth it, - //unless the priority is higher than the current one. + // If the candidate was scheduled after the current thread, then it's not worth it, + // unless the priority is higher than the current one. if (nextThreadOnCurrentQueue.LastScheduledTime >= thread.LastScheduledTime || nextThreadOnCurrentQueue.DynamicPriority < thread.DynamicPriority) { @@ -524,7 +524,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading { if (pause) { - //Pause, the force pause flag should be clear (thread is NOT paused). + // Pause, the force pause flag should be clear (thread is NOT paused). if ((_forcePauseFlags & ThreadSchedState.ThreadPauseFlag) == 0) { _forcePauseFlags |= ThreadSchedState.ThreadPauseFlag; @@ -538,7 +538,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } else { - //Unpause, the force pause flag should be set (thread is paused). + // Unpause, the force pause flag should be set (thread is paused). if ((_forcePauseFlags & ThreadSchedState.ThreadPauseFlag) != 0) { ThreadSchedState oldForcePauseFlags = _forcePauseFlags; @@ -604,7 +604,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading bool useOverride = _affinityOverrideCount != 0; - //The value -3 is "do not change the preferred core". + // The value -3 is "do not change the preferred core". if (newCore == -3) { newCore = useOverride ? _preferredCoreOverride : PreferredCore; @@ -766,7 +766,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading do { - //Skip all threads that are not waiting for this mutex. + // Skip all threads that are not waiting for this mutex. while (currentNode != null && currentNode.Value.MutexAddress != mutexAddress) { currentNode = currentNode.Next; @@ -785,12 +785,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (newMutexOwner != null) { - //New owner was already selected, re-insert on new owner list. + // New owner was already selected, re-insert on new owner list. newMutexOwner.AddToMutexWaitersList(currentNode.Value); } else { - //New owner not selected yet, use current thread. + // New owner not selected yet, use current thread. newMutexOwner = currentNode.Value; } @@ -812,9 +812,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading private void UpdatePriorityInheritance() { - //If any of the threads waiting for the mutex has - //higher priority than the current thread, then - //the current thread inherits that priority. + // If any of the threads waiting for the mutex has + // higher priority than the current thread, then + // the current thread inherits that priority. int highestPriority = BasePriority; if (_mutexWaiters.First != null) @@ -837,7 +837,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (MutexOwner != null) { - //Remove and re-insert to ensure proper sorting based on new priority. + // Remove and re-insert to ensure proper sorting based on new priority. MutexOwner._mutexWaiters.Remove(_mutexWaiterNode); MutexOwner.AddToMutexWaitersList(this); @@ -877,7 +877,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (oldFlags == ThreadSchedState.Running) { - //Was running, now it's stopped. + // Was running, now it's stopped. if (CurrentCore >= 0) { _schedulingData.Unschedule(DynamicPriority, CurrentCore, this); @@ -893,7 +893,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } else if (SchedFlags == ThreadSchedState.Running) { - //Was stopped, now it's running. + // Was stopped, now it's running. if (CurrentCore >= 0) { _schedulingData.Schedule(DynamicPriority, CurrentCore, this); @@ -918,7 +918,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading return; } - //Remove thread from the old priority queues. + // Remove thread from the old priority queues. if (CurrentCore >= 0) { _schedulingData.Unschedule(oldPriority, CurrentCore, this); @@ -932,7 +932,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } } - //Add thread to the new priority queues. + // Add thread to the new priority queues. KThread currentThread = _scheduler.GetCurrentThread(); if (CurrentCore >= 0) @@ -965,7 +965,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading return; } - //Remove thread from the old priority queues. + // Remove thread from the old priority queues. for (int core = 0; core < KScheduler.CpuCoresCount; core++) { if (((oldAffinityMask >> core) & 1) != 0) @@ -981,7 +981,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } } - //Add thread to the new priority queues. + // Add thread to the new priority queues. for (int core = 0; core < KScheduler.CpuCoresCount; core++) { if (((AffinityMask >> core) & 1) != 0) @@ -1069,7 +1069,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading System.CriticalSection.Enter(); - //Wake up all threads that may be waiting for a mutex being held by this thread. + // Wake up all threads that may be waiting for a mutex being held by this thread. foreach (KThread thread in _mutexWaiters) { thread.MutexOwner = null; diff --git a/Ryujinx.HLE/HOS/ProgramLoader.cs b/Ryujinx.HLE/HOS/ProgramLoader.cs index a41df557..af974e18 100644 --- a/Ryujinx.HLE/HOS/ProgramLoader.cs +++ b/Ryujinx.HLE/HOS/ProgramLoader.cs @@ -38,7 +38,7 @@ namespace Ryujinx.HLE.HOS if (AslrEnabled) { - //TODO: Randomization. + // TODO: Randomization. mmuFlags |= 0x20; } diff --git a/Ryujinx.HLE/HOS/Services/Am/IApplicationCreator.cs b/Ryujinx.HLE/HOS/Services/Am/IApplicationCreator.cs index eac609ed..5f31b323 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IApplicationCreator.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IApplicationCreator.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Am { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Am/IApplicationFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/IApplicationFunctions.cs index 41bfb1c8..dc8adb93 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IApplicationFunctions.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IApplicationFunctions.cs @@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Am public long PopLaunchParameter(ServiceCtx context) { - //Only the first 0x18 bytes of the Data seems to be actually used. + // Only the first 0x18 bytes of the Data seems to be actually used. MakeObject(context, new IStorage(StorageHelper.MakeLaunchParams())); return 0; @@ -74,7 +74,7 @@ namespace Ryujinx.HLE.HOS.Services.Am public long GetDisplayVersion(ServiceCtx context) { - //FIXME: Need to check correct version on a switch. + // FIXME: Need to check correct version on a switch. context.ResponseData.Write(1L); context.ResponseData.Write(0L); diff --git a/Ryujinx.HLE/HOS/Services/Am/IDebugFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/IDebugFunctions.cs index f7ea253d..a884a454 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IDebugFunctions.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IDebugFunctions.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Am { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Am/IDisplayController.cs b/Ryujinx.HLE/HOS/Services/Am/IDisplayController.cs index 91fd864c..fc668f3c 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IDisplayController.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IDisplayController.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Am { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Am/IGlobalStateController.cs b/Ryujinx.HLE/HOS/Services/Am/IGlobalStateController.cs index b9387661..634f65eb 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IGlobalStateController.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IGlobalStateController.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Am { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Am/IHomeMenuFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/IHomeMenuFunctions.cs index e61fccb2..868e0215 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IHomeMenuFunctions.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IHomeMenuFunctions.cs @@ -23,7 +23,7 @@ namespace Ryujinx.HLE.HOS.Services.Am { 21, GetPopFromGeneralChannelEvent } }; - //ToDo: Signal this Event somewhere in future. + // TODO: Signal this Event somewhere in future. _channelEvent = new KEvent(system); } diff --git a/Ryujinx.HLE/HOS/Services/Am/IStorageAccessor.cs b/Ryujinx.HLE/HOS/Services/Am/IStorageAccessor.cs index ac54069a..ac44e444 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IStorageAccessor.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IStorageAccessor.cs @@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Am public long Write(ServiceCtx context) { - //TODO: Error conditions. + // TODO: Error conditions. long writePosition = context.RequestData.ReadInt64(); (long position, long size) = context.Request.GetBufferType0x21(); @@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Am public long Read(ServiceCtx context) { - //TODO: Error conditions. + // TODO: Error conditions. long readPosition = context.RequestData.ReadInt64(); (long position, long size) = context.Request.GetBufferType0x22(); diff --git a/Ryujinx.HLE/HOS/Services/Am/StorageHelper.cs b/Ryujinx.HLE/HOS/Services/Am/StorageHelper.cs index 39a4c6dd..a3dbbeb7 100644 --- a/Ryujinx.HLE/HOS/Services/Am/StorageHelper.cs +++ b/Ryujinx.HLE/HOS/Services/Am/StorageHelper.cs @@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Services.Am public static byte[] MakeLaunchParams() { - //Size needs to be at least 0x88 bytes otherwise application errors. + // Size needs to be at least 0x88 bytes otherwise application errors. using (MemoryStream ms = new MemoryStream()) { BinaryWriter writer = new BinaryWriter(ms); diff --git a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/IAudioRenderer.cs b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/IAudioRenderer.cs index 8c984385..2fbb041a 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/IAudioRenderer.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/IAudioRenderer.cs @@ -16,11 +16,11 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer { class IAudioRenderer : IpcService, IDisposable { - //This is the amount of samples that are going to be appended - //each time that RequestUpdateAudioRenderer is called. Ideally, - //this value shouldn't be neither too small (to avoid the player - //starving due to running out of samples) or too large (to avoid - //high latency). + // This is the amount of samples that are going to be appended + // each time that RequestUpdateAudioRenderer is called. Ideally, + // this value shouldn't be neither too small (to avoid the player + // starving due to running out of samples) or too large (to avoid + // high latency). private const int MixBufferSamplesCount = 960; private Dictionary<int, ServiceProcessRequest> _commands; diff --git a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceChannelResourceIn.cs b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceChannelResourceIn.cs index 2a6f424f..4933a79b 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceChannelResourceIn.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceChannelResourceIn.cs @@ -5,6 +5,6 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer [StructLayout(LayoutKind.Sequential, Size = 0x70, Pack = 1)] struct VoiceChannelResourceIn { - //??? + // ??? } } diff --git a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceContext.cs b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceContext.cs index 5de85612..971563dc 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceContext.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceContext.cs @@ -46,7 +46,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer { if (_acquired && !newState) { - //Release. + // Release. Reset(); } @@ -124,9 +124,9 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer private void UpdateBuffer(MemoryManager memory) { - //TODO: Implement conversion for formats other - //than interleaved stereo (2 channels). - //As of now, it assumes that HostChannelsCount == 2. + // TODO: Implement conversion for formats other + // than interleaved stereo (2 channels). + // As of now, it assumes that HostChannelsCount == 2. WaveBuffer wb = WaveBuffers[_bufferIndex]; if (wb.Position == 0) @@ -173,9 +173,9 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer if (SampleRate != AudioConsts.HostSampleRate) { - //TODO: We should keep the frames being discarded (see the 4 below) - //on a buffer and include it on the next samples buffer, to allow - //the resampler to do seamless interpolation between wave buffers. + // TODO: We should keep the frames being discarded (see the 4 below) + // on a buffer and include it on the next samples buffer, to allow + // the resampler to do seamless interpolation between wave buffers. int samplesCount = _samples.Length / AudioConsts.HostChannelsCount; samplesCount = Math.Max(samplesCount - 4, 0); diff --git a/Ryujinx.HLE/HOS/Services/Aud/IAudioDevice.cs b/Ryujinx.HLE/HOS/Services/Aud/IAudioDevice.cs index 4be183fa..d4946999 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IAudioDevice.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IAudioDevice.cs @@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud _systemEvent = new KEvent(system); - //TODO: We shouldn't be signaling this here. + // TODO: We shouldn't be signaling this here. _systemEvent.ReadableEvent.Signal(); } diff --git a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs index fc0bd8db..68b02bcc 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs @@ -37,8 +37,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud { long result = DecodeInterleaved(context); - //TODO: Figure out what this value is. - //According to switchbrew, it is now used. + // TODO: Figure out what this value is. + // According to switchbrew, it is now used. context.ResponseData.Write(0L); return result; diff --git a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs index 495c8ab4..0b5e12f0 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs @@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud public long GetWorkBufferSize(ServiceCtx context) { - //Note: The sample rate is ignored because it is fixed to 48KHz. + // Note: The sample rate is ignored because it is fixed to 48KHz. int sampleRate = context.RequestData.ReadInt32(); int channelsCount = context.RequestData.ReadInt32(); diff --git a/Ryujinx.HLE/HOS/Services/Bcat/IBcatService.cs b/Ryujinx.HLE/HOS/Services/Bcat/IBcatService.cs index 051b75d6..dfd67304 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/IBcatService.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/IBcatService.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } diff --git a/Ryujinx.HLE/HOS/Services/Bcat/IDeliveryCacheStorageService.cs b/Ryujinx.HLE/HOS/Services/Bcat/IDeliveryCacheStorageService.cs index 043cb607..fcf81c7e 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/IDeliveryCacheStorageService.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/IDeliveryCacheStorageService.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } diff --git a/Ryujinx.HLE/HOS/Services/Caps/IAlbumAccessorService.cs b/Ryujinx.HLE/HOS/Services/Caps/IAlbumAccessorService.cs index 7b334ac4..82da2451 100644 --- a/Ryujinx.HLE/HOS/Services/Caps/IAlbumAccessorService.cs +++ b/Ryujinx.HLE/HOS/Services/Caps/IAlbumAccessorService.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Caps { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Caps/IScreenshotService.cs b/Ryujinx.HLE/HOS/Services/Caps/IScreenshotService.cs index 63b155e0..9273b394 100644 --- a/Ryujinx.HLE/HOS/Services/Caps/IScreenshotService.cs +++ b/Ryujinx.HLE/HOS/Services/Caps/IScreenshotService.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Caps { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Friend/IDaemonSuspendSessionService.cs b/Ryujinx.HLE/HOS/Services/Friend/IDaemonSuspendSessionService.cs index d0edf29e..b1f23dd5 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/IDaemonSuspendSessionService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/IDaemonSuspendSessionService.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs index 17a32b00..35f40818 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs @@ -108,7 +108,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend long position = context.Request.PtrBuff[0].Position; long size = context.Request.PtrBuff[0].Size; - //Todo: Write the buffer content. + // TODO: Write the buffer content. Logger.PrintStub(LogClass.ServiceFriend, new { UserId = uuid.ToString(), unknown0 }); diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IFile.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IFile.cs index 0b8b31fb..48239940 100644 --- a/Ryujinx.HLE/HOS/Services/FspSrv/IFile.cs +++ b/Ryujinx.HLE/HOS/Services/FspSrv/IFile.cs @@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv }; _baseFile = baseFile; - Path = LibHac.Fs.PathTools.Normalize(path); + Path = PathTools.Normalize(path); } // Read(u32 readOption, u64 offset, u64 size) -> (u64 out_size, buffer<u8, 0x46, 0> out_buf) diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystem.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystem.cs index 74ba6216..01a8dc9b 100644 --- a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystem.cs +++ b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystem.cs @@ -306,7 +306,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv try { - LibHac.Fs.DirectoryEntryType entryType = _provider.GetEntryType(name); + DirectoryEntryType entryType = _provider.GetEntryType(name); context.ResponseData.Write((int)entryType); } diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs index 23989365..7207aaf0 100644 --- a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs @@ -312,7 +312,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv private void ImportTitleKeysFromNsp(LibHac.Fs.IFileSystem nsp, Keyset keySet) { - foreach (LibHac.Fs.DirectoryEntry ticketEntry in nsp.EnumerateEntries("*.tik")) + foreach (DirectoryEntry ticketEntry in nsp.EnumerateEntries("*.tik")) { Ticket ticket = new Ticket(nsp.OpenFile(ticketEntry.FullPath, OpenMode.Read).AsStream()); diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs index 75f2c9ee..81bdcdcc 100644 --- a/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs +++ b/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs @@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv { IpcBuffDesc buffDesc = context.Request.ReceiveBuff[0]; - //Use smaller length to avoid overflows. + // Use smaller length to avoid overflows. if (size > buffDesc.Size) { size = buffDesc.Size; diff --git a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs index e5b56a60..7e48a186 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs @@ -1014,7 +1014,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Request.PtrBuff[1].Position, context.Request.PtrBuff[1].Size); - //Todo: Read all handles and values from buffer. + // TODO: Read all handles and values from buffer. Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, @@ -1137,7 +1137,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long counter0 = context.RequestData.ReadInt64(); long counter1 = context.RequestData.ReadInt64(); - // Todo: Determine if array<nn::sf::NativeHandle> is a buffer or not... + // TODO: Determine if array<nn::sf::NativeHandle> is a buffer or not... Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, counter0, counter1 }); diff --git a/Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs b/Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs index 202e6df5..49edab59 100644 --- a/Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs @@ -523,7 +523,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldr NrrInfo info; result = ParseNrr(out info, context, nrrAddress, nrrSize); - if(result == 0) + if (result == 0) { if (_nrrInfos.Count >= MaxNrr) { diff --git a/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs b/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs index 94c0e810..9139c9bf 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs @@ -32,8 +32,8 @@ namespace Ryujinx.HLE.HOS.Services.Ns { Logger.PrintStub(LogClass.ServiceNs); - //TODO: This is supposed to write a u32 array aswell. - //It's unknown what it contains. + // TODO: This is supposed to write a u32 array aswell. + // It's unknown what it contains. context.ResponseData.Write(0); return 0; diff --git a/Ryujinx.HLE/HOS/Services/Ns/IApplicationManagerInterface.cs b/Ryujinx.HLE/HOS/Services/Ns/IApplicationManagerInterface.cs index 88fdb792..8c0fa41a 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IApplicationManagerInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IApplicationManagerInterface.cs @@ -1,5 +1,4 @@ using LibHac; -using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Ipc; using System; using System.Collections.Generic; diff --git a/Ryujinx.HLE/HOS/Services/Ns/ISystemUpdateInterface.cs b/Ryujinx.HLE/HOS/Services/Ns/ISystemUpdateInterface.cs index 1b898561..5499e235 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/ISystemUpdateInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/ISystemUpdateInterface.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Ns/IVulnerabilityManagerInterface.cs b/Ryujinx.HLE/HOS/Services/Ns/IVulnerabilityManagerInterface.cs index 922703ec..6b7c4193 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IVulnerabilityManagerInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IVulnerabilityManagerInterface.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs index e69cc17f..dcfaef78 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs @@ -93,7 +93,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv throw new NotImplementedException($"{fdData.Name} {cmd:x4}"); } - //TODO: Verify if the error codes needs to be translated. + // TODO: Verify if the error codes needs to be translated. context.ResponseData.Write(result); return 0; @@ -127,7 +127,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv int fd = context.RequestData.ReadInt32(); int eventId = context.RequestData.ReadInt32(); - //TODO: Use Fd/EventId, different channels have different events. + // TODO: Use Fd/EventId, different channels have different events. if (context.Process.HandleTable.GenerateHandle(_event.ReadableEvent, out int handle) != KernelResult.Success) { throw new InvalidOperationException("Out of handles!"); diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvGpuAS/NvGpuASCtx.cs b/Ryujinx.HLE/HOS/Services/Nv/NvGpuAS/NvGpuASCtx.cs index 67b80e33..e3cdf2f8 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvGpuAS/NvGpuASCtx.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvGpuAS/NvGpuASCtx.cs @@ -50,25 +50,25 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS { long mapEnd = position + size; - //Check if size is valid (0 is also not allowed). + // Check if size is valid (0 is also not allowed). if ((ulong)mapEnd <= (ulong)position) { return false; } - //Check if address is page aligned. + // Check if address is page aligned. if ((position & NvGpuVmm.PageMask) != 0) { return false; } - //Check if region is reserved. + // Check if region is reserved. if (BinarySearch(_reservations, position) == null) { return false; } - //Check for overlap with already mapped buffers. + // Check for overlap with already mapped buffers. Range map = BinarySearchLt(_maps, mapEnd); if (map != null && map.End > (ulong)position) diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvGpuAS/NvGpuASIoctl.cs b/Ryujinx.HLE/HOS/Services/Nv/NvGpuAS/NvGpuASIoctl.cs index 57728382..3b96ed6b 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvGpuAS/NvGpuASIoctl.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvGpuAS/NvGpuASIoctl.cs @@ -64,8 +64,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS lock (asCtx) { - //Note: When the fixed offset flag is not set, - //the Offset field holds the alignment size instead. + // Note: When the fixed offset flag is not set, + // the Offset field holds the alignment size instead. if ((args.Flags & FlagFixedOffset) != 0) { args.Offset = asCtx.Vmm.ReserveFixed(args.Offset, (long)size); @@ -218,8 +218,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS lock (asCtx) { - //Note: When the fixed offset flag is not set, - //the Offset field holds the alignment size instead. + // Note: When the fixed offset flag is not set, + // the Offset field holds the alignment size instead. bool vaAllocated = (args.Flags & FlagFixedOffset) == 0; if (!vaAllocated) diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvHostChannel/NvHostChannelIoctl.cs b/Ryujinx.HLE/HOS/Services/Nv/NvHostChannel/NvHostChannelIoctl.cs index a13f0fcb..c5f29636 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvHostChannel/NvHostChannelIoctl.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvHostChannel/NvHostChannelIoctl.cs @@ -69,14 +69,14 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel context.Device.Gpu.PushCommandBuffer(vmm, cmdBufData); } - //TODO: Relocation, waitchecks, etc. + // TODO: Relocation, waitchecks, etc. return NvResult.Success; } private static int GetSyncpoint(ServiceCtx context) { - //TODO + // TODO long inputPosition = context.Request.GetBufferType0x21().Position; long outputPosition = context.Request.GetBufferType0x22().Position; diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs b/Ryujinx.HLE/HOS/Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs index e05ea77c..35f1a949 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs @@ -208,8 +208,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl { syncpt.AddWaiter(args.Thresh, waitEvent); - //Note: Negative (> INT_MAX) timeouts aren't valid on .NET, - //in this case we just use the maximum timeout possible. + // Note: Negative (> INT_MAX) timeouts aren't valid on .NET, + // in this case we just use the maximum timeout possible. int timeout = args.Timeout; if (timeout < -1) diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvMap/NvMapIoctl.cs b/Ryujinx.HLE/HOS/Services/Nv/NvMap/NvMapIoctl.cs index b1ae8307..72286662 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvMap/NvMapIoctl.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvMap/NvMapIoctl.cs @@ -128,9 +128,9 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvMap if (address == 0) { - //When the address is zero, we need to allocate - //our own backing memory for the NvMap. - //TODO: Is this allocation inside the transfer memory? + // When the address is zero, we need to allocate + // our own backing memory for the NvMap. + // TODO: Is this allocation inside the transfer memory? result = NvResult.OutOfMemory; } @@ -208,8 +208,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvMap case NvMapHandleParam.Kind: args.Result = map.Kind; break; case NvMapHandleParam.Compr: args.Result = 0; break; - //Note: Base is not supported and returns an error. - //Any other value also returns an error. + // Note: Base is not supported and returns an error. + // Any other value also returns an error. default: return NvResult.InvalidInput; } diff --git a/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlService.cs b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlService.cs index 3e8ae81c..2a4a3bdd 100644 --- a/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlService.cs +++ b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlService.cs @@ -1,6 +1,5 @@ using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Ipc; -using System; using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Pctl diff --git a/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs b/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs index 1bdff31a..1c67d356 100644 --- a/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs +++ b/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs @@ -29,8 +29,8 @@ namespace Ryujinx.HLE.HOS.Services.Pl { SharedFontType fontType = (SharedFontType)context.RequestData.ReadInt32(); - //We don't need to do anything here because we do lazy initialization - //on SharedFontManager (the font is loaded when necessary). + // We don't need to do anything here because we do lazy initialization + // on SharedFontManager (the font is loaded when necessary). return 0; } @@ -38,8 +38,8 @@ namespace Ryujinx.HLE.HOS.Services.Pl { SharedFontType fontType = (SharedFontType)context.RequestData.ReadInt32(); - //1 (true) indicates that the font is already loaded. - //All fonts are already loaded. + // 1 (true) indicates that the font is already loaded. + // All fonts are already loaded. context.ResponseData.Write(1); return 0; diff --git a/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs b/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs index 8880b334..35fdd547 100644 --- a/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs @@ -1,7 +1,5 @@ using Ryujinx.HLE.HOS.Ipc; -using System; using System.Collections.Generic; -using System.Text; namespace Ryujinx.HLE.HOS.Services.Pm { diff --git a/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs b/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs index 4a67638b..fd8ffe5e 100644 --- a/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs +++ b/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs @@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.Set const string version = "3.0.0"; const string build = "NintendoSDK Firmware for NX 3.0.0-10.0"; - //http://switchbrew.org/index.php?title=System_Version_Title + // http://switchbrew.org/index.php?title=System_Version_Title using (MemoryStream ms = new MemoryStream(0x100)) { BinaryWriter writer = new BinaryWriter(ms); @@ -177,7 +177,7 @@ namespace Ryujinx.HLE.HOS.Services.Set long titleId = 0x0100000000000809; string contentPath = device.System.ContentManager.GetInstalledContentPath(titleId, StorageId.NandSystem, ContentType.Data); - if(string.IsNullOrWhiteSpace(contentPath)) + if (string.IsNullOrWhiteSpace(contentPath)) { return null; } diff --git a/Ryujinx.HLE/HOS/Services/Set/NxSettings.cs b/Ryujinx.HLE/HOS/Services/Set/NxSettings.cs index 70ab55f9..b47a5390 100644 --- a/Ryujinx.HLE/HOS/Services/Set/NxSettings.cs +++ b/Ryujinx.HLE/HOS/Services/Set/NxSettings.cs @@ -4,7 +4,7 @@ namespace Ryujinx.HLE.HOS.Services.Set { static class NxSettings { - //Generated automatically from a Switch 3.0 config file (Tid: 0100000000000818). + // Generated automatically from a Switch 3.0 config file (Tid: 0100000000000818). public static Dictionary<string, object> Settings = new Dictionary<string, object> { { "account!na_required_for_network_service", true }, diff --git a/Ryujinx.HLE/HOS/Services/Ssl/ISslContext.cs b/Ryujinx.HLE/HOS/Services/Ssl/ISslContext.cs index cf58ed87..1910998f 100644 --- a/Ryujinx.HLE/HOS/Services/Ssl/ISslContext.cs +++ b/Ryujinx.HLE/HOS/Services/Ssl/ISslContext.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl { _commands = new Dictionary<int, ServiceProcessRequest> { - //... + // ... }; } } diff --git a/Ryujinx.HLE/HOS/Services/Vi/ColorFormat.cs b/Ryujinx.HLE/HOS/Services/Vi/ColorFormat.cs index 67848b43..70938585 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/ColorFormat.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/ColorFormat.cs @@ -1,4 +1,5 @@ -namespace Ryujinx.HLE.HOS.Services.Android +// ReSharper disable InconsistentNaming +namespace Ryujinx.HLE.HOS.Services.Android { class ColorShift { diff --git a/Ryujinx.HLE/HOS/Services/Vi/GbpBuffer.cs b/Ryujinx.HLE/HOS/Services/Vi/GbpBuffer.cs index eb1adc77..75b543b8 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/GbpBuffer.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/GbpBuffer.cs @@ -150,7 +150,7 @@ namespace Ryujinx.HLE.HOS.Services.Android if (Header.IntsCount != 0x51) { - throw new System.NotImplementedException($"Unexpected Graphic Buffer ints count (expected 0x51, found 0x{Header.IntsCount:x}"); + throw new NotImplementedException($"Unexpected Graphic Buffer ints count (expected 0x51, found 0x{Header.IntsCount:x}"); } Buffer = reader.ReadStruct<NvGraphicBuffer>(); diff --git a/Ryujinx.HLE/HOS/Services/Vi/IApplicationDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/IApplicationDisplayService.cs index 686f85ef..be9fc263 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/IApplicationDisplayService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/IApplicationDisplayService.cs @@ -81,7 +81,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi MemoryHelper.FillWithZeros(context.Memory, recBuffPtr, 0x60); - //Add only the default display to buffer + // Add only the default display to buffer context.Memory.WriteBytes(recBuffPtr, Encoding.ASCII.GetBytes("Default")); context.Memory.WriteInt64(recBuffPtr + 0x40, 0x1L); context.Memory.WriteInt64(recBuffPtr + 0x48, 0x1L); @@ -186,14 +186,14 @@ namespace Ryujinx.HLE.HOS.Services.Vi if (!convertedScalingMode.HasValue) { - //Scaling mode out of the range of valid values. + // Scaling mode out of the range of valid values. return MakeError(ErrorModule.Vi, 1); } if (scalingMode != SrcScalingMode.ScaleToWindow && scalingMode != SrcScalingMode.PreserveAspectRatio) { - //Invalid scaling mode specified. + // Invalid scaling mode specified. return MakeError(ErrorModule.Vi, 6); } @@ -239,7 +239,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi { BinaryWriter writer = new BinaryWriter(ms); - //flat_binder_object (size is 0x28) + // flat_binder_object (size is 0x28) writer.Write(2); //Type (BINDER_TYPE_WEAK_BINDER) writer.Write(0); //Flags writer.Write((int)(id >> 0)); diff --git a/Ryujinx.HLE/HOS/Services/Vi/ISystemDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/ISystemDisplayService.cs index 6d001588..076618d7 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/ISystemDisplayService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/ISystemDisplayService.cs @@ -37,7 +37,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi public static long GetDisplayMode(ServiceCtx context) { - //TODO: De-hardcode resolution. + // TODO: De-hardcode resolution. context.ResponseData.Write(1280); context.ResponseData.Write(720); context.ResponseData.Write(60.0f); diff --git a/Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs b/Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs index 66c33279..d6b5fbdb 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs @@ -1,7 +1,6 @@ using Ryujinx.Common.Logging; using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Memory; -using Ryujinx.HLE.HOS.Kernel; using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Services.Nv.NvGpuAS; using Ryujinx.HLE.HOS.Services.Nv.NvMap; @@ -213,7 +212,7 @@ namespace Ryujinx.HLE.HOS.Services.Android private long GbpDequeueBuffer(ServiceCtx context, BinaryReader parcelReader) { - //TODO: Errors. + // TODO: Errors. int format = parcelReader.ReadInt32(); int width = parcelReader.ReadInt32(); int height = parcelReader.ReadInt32(); @@ -229,7 +228,7 @@ namespace Ryujinx.HLE.HOS.Services.Android { context.Device.Statistics.RecordGameFrameTime(); - //TODO: Errors. + // TODO: Errors. int slot = parcelReader.ReadInt32(); long Position = parcelReader.BaseStream.Position; @@ -260,7 +259,7 @@ namespace Ryujinx.HLE.HOS.Services.Android private long GbpCancelBuffer(ServiceCtx context, BinaryReader parcelReader) { - //TODO: Errors. + // TODO: Errors. int slot = parcelReader.ReadInt32(); MultiFence fence = ReadFlattenedObject<MultiFence>(parcelReader); @@ -401,7 +400,7 @@ namespace Ryujinx.HLE.HOS.Services.Android int BlockHeight = 1 << _bufferQueue[slot].Data.Buffer.Surfaces[0].BlockHeightLog2; - //Note: Rotation is being ignored. + // Note: Rotation is being ignored. int top = crop.Top; int left = crop.Left; diff --git a/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs b/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs index 2f0c35f4..36775b07 100644 --- a/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs +++ b/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs @@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.SystemState internal string ActiveAudioOutput { get; private set; } - public bool DiscordIntergrationEnabled { get; set; } + public bool DiscordIntegrationEnabled { get; set; } public bool DockedMode { get; set; } |
