aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/OsHle/Utilities
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-05-07 15:53:23 -0300
committerGitHub <noreply@github.com>2018-05-07 15:53:23 -0300
commit34037701c708cb70bbf44dea71ee0912f7b4102b (patch)
treeca4cf2bde85dea48af12033b8d0446f17b611f4f /Ryujinx.Core/OsHle/Utilities
parent4419e8d6b43432eae94a3a9304f7df22b34738a8 (diff)
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
Diffstat (limited to 'Ryujinx.Core/OsHle/Utilities')
-rw-r--r--Ryujinx.Core/OsHle/Utilities/IntUtils.cs15
-rw-r--r--Ryujinx.Core/OsHle/Utilities/MemReader.cs44
-rw-r--r--Ryujinx.Core/OsHle/Utilities/MemWriter.cs38
3 files changed, 15 insertions, 82 deletions
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