olsc.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Copyright 2020 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "core/hle/ipc_helpers.h"
  5. #include "core/hle/kernel/hle_ipc.h"
  6. #include "core/hle/service/olsc/olsc.h"
  7. #include "core/hle/service/service.h"
  8. #include "core/hle/service/sm/sm.h"
  9. namespace Service::OLSC {
  10. class OLSC final : public ServiceFramework<OLSC> {
  11. public:
  12. explicit OLSC(Core::System& system_) : ServiceFramework{system_, "olsc:u"} {
  13. // clang-format off
  14. static const FunctionInfo functions[] = {
  15. {0, &OLSC::Initialize, "Initialize"},
  16. {10, nullptr, "VerifySaveDataBackupLicenseAsync"},
  17. {13, &OLSC::GetSaveDataBackupSetting, "GetSaveDataBackupSetting"},
  18. {14, &OLSC::SetSaveDataBackupSettingEnabled, "SetSaveDataBackupSettingEnabled"},
  19. {15, nullptr, "SetCustomData"},
  20. {16, nullptr, "DeleteSaveDataBackupSetting"},
  21. {18, nullptr, "GetSaveDataBackupInfoCache"},
  22. {19, nullptr, "UpdateSaveDataBackupInfoCacheAsync"},
  23. {22, nullptr, "DeleteSaveDataBackupAsync"},
  24. {25, nullptr, "ListDownloadableSaveDataBackupInfoAsync"},
  25. {26, nullptr, "DownloadSaveDataBackupAsync"},
  26. {27, nullptr, "UploadSaveDataBackupAsync"},
  27. {9010, nullptr, "VerifySaveDataBackupLicenseAsyncForDebug"},
  28. {9013, nullptr, "GetSaveDataBackupSettingForDebug"},
  29. {9014, nullptr, "SetSaveDataBackupSettingEnabledForDebug"},
  30. {9015, nullptr, "SetCustomDataForDebug"},
  31. {9016, nullptr, "DeleteSaveDataBackupSettingForDebug"},
  32. {9018, nullptr, "GetSaveDataBackupInfoCacheForDebug"},
  33. {9019, nullptr, "UpdateSaveDataBackupInfoCacheAsyncForDebug"},
  34. {9022, nullptr, "DeleteSaveDataBackupAsyncForDebug"},
  35. {9025, nullptr, "ListDownloadableSaveDataBackupInfoAsyncForDebug"},
  36. {9026, nullptr, "DownloadSaveDataBackupAsyncForDebug"},
  37. };
  38. // clang-format on
  39. RegisterHandlers(functions);
  40. }
  41. private:
  42. void Initialize(Kernel::HLERequestContext& ctx) {
  43. LOG_WARNING(Service_OLSC, "(STUBBED) called");
  44. initialized = true;
  45. IPC::ResponseBuilder rb{ctx, 2};
  46. rb.Push(RESULT_SUCCESS);
  47. }
  48. void GetSaveDataBackupSetting(Kernel::HLERequestContext& ctx) {
  49. LOG_WARNING(Service_OLSC, "(STUBBED) called");
  50. // backup_setting is set to 0 since real value is unknown
  51. constexpr u64 backup_setting = 0;
  52. IPC::ResponseBuilder rb{ctx, 4};
  53. rb.Push(RESULT_SUCCESS);
  54. rb.Push(backup_setting);
  55. }
  56. void SetSaveDataBackupSettingEnabled(Kernel::HLERequestContext& ctx) {
  57. LOG_WARNING(Service_OLSC, "(STUBBED) called");
  58. IPC::ResponseBuilder rb{ctx, 2};
  59. rb.Push(RESULT_SUCCESS);
  60. }
  61. bool initialized{};
  62. };
  63. void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
  64. std::make_shared<OLSC>(system)->InstallAsService(service_manager);
  65. }
  66. } // namespace Service::OLSC