merge fix

This commit is contained in:
unknown 2018-04-18 20:15:04 +02:00
commit b70b48373b
5 changed files with 136 additions and 15 deletions

View file

@ -133,6 +133,9 @@ namespace ChocolArm64
Set("10011011110xxxxx0xxxxxxxxxxxxxxx", AInstEmit.Umulh, typeof(AOpCodeMul));
//Vector
Set("0101111011100000101110xxxxxxxxxx", AInstEmit.Abs_S, typeof(AOpCodeSimd));
Set("0>001110<<100000101110xxxxxxxxxx", AInstEmit.Abs_V, typeof(AOpCodeSimd));
Set("01011110111xxxxx100001xxxxxxxxxx", AInstEmit.Add_S, typeof(AOpCodeSimdReg));
Set("0>001110<<1xxxxx100001xxxxxxxxxx", AInstEmit.Add_V, typeof(AOpCodeSimdReg));
Set("01011110xx110001101110xxxxxxxxxx", AInstEmit.Addp_S, typeof(AOpCodeSimd));
Set("0>001110<<1xxxxx101111xxxxxxxxxx", AInstEmit.Addp_V, typeof(AOpCodeSimdReg));
@ -282,7 +285,8 @@ namespace ChocolArm64
Set("0x10111100000xxx0xx001xxxxxxxxxx", AInstEmit.Mvni_V, typeof(AOpCodeSimdImm));
Set("0x10111100000xxx10x001xxxxxxxxxx", AInstEmit.Mvni_V, typeof(AOpCodeSimdImm));
Set("0x10111100000xxx110x01xxxxxxxxxx", AInstEmit.Mvni_V, typeof(AOpCodeSimdImm));
Set("0>101110<<100000101110xxxxxxxxxx", AInstEmit.Neg_V, typeof(AOpCodeSimdReg));
Set("0111111011100000101110xxxxxxxxxx", AInstEmit.Neg_S, typeof(AOpCodeSimd));
Set("0>101110<<100000101110xxxxxxxxxx", AInstEmit.Neg_V, typeof(AOpCodeSimd));
Set("0x10111000100000010110xxxxxxxxxx", AInstEmit.Not_V, typeof(AOpCodeSimd));
Set("0x001110101xxxxx000111xxxxxxxxxx", AInstEmit.Orr_V, typeof(AOpCodeSimdReg));
Set("0x00111100000xxx<<x101xxxxxxxxxx", AInstEmit.Orr_Vi, typeof(AOpCodeSimdImm));
@ -315,7 +319,7 @@ namespace ChocolArm64
Set("xx111100x00xxxxxxxxx11xxxxxxxxxx", AInstEmit.Str, typeof(AOpCodeSimdMemImm));
Set("xx111101x0xxxxxxxxxxxxxxxxxxxxxx", AInstEmit.Str, typeof(AOpCodeSimdMemImm));
Set("xx111100x01xxxxxxxxx10xxxxxxxxxx", AInstEmit.Str, typeof(AOpCodeSimdMemReg));
Set("01111110xx1xxxxx100001xxxxxxxxxx", AInstEmit.Sub_S, typeof(AOpCodeSimdReg));
Set("01111110111xxxxx100001xxxxxxxxxx", AInstEmit.Sub_S, typeof(AOpCodeSimdReg));
Set("0>101110<<1xxxxx100001xxxxxxxxxx", AInstEmit.Sub_V, typeof(AOpCodeSimdReg));
Set("0x001110000xxxxx0xx000xxxxxxxxxx", AInstEmit.Tbl_V, typeof(AOpCodeSimdTbl));
Set("0>001110<<0xxxxx001010xxxxxxxxxx", AInstEmit.Trn1_V, typeof(AOpCodeSimdReg));

View file

