summaryrefslogtreecommitdiffstats
path: root/src/core/hle/applets/mii_selector.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-05-30 03:57:07 +0200
committerbunnei <bunneidev@gmail.com>2016-05-30 03:57:07 +0200
commitab4b27f0f5760c7f378f29756d3ce631bafca1b2 (patch)
tree6340ca66710e9603db24c051da0b8173b796d3c6 /src/core/hle/applets/mii_selector.cpp
parentMerge pull request #1756 from wwylele/config-cleanup (diff)
parentMemory: Handle RasterizerCachedMemory and RasterizerCachedSpecial page types in the memory block manipulation functions. (diff)
downloadyuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.gz
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.bz2
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.lz
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.xz
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.zst
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.zip
Diffstat (limited to 'src/core/hle/applets/mii_selector.cpp')
-rw-r--r--src/core/hle/applets/mii_selector.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp
index bf39eca22..77f01d208 100644
--- a/src/core/hle/applets/mii_selector.cpp
+++ b/src/core/hle/applets/mii_selector.cpp
@@ -32,9 +32,9 @@ ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& p
// The LibAppJustStarted message contains a buffer with the size of the framebuffer shared memory.
// Create the SharedMemory that will hold the framebuffer data
Service::APT::CaptureBufferInfo capture_info;
- ASSERT(sizeof(capture_info) == parameter.buffer_size);
+ ASSERT(sizeof(capture_info) == parameter.buffer.size());
- memcpy(&capture_info, parameter.data, sizeof(capture_info));
+ memcpy(&capture_info, parameter.buffer.data(), sizeof(capture_info));
using Kernel::MemoryPermission;
// Allocate a heap block of the required size for this applet.
@@ -47,8 +47,7 @@ ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& p
// Send the response message with the newly created SharedMemory
Service::APT::MessageParameter result;
result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished);
- result.data = nullptr;
- result.buffer_size = 0;
+ result.buffer.clear();
result.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
result.sender_id = static_cast<u32>(id);
result.object = framebuffer_memory;
@@ -63,15 +62,17 @@ ResultCode MiiSelector::StartImpl(const Service::APT::AppletStartupParameter& pa
// TODO(Subv): Set the expected fields in the response buffer before resending it to the application.
// TODO(Subv): Reverse the parameter format for the Mii Selector
- if(parameter.buffer_size >= sizeof(u32)) {
- // TODO: defaults return no error, but garbage in other unknown fields
- memset(parameter.data, 0, sizeof(u32));
- }
+ memcpy(&config, parameter.buffer.data(), parameter.buffer.size());
+
+ // TODO(Subv): Find more about this structure, result code 0 is enough to let most games continue.
+ MiiResult result;
+ memset(&result, 0, sizeof(result));
+ result.result_code = 0;
// Let the application know that we're closing
Service::APT::MessageParameter message;
- message.buffer_size = parameter.buffer_size;
- message.data = parameter.data;
+ message.buffer.resize(sizeof(MiiResult));
+ std::memcpy(message.buffer.data(), &result, message.buffer.size());
message.signal = static_cast<u32>(Service::APT::SignalType::LibAppClosed);
message.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
message.sender_id = static_cast<u32>(id);