diff --git a/ARMeilleure/Memory/IMemoryManager.cs b/ARMeilleure/Memory/IMemoryManager.cs new file mode 100644 index 0000000000..dac712ceb4 --- /dev/null +++ b/ARMeilleure/Memory/IMemoryManager.cs @@ -0,0 +1,42 @@ +using ARMeilleure.State; +using System; + +namespace ARMeilleure.Memory +{ + public interface IMemoryManager : IMemory, IDisposable + { + void Map(long va, long pa, long size); + + void Unmap(long position, long size); + + bool IsMapped(long position); + + long GetPhysicalAddress(long virtualAddress); + + bool IsRegionModified(long position, long size); + + bool TryGetHostAddress(long position, long size, out IntPtr ptr); + + bool IsValidPosition(long position); + + bool AtomicCompareExchangeInt32(long position, int expected, int desired); + + int AtomicIncrementInt32(long position); + + int AtomicDecrementInt32(long position); + + V128 ReadVector128(long position); + + byte[] ReadBytes(long position, long size); + + void ReadBytes(long position, byte[] data, int startIndex, int size); + + void WriteVector128(long position, V128 value); + + void WriteBytes(long position, byte[] data); + + void WriteBytes(long position, byte[] data, int startIndex, int size); + + void CopyBytes(long src, long dst, long size); + } +} \ No newline at end of file diff --git a/ARMeilleure/Memory/MemoryHelper.cs b/ARMeilleure/Memory/MemoryHelper.cs index 8e310d4d7f..71ddac2388 100644 --- a/ARMeilleure/Memory/MemoryHelper.cs +++ b/ARMeilleure/Memory/MemoryHelper.cs @@ -7,7 +7,7 @@ namespace ARMeilleure.Memory { public static class MemoryHelper { - public static void FillWithZeros(MemoryManager memory, long position, int size) + public static void FillWithZeros(IMemoryManager memory, long position, int size) { int size8 = size & ~(8 - 1); @@ -22,7 +22,7 @@ namespace ARMeilleure.Memory } } - public unsafe static T Read(MemoryManager memory, long position) where T : struct + public unsafe static T Read(IMemoryManager memory, long position) where T : struct { long size = Marshal.SizeOf(); @@ -34,7 +34,7 @@ namespace ARMeilleure.Memory } } - public unsafe static void Write(MemoryManager memory, long position, T value) where T : struct + public unsafe static void Write(IMemoryManager memory, long position, T value) where T : struct { long size = Marshal.SizeOf(); @@ -48,7 +48,7 @@ namespace ARMeilleure.Memory memory.WriteBytes(position, data); } - public static string ReadAsciiString(MemoryManager memory, long position, long maxSize = -1) + public static string ReadAsciiString(IMemoryManager memory, long position, long maxSize = -1) { using (MemoryStream ms = new MemoryStream()) { diff --git a/ARMeilleure/Memory/MemoryManager.cs b/ARMeilleure/Memory/MemoryManager.cs index c5c7034654..12c1184373 100644 --- a/ARMeilleure/Memory/MemoryManager.cs +++ b/ARMeilleure/Memory/MemoryManager.cs @@ -7,7 +7,7 @@ using static ARMeilleure.Memory.MemoryManagement; namespace ARMeilleure.Memory { - public unsafe class MemoryManager : IMemory, IDisposable + public unsafe class MemoryManager : IMemoryManager { public const int PageBits = 12; public const int PageSize = 1 << PageBits; diff --git a/ARMeilleure/State/ExecutionContext.cs b/ARMeilleure/State/ExecutionContext.cs index cc6321064e..22cfcb6943 100644 --- a/ARMeilleure/State/ExecutionContext.cs +++ b/ARMeilleure/State/ExecutionContext.cs @@ -3,7 +3,7 @@ using System.Diagnostics; namespace ARMeilleure.State { - public class ExecutionContext : IDisposable + public class ExecutionContext : IExecutionContext { private const int MinCountForCheck = 40000; @@ -90,7 +90,7 @@ namespace ARMeilleure.State public bool GetPstateFlag(PState flag) => _nativeContext.GetPstateFlag(flag); public void SetPstateFlag(PState flag, bool value) => _nativeContext.SetPstateFlag(flag, value); - public void CheckInterrupt() + internal void CheckInterrupt() { if (_interrupted) { diff --git a/ARMeilleure/State/IExecutionContext.cs b/ARMeilleure/State/IExecutionContext.cs new file mode 100644 index 0000000000..393bcd06e5 --- /dev/null +++ b/ARMeilleure/State/IExecutionContext.cs @@ -0,0 +1,39 @@ +using System; + +namespace ARMeilleure.State +{ + public interface IExecutionContext : IDisposable + { + uint CtrEl0 { get; } + uint DczidEl0 { get; } + + ulong CntfrqEl0 { get; set; } + ulong CntpctEl0 { get; } + + long TpidrEl0 { get; set; } + long Tpidr { get; set; } + + FPCR Fpcr { get; set; } + FPSR Fpsr { get; set; } + + bool IsAarch32 { get; set; } + + bool Running { get; set; } + + event EventHandler Interrupt; + event EventHandler Break; + event EventHandler SupervisorCall; + event EventHandler Undefined; + + ulong GetX(int index); + void SetX(int index, ulong value); + + V128 GetV(int index); + void SetV(int index, V128 value); + + bool GetPstateFlag(PState flag); + void SetPstateFlag(PState flag, bool value); + + void RequestInterrupt(); + } +} \ No newline at end of file diff --git a/ARMeilleure/Translation/ITranslator.cs b/ARMeilleure/Translation/ITranslator.cs new file mode 100644 index 0000000000..1063d3a658 --- /dev/null +++ b/ARMeilleure/Translation/ITranslator.cs @@ -0,0 +1,9 @@ +using ARMeilleure.State; + +namespace ARMeilleure.Translation +{ + public interface ITranslator + { + void Execute(IExecutionContext context, ulong address); + } +} \ No newline at end of file diff --git a/ARMeilleure/Translation/Translator.cs b/ARMeilleure/Translation/Translator.cs index 8ef7532370..34871585aa 100644 --- a/ARMeilleure/Translation/Translator.cs +++ b/ARMeilleure/Translation/Translator.cs @@ -12,7 +12,7 @@ using static ARMeilleure.IntermediateRepresentation.OperandHelper; namespace ARMeilleure.Translation { - public class Translator + public class Translator : ITranslator { private const ulong CallFlag = InstEmitFlowHelper.CallFlag; @@ -54,8 +54,10 @@ namespace ARMeilleure.Translation } } - public void Execute(State.ExecutionContext context, ulong address) + public void Execute(IExecutionContext ctx, ulong address) { + State.ExecutionContext context = (State.ExecutionContext)ctx; + if (Interlocked.Increment(ref _threadCount) == 1) { Thread backgroundTranslatorThread = new Thread(TranslateQueuedSubs); diff --git a/Ryujinx.HLE/HOS/Homebrew.cs b/Ryujinx.HLE/HOS/Homebrew.cs index 9c33fbd27b..8e54f82c11 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(MemoryManager memory, long position, int mainThreadHandle, string switchPath) + public static void WriteHbAbiData(IMemoryManager memory, long position, int mainThreadHandle, string switchPath) { // MainThreadHandle. WriteConfigEntry(memory, ref position, 1, 0, mainThreadHandle); @@ -31,7 +31,7 @@ namespace Ryujinx.HLE.HOS } private static void WriteConfigEntry( - MemoryManager memory, + IMemoryManager memory, ref long position, int key, int flags = 0, @@ -46,7 +46,7 @@ namespace Ryujinx.HLE.HOS position += 0x18; } - public static string ReadHbAbiNextLoadPath(MemoryManager memory, long position) + public static string ReadHbAbiNextLoadPath(IMemoryManager memory, long position) { string fileName = null; diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index f8bb345f22..5873223ef6 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -110,6 +110,8 @@ namespace Ryujinx.HLE.HOS public int GlobalAccessLogMode { get; set; } + public bool UseLegacyJit { get; set; } + internal long HidBaseAddress { get; private set; } public Horizon(Switch device) diff --git a/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs b/Ryujinx.HLE/HOS/Ipc/IpcHandler.cs index 53fcc3fe35..50ab3d1000 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, - MemoryManager memory, + IMemoryManager 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 fd2078ee16..fd80b3b9e0 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 _blocks; - private MemoryManager _cpuMemory; + private IMemoryManager _cpuMemory; private Horizon _system; @@ -72,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory private MersenneTwister _randomNumberGenerator; - public KMemoryManager(Horizon system, MemoryManager cpuMemory) + public KMemoryManager(Horizon system, IMemoryManager cpuMemory) { _system = system; _cpuMemory = cpuMemory; diff --git a/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs b/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs index 4219eb7585..e2ca44b594 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs @@ -1,4 +1,5 @@ using ARMeilleure.Memory; +using ARMeilleure.State; using Ryujinx.HLE.HOS.Diagnostics.Demangler; using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.Loaders.Elf; @@ -39,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process _images = new List(); } - public string GetGuestStackTrace(ARMeilleure.State.ExecutionContext context) + public string GetGuestStackTrace(IExecutionContext context) { EnsureLoaded(); @@ -217,7 +218,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } } - private void LoadMod0Symbols(MemoryManager memory, long textOffset) + private void LoadMod0Symbols(IMemoryManager memory, long textOffset) { long mod0Offset = textOffset + memory.ReadUInt32(textOffset + 4); @@ -287,7 +288,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } } - private ElfSymbol GetSymbol(MemoryManager memory, long address, long strTblAddr) + private ElfSymbol GetSymbol(IMemoryManager 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 2118b0d23c..beb376f64f 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 MemoryManager CpuMemory { get; private set; } + public IMemoryManager CpuMemory { get; private set; } - public Translator Translator { get; private set; } + public ITranslator Translator { get; private set; } private SvcHandler _svcHandler; @@ -791,7 +791,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } } - public void SubscribeThreadEventHandlers(ARMeilleure.State.ExecutionContext context) + public void SubscribeThreadEventHandlers(IExecutionContext context) { context.Interrupt += InterruptHandler; context.SupervisorCall += _svcHandler.SvcCall; @@ -1022,11 +1022,20 @@ namespace Ryujinx.HLE.HOS.Kernel.Process bool useFlatPageTable = memRegion == MemoryRegion.Application; - CpuMemory = new MemoryManager(_system.Device.Memory.RamPointer, addrSpaceBits, useFlatPageTable); + 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); + + Translator = new Translator((MemoryManager)CpuMemory); + } MemoryManager = new KMemoryManager(_system, CpuMemory); - - Translator = new Translator(CpuMemory); } public void PrintCurrentThreadStackTrace() diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs index 5e7e9785ef..7509ae048f 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs @@ -6,9 +6,9 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall { partial class SvcHandler { - private Switch _device; - private KProcess _process; - private Horizon _system; + private Switch _device; + private KProcess _process; + private Horizon _system; public SvcHandler(Switch device, KProcess process) { @@ -19,14 +19,14 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall public void SvcCall(object sender, InstExceptionEventArgs e) { - Action svcFunc = SvcTable.GetSvcFunc(e.Id); + Action svcFunc = SvcTable.GetSvcFunc(e.Id); if (svcFunc == null) { throw new NotImplementedException($"SVC 0x{e.Id:X4} is not implemented."); } - ExecutionContext context = (ExecutionContext)sender; + IExecutionContext context = (IExecutionContext)sender; svcFunc(this, context); } diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcTable.cs index 8ed153c5e9..c1a31da9b4 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 _svcFuncs64; - private static Action[] _svcTable64; + private static Action[] _svcTable64; static SvcTable() { @@ -77,10 +77,10 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall { 0x78, nameof(SvcHandler.UnmapProcessCodeMemory64) } }; - _svcTable64 = new Action[0x80]; + _svcTable64 = new Action[0x80]; } - public static Action GetSvcFunc(int svcId) + public static Action GetSvcFunc(int svcId) { if (_svcTable64[svcId] != null) { @@ -95,9 +95,9 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return null; } - private static Action GenerateMethod(string svcName) + private static Action GenerateMethod(string svcName) { - Type[] argTypes = new Type[] { typeof(SvcHandler), typeof(ExecutionContext) }; + Type[] argTypes = new Type[] { typeof(SvcHandler), typeof(IExecutionContext) }; DynamicMethod method = new DynamicMethod(svcName, null, argTypes); @@ -185,7 +185,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Ldc_I4, byRefArgsCount + index); - MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.GetX)); + MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.GetX)); generator.Emit(OpCodes.Call, info); @@ -233,7 +233,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Ldc_I4, byRefArgsCount + index); - MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.GetX)); + MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.GetX)); generator.Emit(OpCodes.Call, info); @@ -271,7 +271,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall ConvertToFieldType(retType); - MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX)); + MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.SetX)); generator.Emit(OpCodes.Call, info); } @@ -284,7 +284,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall ConvertToFieldType(locals[index].LocalType); - MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX)); + MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.SetX)); generator.Emit(OpCodes.Call, info); } @@ -296,14 +296,14 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall generator.Emit(OpCodes.Ldc_I4, outRegIndex++); generator.Emit(OpCodes.Ldc_I8, 0L); - MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX)); + MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.SetX)); generator.Emit(OpCodes.Call, info); } generator.Emit(OpCodes.Ret); - return (Action)method.CreateDelegate(typeof(Action)); + return (Action)method.CreateDelegate(typeof(Action)); } 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 0908de1083..e49da023a4 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; } - MemoryManager memory = currentProcess.CpuMemory; + IMemoryManager 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(ExecutionContext context) + private static int GetPsr(IExecutionContext 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 d4965b4125..54d5d06c8d 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs @@ -1,4 +1,5 @@ using ARMeilleure.Memory; +using ARMeilleure.State; using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Process; @@ -16,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading public Thread HostThread { get; private set; } - public ARMeilleure.State.ExecutionContext Context { get; private set; } + public IExecutionContext Context { get; private set; } public long AffinityMask { get; set; } @@ -158,7 +159,14 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading HostThread = new Thread(() => ThreadStart(entrypoint)); - Context = new ARMeilleure.State.ExecutionContext(); + if (System.UseLegacyJit) + { + Context = new ChocolArm64.State.CpuThreadState(); + } + else + { + 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 fa6cfca3a8..df74ba0a8d 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 MemoryManager Memory { get; } + public IMemoryManager 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, - MemoryManager memory, + IMemoryManager memory, KThread thread, KClientSession session, IpcMessage request, diff --git a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/IAudioRenderer.cs b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/IAudioRenderer.cs index 176279c87b..e8baf8192f 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/IAudioRenderer.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/IAudioRenderer.cs @@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer private KEvent _updateEvent; - private MemoryManager _memory; + private IMemoryManager _memory; private IAalOutput _audioOut; @@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer public IAudioRenderer( Horizon system, - MemoryManager memory, + IMemoryManager memory, IAalOutput audioOut, AudioRendererParameter Params) { diff --git a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceContext.cs b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceContext.cs index 65e79c2bc8..aaff20a5b4 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceContext.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/AudioRenderer/VoiceContext.cs @@ -65,7 +65,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer _outStatus.VoiceDropsCount = 0; } - public int[] GetBufferData(MemoryManager memory, int maxSamples, out int samplesCount) + public int[] GetBufferData(IMemoryManager memory, int maxSamples, out int samplesCount) { if (!Playing) { @@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer return output; } - private void UpdateBuffer(MemoryManager memory) + private void UpdateBuffer(IMemoryManager memory) { // TODO: Implement conversion for formats other // than interleaved stereo (2 channels). diff --git a/Ryujinx.HLE/Ryujinx.HLE.csproj b/Ryujinx.HLE/Ryujinx.HLE.csproj index 7d1f343fab..a393bf979e 100644 --- a/Ryujinx.HLE/Ryujinx.HLE.csproj +++ b/Ryujinx.HLE/Ryujinx.HLE.csproj @@ -43,6 +43,7 @@ + diff --git a/Ryujinx.HLE/Utilities/StructReader.cs b/Ryujinx.HLE/Utilities/StructReader.cs index cd274a9582..36e5c7d198 100644 --- a/Ryujinx.HLE/Utilities/StructReader.cs +++ b/Ryujinx.HLE/Utilities/StructReader.cs @@ -5,11 +5,11 @@ namespace Ryujinx.HLE.Utilities { class StructReader { - private MemoryManager _memory; + private IMemoryManager _memory; public long Position { get; private set; } - public StructReader(MemoryManager memory, long position) + public StructReader(IMemoryManager memory, long position) { _memory = memory; Position = position; diff --git a/Ryujinx.HLE/Utilities/StructWriter.cs b/Ryujinx.HLE/Utilities/StructWriter.cs index b488b5d613..c156956db7 100644 --- a/Ryujinx.HLE/Utilities/StructWriter.cs +++ b/Ryujinx.HLE/Utilities/StructWriter.cs @@ -5,11 +5,11 @@ namespace Ryujinx.HLE.Utilities { class StructWriter { - private MemoryManager _memory; + private IMemoryManager _memory; public long Position { get; private set; } - public StructWriter(MemoryManager memory, long position) + public StructWriter(IMemoryManager memory, long position) { _memory = memory; Position = position;