diff --git a/Ryujinx.Graphics.OpenGL/EnumConversion.cs b/Ryujinx.Graphics.OpenGL/EnumConversion.cs index 0d5ea823b3..014ddfc1db 100644 --- a/Ryujinx.Graphics.OpenGL/EnumConversion.cs +++ b/Ryujinx.Graphics.OpenGL/EnumConversion.cs @@ -193,9 +193,9 @@ namespace Ryujinx.Graphics.OpenGL switch (mode) { case DepthStencilMode.Depth: - return All.Depth; + return All.DepthComponent; case DepthStencilMode.Stencil: - return All.Stencil; + return All.StencilIndex; } Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}."); diff --git a/Ryujinx.Graphics.OpenGL/TextureView.cs b/Ryujinx.Graphics.OpenGL/TextureView.cs index 2efaf7c0a1..8fa78e5b5f 100644 --- a/Ryujinx.Graphics.OpenGL/TextureView.cs +++ b/Ryujinx.Graphics.OpenGL/TextureView.cs @@ -100,9 +100,7 @@ namespace Ryujinx.Graphics.OpenGL } GL.TexParameter(target, TextureParameterName.TextureMaxLevel, maxLevel); - - // TODO: This requires ARB_stencil_texturing, we should uncomment and test this. - // GL.TexParameter(target, TextureParameterName.DepthStencilTextureMode, (int)_info.DepthStencilMode.Convert()); + GL.TexParameter(target, TextureParameterName.DepthStencilTextureMode, (int)_info.DepthStencilMode.Convert()); } public ITexture CreateView(TextureCreateInfo info, int firstLayer, int firstLevel) diff --git a/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs b/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs index ee3ace68d2..4b201d1419 100644 --- a/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs +++ b/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs @@ -53,8 +53,8 @@ namespace Ryujinx.HLE.HOS.Ipc else if (request.Type == IpcMessageType.Control || request.Type == IpcMessageType.ControlWithContext) { - long magic = reqReader.ReadInt64(); - long cmdId = reqReader.ReadInt64(); + uint magic = (uint)reqReader.ReadUInt64(); + uint cmdId = (uint)reqReader.ReadUInt64(); switch (cmdId) { diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs index 1dd5fb86e7..c0f28166b1 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs @@ -115,8 +115,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy public static Result ReadFsPath(out FsPath path, ServiceCtx context, int index = 0) { - long position = context.Request.SendBuff[index].Position; - long size = context.Request.SendBuff[index].Size; + long position = context.Request.PtrBuff[index].Position; + long size = context.Request.PtrBuff[index].Size; byte[] pathBytes = context.Memory.ReadBytes(position, size); diff --git a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs index f606361c76..f5c8a873df 100644 --- a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs +++ b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs @@ -1,7 +1,7 @@ +using MsgPack.Serialization; using Ryujinx.Common.Logging; using Ryujinx.HLE.Utilities; -using System; -using System.Buffers.Binary; +using System.Collections.Generic; using System.IO; using System.Text; @@ -79,7 +79,7 @@ namespace Ryujinx.HLE.HOS.Services.Prepo return ResultCode.Success; } - public string ReadReportBuffer(byte[] buffer, string room, UInt128 userId) + private string ReadReportBuffer(byte[] buffer, string room, UInt128 userId) { StringBuilder sb = new StringBuilder(); @@ -93,103 +93,24 @@ namespace Ryujinx.HLE.HOS.Services.Prepo sb.AppendLine($" Room: {room}"); - try + var payload = Deserialize>(buffer); + + foreach (var field in payload) { - using (MemoryStream stream = new MemoryStream(buffer)) - using (BinaryReader reader = new BinaryReader(stream)) - { - byte unknown1 = reader.ReadByte(); // Version ? - short unknown2 = reader.ReadInt16(); // Size ? - - bool isValue = false; - - string fieldStr = string.Empty; - - while (stream.Position != stream.Length) - { - byte descriptor = reader.ReadByte(); - - if (!isValue) - { - byte[] key = reader.ReadBytes(descriptor - 0xA0); - - fieldStr = $" Key: {Encoding.ASCII.GetString(key)}"; - - isValue = true; - } - else - { - if (descriptor > 0xD0) // Int value. - { - if (descriptor - 0xD0 == 1) - { - fieldStr += $", Value: {BinaryPrimitives.ReverseEndianness(reader.ReadUInt16())}"; - } - else if (descriptor - 0xD0 == 2) - { - fieldStr += $", Value: {BinaryPrimitives.ReverseEndianness(reader.ReadInt32())}"; - } - else if (descriptor - 0xD0 == 4) - { - fieldStr += $", Value: {BinaryPrimitives.ReverseEndianness(reader.ReadInt64())}"; - } - else - { - // Unknown. - break; - } - } - else if (descriptor > 0xA0 && descriptor < 0xD0) // String value, max size = 0x20 bytes ? - { - int size = descriptor - 0xA0; - string value = string.Empty; - byte[] rawValues = new byte[0]; - - for (int i = 0; i < size; i++) - { - byte chr = reader.ReadByte(); - - if (chr >= 0x20 && chr < 0x7f) - { - value += (char)chr; - } - else - { - Array.Resize(ref rawValues, rawValues.Length + 1); - - rawValues[rawValues.Length - 1] = chr; - } - } - - if (value != string.Empty) - { - fieldStr += $", Value: {value}"; - } - - // TODO(Ac_K): Determine why there are non-alphanumeric values sometimes. - if (rawValues.Length > 0) - { - fieldStr += $", RawValue: 0x{BitConverter.ToString(rawValues).Replace("-", "")}"; - } - } - else // Byte value. - { - fieldStr += $", Value: {descriptor}"; - } - - sb.AppendLine(fieldStr); - - isValue = false; - } - } - } - } - catch (Exception) - { - sb.AppendLine(" Error while parsing the report buffer."); + sb.AppendLine($" Key: {field.Key}, Value: {field.Value}"); } return sb.ToString(); } + + private static T Deserialize(byte[] bytes) + { + MessagePackSerializer serializer = MessagePackSerializer.Get(); + + using (MemoryStream byteStream = new MemoryStream(bytes)) + { + return (T)serializer.Unpack(byteStream); + } + } } -} +} \ No newline at end of file diff --git a/Ryujinx.HLE/Ryujinx.HLE.csproj b/Ryujinx.HLE/Ryujinx.HLE.csproj index 4fb4835d9c..ac4b822401 100644 --- a/Ryujinx.HLE/Ryujinx.HLE.csproj +++ b/Ryujinx.HLE/Ryujinx.HLE.csproj @@ -53,6 +53,7 @@ +