2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #134 from gdkchan/audout_hid_fix

Stub OpenAudioOut and fix a issue with HID IAppletResource
This commit is contained in:
bunnei 2018-01-22 17:09:09 -05:00 committed by GitHub
commit de2e5a0855
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -49,9 +49,22 @@ void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) {
rb.Push<u32>(1);
}
void AudOutU::OpenAudioOut(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 6};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(48000); // Sample Rate
rb.Push<u32>(2); // Channels
rb.Push<u32>(2); // PCM Format (INT16)
rb.Push<u32>(0); // Unknown
rb.PushIpcInterface<Audio::IAudioOut>();
}
AudOutU::AudOutU() : ServiceFramework("audout:u") {
static const FunctionInfo functions[] = {{0x00000000, &AudOutU::ListAudioOuts, "ListAudioOuts"},
{0x00000001, nullptr, "OpenAudioOut"},
{0x00000001, &AudOutU::OpenAudioOut, "OpenAudioOut"},
{0x00000002, nullptr, "Unknown2"},
{0x00000003, nullptr, "Unknown3"}};
RegisterHandlers(functions);

View file

@ -20,6 +20,7 @@ public:
private:
void ListAudioOuts(Kernel::HLERequestContext& ctx);
void OpenAudioOut(Kernel::HLERequestContext& ctx);
};
} // namespace Audio

View file

@ -162,8 +162,13 @@ public:
~Hid() = default;
private:
Kernel::SharedPtr<Kernel::ClientPort> client_port;
void CreateAppletResource(Kernel::HLERequestContext& ctx) {
auto client_port = std::make_shared<IAppletResource>()->CreatePort();
if (client_port == nullptr) {
client_port = std::make_shared<IAppletResource>()->CreatePort();
}
auto session = client_port->Connect();
if (session.Succeeded()) {
LOG_DEBUG(Service, "called, initialized IAppletResource -> session=%u",