diff options
Diffstat (limited to 'Ryujinx.HLE/HOS')
| -rw-r--r-- | Ryujinx.HLE/HOS/Homebrew.cs | 16 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Horizon.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Ipc/IpcHandler.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs | 7 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs | 19 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs | 24 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs | 12 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/ServiceCtx.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/VoiceContext.cs | 4 |
13 files changed, 43 insertions, 63 deletions
diff --git a/Ryujinx.HLE/HOS/Homebrew.cs b/Ryujinx.HLE/HOS/Homebrew.cs index 8e54f82c..dca02d91 100644 --- a/Ryujinx.HLE/HOS/Homebrew.cs +++ b/Ryujinx.HLE/HOS/Homebrew.cs @@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS public const string TemporaryNroSuffix = ".ryu_tmp.nro"; // http://switchbrew.org/index.php?title=Homebrew_ABI - public static void WriteHbAbiData(IMemoryManager memory, long position, int mainThreadHandle, string switchPath) + public static void WriteHbAbiData(MemoryManager memory, long position, int mainThreadHandle, string switchPath) { // MainThreadHandle. WriteConfigEntry(memory, ref position, 1, 0, mainThreadHandle); @@ -31,12 +31,12 @@ namespace Ryujinx.HLE.HOS } private static void WriteConfigEntry( - IMemoryManager memory, - ref long position, - int key, - int flags = 0, - long value0 = 0, - long value1 = 0) + MemoryManager memory, + ref long position, + int key, + int flags = 0, + long value0 = 0, + long value1 = 0) { memory.WriteInt32(position + 0x00, key); memory.WriteInt32(position + 0x04, flags); @@ -46,7 +46,7 @@ namespace Ryujinx.HLE.HOS position += 0x18; } - public static string ReadHbAbiNextLoadPath(IMemoryManager memory, long position) + public static string ReadHbAbiNextLoadPath(MemoryManager memory, long position) { string fileName = null; diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 0deb7ac1..1e218c87 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -115,8 +115,6 @@ namespace Ryujinx.HLE.HOS public int GlobalAccessLogMode { get; set; } - public bool UseLegacyJit { get; set; } - internal long HidBaseAddress { get; private set; } internal FileSystemServer FsServer { get; private set; } diff --git a/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs b/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs index dd36871a..ee3ace68 100644 --- a/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs +++ b/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Ipc public static KernelResult IpcCall( Switch device, KProcess process, - IMemoryManager memory, + MemoryManager memory, KThread thread, KClientSession session, IpcMessage request, diff --git a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs index fd80b3b9..fd2078ee 100644 --- a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs +++ b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryManager.cs @@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory private LinkedList<KMemoryBlock> _blocks; - private IMemoryManager _cpuMemory; + private MemoryManager _cpuMemory; private Horizon _system; @@ -72,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory private MersenneTwister _randomNumberGenerator; - public KMemoryManager(Horizon system, IMemoryManager cpuMemory) + public KMemoryManager(Horizon system, MemoryManager cpuMemory) { _system = system; _cpuMemory = cpuMemory; diff --git a/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs b/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs index e2ca44b5..4219eb75 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs @@ -1,5 +1,4 @@ using ARMeilleure.Memory; -using ARMeilleure.State; using Ryujinx.HLE.HOS.Diagnostics.Demangler; using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.Loaders.Elf; @@ -40,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process _images = new List<Image>(); } - public string GetGuestStackTrace(IExecutionContext context) + public string GetGuestStackTrace(ARMeilleure.State.ExecutionContext context) { EnsureLoaded(); @@ -218,7 +217,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } } - private void LoadMod0Symbols(IMemoryManager memory, long textOffset) + private void LoadMod0Symbols(MemoryManager memory, long textOffset) { long mod0Offset = textOffset + memory.ReadUInt32(textOffset + 4); @@ -288,7 +287,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } } - private ElfSymbol GetSymbol(IMemoryManager memory, long address, long strTblAddr) + private ElfSymbol GetSymbol(MemoryManager memory, long address, long strTblAddr) { int nameIndex = memory.ReadInt32(address + 0); int info = memory.ReadByte (address + 4); diff --git a/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs b/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs index c6283afd..1b16d79a 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs @@ -78,9 +78,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Process public bool IsPaused { get; private set; } - public IMemoryManager CpuMemory { get; private set; } + public MemoryManager CpuMemory { get; private set; } - public ITranslator Translator { get; private set; } + public Translator Translator { get; private set; } private SvcHandler _svcHandler; @@ -791,7 +791,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } } - public void SubscribeThreadEventHandlers(IExecutionContext context) + public void SubscribeThreadEventHandlers(ARMeilleure.State.ExecutionContext context) { context.Interrupt += InterruptHandler; context.SupervisorCall += _svcHandler.SvcCall; @@ -1022,18 +1022,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Process bool useFlatPageTable = memRegion == MemoryRegion.Application; - if (_system.UseLegacyJit) - { - CpuMemory = new ChocolArm64.Memory.MemoryManager(_system.Device.Memory.RamPointer, addrSpaceBits, useFlatPageTable); - - Translator = new ChocolArm64.Translation.Translator((ChocolArm64.Memory.MemoryManager)CpuMemory); - } - else - { - CpuMemory = new MemoryManager(_system.Device.Memory.RamPointer, addrSpaceBits, useFlatPageTable); + CpuMemory = new MemoryManager(_system.Device.Memory.RamPointer, addrSpaceBits, useFlatPageTable); - Translator = new Translator((MemoryManager)CpuMemory); - } + Translator = new Translator(CpuMemory); MemoryManager = new KMemoryManager(_system, CpuMemory); } diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs index 7509ae04..e3a4b375 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs @@ -19,14 +19,14 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall public void SvcCall(object sender, InstExceptionEventArgs e) { - Action<SvcHandler, IExecutionContext> svcFunc = SvcTable.GetSvcFunc(e.Id); + Action<SvcHandler, ExecutionContext> svcFunc = SvcTable.GetSvcFunc(e.Id); if (svcFunc == null) { throw new NotImplementedException($"SVC 0x{e.Id:X4} is not implemented."); } - IExecutionContext context = (IExecutionContext)sender; + ExecutionContext context = (ExecutionContext)sender; svcFunc(this, context); } diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs index b740253f..9ec0931a 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs @@ -14,7 +14,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall private static Dictionary<int, string> _svcFuncs64; - private static Action<SvcHandler, IExecutionContext>[] _svcTable64; + private static Action<SvcHandler, ExecutionContext>[] _svcTable64; static SvcTable() { @@ -77,10 +77,10 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall { 0x78, nameof(SvcHandler.UnmapProcessCodeMemory64) } }; - _svcTable64 = new Action<SvcHandler, IExecutionContext>[0x80]; + _svcTable64 = new Action<SvcHandler, ExecutionContext>[0x80]; } - public static Action<SvcHandler, IExecutionContext> GetSvcFunc(int svcId) + public static Action<SvcHandler, ExecutionContext> GetSvcFunc(int svcId) { if (_svcTable64[svcId] != null) { @@ -95,9 +95,9 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return null; } - private static Action<SvcHandler, IExecutionContext> GenerateMethod(string svcName) + private static Action<SvcHandler, ExecutionContext> GenerateMethod(string svcName) { - Type[] argTypes = new Type[] { typeof(SvcHandler), typeof(IExecutionContext) }; + Type[] argTypes = new Type[] { typeof(SvcHandler), typeof(ExecutionContext) }; DynamicMethod method = new DynamicMethod(svcName, null, argTypes); @@ -188,7 +188,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Ldc_I4, byRefArgsCount + index); - MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.GetX)); + MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.GetX)); generator.Emit(OpCodes.Call, info); @@ -234,7 +234,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Ldc_I4, index); - MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.GetX)); + MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.GetX)); generator.Emit(OpCodes.Call, info); @@ -250,7 +250,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Ldc_I4, byRefArgsCount + index); - MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.GetX)); + MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.GetX)); generator.Emit(OpCodes.Call, info); @@ -288,7 +288,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall ConvertToFieldType(retType); - MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.SetX)); + MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX)); generator.Emit(OpCodes.Call, info); } @@ -301,7 +301,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall ConvertToFieldType(locals[index].LocalType); - MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.SetX)); + MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX)); generator.Emit(OpCodes.Call, info); } @@ -313,14 +313,14 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Ldc_I4, outRegIndex++); generator.Emit(OpCodes.Ldc_I8, 0L); - MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.SetX)); + MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX)); generator.Emit(OpCodes.Call, info); } generator.Emit(OpCodes.Ret); - return (Action<SvcHandler, IExecutionContext>)method.CreateDelegate(typeof(Action<SvcHandler, IExecutionContext>)); + return (Action<SvcHandler, ExecutionContext>)method.CreateDelegate(typeof(Action<SvcHandler, ExecutionContext>)); } private static void CheckIfTypeIsSupported(Type type, string svcName) diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs index e49da023..0908de10 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThread.cs @@ -348,7 +348,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.InvalidThread; } - IMemoryManager memory = currentProcess.CpuMemory; + MemoryManager memory = currentProcess.CpuMemory; memory.WriteUInt64((long)address + 0x0, thread.Context.GetX(0)); memory.WriteUInt64((long)address + 0x8, thread.Context.GetX(1)); @@ -427,7 +427,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.Success; } - private static int GetPsr(IExecutionContext context) + private static int GetPsr(ExecutionContext context) { return (context.GetPstateFlag(PState.NFlag) ? (1 << 31) : 0) | (context.GetPstateFlag(PState.ZFlag) ? (1 << 30) : 0) | diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs index 54d5d06c..d4965b41 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs @@ -1,5 +1,4 @@ using ARMeilleure.Memory; -using ARMeilleure.State; using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Process; @@ -17,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading public Thread HostThread { get; private set; } - public IExecutionContext Context { get; private set; } + public ARMeilleure.State.ExecutionContext Context { get; private set; } public long AffinityMask { get; set; } @@ -159,14 +158,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading HostThread = new Thread(() => ThreadStart(entrypoint)); - if (System.UseLegacyJit) - { - Context = new ChocolArm64.State.CpuThreadState(); - } - else - { - Context = new ARMeilleure.State.ExecutionContext(); - } + Context = new ARMeilleure.State.ExecutionContext(); bool isAarch32 = (Owner.MmuFlags & 1) == 0; diff --git a/Ryujinx.HLE/HOS/ServiceCtx.cs b/Ryujinx.HLE/HOS/ServiceCtx.cs index df74ba0a..fa6cfca3 100644 --- a/Ryujinx.HLE/HOS/ServiceCtx.cs +++ b/Ryujinx.HLE/HOS/ServiceCtx.cs @@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS { public Switch Device { get; } public KProcess Process { get; } - public IMemoryManager Memory { get; } + public MemoryManager Memory { get; } public KThread Thread { get; } public KClientSession Session { get; } public IpcMessage Request { get; } @@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS public ServiceCtx( Switch device, KProcess process, - IMemoryManager memory, + MemoryManager memory, KThread thread, KClientSession session, IpcMessage request, diff --git a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs index 0075fd5f..aa9b6e51 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs @@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager private KEvent _updateEvent; - private IMemoryManager _memory; + private MemoryManager _memory; private IAalOutput _audioOut; @@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager public IAudioRenderer( Horizon system, - IMemoryManager memory, + MemoryManager memory, IAalOutput audioOut, AudioRendererParameter Params) { diff --git a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/VoiceContext.cs b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/VoiceContext.cs index 4bf15a59..60fe2e23 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/VoiceContext.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/VoiceContext.cs @@ -65,7 +65,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager _outStatus.VoiceDropsCount = 0; } - public int[] GetBufferData(IMemoryManager memory, int maxSamples, out int samplesCount) + public int[] GetBufferData(MemoryManager memory, int maxSamples, out int samplesCount) { if (!Playing) { @@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager return output; } - private void UpdateBuffer(IMemoryManager memory) + private void UpdateBuffer(MemoryManager memory) { // TODO: Implement conversion for formats other // than interleaved stereo (2 channels). |
