mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-11-27 17:40:50 +01:00
38 lines
745 B
C#
38 lines
745 B
C#
|
using ChocolArm64.Memory;
|
||
|
|
||
|
namespace Ryujinx.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;
|
||
|
}
|
||
|
}
|
||
|
}
|