summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-04-29 00:51:18 +0200
committerZach Hilman <zachhilman@gmail.com>2019-09-30 23:23:26 +0200
commit78d146f907cbab60026f972e1be7cc8eb83e05bb (patch)
tree12c4190b1da9c2b9ca56a5a7eac3a654d8f6c23c /src/core
parentmodule: Create BCAT backend based upon Settings value on construction (diff)
downloadyuzu-78d146f907cbab60026f972e1be7cc8eb83e05bb.tar
yuzu-78d146f907cbab60026f972e1be7cc8eb83e05bb.tar.gz
yuzu-78d146f907cbab60026f972e1be7cc8eb83e05bb.tar.bz2
yuzu-78d146f907cbab60026f972e1be7cc8eb83e05bb.tar.lz
yuzu-78d146f907cbab60026f972e1be7cc8eb83e05bb.tar.xz
yuzu-78d146f907cbab60026f972e1be7cc8eb83e05bb.tar.zst
yuzu-78d146f907cbab60026f972e1be7cc8eb83e05bb.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/bcat/bcat.cpp4
-rw-r--r--src/core/hle/service/bcat/module.cpp28
-rw-r--r--src/core/hle/service/bcat/module.h2
3 files changed, 32 insertions, 2 deletions
diff --git a/src/core/hle/service/bcat/bcat.cpp b/src/core/hle/service/bcat/bcat.cpp
index 179aa4949..391f599ee 100644
--- a/src/core/hle/service/bcat/bcat.cpp
+++ b/src/core/hle/service/bcat/bcat.cpp
@@ -8,9 +8,13 @@ namespace Service::BCAT {
BCAT::BCAT(std::shared_ptr<Module> module, const char* name)
: Module::Interface(std::move(module), name) {
+ // clang-format off
static const FunctionInfo functions[] = {
{0, &BCAT::CreateBcatService, "CreateBcatService"},
+ {1, &BCAT::CreateDeliveryCacheStorageService, "CreateDeliveryCacheStorageService"},
+ {2, &BCAT::CreateDeliveryCacheStorageServiceWithApplicationId, "CreateDeliveryCacheStorageServiceWithApplicationId"},
};
+ // clang-format on
RegisterHandlers(functions);
}
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp
index 32d3d5cfc..fd742fde2 100644
--- a/src/core/hle/service/bcat/module.cpp
+++ b/src/core/hle/service/bcat/module.cpp
@@ -11,7 +11,8 @@ namespace Service::BCAT {
class IBcatService final : public ServiceFramework<IBcatService> {
public:
- IBcatService() : ServiceFramework("IBcatService") {
+ IBcatService(Backend& backend) : ServiceFramework("IBcatService"), backend(backend) {
+ // clang-format off
static const FunctionInfo functions[] = {
{10100, nullptr, "RequestSyncDeliveryCache"},
{10101, nullptr, "RequestSyncDeliveryCacheWithDirectoryName"},
@@ -28,6 +29,7 @@ public:
{90201, nullptr, "ClearDeliveryCacheStorage"},
{90300, nullptr, "GetPushNotificationLog"},
};
+ // clang-format on
RegisterHandlers(functions);
}
};
@@ -37,7 +39,29 @@ void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IBcatService>();
+ rb.PushIpcInterface<IBcatService>(*backend);
+void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_BCAT, "called");
+
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<IDeliveryCacheStorageService>(
+ Service::FileSystem::GetBCATDirectory(Core::CurrentProcess()->GetTitleID()));
+}
+
+void Module::Interface::CreateDeliveryCacheStorageServiceWithApplicationId(
+ Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+ const auto title_id = rp.PopRaw<u64>();
+
+ LOG_DEBUG(Service_BCAT, "called, title_id={:016X}", title_id);
+
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<IDeliveryCacheStorageService>(
+ Service::FileSystem::GetBCATDirectory(title_id));
+}
+
namespace {
std::unique_ptr<Backend> CreateBackendFromSettings(DirectoryGetter getter) {
const auto backend = Settings::values.bcat_backend;
diff --git a/src/core/hle/service/bcat/module.h b/src/core/hle/service/bcat/module.h
index 4af363bfd..fc52574c2 100644
--- a/src/core/hle/service/bcat/module.h
+++ b/src/core/hle/service/bcat/module.h
@@ -18,6 +18,8 @@ public:
~Interface() override;
void CreateBcatService(Kernel::HLERequestContext& ctx);
+ void CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx);
+ void CreateDeliveryCacheStorageServiceWithApplicationId(Kernel::HLERequestContext& ctx);
protected:
std::shared_ptr<Module> module;