aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/OsHle/Utilities/MemReader.cs
blob: fe92f68fd245373e3cb17ccf96dc8ef44bc82e48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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;
        }
    }
}