Implement GetSystemClockContext

This commit is contained in:
greggameplayer 2018-06-16 03:20:48 +02:00
parent adeb8793c2
commit e13828bea8
258 changed files with 2484 additions and 2277 deletions

View file

@ -206,6 +206,7 @@ namespace ChocolArm64
SetA64("0>101110000xxxxx0<xxx0xxxxxxxxxx", AInstEmit.Ext_V, typeof(AOpCodeSimdExt)); SetA64("0>101110000xxxxx0<xxx0xxxxxxxxxx", AInstEmit.Ext_V, typeof(AOpCodeSimdExt));
SetA64("011111101x1xxxxx110101xxxxxxxxxx", AInstEmit.Fabd_S, typeof(AOpCodeSimdReg)); SetA64("011111101x1xxxxx110101xxxxxxxxxx", AInstEmit.Fabd_S, typeof(AOpCodeSimdReg));
SetA64("000111100x100000110000xxxxxxxxxx", AInstEmit.Fabs_S, typeof(AOpCodeSimd)); SetA64("000111100x100000110000xxxxxxxxxx", AInstEmit.Fabs_S, typeof(AOpCodeSimd));
SetA64("0>0011101<100000111110xxxxxxxxxx", AInstEmit.Fabs_V, typeof(AOpCodeSimd));
SetA64("000111100x1xxxxx001010xxxxxxxxxx", AInstEmit.Fadd_S, typeof(AOpCodeSimdReg)); SetA64("000111100x1xxxxx001010xxxxxxxxxx", AInstEmit.Fadd_S, typeof(AOpCodeSimdReg));
SetA64("0>0011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Fadd_V, typeof(AOpCodeSimdReg)); SetA64("0>0011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Fadd_V, typeof(AOpCodeSimdReg));
SetA64("0>1011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Faddp_V, typeof(AOpCodeSimdReg)); SetA64("0>1011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Faddp_V, typeof(AOpCodeSimdReg));

View file

@ -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) public static void Fadd_S(AILEmitterCtx Context)
{ {
if (AOptimizations.UseSse2) if (AOptimizations.UseSse2)

View file

@ -64,7 +64,7 @@ https://discord.gg/VkQYXAZ
**Running** **Running**
To run this emulator, you need the .NET Core 2.0 (or higher) SDK. To run this emulator, you need the .NET Core 2.1 (or higher) SDK *and* the OpenAL 11 Core SDK.
Run `dotnet run -c Release -- path\to\homebrew.nro` inside the Ryujinx solution folder to run homebrew apps. Run `dotnet run -c Release -- path\to\homebrew.nro` inside the Ryujinx solution folder to run homebrew apps.
Run `dotnet run -c Release -- path\to\game_exefs_and_romfs_folder` to run official games (they need to be decrypted and extracted first!) Run `dotnet run -c Release -- path\to\game_exefs_and_romfs_folder` to run official games (they need to be decrypted and extracted first!)
@ -73,5 +73,5 @@ You can check out the compatibility list within the Wiki. Only a handful of game
**Latest build** **Latest build**
These builds are compiled automatically for each commit on the master branch. They may be unstable or not work at all. These builds are compiled automatically for each commit on the master branch. They may be unstable or might not work at all.
To download the latest automatic build for Windows (64-bits), [Click Here](https://ci.appveyor.com/api/projects/gdkchan/ryujinx/artifacts/ryujinx_latest_unstable.zip?pr=false). The latest automatic build for Windows (64-bit) can be found on the [official website](https://ryujinx.org/#/Build).

View file

@ -1,28 +0,0 @@
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
namespace Ryujinx.Core.OsHle.Services.Nfp
{
class IUser : IpcService
{
private Dictionary<int, ServiceProcessRequest> m_Commands;
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
public IUser()
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, Initialize }
};
}
public long Initialize(ServiceCtx Context)
{
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
return 0;
}
}
}

View file

@ -8,7 +8,9 @@ namespace Ryujinx.Graphics.Gal
R32 = 0xf, R32 = 0xf,
A1B5G5R5 = 0x14, A1B5G5R5 = 0x14,
B5G6R5 = 0x15, B5G6R5 = 0x15,
BC7U = 0x17,
G8R8 = 0x18, G8R8 = 0x18,
R16 = 0x1b,
R8 = 0x1d, R8 = 0x1d,
BC1 = 0x24, BC1 = 0x24,
BC2 = 0x25, BC2 = 0x25,

