aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/OsHle/Utilities/StructWriter.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-07-14 23:57:41 -0300
committerGitHub <noreply@github.com>2018-07-14 23:57:41 -0300
commit98c6ceede564eda4aed528e51219a9b0d6bea1c4 (patch)
tree2fabe99e761098b6cafb49fb0ab4e90f6f9ef106 /Ryujinx.HLE/OsHle/Utilities/StructWriter.cs
parentbe31f5b46d16f0f8730d9a9ec71f938eee97524a (diff)
Audio Renderer improvements (#210)
* Partial voice implementation on audio renderer * Implemented audren resampler (based on original impl) * Fix BiquadFilter struct * Pause audio playback on last stream buffer * Split audren/audout files into separate folders, some minor cleanup * Use AudioRendererParameter on GetWorkBufferSize aswell * Bump audren version to REV4, name a few things, increase sample buffer size * Remove useless new lines
Diffstat (limited to 'Ryujinx.HLE/OsHle/Utilities/StructWriter.cs')
-rw-r--r--Ryujinx.HLE/OsHle/Utilities/StructWriter.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Ryujinx.HLE/OsHle/Utilities/StructWriter.cs b/Ryujinx.HLE/OsHle/Utilities/StructWriter.cs
new file mode 100644
index 00000000..7daa95fb
--- /dev/null
+++ b/Ryujinx.HLE/OsHle/Utilities/StructWriter.cs
@@ -0,0 +1,25 @@
+using ChocolArm64.Memory;
+using System.Runtime.InteropServices;
+
+namespace Ryujinx.HLE.OsHle.Utilities
+{
+ class StructWriter
+ {
+ private AMemory Memory;
+
+ public long Position { get; private set; }
+
+ public StructWriter(AMemory Memory, long Position)
+ {
+ this.Memory = Memory;
+ this.Position = Position;
+ }
+
+ public void Write<T>(T Value) where T : struct
+ {
+ AMemoryHelper.Write(Memory, Position, Value);
+
+ Position += Marshal.SizeOf<T>();
+ }
+ }
+}