2018-02-04 18:08:20 -05:00
|
|
|
using ChocolArm64.Memory;
|
|
|
|
|
2018-02-20 15:09:23 -05:00
|
|
|
namespace Ryujinx.Core.OsHle.Utilities
|
2018-02-04 18:08:20 -05:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|