Browse Source
Merge pull request #13117 from liamwhite/ovln
Merge pull request #13117 from liamwhite/ovln
psc: stub overlay notification channelnce_cpp
committed by
GitHub
18 changed files with 372 additions and 69 deletions
-
15src/core/CMakeLists.txt
-
21src/core/hle/service/psc/ovln/ovln_types.h
-
24src/core/hle/service/psc/ovln/receiver.cpp
-
16src/core/hle/service/psc/ovln/receiver.h
-
28src/core/hle/service/psc/ovln/receiver_service.cpp
-
22src/core/hle/service/psc/ovln/receiver_service.h
-
32src/core/hle/service/psc/ovln/sender.cpp
-
21src/core/hle/service/psc/ovln/sender.h
-
30src/core/hle/service/psc/ovln/sender_service.cpp
-
23src/core/hle/service/psc/ovln/sender_service.h
-
28src/core/hle/service/psc/pm_control.cpp
-
16src/core/hle/service/psc/pm_control.h
-
24src/core/hle/service/psc/pm_module.cpp
-
16src/core/hle/service/psc/pm_module.h
-
28src/core/hle/service/psc/pm_service.cpp
-
22src/core/hle/service/psc/pm_service.h
-
71src/core/hle/service/psc/psc.cpp
-
4src/core/hle/service/psc/psc.h
@ -0,0 +1,21 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "common/bit_field.h" |
||||
|
#include "common/common_types.h" |
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
using OverlayNotification = std::array<u64, 0x10>; |
||||
|
static_assert(sizeof(OverlayNotification) == 0x80, "OverlayNotification has incorrect size"); |
||||
|
|
||||
|
union MessageFlags { |
||||
|
u64 raw; |
||||
|
BitField<0, 8, u64> message_type; |
||||
|
BitField<8, 8, u64> queue_type; |
||||
|
}; |
||||
|
static_assert(sizeof(MessageFlags) == 0x8, "MessageFlags has incorrect size"); |
||||
|
|
||||
|
} // namespace Service::PSC |
||||
@ -0,0 +1,24 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
|
||||
|
#include "core/hle/service/psc/ovln/receiver.h"
|
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
IReceiver::IReceiver(Core::System& system_) : ServiceFramework{system_, "IReceiver"} { |
||||
|
// clang-format off
|
||||
|
static const FunctionInfo functions[] = { |
||||
|
{0, nullptr, "AddSource"}, |
||||
|
{1, nullptr, "RemoveSource"}, |
||||
|
{2, nullptr, "GetReceiveEventHandle"}, |
||||
|
{3, nullptr, "Receive"}, |
||||
|
{4, nullptr, "ReceiveWithTick"}, |
||||
|
}; |
||||
|
// clang-format on
|
||||
|
|
||||
|
RegisterHandlers(functions); |
||||
|
} |
||||
|
|
||||
|
IReceiver::~IReceiver() = default; |
||||
|
|
||||
|
} // namespace Service::PSC
|
||||
@ -0,0 +1,16 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
class IReceiver final : public ServiceFramework<IReceiver> { |
||||
|
public: |
||||
|
explicit IReceiver(Core::System& system_); |
||||
|
~IReceiver() override; |
||||
|
}; |
||||
|
|
||||
|
} // namespace Service::PSC |
||||
@ -0,0 +1,28 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
|
||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||
|
#include "core/hle/service/psc/ovln/receiver.h"
|
||||
|
#include "core/hle/service/psc/ovln/receiver_service.h"
|
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
IReceiverService::IReceiverService(Core::System& system_) : ServiceFramework{system_, "ovln:rcv"} { |
||||
|
// clang-format off
|
||||
|
static const FunctionInfo functions[] = { |
||||
|
{0, D<&IReceiverService::OpenReceiver>, "OpenReceiver"}, |
||||
|
}; |
||||
|
// clang-format on
|
||||
|
|
||||
|
RegisterHandlers(functions); |
||||
|
} |
||||
|
|
||||
|
IReceiverService::~IReceiverService() = default; |
||||
|
|
||||
|
Result IReceiverService::OpenReceiver(Out<SharedPointer<IReceiver>> out_receiver) { |
||||
|
LOG_DEBUG(Service_PSC, "called"); |
||||
|
*out_receiver = std::make_shared<IReceiver>(system); |
||||
|
R_SUCCEED(); |
||||
|
} |
||||
|
|
||||
|
} // namespace Service::PSC
|
||||
@ -0,0 +1,22 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "core/hle/service/cmif_types.h" |
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
class IReceiver; |
||||
|
|
||||
|
class IReceiverService final : public ServiceFramework<IReceiverService> { |
||||
|
public: |
||||
|
explicit IReceiverService(Core::System& system_); |
||||
|
~IReceiverService() override; |
||||
|
|
||||
|
private: |
||||
|
Result OpenReceiver(Out<SharedPointer<IReceiver>> out_receiver); |
||||
|
}; |
||||
|
|
||||
|
} // namespace Service::PSC |
||||
@ -0,0 +1,32 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
|
||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||
|
#include "core/hle/service/psc/ovln/sender.h"
|
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
ISender::ISender(Core::System& system_) : ServiceFramework{system_, "ISender"} { |
||||
|
// clang-format off
|
||||
|
static const FunctionInfo functions[] = { |
||||
|
{0, D<&ISender::Send>, "Send"}, |
||||
|
{1, nullptr, "GetUnreceivedMessageCount"}, |
||||
|
}; |
||||
|
// clang-format on
|
||||
|
|
||||
|
RegisterHandlers(functions); |
||||
|
} |
||||
|
|
||||
|
ISender::~ISender() = default; |
||||
|
|
||||
|
Result ISender::Send(const OverlayNotification& notification, MessageFlags flags) { |
||||
|
std::string data; |
||||
|
for (const auto m : notification) { |
||||
|
data += fmt::format("{:016X} ", m); |
||||
|
} |
||||
|
|
||||
|
LOG_WARNING(Service_PSC, "(STUBBED) called, flags={} notification={}", flags.raw, data); |
||||
|
R_SUCCEED(); |
||||
|
} |
||||
|
|
||||
|
} // namespace Service::PSC
|
||||
@ -0,0 +1,21 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "core/hle/service/cmif_types.h" |
||||
|
#include "core/hle/service/psc/ovln/ovln_types.h" |
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
class ISender final : public ServiceFramework<ISender> { |
||||
|
public: |
||||
|
explicit ISender(Core::System& system_); |
||||
|
~ISender() override; |
||||
|
|
||||
|
private: |
||||
|
Result Send(const OverlayNotification& notification, MessageFlags flags); |
||||
|
}; |
||||
|
|
||||
|
} // namespace Service::PSC |
||||
@ -0,0 +1,30 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
|
||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||
|
#include "core/hle/service/psc/ovln/sender.h"
|
||||
|
#include "core/hle/service/psc/ovln/sender_service.h"
|
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
ISenderService::ISenderService(Core::System& system_) : ServiceFramework{system_, "ovln:snd"} { |
||||
|
// clang-format off
|
||||
|
static const FunctionInfo functions[] = { |
||||
|
{0, D<&ISenderService::OpenSender>, "OpenSender"}, |
||||
|
}; |
||||
|
// clang-format on
|
||||
|
|
||||
|
RegisterHandlers(functions); |
||||
|
} |
||||
|
|
||||
|
ISenderService::~ISenderService() = default; |
||||
|
|
||||
|
Result ISenderService::OpenSender(Out<SharedPointer<ISender>> out_sender, u32 sender_id, |
||||
|
std::array<u64, 2> data) { |
||||
|
LOG_WARNING(Service_PSC, "(STUBBED) called, sender_id={}, data={:016X} {:016X}", sender_id, |
||||
|
data[0], data[1]); |
||||
|
*out_sender = std::make_shared<ISender>(system); |
||||
|
R_SUCCEED(); |
||||
|
} |
||||
|
|
||||
|
} // namespace Service::PSC
|
||||
@ -0,0 +1,23 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "core/hle/service/cmif_types.h" |
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
class ISender; |
||||
|
|
||||
|
class ISenderService final : public ServiceFramework<ISenderService> { |
||||
|
public: |
||||
|
explicit ISenderService(Core::System& system_); |
||||
|
~ISenderService() override; |
||||
|
|
||||
|
private: |
||||
|
Result OpenSender(Out<SharedPointer<ISender>> out_sender, u32 sender_id, |
||||
|
std::array<u64, 2> data); |
||||
|
}; |
||||
|
|
||||
|
} // namespace Service::PSC |
||||
@ -0,0 +1,28 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
|
||||
|
#include "core/hle/service/psc/pm_control.h"
|
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
IPmControl::IPmControl(Core::System& system_) : ServiceFramework{system_, "psc:c"} { |
||||
|
// clang-format off
|
||||
|
static const FunctionInfo functions[] = { |
||||
|
{0, nullptr, "Initialize"}, |
||||
|
{1, nullptr, "DispatchRequest"}, |
||||
|
{2, nullptr, "GetResult"}, |
||||
|
{3, nullptr, "GetState"}, |
||||
|
{4, nullptr, "Cancel"}, |
||||
|
{5, nullptr, "PrintModuleInformation"}, |
||||
|
{6, nullptr, "GetModuleInformation"}, |
||||
|
{10, nullptr, "AcquireStateLock"}, |
||||
|
{11, nullptr, "HasStateLock"}, |
||||
|
}; |
||||
|
// clang-format on
|
||||
|
|
||||
|
RegisterHandlers(functions); |
||||
|
} |
||||
|
|
||||
|
IPmControl::~IPmControl() = default; |
||||
|
|
||||
|
} // namespace Service::PSC
|
||||
@ -0,0 +1,16 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
class IPmControl final : public ServiceFramework<IPmControl> { |
||||
|
public: |
||||
|
explicit IPmControl(Core::System& system_); |
||||
|
~IPmControl() override; |
||||
|
}; |
||||
|
|
||||
|
} // namespace Service::PSC |
||||
@ -0,0 +1,24 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
|
||||
|
#include "core/hle/service/psc/pm_module.h"
|
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
IPmModule::IPmModule(Core::System& system_) : ServiceFramework{system_, "IPmModule"} { |
||||
|
// clang-format off
|
||||
|
static const FunctionInfo functions[] = { |
||||
|
{0, nullptr, "Initialize"}, |
||||
|
{1, nullptr, "GetRequest"}, |
||||
|
{2, nullptr, "Acknowledge"}, |
||||
|
{3, nullptr, "Finalize"}, |
||||
|
{4, nullptr, "AcknowledgeEx"}, |
||||
|
}; |
||||
|
// clang-format on
|
||||
|
|
||||
|
RegisterHandlers(functions); |
||||
|
} |
||||
|
|
||||
|
IPmModule::~IPmModule() = default; |
||||
|
|
||||
|
} // namespace Service::PSC
|
||||
@ -0,0 +1,16 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
class IPmModule final : public ServiceFramework<IPmModule> { |
||||
|
public: |
||||
|
explicit IPmModule(Core::System& system_); |
||||
|
~IPmModule() override; |
||||
|
}; |
||||
|
|
||||
|
} // namespace Service::PSC |
||||
@ -0,0 +1,28 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
|
||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||
|
#include "core/hle/service/psc/pm_module.h"
|
||||
|
#include "core/hle/service/psc/pm_service.h"
|
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
IPmService::IPmService(Core::System& system_) : ServiceFramework{system_, "psc:m"} { |
||||
|
// clang-format off
|
||||
|
static const FunctionInfo functions[] = { |
||||
|
{0, D<&IPmService::GetPmModule>, "GetPmModule"}, |
||||
|
}; |
||||
|
// clang-format on
|
||||
|
|
||||
|
RegisterHandlers(functions); |
||||
|
} |
||||
|
|
||||
|
IPmService::~IPmService() = default; |
||||
|
|
||||
|
Result IPmService::GetPmModule(Out<SharedPointer<IPmModule>> out_module) { |
||||
|
LOG_DEBUG(Service_PSC, "called"); |
||||
|
*out_module = std::make_shared<IPmModule>(system); |
||||
|
R_SUCCEED(); |
||||
|
} |
||||
|
|
||||
|
} // namespace Service::PSC
|
||||
@ -0,0 +1,22 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "core/hle/service/cmif_types.h" |
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service::PSC { |
||||
|
|
||||
|
class IPmModule; |
||||
|
|
||||
|
class IPmService final : public ServiceFramework<IPmService> { |
||||
|
public: |
||||
|
explicit IPmService(Core::System& system_); |
||||
|
~IPmService() override; |
||||
|
|
||||
|
private: |
||||
|
Result GetPmModule(Out<SharedPointer<IPmModule>> out_module); |
||||
|
}; |
||||
|
|
||||
|
} // namespace Service::PSC |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue