diff options
Diffstat (limited to 'src/core/hle/applets/erreula.cpp')
| -rw-r--r-- | src/core/hle/applets/erreula.cpp | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/core/hle/applets/erreula.cpp b/src/core/hle/applets/erreula.cpp deleted file mode 100644 index 518f371f5..000000000 --- a/src/core/hle/applets/erreula.cpp +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/string_util.h" | ||
| 6 | #include "core/hle/applets/erreula.h" | ||
| 7 | #include "core/hle/service/apt/apt.h" | ||
| 8 | |||
| 9 | namespace HLE { | ||
| 10 | namespace Applets { | ||
| 11 | |||
| 12 | ResultCode ErrEula::ReceiveParameter(const Service::APT::MessageParameter& parameter) { | ||
| 13 | if (parameter.signal != static_cast<u32>(Service::APT::SignalType::Request)) { | ||
| 14 | LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal); | ||
| 15 | UNIMPLEMENTED(); | ||
| 16 | // TODO(Subv): Find the right error code | ||
| 17 | return ResultCode(-1); | ||
| 18 | } | ||
| 19 | |||
| 20 | // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared | ||
| 21 | // memory. | ||
| 22 | // Create the SharedMemory that will hold the framebuffer data | ||
| 23 | Service::APT::CaptureBufferInfo capture_info; | ||
| 24 | ASSERT(sizeof(capture_info) == parameter.buffer.size()); | ||
| 25 | |||
| 26 | memcpy(&capture_info, parameter.buffer.data(), sizeof(capture_info)); | ||
| 27 | |||
| 28 | // TODO: allocated memory never released | ||
| 29 | using Kernel::MemoryPermission; | ||
| 30 | // Allocate a heap block of the required size for this applet. | ||
| 31 | heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); | ||
| 32 | // Create a SharedMemory that directly points to this heap block. | ||
| 33 | framebuffer_memory = Kernel::SharedMemory::CreateForApplet( | ||
| 34 | heap_memory, 0, capture_info.size, MemoryPermission::ReadWrite, MemoryPermission::ReadWrite, | ||
| 35 | "ErrEula Memory"); | ||
| 36 | |||
| 37 | // Send the response message with the newly created SharedMemory | ||
| 38 | Service::APT::MessageParameter result; | ||
| 39 | result.signal = static_cast<u32>(Service::APT::SignalType::Response); | ||
| 40 | result.buffer.clear(); | ||
| 41 | result.destination_id = static_cast<u32>(Service::APT::AppletId::Application); | ||
| 42 | result.sender_id = static_cast<u32>(id); | ||
| 43 | result.object = framebuffer_memory; | ||
| 44 | |||
| 45 | Service::APT::SendParameter(result); | ||
| 46 | return RESULT_SUCCESS; | ||
| 47 | } | ||
| 48 | |||
| 49 | ResultCode ErrEula::StartImpl(const Service::APT::AppletStartupParameter& parameter) { | ||
| 50 | is_running = true; | ||
| 51 | |||
| 52 | // TODO(Subv): Set the expected fields in the response buffer before resending it to the | ||
| 53 | // application. | ||
| 54 | // TODO(Subv): Reverse the parameter format for the ErrEula applet | ||
| 55 | |||
| 56 | // Let the application know that we're closing | ||
| 57 | Service::APT::MessageParameter message; | ||
| 58 | message.buffer.resize(parameter.buffer.size()); | ||
| 59 | std::fill(message.buffer.begin(), message.buffer.end(), 0); | ||
| 60 | message.signal = static_cast<u32>(Service::APT::SignalType::WakeupByExit); | ||
| 61 | message.destination_id = static_cast<u32>(Service::APT::AppletId::Application); | ||
| 62 | message.sender_id = static_cast<u32>(id); | ||
| 63 | Service::APT::SendParameter(message); | ||
| 64 | |||
| 65 | is_running = false; | ||
| 66 | return RESULT_SUCCESS; | ||
| 67 | } | ||
| 68 | |||
| 69 | void ErrEula::Update() {} | ||
| 70 | |||
| 71 | } // namespace Applets | ||
| 72 | } // namespace HLE | ||