diff options
author | bunnei <bunneidev@gmail.com> | 2018-07-31 18:23:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 18:23:17 +0200 |
commit | fd020ad52ae3dc511527b0f26aab198484dac2dc (patch) | |
tree | 5f54d9c8cec615080d762d239bf2756eeffa74f1 /src/core/hle/service/fgm/fgm.cpp | |
parent | Merge pull request #874 from lioncash/am (diff) | |
parent | service: Add fgm services (diff) | |
download | yuzu-fd020ad52ae3dc511527b0f26aab198484dac2dc.tar yuzu-fd020ad52ae3dc511527b0f26aab198484dac2dc.tar.gz yuzu-fd020ad52ae3dc511527b0f26aab198484dac2dc.tar.bz2 yuzu-fd020ad52ae3dc511527b0f26aab198484dac2dc.tar.lz yuzu-fd020ad52ae3dc511527b0f26aab198484dac2dc.tar.xz yuzu-fd020ad52ae3dc511527b0f26aab198484dac2dc.tar.zst yuzu-fd020ad52ae3dc511527b0f26aab198484dac2dc.zip |
Diffstat (limited to 'src/core/hle/service/fgm/fgm.cpp')
-rw-r--r-- | src/core/hle/service/fgm/fgm.cpp | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp new file mode 100644 index 000000000..566fbf924 --- /dev/null +++ b/src/core/hle/service/fgm/fgm.cpp @@ -0,0 +1,75 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <memory> + +#include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/hle_ipc.h" +#include "core/hle/service/fgm/fgm.h" +#include "core/hle/service/service.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::FGM { + +class IRequest final : public ServiceFramework<IRequest> { +public: + explicit IRequest() : ServiceFramework{"IRequest"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "Set"}, + {2, nullptr, "Get"}, + {3, nullptr, "Cancel"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class FGM final : public ServiceFramework<FGM> { +public: + explicit FGM(const char* name) : ServiceFramework{name} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &FGM::Initialize, "Initialize"}, + }; + // clang-format on + + RegisterHandlers(functions); + } + +private: + void Initialize(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<IRequest>(); + + LOG_DEBUG(Service_FGM, "called"); + } +}; + +class FGM_DBG final : public ServiceFramework<FGM_DBG> { +public: + explicit FGM_DBG() : ServiceFramework{"fgm:dbg"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "Read"}, + {2, nullptr, "Cancel"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +void InstallInterfaces(SM::ServiceManager& sm) { + std::make_shared<FGM>("fgm")->InstallAsService(sm); + std::make_shared<FGM>("fgm:0")->InstallAsService(sm); + std::make_shared<FGM>("fgm:9")->InstallAsService(sm); + std::make_shared<FGM_DBG>()->InstallAsService(sm); +} + +} // namespace Service::FGM |