diff options
author | st4rk <zeromythos@ufrn.edu.br> | 2018-01-22 04:03:36 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-01-22 04:03:36 +0100 |
commit | 07355cf7cc114d27c34d2b61a35f929a6db3f8fb (patch) | |
tree | 35381b658ed1f3014813aecd7c58ac289de41032 /src/core/hle/service/audio/audout_u.cpp | |
parent | Merge pull request #131 from lioncash/enum (diff) | |
download | yuzu-07355cf7cc114d27c34d2b61a35f929a6db3f8fb.tar yuzu-07355cf7cc114d27c34d2b61a35f929a6db3f8fb.tar.gz yuzu-07355cf7cc114d27c34d2b61a35f929a6db3f8fb.tar.bz2 yuzu-07355cf7cc114d27c34d2b61a35f929a6db3f8fb.tar.lz yuzu-07355cf7cc114d27c34d2b61a35f929a6db3f8fb.tar.xz yuzu-07355cf7cc114d27c34d2b61a35f929a6db3f8fb.tar.zst yuzu-07355cf7cc114d27c34d2b61a35f929a6db3f8fb.zip |
Diffstat (limited to 'src/core/hle/service/audio/audout_u.cpp')
-rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index c028262c6..8ecfef413 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -4,21 +4,56 @@ #include "common/logging/log.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/hle_ipc.h" #include "core/hle/service/audio/audout_u.h" namespace Service { namespace Audio { +class IAudioOut final : public ServiceFramework<IAudioOut> { +public: + IAudioOut() : ServiceFramework("IAudioOut") { + static const FunctionInfo functions[] = { + {0x0, nullptr, "GetAudioOutState"}, + {0x1, nullptr, "StartAudioOut"}, + {0x2, nullptr, "StopAudioOut"}, + {0x3, nullptr, "AppendAudioOutBuffer_1"}, + {0x4, nullptr, "RegisterBufferEvent"}, + {0x5, nullptr, "GetReleasedAudioOutBuffer_1"}, + {0x6, nullptr, "ContainsAudioOutBuffer"}, + {0x7, nullptr, "AppendAudioOutBuffer_2"}, + {0x8, nullptr, "GetReleasedAudioOutBuffer_2"}, + }; + RegisterHandlers(functions); + } + ~IAudioOut() = default; +}; + void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2}; + IPC::RequestParser rp{ctx}; + + auto& buffer = ctx.BufferDescriptorB()[0]; + const std::string audio_interface = "AudioInterface"; + + Memory::WriteBlock(buffer.Address(), &audio_interface[0], audio_interface.size()); + + IPC::RequestBuilder rb = rp.MakeBuilder(3, 0, 0, 0); + rb.Push(RESULT_SUCCESS); + // TODO(st4rk): we're currently returning only one audio interface + // (stringlist size) + // however, it's highly possible to have more than one interface (despite that + // libtransistor + // requires only one). + rb.Push<u32>(1); } AudOutU::AudOutU() : ServiceFramework("audout:u") { - static const FunctionInfo functions[] = { - {0x00000000, &AudOutU::ListAudioOuts, "ListAudioOuts"}, - }; + static const FunctionInfo functions[] = {{0x00000000, &AudOutU::ListAudioOuts, "ListAudioOuts"}, + {0x00000001, nullptr, "OpenAudioOut"}, + {0x00000002, nullptr, "Unknown2"}, + {0x00000003, nullptr, "Unknown3"}}; RegisterHandlers(functions); } |