From 39b8e6bc37d81bf9aa186b873787a5290c09e9a4 Mon Sep 17 00:00:00 2001 From: DatBoiJay3 <38231221+DatBoiJay3@users.noreply.github.com> Date: Mon, 11 Jun 2018 19:29:12 -0700 Subject: [PATCH 1/5] Fix input in SMO Unsure if this will break other games though. Please test. :) --- Ryujinx.HLE/Hid/Hid.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Ryujinx.HLE/Hid/Hid.cs b/Ryujinx.HLE/Hid/Hid.cs index 054c4fac8..97a5260eb 100644 --- a/Ryujinx.HLE/Hid/Hid.cs +++ b/Ryujinx.HLE/Hid/Hid.cs @@ -131,8 +131,7 @@ namespace Ryujinx.HLE.Input long BaseControllerOffset = Position + HidControllersOffset + 8 * HidControllerSize; HidControllerType Type = - HidControllerType.ControllerType_Handheld | - HidControllerType.ControllerType_JoyconPair; + HidControllerType.ControllerType_Handheld; bool IsHalf = false; @@ -276,4 +275,4 @@ namespace Ryujinx.HLE.Input return (long)((ulong)Environment.TickCount * 19_200); } } -} \ No newline at end of file +} From 274c996ff119ab201060e5818bc74879c2826c62 Mon Sep 17 00:00:00 2001 From: DatBoiJay3 <38231221+DatBoiJay3@users.noreply.github.com> Date: Mon, 11 Jun 2018 19:53:44 -0700 Subject: [PATCH 2/5] Neatness counts --- Ryujinx.HLE/Hid/Hid.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Ryujinx.HLE/Hid/Hid.cs b/Ryujinx.HLE/Hid/Hid.cs index 97a5260eb..2f007f1fb 100644 --- a/Ryujinx.HLE/Hid/Hid.cs +++ b/Ryujinx.HLE/Hid/Hid.cs @@ -130,8 +130,7 @@ namespace Ryujinx.HLE.Input { long BaseControllerOffset = Position + HidControllersOffset + 8 * HidControllerSize; - HidControllerType Type = - HidControllerType.ControllerType_Handheld; + HidControllerType Type = HidControllerType.ControllerType_Handheld; bool IsHalf = false; From 9176180abb119ff76c4f63eac09343faee686a18 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 12 Jun 2018 09:26:49 -0300 Subject: [PATCH 3/5] Minor shader fixes --- Ryujinx.Graphics/Gal/Shader/GlslDecl.cs | 3 ++- Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs | 3 ++- Ryujinx.Graphics/Gal/Shader/ShaderDecodeHelper.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs b/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs index 43a04813c..4002c29a5 100644 --- a/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs +++ b/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs @@ -159,7 +159,8 @@ namespace Ryujinx.Graphics.Gal.Shader case ShaderIrOperAbuf Abuf: { //This is a built-in input variable. - if (Abuf.Offs == VertexIdAttr) + if (Abuf.Offs == VertexIdAttr || + Abuf.Offs == InstanceIdAttr) { break; } diff --git a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs index 71a53a5a3..1bcedacba 100644 --- a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs +++ b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs @@ -975,7 +975,8 @@ namespace Ryujinx.Graphics.Gal.Shader switch (Node) { case ShaderIrOperAbuf Abuf: - return Abuf.Offs == GlslDecl.VertexIdAttr + return Abuf.Offs == GlslDecl.VertexIdAttr || + Abuf.Offs == GlslDecl.InstanceIdAttr ? OperType.I32 : OperType.F32; diff --git a/Ryujinx.Graphics/Gal/Shader/ShaderDecodeHelper.cs b/Ryujinx.Graphics/Gal/Shader/ShaderDecodeHelper.cs index 3299ebab6..a8ad5ec2e 100644 --- a/Ryujinx.Graphics/Gal/Shader/ShaderDecodeHelper.cs +++ b/Ryujinx.Graphics/Gal/Shader/ShaderDecodeHelper.cs @@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.Gal.Shader for (int Index = 0; Index <= Size; Index++) { - Opers[Index] = new ShaderIrOperAbuf(Abuf, Reg); + Opers[Index] = new ShaderIrOperAbuf(Abuf + Index * 4, Reg); } return Opers; From 46dc89f8dd7fc6fa75d3255a49e89a4615e1e504 Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Tue, 12 Jun 2018 14:29:16 +0200 Subject: [PATCH 4/5] Implement Fabs_V (#146) --- ChocolArm64/AOpCodeTable.cs | 1 + ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/ChocolArm64/AOpCodeTable.cs b/ChocolArm64/AOpCodeTable.cs index 3500fba0b..5bddc3b99 100644 --- a/ChocolArm64/AOpCodeTable.cs +++ b/ChocolArm64/AOpCodeTable.cs @@ -206,6 +206,7 @@ namespace ChocolArm64 SetA64("0>101110000xxxxx00011101<100000111110xxxxxxxxxx", AInstEmit.Fabs_V, typeof(AOpCodeSimd)); SetA64("000111100x1xxxxx001010xxxxxxxxxx", AInstEmit.Fadd_S, typeof(AOpCodeSimdReg)); SetA64("0>0011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Fadd_V, typeof(AOpCodeSimdReg)); SetA64("0>1011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Faddp_V, typeof(AOpCodeSimdReg)); diff --git a/ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs b/ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs index 0dfe0bd31..5aea6b045 100644 --- a/ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs +++ b/ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs @@ -309,6 +309,14 @@ namespace ChocolArm64.Instruction }); } + public static void Fabs_V(AILEmitterCtx Context) + { + EmitVectorUnaryOpF(Context, () => + { + EmitUnaryMathCall(Context, nameof(Math.Abs)); + }); + } + public static void Fadd_S(AILEmitterCtx Context) { if (AOptimizations.UseSse2) From 98e6a34608cc31f1f40e964a4a8cc80606877eca Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Tue, 12 Jun 2018 14:29:44 +0200 Subject: [PATCH 5/5] Implement R16 texture format (#147) --- Ryujinx.Graphics/Gal/GalTextureFormat.cs | 1 + Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs | 1 + Ryujinx.HLE/Gpu/TextureHelper.cs | 1 + Ryujinx.HLE/Gpu/TextureReader.cs | 1 + 4 files changed, 4 insertions(+) diff --git a/Ryujinx.Graphics/Gal/GalTextureFormat.cs b/Ryujinx.Graphics/Gal/GalTextureFormat.cs index 3bac2f800..7d19dc26d 100644 --- a/Ryujinx.Graphics/Gal/GalTextureFormat.cs +++ b/Ryujinx.Graphics/Gal/GalTextureFormat.cs @@ -10,6 +10,7 @@ namespace Ryujinx.Graphics.Gal B5G6R5 = 0x15, BC7U = 0x17, G8R8 = 0x18, + R16 = 0x1b, R8 = 0x1d, BC1 = 0x24, BC2 = 0x25, diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs index 50b802c1a..c8000603a 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs @@ -66,6 +66,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL case GalTextureFormat.A1B5G5R5: return (PixelFormat.Rgba, PixelType.UnsignedShort5551); case GalTextureFormat.B5G6R5: return (PixelFormat.Rgb, PixelType.UnsignedShort565); case GalTextureFormat.G8R8: return (PixelFormat.Rg, PixelType.UnsignedByte); + case GalTextureFormat.R16: return (PixelFormat.Red, PixelType.HalfFloat); case GalTextureFormat.R8: return (PixelFormat.Red, PixelType.UnsignedByte); } diff --git a/Ryujinx.HLE/Gpu/TextureHelper.cs b/Ryujinx.HLE/Gpu/TextureHelper.cs index f1b3f0b38..e48e25ad8 100644 --- a/Ryujinx.HLE/Gpu/TextureHelper.cs +++ b/Ryujinx.HLE/Gpu/TextureHelper.cs @@ -33,6 +33,7 @@ namespace Ryujinx.HLE.Gpu case GalTextureFormat.A1B5G5R5: return Texture.Width * Texture.Height * 2; case GalTextureFormat.B5G6R5: return Texture.Width * Texture.Height * 2; case GalTextureFormat.G8R8: return Texture.Width * Texture.Height * 2; + case GalTextureFormat.R16: return Texture.Width * Texture.Height * 2; case GalTextureFormat.R8: return Texture.Width * Texture.Height; case GalTextureFormat.BC1: diff --git a/Ryujinx.HLE/Gpu/TextureReader.cs b/Ryujinx.HLE/Gpu/TextureReader.cs index 4436e07fd..9e9ff7834 100644 --- a/Ryujinx.HLE/Gpu/TextureReader.cs +++ b/Ryujinx.HLE/Gpu/TextureReader.cs @@ -17,6 +17,7 @@ namespace Ryujinx.HLE.Gpu case GalTextureFormat.A1B5G5R5: return Read5551 (Memory, Texture); case GalTextureFormat.B5G6R5: return Read565 (Memory, Texture); case GalTextureFormat.G8R8: return Read2Bpp (Memory, Texture); + case GalTextureFormat.R16: return Read2Bpp (Memory, Texture); case GalTextureFormat.R8: return Read1Bpp (Memory, Texture); case GalTextureFormat.BC7U: return Read16Bpt4x4(Memory, Texture); case GalTextureFormat.BC1: return Read8Bpt4x4 (Memory, Texture);