aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/OsHle/Utilities/MemReader.cs
diff options
context:
space:
mode:
authoremmauss <emmausssss@gmail.com>2018-02-20 22:09:23 +0200
committergdkchan <gab.dark.100@gmail.com>2018-02-20 17:09:23 -0300
commit62b827f474f0aa2152dd339fcc7cf31084e16a0b (patch)
tree0e5c55b341aee4db0ccb841a084f253ec5e05657 /Ryujinx.Core/OsHle/Utilities/MemReader.cs
parentcb665bb715834526d73c9469d16114b287faaecd (diff)
Split main project into core,graphics and chocolarm4 subproject (#29)
Diffstat (limited to 'Ryujinx.Core/OsHle/Utilities/MemReader.cs')
-rw-r--r--Ryujinx.Core/OsHle/Utilities/MemReader.cs44
1 files changed, 44 insertions, 0 deletions
diff --git a/Ryujinx.Core/OsHle/Utilities/MemReader.cs b/Ryujinx.Core/OsHle/Utilities/MemReader.cs
new file mode 100644
index 00000000..fe92f68f
--- /dev/null
+++ b/Ryujinx.Core/OsHle/Utilities/MemReader.cs
@@ -0,0 +1,44 @@
+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