2022-04-23 04:59:50 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-11-19 15:35:07 -05:00
|
|
|
|
2023-02-19 14:42:12 -05:00
|
|
|
#include "core/hle/service/ipc_helpers.h"
|
2020-11-19 15:35:07 -05:00
|
|
|
#include "core/hle/service/olsc/olsc.h"
|
2023-02-18 16:26:48 -05:00
|
|
|
#include "core/hle/service/server_manager.h"
|
2020-11-19 15:35:07 -05:00
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
|
|
|
|
namespace Service::OLSC {
|
|
|
|
|
|
|
|
class OLSC final : public ServiceFramework<OLSC> {
|
|
|
|
public:
|
2020-11-26 15:19:08 -05:00
|
|
|
explicit OLSC(Core::System& system_) : ServiceFramework{system_, "olsc:u"} {
|
2020-11-19 15:35:07 -05:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, &OLSC::Initialize, "Initialize"},
|
|
|
|
{10, nullptr, "VerifySaveDataBackupLicenseAsync"},
|
2021-02-07 23:09:40 -05:00
|
|
|
{13, &OLSC::GetSaveDataBackupSetting, "GetSaveDataBackupSetting"},
|
2020-11-19 15:35:07 -05:00
|
|
|
{14, &OLSC::SetSaveDataBackupSettingEnabled, "SetSaveDataBackupSettingEnabled"},
|
|
|
|
{15, nullptr, "SetCustomData"},
|
|
|
|
{16, nullptr, "DeleteSaveDataBackupSetting"},
|
|
|
|
{18, nullptr, "GetSaveDataBackupInfoCache"},
|
|
|
|
{19, nullptr, "UpdateSaveDataBackupInfoCacheAsync"},
|
|
|
|
{22, nullptr, "DeleteSaveDataBackupAsync"},
|
|
|
|
{25, nullptr, "ListDownloadableSaveDataBackupInfoAsync"},
|
|
|
|
{26, nullptr, "DownloadSaveDataBackupAsync"},
|
2021-04-08 15:54:01 -04:00
|
|
|
{27, nullptr, "UploadSaveDataBackupAsync"},
|
2020-11-19 15:35:07 -05:00
|
|
|
{9010, nullptr, "VerifySaveDataBackupLicenseAsyncForDebug"},
|
|
|
|
{9013, nullptr, "GetSaveDataBackupSettingForDebug"},
|
|
|
|
{9014, nullptr, "SetSaveDataBackupSettingEnabledForDebug"},
|
|
|
|
{9015, nullptr, "SetCustomDataForDebug"},
|
|
|
|
{9016, nullptr, "DeleteSaveDataBackupSettingForDebug"},
|
|
|
|
{9018, nullptr, "GetSaveDataBackupInfoCacheForDebug"},
|
|
|
|
{9019, nullptr, "UpdateSaveDataBackupInfoCacheAsyncForDebug"},
|
|
|
|
{9022, nullptr, "DeleteSaveDataBackupAsyncForDebug"},
|
|
|
|
{9025, nullptr, "ListDownloadableSaveDataBackupInfoAsyncForDebug"},
|
|
|
|
{9026, nullptr, "DownloadSaveDataBackupAsyncForDebug"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2023-02-19 14:42:12 -05:00
|
|
|
void Initialize(HLERequestContext& ctx) {
|
2020-11-19 15:35:07 -05:00
|
|
|
LOG_WARNING(Service_OLSC, "(STUBBED) called");
|
|
|
|
|
|
|
|
initialized = true;
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
2021-05-21 01:05:04 -04:00
|
|
|
rb.Push(ResultSuccess);
|
2020-11-19 15:35:07 -05:00
|
|
|
}
|
|
|
|
|
2023-02-19 14:42:12 -05:00
|
|
|
void GetSaveDataBackupSetting(HLERequestContext& ctx) {
|
2021-02-07 23:09:40 -05:00
|
|
|
LOG_WARNING(Service_OLSC, "(STUBBED) called");
|
|
|
|
|
|
|
|
// backup_setting is set to 0 since real value is unknown
|
|
|
|
constexpr u64 backup_setting = 0;
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 4};
|
2021-05-21 01:05:04 -04:00
|
|
|
rb.Push(ResultSuccess);
|
2021-02-07 23:09:40 -05:00
|
|
|
rb.Push(backup_setting);
|
|
|
|
}
|
|
|
|
|
2023-02-19 14:42:12 -05:00
|
|
|
void SetSaveDataBackupSettingEnabled(HLERequestContext& ctx) {
|
2020-11-19 15:35:07 -05:00
|
|
|
LOG_WARNING(Service_OLSC, "(STUBBED) called");
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
2021-05-21 01:05:04 -04:00
|
|
|
rb.Push(ResultSuccess);
|
2020-11-19 15:35:07 -05:00
|
|
|
}
|
2020-11-20 13:50:50 -05:00
|
|
|
|
|
|
|
bool initialized{};
|
2020-11-19 15:35:07 -05:00
|
|
|
};
|
|
|
|
|
2023-02-18 16:26:48 -05:00
|
|
|
void LoopProcess(Core::System& system) {
|
|
|
|
auto server_manager = std::make_unique<ServerManager>(system);
|
|
|
|
|
|
|
|
server_manager->RegisterNamedService("olsc:u", std::make_shared<OLSC>(system));
|
|
|
|
ServerManager::RunServer(std::move(server_manager));
|
2020-11-19 15:35:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Service::OLSC
|