summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-04-29 00:49:46 +0200
committerZach Hilman <zachhilman@gmail.com>2019-09-30 23:23:26 +0200
commit68658a8385b74454c8523efe95ceb81b34bb8812 (patch)
treec66190e40aa52d7de174653bccbdff78104865b1 /src/core/hle
parentbcat: Add BCAT backend for Boxcat service (diff)
downloadyuzu-68658a8385b74454c8523efe95ceb81b34bb8812.tar
yuzu-68658a8385b74454c8523efe95ceb81b34bb8812.tar.gz
yuzu-68658a8385b74454c8523efe95ceb81b34bb8812.tar.bz2
yuzu-68658a8385b74454c8523efe95ceb81b34bb8812.tar.lz
yuzu-68658a8385b74454c8523efe95ceb81b34bb8812.tar.xz
yuzu-68658a8385b74454c8523efe95ceb81b34bb8812.tar.zst
yuzu-68658a8385b74454c8523efe95ceb81b34bb8812.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/bcat/module.cpp14
-rw-r--r--src/core/hle/service/bcat/module.h3
2 files changed, 16 insertions, 1 deletions
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp
index b7bd738fc..32d3d5cfc 100644
--- a/src/core/hle/service/bcat/module.cpp
+++ b/src/core/hle/service/bcat/module.cpp
@@ -38,10 +38,22 @@ void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IBcatService>();
+namespace {
+std::unique_ptr<Backend> CreateBackendFromSettings(DirectoryGetter getter) {
+ const auto backend = Settings::values.bcat_backend;
+
+#ifdef YUZU_ENABLE_BOXCAT
+ if (backend == "boxcat")
+ return std::make_unique<Boxcat>(std::move(getter));
+#endif
+
+ return std::make_unique<NullBackend>(std::move(getter));
}
+} // Anonymous namespace
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
- : ServiceFramework(name), module(std::move(module)) {}
+ : ServiceFramework(name), module(std::move(module)),
+ backend(CreateBackendFromSettings(&Service::FileSystem::GetBCATDirectory)) {}
Module::Interface::~Interface() = default;
diff --git a/src/core/hle/service/bcat/module.h b/src/core/hle/service/bcat/module.h
index f0d63cab0..4af363bfd 100644
--- a/src/core/hle/service/bcat/module.h
+++ b/src/core/hle/service/bcat/module.h
@@ -8,6 +8,8 @@
namespace Service::BCAT {
+class Backend;
+
class Module final {
public:
class Interface : public ServiceFramework<Interface> {
@@ -19,6 +21,7 @@ public:
protected:
std::shared_ptr<Module> module;
+ std::unique_ptr<Backend> backend;
};
};