diff options
| author | 2018-01-22 17:27:55 -0300 | |
|---|---|---|
| committer | 2018-01-22 17:27:55 -0300 | |
| commit | 832009bfdb360a9700c1d367ecfe0f84e32264a7 (patch) | |
| tree | 55b40ec33c4799110a4b01f4115f925aac912c5f /src | |
| parent | Added stubs for audio services. (#116) (diff) | |
| download | yuzu-832009bfdb360a9700c1d367ecfe0f84e32264a7.tar.gz yuzu-832009bfdb360a9700c1d367ecfe0f84e32264a7.tar.xz yuzu-832009bfdb360a9700c1d367ecfe0f84e32264a7.zip | |
Stub OpenAudioOut and fix a issue with HID IAppletResource being created more than once
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 15 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audout_u.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 7 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 8ecfef413..8a436bf97 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp | |||
| @@ -49,9 +49,22 @@ void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) { | |||
| 49 | rb.Push<u32>(1); | 49 | rb.Push<u32>(1); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | void AudOutU::OpenAudioOut(Kernel::HLERequestContext& ctx) { | ||
| 53 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 54 | |||
| 55 | IPC::RequestBuilder rb{ctx, 6}; | ||
| 56 | |||
| 57 | rb.Push(RESULT_SUCCESS); | ||
| 58 | rb.Push<u32>(48000); // Sample Rate | ||
| 59 | rb.Push<u32>(2); // Channels | ||
| 60 | rb.Push<u32>(2); // PCM Format (INT16) | ||
| 61 | rb.Push<u32>(0); // Unknown | ||
| 62 | rb.PushIpcInterface<Audio::IAudioOut>(); | ||
| 63 | } | ||
| 64 | |||
| 52 | AudOutU::AudOutU() : ServiceFramework("audout:u") { | 65 | AudOutU::AudOutU() : ServiceFramework("audout:u") { |
| 53 | static const FunctionInfo functions[] = {{0x00000000, &AudOutU::ListAudioOuts, "ListAudioOuts"}, | 66 | static const FunctionInfo functions[] = {{0x00000000, &AudOutU::ListAudioOuts, "ListAudioOuts"}, |
| 54 | {0x00000001, nullptr, "OpenAudioOut"}, | 67 | {0x00000001, &AudOutU::OpenAudioOut, "OpenAudioOut"}, |
| 55 | {0x00000002, nullptr, "Unknown2"}, | 68 | {0x00000002, nullptr, "Unknown2"}, |
| 56 | {0x00000003, nullptr, "Unknown3"}}; | 69 | {0x00000003, nullptr, "Unknown3"}}; |
| 57 | RegisterHandlers(functions); | 70 | RegisterHandlers(functions); |
diff --git a/src/core/hle/service/audio/audout_u.h b/src/core/hle/service/audio/audout_u.h index 17529245b..69626cc58 100644 --- a/src/core/hle/service/audio/audout_u.h +++ b/src/core/hle/service/audio/audout_u.h | |||
| @@ -20,6 +20,7 @@ public: | |||
| 20 | 20 | ||
| 21 | private: | 21 | private: |
| 22 | void ListAudioOuts(Kernel::HLERequestContext& ctx); | 22 | void ListAudioOuts(Kernel::HLERequestContext& ctx); |
| 23 | void OpenAudioOut(Kernel::HLERequestContext& ctx); | ||
| 23 | }; | 24 | }; |
| 24 | 25 | ||
| 25 | } // namespace Audio | 26 | } // namespace Audio |
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index be7a6ff65..d99e9c505 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -162,8 +162,13 @@ public: | |||
| 162 | ~Hid() = default; | 162 | ~Hid() = default; |
| 163 | 163 | ||
| 164 | private: | 164 | private: |
| 165 | Kernel::SharedPtr<Kernel::ClientPort> client_port; | ||
| 166 | |||
| 165 | void CreateAppletResource(Kernel::HLERequestContext& ctx) { | 167 | void CreateAppletResource(Kernel::HLERequestContext& ctx) { |
| 166 | auto client_port = std::make_shared<IAppletResource>()->CreatePort(); | 168 | if (client_port == nullptr) { |
| 169 | client_port = std::make_shared<IAppletResource>()->CreatePort(); | ||
| 170 | } | ||
| 171 | |||
| 167 | auto session = client_port->Connect(); | 172 | auto session = client_port->Connect(); |
| 168 | if (session.Succeeded()) { | 173 | if (session.Succeeded()) { |
| 169 | LOG_DEBUG(Service, "called, initialized IAppletResource -> session=%u", | 174 | LOG_DEBUG(Service, "called, initialized IAppletResource -> session=%u", |