From 6f4282daf8b5bfa650dc8c43714c7955dc779cd1 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 12 Mar 2018 16:31:09 -0300 Subject: IAudioDeviceService -> IAudioDevice --- ChocolArm64/Instruction/AInstEmitSystem.cs | 3 -- Ryujinx.Core/OsHle/Services/Aud/IAudioDevice.cs | 63 ++++++++++++++++++++++ .../OsHle/Services/Aud/IAudioDeviceService.cs | 63 ---------------------- Ryujinx.Core/OsHle/Services/Aud/ServiceAudRen.cs | 1 - 4 files changed, 63 insertions(+), 67 deletions(-) create mode 100644 Ryujinx.Core/OsHle/Services/Aud/IAudioDevice.cs delete mode 100644 Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs diff --git a/ChocolArm64/Instruction/AInstEmitSystem.cs b/ChocolArm64/Instruction/AInstEmitSystem.cs index 80b56604..42a62009 100644 --- a/ChocolArm64/Instruction/AInstEmitSystem.cs +++ b/ChocolArm64/Instruction/AInstEmitSystem.cs @@ -89,9 +89,6 @@ namespace ChocolArm64.Instruction //We treat it as no-op here since we don't have any cache being emulated anyway. AOpCodeSystem Op = (AOpCodeSystem)Context.CurrOp; - //TODO: We should throw on unimplemented sys instructions here, - //since it causing some problems when the programs expects some values - //that never return. switch (GetPackedId(Op)) { case 0b11_011_0111_0100_001: diff --git a/Ryujinx.Core/OsHle/Services/Aud/IAudioDevice.cs b/Ryujinx.Core/OsHle/Services/Aud/IAudioDevice.cs new file mode 100644 index 00000000..9ebf140a --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Aud/IAudioDevice.cs @@ -0,0 +1,63 @@ +using ChocolArm64.Memory; +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; +using System.Text; + +namespace Ryujinx.Core.OsHle.IpcServices.Aud +{ + class IAudioDevice : IIpcService + { + private Dictionary m_Commands; + + public IReadOnlyDictionary Commands => m_Commands; + + public IAudioDevice() + { + m_Commands = new Dictionary() + { + { 0, ListAudioDeviceName }, + { 1, SetAudioDeviceOutputVolume }, + }; + } + + public long ListAudioDeviceName(ServiceCtx Context) + { + string[] Names = new string[] { "FIXME" }; + + Context.ResponseData.Write(Names.Length); + + long Position = Context.Request.ReceiveBuff[0].Position; + long Size = Context.Request.ReceiveBuff[0].Size; + + long BasePosition = Position; + + foreach (string Name in Names) + { + byte[] Buffer = Encoding.ASCII.GetBytes(Name + '\0'); + + if ((Position - BasePosition) + Buffer.Length > Size) + { + break; + } + + AMemoryHelper.WriteBytes(Context.Memory, Position, Buffer); + + Position += Buffer.Length; + } + + return 0; + } + + public long SetAudioDeviceOutputVolume(ServiceCtx Context) + { + float Volume = Context.RequestData.ReadSingle(); + + long Position = Context.Request.SendBuff[0].Position; + long Size = Context.Request.SendBuff[0].Size; + + string Name = AMemoryHelper.ReadAsciiString(Context.Memory, Position, (int)Size); + + return 0; + } + } +} \ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs b/Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs deleted file mode 100644 index 9ebf140a..00000000 --- a/Ryujinx.Core/OsHle/Services/Aud/IAudioDeviceService.cs +++ /dev/null @@ -1,63 +0,0 @@ -using ChocolArm64.Memory; -using Ryujinx.Core.OsHle.Ipc; -using System.Collections.Generic; -using System.Text; - -namespace Ryujinx.Core.OsHle.IpcServices.Aud -{ - class IAudioDevice : IIpcService - { - private Dictionary m_Commands; - - public IReadOnlyDictionary Commands => m_Commands; - - public IAudioDevice() - { - m_Commands = new Dictionary() - { - { 0, ListAudioDeviceName }, - { 1, SetAudioDeviceOutputVolume }, - }; - } - - public long ListAudioDeviceName(ServiceCtx Context) - { - string[] Names = new string[] { "FIXME" }; - - Context.ResponseData.Write(Names.Length); - - long Position = Context.Request.ReceiveBuff[0].Position; - long Size = Context.Request.ReceiveBuff[0].Size; - - long BasePosition = Position; - - foreach (string Name in Names) - { - byte[] Buffer = Encoding.ASCII.GetBytes(Name + '\0'); - - if ((Position - BasePosition) + Buffer.Length > Size) - { - break; - } - - AMemoryHelper.WriteBytes(Context.Memory, Position, Buffer); - - Position += Buffer.Length; - } - - return 0; - } - - public long SetAudioDeviceOutputVolume(ServiceCtx Context) - { - float Volume = Context.RequestData.ReadSingle(); - - long Position = Context.Request.SendBuff[0].Position; - long Size = Context.Request.SendBuff[0].Size; - - string Name = AMemoryHelper.ReadAsciiString(Context.Memory, Position, (int)Size); - - return 0; - } - } -} \ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Aud/ServiceAudRen.cs b/Ryujinx.Core/OsHle/Services/Aud/ServiceAudRen.cs index 155d0425..c3a0a8b4 100644 --- a/Ryujinx.Core/OsHle/Services/Aud/ServiceAudRen.cs +++ b/Ryujinx.Core/OsHle/Services/Aud/ServiceAudRen.cs @@ -1,4 +1,3 @@ -using Ryujinx.Core.OsHle.Handles; using Ryujinx.Core.OsHle.Ipc; using System.Collections.Generic; -- cgit v1.2.3