View file

@ -66,6 +66,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
case GalTextureFormat.A1B5G5R5: return (PixelFormat.Rgba, PixelType.UnsignedShort5551); case GalTextureFormat.A1B5G5R5: return (PixelFormat.Rgba, PixelType.UnsignedShort5551);
case GalTextureFormat.B5G6R5: return (PixelFormat.Rgb, PixelType.UnsignedShort565); case GalTextureFormat.B5G6R5: return (PixelFormat.Rgb, PixelType.UnsignedShort565);
case GalTextureFormat.G8R8: return (PixelFormat.Rg, PixelType.UnsignedByte); case GalTextureFormat.G8R8: return (PixelFormat.Rg, PixelType.UnsignedByte);
case GalTextureFormat.R16: return (PixelFormat.Red, PixelType.HalfFloat);
case GalTextureFormat.R8: return (PixelFormat.Red, PixelType.UnsignedByte); case GalTextureFormat.R8: return (PixelFormat.Red, PixelType.UnsignedByte);
} }
@ -76,11 +77,12 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{ {
switch (Format) switch (Format)
{ {
case GalTextureFormat.BC1: return PixelInternalFormat.CompressedRgbaS3tcDxt1Ext; case GalTextureFormat.BC7U: return PixelInternalFormat.CompressedRgbaBptcUnorm;
case GalTextureFormat.BC2: return PixelInternalFormat.CompressedRgbaS3tcDxt3Ext; case GalTextureFormat.BC1: return PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
case GalTextureFormat.BC3: return PixelInternalFormat.CompressedRgbaS3tcDxt5Ext; case GalTextureFormat.BC2: return PixelInternalFormat.CompressedRgbaS3tcDxt3Ext;
case GalTextureFormat.BC4: return PixelInternalFormat.CompressedRedRgtc1; case GalTextureFormat.BC3: return PixelInternalFormat.CompressedRgbaS3tcDxt5Ext;
case GalTextureFormat.BC5: return PixelInternalFormat.CompressedRgRgtc2; case GalTextureFormat.BC4: return PixelInternalFormat.CompressedRedRgtc1;
case GalTextureFormat.BC5: return PixelInternalFormat.CompressedRgRgtc2;
} }
throw new NotImplementedException(Format.ToString()); throw new NotImplementedException(Format.ToString());

View file

@ -202,6 +202,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{ {
switch (Format) switch (Format)
{ {
case GalTextureFormat.BC7U:
case GalTextureFormat.BC1: case GalTextureFormat.BC1:
case GalTextureFormat.BC2: case GalTextureFormat.BC2:
case GalTextureFormat.BC3: case GalTextureFormat.BC3:

View file

@ -159,7 +159,8 @@ namespace Ryujinx.Graphics.Gal.Shader
case ShaderIrOperAbuf Abuf: case ShaderIrOperAbuf Abuf:
{ {
//This is a built-in input variable. //This is a built-in input variable.
if (Abuf.Offs == VertexIdAttr) if (Abuf.Offs == VertexIdAttr ||
Abuf.Offs == InstanceIdAttr)
{ {
break; break;
} }

View file

@ -975,7 +975,8 @@ namespace Ryujinx.Graphics.Gal.Shader
switch (Node) switch (Node)
{ {
case ShaderIrOperAbuf Abuf: case ShaderIrOperAbuf Abuf:
return Abuf.Offs == GlslDecl.VertexIdAttr return Abuf.Offs == GlslDecl.VertexIdAttr ||
Abuf.Offs == GlslDecl.InstanceIdAttr
? OperType.I32 ? OperType.I32
: OperType.F32; : OperType.F32;

View file

@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.Gal.Shader
for (int Index = 0; Index <= Size; Index++) for (int Index = 0; Index <= Size; Index++)
{ {
Opers[Index] = new ShaderIrOperAbuf(Abuf, Reg); Opers[Index] = new ShaderIrOperAbuf(Abuf + Index * 4, Reg);
} }
return Opers; return Opers;

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class BlockLinearSwizzle : ISwizzle class BlockLinearSwizzle : ISwizzle
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
interface INvGpuEngine interface INvGpuEngine
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
interface ISwizzle interface ISwizzle
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class LinearSwizzle : ISwizzle class LinearSwizzle : ISwizzle
{ {

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class MacroInterpreter class MacroInterpreter
{ {

View file

@ -1,7 +1,7 @@
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using System.Threading; using System.Threading;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class NvGpu class NvGpu
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
enum NvGpuBufferType enum NvGpuBufferType
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
enum NvGpuEngine enum NvGpuEngine
{ {

View file

@ -1,7 +1,7 @@
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class NvGpuEngine2d : INvGpuEngine class NvGpuEngine2d : INvGpuEngine
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
enum NvGpuEngine2dReg enum NvGpuEngine2dReg
{ {

View file

@ -2,7 +2,7 @@ using Ryujinx.Graphics.Gal;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class NvGpuEngine3d : INvGpuEngine class NvGpuEngine3d : INvGpuEngine
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
enum NvGpuEngine3dReg enum NvGpuEngine3dReg
{ {

View file

@ -1,6 +1,6 @@
using System.Collections.Concurrent; using System.Collections.Concurrent;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class NvGpuFifo class NvGpuFifo
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
enum NvGpuFifoMeth enum NvGpuFifoMeth
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
delegate void NvGpuMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry); delegate void NvGpuMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry);
} }

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
struct NvGpuPBEntry struct NvGpuPBEntry
{ {

View file

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
static class NvGpuPushBuffer static class NvGpuPushBuffer
{ {

View file

@ -2,7 +2,7 @@ using ChocolArm64.Memory;
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using System.Collections.Concurrent; using System.Collections.Concurrent;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class NvGpuVmm : IAMemory, IGalMemory class NvGpuVmm : IAMemory, IGalMemory
{ {

View file

@ -2,7 +2,7 @@ using ChocolArm64.Memory;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
class NvGpuVmmCache class NvGpuVmmCache
{ {

View file

@ -1,6 +1,6 @@
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
struct Texture struct Texture
{ {

View file

@ -1,7 +1,7 @@
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using System; using System;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
static class TextureFactory static class TextureFactory
{ {

View file

@ -2,7 +2,7 @@ using ChocolArm64.Memory;
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using System; using System;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
static class TextureHelper static class TextureHelper
{ {
@ -33,6 +33,7 @@ namespace Ryujinx.Core.Gpu
case GalTextureFormat.A1B5G5R5: return Texture.Width * Texture.Height * 2; case GalTextureFormat.A1B5G5R5: return Texture.Width * Texture.Height * 2;
case GalTextureFormat.B5G6R5: 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.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.R8: return Texture.Width * Texture.Height;
case GalTextureFormat.BC1: case GalTextureFormat.BC1:
@ -44,6 +45,7 @@ namespace Ryujinx.Core.Gpu
return W * H * 8; return W * H * 8;
} }
case GalTextureFormat.BC7U:
case GalTextureFormat.BC2: case GalTextureFormat.BC2:
case GalTextureFormat.BC3: case GalTextureFormat.BC3:
case GalTextureFormat.BC5: case GalTextureFormat.BC5:

View file

@ -2,7 +2,7 @@ using ChocolArm64.Memory;
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using System; using System;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
static class TextureReader static class TextureReader
{ {
@ -17,7 +17,9 @@ namespace Ryujinx.Core.Gpu
case GalTextureFormat.A1B5G5R5: return Read5551 (Memory, Texture); case GalTextureFormat.A1B5G5R5: return Read5551 (Memory, Texture);
case GalTextureFormat.B5G6R5: return Read565 (Memory, Texture); case GalTextureFormat.B5G6R5: return Read565 (Memory, Texture);
case GalTextureFormat.G8R8: return Read2Bpp (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.R8: return Read1Bpp (Memory, Texture);
case GalTextureFormat.BC7U: return Read16Bpt4x4(Memory, Texture);
case GalTextureFormat.BC1: return Read8Bpt4x4 (Memory, Texture); case GalTextureFormat.BC1: return Read8Bpt4x4 (Memory, Texture);
case GalTextureFormat.BC2: return Read16Bpt4x4(Memory, Texture); case GalTextureFormat.BC2: return Read16Bpt4x4(Memory, Texture);
case GalTextureFormat.BC3: return Read16Bpt4x4(Memory, Texture); case GalTextureFormat.BC3: return Read16Bpt4x4(Memory, Texture);

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
enum TextureSwizzle enum TextureSwizzle
{ {

View file

@ -2,7 +2,7 @@ using ChocolArm64.Memory;
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using System; using System;
namespace Ryujinx.Core.Gpu namespace Ryujinx.HLE.Gpu
{ {
static class TextureWriter static class TextureWriter
{ {

View file

@ -1,9 +1,10 @@
using ChocolArm64.Memory; using ChocolArm64.Memory;
using Ryujinx.Core.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle;
using Ryujinx.HLE.OsHle.Handles;
using System; using System;
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
public class Hid public class Hid
{ {
@ -85,11 +86,16 @@ namespace Ryujinx.Core.Input
{ {
ShMemPositions = SharedMem.GetVirtualPositions(); ShMemPositions = SharedMem.GetVirtualPositions();
(AMemory Memory, long Position) ShMem = ShMemPositions[ShMemPositions.Length - 1]; (AMemory Memory, long Position) = ShMemPositions[ShMemPositions.Length - 1];
Log.PrintInfo(LogClass.Hid, $"HID shared memory successfully mapped to 0x{ShMem.Position:x16}!"); for (long Offset = 0; Offset < Horizon.HidSize; Offset += 8)
{
Memory.WriteInt64Unchecked(Position + Offset, 0);
}
Init(ShMem.Memory, ShMem.Position); Log.PrintInfo(LogClass.Hid, $"HID shared memory successfully mapped to 0x{Position:x16}!");
Init(Memory, Position);
} }
} }
@ -124,9 +130,7 @@ namespace Ryujinx.Core.Input
{ {
long BaseControllerOffset = Position + HidControllersOffset + 8 * HidControllerSize; long BaseControllerOffset = Position + HidControllersOffset + 8 * HidControllerSize;
HidControllerType Type = HidControllerType Type = HidControllerType.ControllerType_Handheld;
HidControllerType.ControllerType_Handheld |
HidControllerType.ControllerType_JoyconPair;
bool IsHalf = false; bool IsHalf = false;
@ -186,18 +190,22 @@ namespace Ryujinx.Core.Input
ControllerOffset += HidControllersLayoutHeaderSize; ControllerOffset += HidControllersLayoutHeaderSize;
long LastEntryOffset = ControllerOffset + LastEntry * HidControllersInputEntrySize;
ControllerOffset += CurrEntry * HidControllersInputEntrySize; ControllerOffset += CurrEntry * HidControllersInputEntrySize;
Memory.WriteInt64Unchecked(ControllerOffset + 0x0, Timestamp); long SampleCounter = Memory.ReadInt64Unchecked(LastEntryOffset) + 1;
Memory.WriteInt64Unchecked(ControllerOffset + 0x8, Timestamp);
Memory.WriteInt64Unchecked(ControllerOffset + 0x0, SampleCounter);
Memory.WriteInt64Unchecked(ControllerOffset + 0x8, SampleCounter);
Memory.WriteInt64Unchecked(ControllerOffset + 0x10, (uint)Buttons); Memory.WriteInt64Unchecked(ControllerOffset + 0x10, (uint)Buttons);
Memory.WriteInt32Unchecked(ControllerOffset + 0x18, LeftStick.DX); Memory.WriteInt32Unchecked(ControllerOffset + 0x18, LeftStick.DX);
Memory.WriteInt32Unchecked(ControllerOffset + 0x1c, LeftStick.DY); Memory.WriteInt32Unchecked(ControllerOffset + 0x1c, LeftStick.DY);
Memory.WriteInt64Unchecked(ControllerOffset + 0x20, RightStick.DX); Memory.WriteInt32Unchecked(ControllerOffset + 0x20, RightStick.DX);
Memory.WriteInt64Unchecked(ControllerOffset + 0x24, RightStick.DY); Memory.WriteInt32Unchecked(ControllerOffset + 0x24, RightStick.DY);
Memory.WriteInt64Unchecked(ControllerOffset + 0x28, Memory.WriteInt64Unchecked(ControllerOffset + 0x28,
(uint)HidControllerConnState.Controller_State_Connected | (uint)HidControllerConnState.Controller_State_Connected |

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
[Flags] [Flags]
public enum HidControllerButtons public enum HidControllerButtons

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
[Flags] [Flags]
public enum HidControllerColorDesc public enum HidControllerColorDesc

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
[Flags] [Flags]
public enum HidControllerConnState public enum HidControllerConnState

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
public enum HidControllerId public enum HidControllerId
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
public enum HidControllerLayouts public enum HidControllerLayouts
{ {

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
[Flags] [Flags]
public enum HidControllerType public enum HidControllerType

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
public struct HidJoystickPosition public struct HidJoystickPosition
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
public struct HidTouchPoint public struct HidTouchPoint
{ {

View file

@ -1,5 +1,5 @@
//TODO: This is only used by Config, it doesn't belong to Core. //TODO: This is only used by Config, it doesn't belong to Core.
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
public struct JoyConLeft public struct JoyConLeft
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Input namespace Ryujinx.HLE.Input
{ {
public enum JoyConColor //Thanks to CTCaer public enum JoyConColor //Thanks to CTCaer
{ {

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.Loaders.Compression namespace Ryujinx.HLE.Loaders.Compression
{ {
static class Lz4 static class Lz4
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
struct ElfDyn struct ElfDyn
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
enum ElfDynTag enum ElfDynTag
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
struct ElfRel struct ElfRel
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
enum ElfRelType enum ElfRelType
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
struct ElfSym struct ElfSym
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
enum ElfSymBinding enum ElfSymBinding
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
enum ElfSymType enum ElfSymType
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
enum ElfSymVisibility enum ElfSymVisibility
{ {

View file

@ -1,9 +1,9 @@
using ChocolArm64.Memory; using ChocolArm64.Memory;
using Ryujinx.Core.Loaders.Executables; using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.Core.OsHle; using Ryujinx.HLE.OsHle;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.Loaders namespace Ryujinx.HLE.Loaders
{ {
class Executable class Executable
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Loaders.Executables namespace Ryujinx.HLE.Loaders.Executables
{ {
public interface IExecutable public interface IExecutable
{ {

View file

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace Ryujinx.Core.Loaders.Executables namespace Ryujinx.HLE.Loaders.Executables
{ {
class Nro : IExecutable class Nro : IExecutable
{ {

View file

@ -1,8 +1,8 @@
using Ryujinx.Core.Loaders.Compression; using Ryujinx.HLE.Loaders.Compression;
using System; using System;
using System.IO; using System.IO;
namespace Ryujinx.Core.Loaders.Executables namespace Ryujinx.HLE.Loaders.Executables
{ {
class Nso : IExecutable class Nso : IExecutable
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Logging namespace Ryujinx.HLE.Logging
{ {
public enum LogClass public enum LogClass
{ {

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.Logging namespace Ryujinx.HLE.Logging
{ {
public class LogEventArgs : EventArgs public class LogEventArgs : EventArgs
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.Logging namespace Ryujinx.HLE.Logging
{ {
public enum LogLevel public enum LogLevel
{ {

View file

@ -2,7 +2,7 @@ using System;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Ryujinx.Core.Logging namespace Ryujinx.HLE.Logging
{ {
public class Logger public class Logger
{ {

View file

@ -1,9 +1,9 @@
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using Ryujinx.Core.OsHle.Services.Am; using Ryujinx.HLE.OsHle.Services.Am;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
namespace Ryujinx.Core.OsHle namespace Ryujinx.HLE.OsHle
{ {
class AppletStateMgr : IDisposable class AppletStateMgr : IDisposable
{ {

View file

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace Ryujinx.Core.OsHle.Diagnostics namespace Ryujinx.HLE.OsHle.Diagnostics
{ {
static class Demangler static class Demangler
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle namespace Ryujinx.HLE.OsHle
{ {
static class ErrorCode static class ErrorCode
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle namespace Ryujinx.HLE.OsHle
{ {
enum ErrorModule enum ErrorModule
{ {

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.OsHle.Exceptions namespace Ryujinx.HLE.OsHle.Exceptions
{ {
public class GuestBrokeExecutionException : Exception public class GuestBrokeExecutionException : Exception
{ {

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.OsHle.Exceptions namespace Ryujinx.HLE.OsHle.Exceptions
{ {
public class UndefinedInstructionException : Exception public class UndefinedInstructionException : Exception
{ {

View file

@ -1,7 +1,7 @@
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.OsHle namespace Ryujinx.HLE.OsHle
{ {
class GlobalStateTable class GlobalStateTable
{ {

View file

@ -2,7 +2,7 @@ using ChocolArm64.Memory;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class HSharedMem class HSharedMem
{ {

View file

@ -1,6 +1,6 @@
using ChocolArm64.Memory; using ChocolArm64.Memory;
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class HTransferMem class HTransferMem
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class KEvent : KSynchronizationObject { } class KEvent : KSynchronizationObject { }
} }

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class KProcessHandleTable class KProcessHandleTable
{ {

View file

@ -1,9 +1,9 @@
using Ryujinx.Core.Logging; using Ryujinx.HLE.Logging;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Threading; using System.Threading;
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class KProcessScheduler : IDisposable class KProcessScheduler : IDisposable
{ {

View file

@ -1,7 +1,7 @@
using Ryujinx.Core.OsHle.Services; using Ryujinx.HLE.OsHle.Services;
using System; using System;
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class KSession : IDisposable class KSession : IDisposable
{ {

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Threading; using System.Threading;
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class KSynchronizationObject : IDisposable class KSynchronizationObject : IDisposable
{ {

View file

@ -1,7 +1,7 @@
using ChocolArm64; using ChocolArm64;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class KThread : KSynchronizationObject class KThread : KSynchronizationObject
{ {

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Threading; using System.Threading;
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class SchedulerThread : IDisposable class SchedulerThread : IDisposable
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle.Handles namespace Ryujinx.HLE.OsHle.Handles
{ {
class ThreadQueue class ThreadQueue
{ {

View file

@ -1,6 +1,6 @@
using ChocolArm64.Memory; using ChocolArm64.Memory;
namespace Ryujinx.Core.OsHle namespace Ryujinx.HLE.OsHle
{ {
static class Homebrew static class Homebrew
{ {

View file

@ -1,11 +1,11 @@
using Ryujinx.Core.Loaders.Executables; using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.Core.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.IO; using System.IO;
namespace Ryujinx.Core.OsHle namespace Ryujinx.HLE.OsHle
{ {
public class Horizon : IDisposable public class Horizon : IDisposable
{ {

View file

@ -2,7 +2,7 @@ using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.Core.OsHle namespace Ryujinx.HLE.OsHle
{ {
class IdDictionary class IdDictionary
{ {

View file

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
struct IpcBuffDesc struct IpcBuffDesc
{ {

View file

@ -1,7 +1,7 @@
using System; using System;
using System.IO; using System.IO;
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
class IpcHandleDesc class IpcHandleDesc
{ {

View file

@ -1,9 +1,9 @@
using ChocolArm64.Memory; using ChocolArm64.Memory;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using System; using System;
using System.IO; using System.IO;
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
static class IpcHandler static class IpcHandler
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
abstract class IpcMagic abstract class IpcMagic
{ {

View file

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
class IpcMessage class IpcMessage
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
enum IpcMessageType enum IpcMessageType
{ {

View file

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
struct IpcPtrBuffDesc struct IpcPtrBuffDesc
{ {

View file

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
struct IpcRecvListBuffDesc struct IpcRecvListBuffDesc
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle.Ipc namespace Ryujinx.HLE.OsHle.Ipc
{ {
delegate long ServiceProcessRequest(ServiceCtx Context); delegate long ServiceProcessRequest(ServiceCtx Context);
} }

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle.Kernel namespace Ryujinx.HLE.OsHle.Kernel
{ {
static class KernelErr static class KernelErr
{ {

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Core.OsHle.Kernel namespace Ryujinx.HLE.OsHle.Kernel
{ {
static class NsTimeConverter static class NsTimeConverter
{ {

View file

@ -1,14 +1,14 @@
using ChocolArm64.Events; using ChocolArm64.Events;
using ChocolArm64.Memory; using ChocolArm64.Memory;
using ChocolArm64.State; using ChocolArm64.State;
using Ryujinx.Core.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using System; using System;
using System.Collections.Generic;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading; using System.Threading;
namespace Ryujinx.Core.OsHle.Kernel namespace Ryujinx.HLE.OsHle.Kernel
{ {
partial class SvcHandler : IDisposable partial class SvcHandler : IDisposable
{ {
@ -47,6 +47,7 @@ namespace Ryujinx.Core.OsHle.Kernel
{ 0x0b, SvcSleepThread }, { 0x0b, SvcSleepThread },
{ 0x0c, SvcGetThreadPriority }, { 0x0c, SvcGetThreadPriority },
{ 0x0d, SvcSetThreadPriority }, { 0x0d, SvcSetThreadPriority },
{ 0x0e, SvcGetThreadCoreMask },
{ 0x0f, SvcSetThreadCoreMask }, { 0x0f, SvcSetThreadCoreMask },
{ 0x10, SvcGetCurrentProcessorNumber }, { 0x10, SvcGetCurrentProcessorNumber },
{ 0x12, SvcClearEvent }, { 0x12, SvcClearEvent },

View file

@ -1,11 +1,11 @@
using ChocolArm64.Memory; using ChocolArm64.Memory;
using ChocolArm64.State; using ChocolArm64.State;
using Ryujinx.Core.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using static Ryujinx.Core.OsHle.ErrorCode; using static Ryujinx.HLE.OsHle.ErrorCode;
namespace Ryujinx.Core.OsHle.Kernel namespace Ryujinx.HLE.OsHle.Kernel
{ {
partial class SvcHandler partial class SvcHandler
{ {

View file

@ -1,16 +1,16 @@
using ChocolArm64.Memory; using ChocolArm64.Memory;
using ChocolArm64.State; using ChocolArm64.State;
using Ryujinx.Core.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.Core.OsHle.Exceptions; using Ryujinx.HLE.OsHle.Exceptions;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc; using Ryujinx.HLE.OsHle.Ipc;
using Ryujinx.Core.OsHle.Services; using Ryujinx.HLE.OsHle.Services;
using System; using System;
using System.Threading; using System.Threading;
using static Ryujinx.Core.OsHle.ErrorCode; using static Ryujinx.HLE.OsHle.ErrorCode;
namespace Ryujinx.Core.OsHle.Kernel namespace Ryujinx.HLE.OsHle.Kernel
{ {
partial class SvcHandler partial class SvcHandler
{ {

View file

@ -1,11 +1,11 @@
using ChocolArm64.State; using ChocolArm64.State;
using Ryujinx.Core.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using System.Threading; using System.Threading;
using static Ryujinx.Core.OsHle.ErrorCode; using static Ryujinx.HLE.OsHle.ErrorCode;
namespace Ryujinx.Core.OsHle.Kernel namespace Ryujinx.HLE.OsHle.Kernel
{ {
partial class SvcHandler partial class SvcHandler
{ {
@ -139,6 +139,28 @@ namespace Ryujinx.Core.OsHle.Kernel
} }
} }
private void SvcGetThreadCoreMask(AThreadState ThreadState)
{
int Handle = (int)ThreadState.X2;
Ns.Log.PrintDebug(LogClass.KernelSvc, "Handle = " + Handle.ToString("x8"));
KThread Thread = GetThread(ThreadState.Tpidr, Handle);
if (Thread != null)
{
ThreadState.X0 = 0;
ThreadState.X1 = (ulong)Thread.IdealCore;
ThreadState.X2 = (ulong)Thread.CoreMask;
}
else
{
Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!");
ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle);
}
}
private void SvcSetThreadCoreMask(AThreadState ThreadState) private void SvcSetThreadCoreMask(AThreadState ThreadState)
{ {
//FIXME: This is wrong, but the "correct" way to handle //FIXME: This is wrong, but the "correct" way to handle

View file

@ -1,14 +1,14 @@
using ChocolArm64.State; using ChocolArm64.State;
using Ryujinx.Core.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using static Ryujinx.Core.OsHle.ErrorCode; using static Ryujinx.HLE.OsHle.ErrorCode;
namespace Ryujinx.Core.OsHle.Kernel namespace Ryujinx.HLE.OsHle.Kernel
{ {
partial class SvcHandler partial class SvcHandler
{ {

View file

@ -1,6 +1,6 @@
using System; using System;
namespace Ryujinx.Core.OsHle namespace Ryujinx.HLE.OsHle
{ {
class MemoryAllocator class MemoryAllocator
{ {

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