Fix some things
This commit is contained in:
parent
9f44819cd9
commit
f3b43e9e6d
5 changed files with 21 additions and 43 deletions
|
@ -1,22 +0,0 @@
|
|||
namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||
{
|
||||
struct AudioRendererConfig
|
||||
{
|
||||
public int Revision;
|
||||
public int BehaviourSize;
|
||||
public int MemoryPoolsSize;
|
||||
public int VoicesSize;
|
||||
public int VoiceResourceSize;
|
||||
public int EffectsSize;
|
||||
public int MixesSize;
|
||||
public int SinksSize;
|
||||
public int PerformanceBufferSize;
|
||||
public int Unknown24;
|
||||
public int Unknown28;
|
||||
public int Unknown2C;
|
||||
public int Unknown30;
|
||||
public int Unknown34;
|
||||
public int Unknown38;
|
||||
public int TotalSize;
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct AudioRendererParameters
|
||||
struct AudioRendererParameter
|
||||
{
|
||||
public int SampleRate;
|
||||
public int SampleCount;
|
|
@ -16,9 +16,9 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
|||
|
||||
private KEvent UpdateEvent;
|
||||
|
||||
private AudioRendererParameters Params;
|
||||
private AudioRendererParameter Params;
|
||||
|
||||
public IAudioRenderer(AudioRendererParameters WorkerParams)
|
||||
public IAudioRenderer(AudioRendererParameter Params)
|
||||
{
|
||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
|||
|
||||
UpdateEvent = new KEvent();
|
||||
|
||||
this.Params = WorkerParams;
|
||||
this.Params = Params;
|
||||
}
|
||||
|
||||
public long RequestUpdateAudioRenderer(ServiceCtx Context)
|
||||
|
@ -38,25 +38,25 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
|||
long OutputPosition = Context.Request.GetBufferType0x22().Position;
|
||||
long InputPosition = Context.Request.GetBufferType0x21().Position;
|
||||
|
||||
AudioRendererConfig InputData = AMemoryHelper.Read<AudioRendererConfig>(Context.Memory, InputPosition);
|
||||
UpdateDataHeader InputDataHeader = AMemoryHelper.Read<UpdateDataHeader>(Context.Memory, InputPosition);
|
||||
|
||||
int MemoryPoolOffset = Marshal.SizeOf(InputData) + InputData.BehaviourSize;
|
||||
int MemoryPoolOffset = Marshal.SizeOf(InputDataHeader) + InputDataHeader.BehaviorSize;
|
||||
|
||||
AudioRendererOutput OutputData = new AudioRendererOutput();
|
||||
UpdateDataHeader OutputDataHeader = new UpdateDataHeader();
|
||||
|
||||
OutputData.Revision = Params.Revision;
|
||||
OutputData.ErrorInfoSize = 0xb0;
|
||||
OutputData.MemoryPoolsSize = (Params.EffectCount + (Params.VoiceCount * 4)) * 0x10;
|
||||
OutputData.VoicesSize = Params.VoiceCount * 0x10;
|
||||
OutputData.EffectsSize = Params.EffectCount * 0x10;
|
||||
OutputData.SinksSize = Params.SinkCount * 0x20;
|
||||
OutputData.PerformanceManagerSize = 0x10;
|
||||
OutputData.TotalSize = Marshal.SizeOf(OutputData) + OutputData.ErrorInfoSize + OutputData.MemoryPoolsSize +
|
||||
OutputData.VoicesSize + OutputData.EffectsSize + OutputData.SinksSize + OutputData.PerformanceManagerSize;
|
||||
OutputDataHeader.Revision = Params.Revision;
|
||||
OutputDataHeader.BehaviorSize = 0xb0;
|
||||
OutputDataHeader.MemoryPoolsSize = (Params.EffectCount + (Params.VoiceCount * 4)) * 0x10;
|
||||
OutputDataHeader.VoicesSize = Params.VoiceCount * 0x10;
|
||||
OutputDataHeader.EffectsSize = Params.EffectCount * 0x10;
|
||||
OutputDataHeader.SinksSize = Params.SinkCount * 0x20;
|
||||
OutputDataHeader.PerformanceManagerSize = 0x10;
|
||||
OutputDataHeader.TotalSize = Marshal.SizeOf(OutputDataHeader) + OutputDataHeader.BehaviorSize + OutputDataHeader.MemoryPoolsSize +
|
||||
OutputDataHeader.VoicesSize + OutputDataHeader.EffectsSize + OutputDataHeader.SinksSize + OutputDataHeader.PerformanceManagerSize;
|
||||
|
||||
AMemoryHelper.Write(Context.Memory, OutputPosition, OutputData);
|
||||
AMemoryHelper.Write(Context.Memory, OutputPosition, OutputDataHeader);
|
||||
|
||||
for (int Offset = 0x40; Offset < 0x40 + OutputData.MemoryPoolsSize; Offset += 0x10, MemoryPoolOffset += 0x20)
|
||||
for (int Offset = 0x40; Offset < 0x40 + OutputDataHeader.MemoryPoolsSize; Offset += 0x10, MemoryPoolOffset += 0x20)
|
||||
{
|
||||
MemoryPoolStates PoolState = (MemoryPoolStates) Context.Memory.ReadInt32(InputPosition + MemoryPoolOffset + 0x10);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
|||
{
|
||||
//Same buffer as GetAudioRendererWorkBufferSize is receive here.
|
||||
|
||||
AudioRendererParameters Params = new AudioRendererParameters();
|
||||
AudioRendererParameter Params = new AudioRendererParameter();
|
||||
|
||||
Params.SampleRate = Context.RequestData.ReadInt32();
|
||||
Params.SampleCount = Context.RequestData.ReadInt32();
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||
{
|
||||
struct AudioRendererOutput
|
||||
struct UpdateDataHeader
|
||||
{
|
||||
public int Revision;
|
||||
public int ErrorInfoSize;
|
||||
public int BehaviorSize;
|
||||
public int MemoryPoolsSize;
|
||||
public int VoicesSize;
|
||||
public int VoiceResourceSize;
|
Loading…
Add table
Reference in a new issue