@ -11,6 +11,35 @@ namespace ChocolArm64.Instruction
{
static partial class AInstEmit
{
public static void Abs_S(AILEmitterCtx Context)
{
EmitScalarUnaryOpSx(Context, () => EmitAbs(Context));
}
public static void Abs_V(AILEmitterCtx Context)
{
EmitVectorUnaryOpSx(Context, () => EmitAbs(Context));
}
private static void EmitAbs(AILEmitterCtx Context)
{
AILLabel LblTrue = new AILLabel();
Context.Emit(OpCodes.Dup);
Context.Emit(OpCodes.Ldc_I4_0);
Context.Emit(OpCodes.Bge_S, LblTrue);
Context.Emit(OpCodes.Neg);
Context.MarkLabel(LblTrue);
}
public static void Add_S(AILEmitterCtx Context)
{
EmitScalarBinaryOpZx(Context, () => Context.Emit(OpCodes.Add));
}
public static void Add_V(AILEmitterCtx Context)
{
EmitVectorBinaryOpZx(Context, () => Context.Emit(OpCodes.Add));
@ -805,6 +834,11 @@ namespace ChocolArm64.Instruction
EmitVectorBinaryOpByElemZx(Context, () => Context.Emit(OpCodes.Mul));
}
public static void Neg_S(AILEmitterCtx Context)
{
EmitScalarUnaryOpSx(Context, () => Context.Emit(OpCodes.Neg));
}
public static void Neg_V(AILEmitterCtx Context)
{
EmitVectorUnaryOpSx(Context, () => Context.Emit(OpCodes.Neg));

View file

@ -256,8 +256,8 @@ namespace ChocolArm64.Instruction
((Value >> 6) & 1) + (Value >> 7);
}
public static float CustomMaxF(float val1, float val2) {
public static float CustomMaxF(float val1, float val2)
{
if(val1 == 0.0 && val2 == 0.0)
{
@ -279,8 +279,8 @@ namespace ChocolArm64.Instruction
return val2;
}
public static double CustomMax(double val1, double val2) {
public static double CustomMax(double val1, double val2)
{
if(val1 == 0.0 && val2 == 0.0)
{
if(BitConverter.GetBytes(val1)[7] == 0x80 && BitConverter.GetBytes(val2)[7] == 0x80)
@ -301,8 +301,8 @@ namespace ChocolArm64.Instruction
return val2;
}
public static float CustomMinF(float val1, float val2) {
public static float CustomMinF(float val1, float val2)
{
if((val1 == 0.0 && val2 >= 0.0) || (val1 >= 0.0 && val2 == 0.0))
{
if(BitConverter.GetBytes(val1)[3] == 0x80 || BitConverter.GetBytes(val2)[3] == 0x80)
@ -330,8 +330,8 @@ namespace ChocolArm64.Instruction
return val2;
}
public static double CustomMin(double val1, double val2) {
public static double CustomMin(double val1, double val2)
{
if((val1 == 0.0 && val2 >= 0.0) || (val1 >= 0.0 && val2 == 0.0))
{
if(BitConverter.GetBytes(val1)[7] == 0x80 || BitConverter.GetBytes(val2)[7] == 0x80)

View file

@ -13,8 +13,59 @@ namespace Ryujinx.Core.OsHle.Services.Am
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
//...
{ 0, SetExpectedMasterVolume },
{ 1, GetMainAppletExpectedMasterVolume },
{ 2, GetLibraryAppletExpectedMasterVolume },
{ 3, ChangeMainAppletMasterVolume },
{ 4, SetTransparentVolumeRate }
};
}
public long SetExpectedMasterVolume(ServiceCtx Context)
{
float Unknown0 = Context.RequestData.ReadSingle();
float Unknown1 = Context.RequestData.ReadSingle();
Logging.Stub(LogClass.ServiceAm, "Stubbed");
return 0;
}
public long GetMainAppletExpectedMasterVolume(ServiceCtx Context)
{
Context.ResponseData.Write(1f);
Logging.Stub(LogClass.ServiceAm, "Stubbed");
return 0;
}
public long GetLibraryAppletExpectedMasterVolume(ServiceCtx Context)
{
Context.ResponseData.Write(1f);
Logging.Stub(LogClass.ServiceAm, "Stubbed");
return 0;
}
public long ChangeMainAppletMasterVolume(ServiceCtx Context)
{
float Unknown0 = Context.RequestData.ReadSingle();
long Unknown1 = Context.RequestData.ReadInt64();
Logging.Stub(LogClass.ServiceAm, "Stubbed");
return 0;
}
public long SetTransparentVolumeRate(ServiceCtx Context)
{
float Unknown0 = Context.RequestData.ReadSingle();
Logging.Stub(LogClass.ServiceAm, "Stubbed");
return 0;
}
}
}
}

View file

@ -1,4 +1,5 @@
using ChocolArm64.Memory;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
using System.Text;
@ -11,13 +12,21 @@ namespace Ryujinx.Core.OsHle.Services.Aud
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
private KEvent SystemEvent;
public IAudioDeviceService()
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 0, ListAudioDeviceName },
{ 1, SetAudioDeviceOutputVolume },
{ 0, ListAudioDeviceName },
{ 1, SetAudioDeviceOutputVolume },
{ 4, QueryAudioDeviceSystemEvent },
{ 5, GetActiveChannelCount }
};
SystemEvent = new KEvent();
//TODO: We shouldn't be signaling this here.
SystemEvent.Handle.Set();
}
public long ListAudioDeviceName(ServiceCtx Context)
@ -59,7 +68,30 @@ namespace Ryujinx.Core.OsHle.Services.Aud
Logging.Stub(LogClass.ServiceAudio, $"Volume = {Volume}, Position = {Position}, Size = {Size}");
<<<<<<< HEAD:Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs
=======
return 0;
}
public long QueryAudioDeviceSystemEvent(ServiceCtx Context)
{
int Handle = Context.Process.HandleTable.OpenHandle(SystemEvent);
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
Logging.Stub(LogClass.ServiceAudio, "Stubbed");
return 0;
}
public long GetActiveChannelCount(ServiceCtx Context)
{
Context.ResponseData.Write(2);
Logging.Stub(LogClass.ServiceAudio, "Stubbed");
>>>>>>> upstream/master:Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs
return 0;
}
}
}
}