mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-23 16:31:21 -08:00
23170da5a0
This implement the rendering information output informations of RequestUpdate. This is needed by some games to keep track of the count of update on the DSP.
31 lines
651 B
C#
31 lines
651 B
C#
using ARMeilleure.Memory;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Ryujinx.HLE.Utilities
|
|
{
|
|
class StructWriter
|
|
{
|
|
private MemoryManager _memory;
|
|
|
|
public long Position { get; private set; }
|
|
|
|
public StructWriter(MemoryManager memory, long position)
|
|
{
|
|
_memory = memory;
|
|
Position = position;
|
|
}
|
|
|
|
public void Write<T>(T value) where T : struct
|
|
{
|
|
MemoryHelper.Write(_memory, Position, value);
|
|
|
|
Position += Marshal.SizeOf<T>();
|
|
}
|
|
|
|
public void SkipBytes(long count)
|
|
{
|
|
Position += count;
|
|
}
|
|
}
|
|
}
|