From 34037701c708cb70bbf44dea71ee0912f7b4102b Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 7 May 2018 15:53:23 -0300 Subject: NvServices refactoring (#120) * Initial implementation of NvMap/NvHostCtrl * More work on NvHostCtrl * Refactoring of nvservices, move GPU Vmm, make Vmm per-process, refactor most gpu devices, move Gpu to Core, fix CbBind * Implement GetGpuTime, support CancelSynchronization, fix issue on InsertWaitingMutex, proper double buffering support (again, not working properly for commercial games, only hb) * Try to fix perf regression reading/writing textures, moved syncpts and events to a UserCtx class, delete global state when the process exits, other minor tweaks * Remove now unused code, add comment about probably wrong result codes --- Ryujinx.Core/OsHle/Utilities/IntUtils.cs | 15 +++++++++++ Ryujinx.Core/OsHle/Utilities/MemReader.cs | 44 ------------------------------- Ryujinx.Core/OsHle/Utilities/MemWriter.cs | 38 -------------------------- 3 files changed, 15 insertions(+), 82 deletions(-) create mode 100644 Ryujinx.Core/OsHle/Utilities/IntUtils.cs delete mode 100644 Ryujinx.Core/OsHle/Utilities/MemReader.cs delete mode 100644 Ryujinx.Core/OsHle/Utilities/MemWriter.cs (limited to 'Ryujinx.Core/OsHle/Utilities') diff --git a/Ryujinx.Core/OsHle/Utilities/IntUtils.cs b/Ryujinx.Core/OsHle/Utilities/IntUtils.cs new file mode 100644 index 00000000..4a522465 --- /dev/null +++ b/Ryujinx.Core/OsHle/Utilities/IntUtils.cs @@ -0,0 +1,15 @@ +namespace Ryujinx.Core.OsHle.Utilities +{ + static class IntUtils + { + public static int RoundUp(int Value, int Size) + { + return (Value + (Size - 1)) & ~(Size - 1); + } + + public static long RoundUp(long Value, int Size) + { + return (Value + (Size - 1)) & ~((long)Size - 1); + } + } +} diff --git a/Ryujinx.Core/OsHle/Utilities/MemReader.cs b/Ryujinx.Core/OsHle/Utilities/MemReader.cs deleted file mode 100644 index fe92f68f..00000000 --- a/Ryujinx.Core/OsHle/Utilities/MemReader.cs +++ /dev/null @@ -1,44 +0,0 @@ -using ChocolArm64.Memory; - -namespace Ryujinx.Core.OsHle.Utilities -{ - class MemReader - { - private AMemory Memory; - - public long Position { get; private set; } - - public MemReader(AMemory Memory, long Position) - { - this.Memory = Memory; - this.Position = Position; - } - - public byte ReadByte() - { - byte Value = Memory.ReadByte(Position); - - Position++; - - return Value; - } - - public int ReadInt32() - { - int Value = Memory.ReadInt32(Position); - - Position += 4; - - return Value; - } - - public long ReadInt64() - { - long Value = Memory.ReadInt64(Position); - - Position += 8; - - return Value; - } - } -} \ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Utilities/MemWriter.cs b/Ryujinx.Core/OsHle/Utilities/MemWriter.cs deleted file mode 100644 index 21b6a3b6..00000000 --- a/Ryujinx.Core/OsHle/Utilities/MemWriter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using ChocolArm64.Memory; - -namespace Ryujinx.Core.OsHle.Utilities -{ - class MemWriter - { - private AMemory Memory; - - public long Position { get; private set; } - - public MemWriter(AMemory Memory, long Position) - { - this.Memory = Memory; - this.Position = Position; - } - - public void WriteByte(byte Value) - { - Memory.WriteByte(Position, Value); - - Position++; - } - - public void WriteInt32(int Value) - { - Memory.WriteInt32(Position, Value); - - Position += 4; - } - - public void WriteInt64(long Value) - { - Memory.WriteInt64(Position, Value); - - Position += 8; - } - } -} \ No newline at end of file -- cgit v1.2.3