mirror of https://git.suyu.dev/suyu/suyu
psc: stub overlay notification channel
parent
352297d361
commit
e85466c1ae
@ -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
|
Loading…
Reference in New Issue