From 24d086cbecb1adb596e2dbeb286dc55f67a68036 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 5 Jul 2020 13:24:29 +0100 Subject: [PATCH] Correctly check the usage bits in DequeueBuffer and fix it's result The extra parameters in result are required for retail games to accept it as valid. --- .../main/cpp/skyline/services/hosbinder/IHOSBinderDriver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/services/hosbinder/IHOSBinderDriver.cpp b/app/src/main/cpp/skyline/services/hosbinder/IHOSBinderDriver.cpp index 906e8033..81c0f5b4 100644 --- a/app/src/main/cpp/skyline/services/hosbinder/IHOSBinderDriver.cpp +++ b/app/src/main/cpp/skyline/services/hosbinder/IHOSBinderDriver.cpp @@ -38,7 +38,7 @@ namespace skyline::service::hosbinder { i64 slot{-1}; while (slot == -1) { for (auto &buffer : queue) { - if (buffer.second->status == BufferStatus::Free && buffer.second->gbpBuffer.width == data->width && buffer.second->gbpBuffer.height == data->height && buffer.second->gbpBuffer.usage == data->usage) { + if (buffer.second->status == BufferStatus::Free && buffer.second->gbpBuffer.width == data->width && buffer.second->gbpBuffer.height == data->height && (buffer.second->gbpBuffer.usage & data->usage) == data->usage) { slot = buffer.first; buffer.second->status = BufferStatus::Dequeued; break; @@ -51,7 +51,8 @@ namespace skyline::service::hosbinder { u32 slot; u32 _unk_[13]; } output{ - .slot = static_cast(slot) + .slot = static_cast(slot), + ._unk_ = {1, 0x24} }; out.WriteData(output);