Merge remote-tracking branch 'origin/master' into riperiperi/a32-wip
This commit is contained in:
commit
fbfed4f47a
10 changed files with 106 additions and 46 deletions
|
@ -30,7 +30,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
CompareMode compareMode = descriptor.UnpackCompareMode();
|
CompareMode compareMode = descriptor.UnpackCompareMode();
|
||||||
CompareOp compareOp = descriptor.UnpackCompareOp();
|
CompareOp compareOp = descriptor.UnpackCompareOp();
|
||||||
|
|
||||||
ColorF color = new ColorF(0, 0, 0, 0);
|
ColorF color = new ColorF(
|
||||||
|
descriptor.BorderColorR,
|
||||||
|
descriptor.BorderColorG,
|
||||||
|
descriptor.BorderColorB,
|
||||||
|
descriptor.BorderColorA);
|
||||||
|
|
||||||
float minLod = descriptor.UnpackMinLod();
|
float minLod = descriptor.UnpackMinLod();
|
||||||
float maxLod = descriptor.UnpackMaxLod();
|
float maxLod = descriptor.UnpackMaxLod();
|
||||||
|
|
|
@ -55,10 +55,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
public uint Word1;
|
public uint Word1;
|
||||||
public uint Word2;
|
public uint Word2;
|
||||||
public uint Word3;
|
public uint Word3;
|
||||||
public uint BorderColorR;
|
public float BorderColorR;
|
||||||
public uint BorderColorG;
|
public float BorderColorG;
|
||||||
public uint BorderColorB;
|
public float BorderColorB;
|
||||||
public uint BorderColorA;
|
public float BorderColorA;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unpacks the texture wrap mode along the X axis.
|
/// Unpacks the texture wrap mode along the X axis.
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||||
|
{
|
||||||
|
class EffectContext
|
||||||
|
{
|
||||||
|
public EffectOut OutStatus;
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,6 +34,8 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||||
|
|
||||||
private VoiceContext[] _voices;
|
private VoiceContext[] _voices;
|
||||||
|
|
||||||
|
private EffectContext[] _effects;
|
||||||
|
|
||||||
private int _track;
|
private int _track;
|
||||||
|
|
||||||
private PlayState _playState;
|
private PlayState _playState;
|
||||||
|
@ -42,22 +44,24 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||||
Horizon system,
|
Horizon system,
|
||||||
MemoryManager memory,
|
MemoryManager memory,
|
||||||
IAalOutput audioOut,
|
IAalOutput audioOut,
|
||||||
AudioRendererParameter Params)
|
AudioRendererParameter rendererParams)
|
||||||
{
|
{
|
||||||
_updateEvent = new KEvent(system);
|
_updateEvent = new KEvent(system);
|
||||||
|
|
||||||
_memory = memory;
|
_memory = memory;
|
||||||
_audioOut = audioOut;
|
_audioOut = audioOut;
|
||||||
_params = Params;
|
_params = rendererParams;
|
||||||
|
|
||||||
_track = audioOut.OpenTrack(
|
_track = audioOut.OpenTrack(
|
||||||
AudioRendererConsts.HostSampleRate,
|
AudioRendererConsts.HostSampleRate,
|
||||||
AudioRendererConsts.HostChannelsCount,
|
AudioRendererConsts.HostChannelsCount,
|
||||||
AudioCallback);
|
AudioCallback);
|
||||||
|
|
||||||
_memoryPools = CreateArray<MemoryPoolContext>(Params.EffectCount + Params.VoiceCount * 4);
|
_memoryPools = CreateArray<MemoryPoolContext>(rendererParams.EffectCount + rendererParams.VoiceCount * 4);
|
||||||
|
|
||||||
_voices = CreateArray<VoiceContext>(Params.VoiceCount);
|
_voices = CreateArray<VoiceContext>(rendererParams.VoiceCount);
|
||||||
|
|
||||||
|
_effects = CreateArray<EffectContext>(rendererParams.EffectCount);
|
||||||
|
|
||||||
InitializeAudioOut();
|
InitializeAudioOut();
|
||||||
|
|
||||||
|
@ -205,6 +209,16 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||||
voiceCtx.PlayState = voice.PlayState;
|
voiceCtx.PlayState = voice.PlayState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EffectIn[] effectsIn = reader.Read<EffectIn>(inputHeader.EffectSize);
|
||||||
|
|
||||||
|
for (int index = 0; index < effectsIn.Length; index++)
|
||||||
|
{
|
||||||
|
if (effectsIn[index].IsNew != 0)
|
||||||
|
{
|
||||||
|
_effects[index].OutStatus.State = EffectState.New;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UpdateAudio();
|
UpdateAudio();
|
||||||
|
|
||||||
UpdateDataHeader outputHeader = new UpdateDataHeader();
|
UpdateDataHeader outputHeader = new UpdateDataHeader();
|
||||||
|
@ -245,6 +259,11 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||||
writer.Write(voice.OutStatus);
|
writer.Write(voice.OutStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (EffectContext effect in _effects)
|
||||||
|
{
|
||||||
|
writer.Write(effect.OutStatus);
|
||||||
|
}
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||||
|
{
|
||||||
|
[StructLayout(LayoutKind.Sequential, Size = 0xc0, Pack = 1)]
|
||||||
|
unsafe struct EffectIn
|
||||||
|
{
|
||||||
|
public byte Unknown0x0;
|
||||||
|
public byte IsNew;
|
||||||
|
public fixed byte Unknown[0xbe];
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||||
|
{
|
||||||
|
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 1)]
|
||||||
|
unsafe struct EffectOut
|
||||||
|
{
|
||||||
|
public EffectState State;
|
||||||
|
public fixed byte Reserved[15];
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||||
|
{
|
||||||
|
enum EffectState : byte
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
New = 1
|
||||||
|
}
|
||||||
|
}
|
|
@ -130,7 +130,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
||||||
public ResultCode CreateSaveDataFileSystem(ServiceCtx context)
|
public ResultCode CreateSaveDataFileSystem(ServiceCtx context)
|
||||||
{
|
{
|
||||||
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
||||||
SaveDataCreateInfo createInfo = context.RequestData.ReadStruct<SaveDataCreateInfo>();
|
SaveDataCreationInfo creationInfo = context.RequestData.ReadStruct<SaveDataCreationInfo>();
|
||||||
SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct<SaveMetaCreateInfo>();
|
SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct<SaveMetaCreateInfo>();
|
||||||
|
|
||||||
// TODO: There's currently no program registry for FS to reference.
|
// TODO: There's currently no program registry for FS to reference.
|
||||||
|
@ -140,14 +140,14 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
||||||
attribute.TitleId = new TitleId(context.Process.TitleId);
|
attribute.TitleId = new TitleId(context.Process.TitleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createInfo.OwnerId == TitleId.Zero)
|
if (creationInfo.OwnerId == TitleId.Zero)
|
||||||
{
|
{
|
||||||
createInfo.OwnerId = new TitleId(context.Process.TitleId);
|
creationInfo.OwnerId = new TitleId(context.Process.TitleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.PrintInfo(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}");
|
Logger.PrintInfo(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}");
|
||||||
|
|
||||||
Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref createInfo, ref metaCreateInfo);
|
Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref creationInfo, ref metaCreateInfo);
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
return (ResultCode)result.Value;
|
||||||
}
|
}
|
||||||
|
@ -156,9 +156,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
||||||
public ResultCode CreateSaveDataFileSystemBySystemSaveDataId(ServiceCtx context)
|
public ResultCode CreateSaveDataFileSystemBySystemSaveDataId(ServiceCtx context)
|
||||||
{
|
{
|
||||||
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
||||||
SaveDataCreateInfo createInfo = context.RequestData.ReadStruct<SaveDataCreateInfo>();
|
SaveDataCreationInfo creationInfo = context.RequestData.ReadStruct<SaveDataCreationInfo>();
|
||||||
|
|
||||||
Result result = _baseFileSystemProxy.CreateSaveDataFileSystemBySystemSaveDataId(ref attribute, ref createInfo);
|
Result result = _baseFileSystemProxy.CreateSaveDataFileSystemBySystemSaveDataId(ref attribute, ref creationInfo);
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
return (ResultCode)result.Value;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
||||||
public ResultCode CreateSaveDataFileSystemWithHashSalt(ServiceCtx context)
|
public ResultCode CreateSaveDataFileSystemWithHashSalt(ServiceCtx context)
|
||||||
{
|
{
|
||||||
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
||||||
SaveDataCreateInfo createInfo = context.RequestData.ReadStruct<SaveDataCreateInfo>();
|
SaveDataCreationInfo creationInfo = context.RequestData.ReadStruct<SaveDataCreationInfo>();
|
||||||
SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct<SaveMetaCreateInfo>();
|
SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct<SaveMetaCreateInfo>();
|
||||||
HashSalt hashSalt = context.RequestData.ReadStruct<HashSalt>();
|
HashSalt hashSalt = context.RequestData.ReadStruct<HashSalt>();
|
||||||
|
|
||||||
|
@ -217,12 +217,12 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
||||||
attribute.TitleId = new TitleId(context.Process.TitleId);
|
attribute.TitleId = new TitleId(context.Process.TitleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createInfo.OwnerId == TitleId.Zero)
|
if (creationInfo.OwnerId == TitleId.Zero)
|
||||||
{
|
{
|
||||||
createInfo.OwnerId = new TitleId(context.Process.TitleId);
|
creationInfo.OwnerId = new TitleId(context.Process.TitleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result result = _baseFileSystemProxy.CreateSaveDataFileSystemWithHashSalt(ref attribute, ref createInfo, ref metaCreateInfo, ref hashSalt);
|
Result result = _baseFileSystemProxy.CreateSaveDataFileSystemWithHashSalt(ref attribute, ref creationInfo, ref metaCreateInfo, ref hashSalt);
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
return (ResultCode)result.Value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Concentus" Version="1.1.7" />
|
<PackageReference Include="Concentus" Version="1.1.7" />
|
||||||
<PackageReference Include="LibHac" Version="0.7.0" />
|
<PackageReference Include="LibHac" Version="0.8.2" />
|
||||||
<PackageReference Include="TimeZoneConverter.Posix" Version="2.1.0" />
|
<PackageReference Include="TimeZoneConverter.Posix" Version="2.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ using LibHac.Common;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Fs.Shim;
|
using LibHac.Fs.Shim;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.Save;
|
|
||||||
using LibHac.Ncm;
|
using LibHac.Ncm;
|
||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.HLE.Utilities;
|
||||||
using System;
|
using System;
|
||||||
|
@ -131,7 +130,7 @@ namespace Ryujinx.Ui
|
||||||
{
|
{
|
||||||
SaveDataAttribute attribute = new SaveDataAttribute
|
SaveDataAttribute attribute = new SaveDataAttribute
|
||||||
{
|
{
|
||||||
Type = SaveDataType.SaveData,
|
Type = SaveDataType.Account,
|
||||||
UserId = userId,
|
UserId = userId,
|
||||||
TitleId = new TitleId(titleId)
|
TitleId = new TitleId(titleId)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue