Add APT::StartLibraryApplet

This commit is contained in:
wheremyfoodat 2024-01-24 20:28:16 +02:00
parent 85a2ca1bf4
commit 5fe1637e17
6 changed files with 71 additions and 21 deletions

View file

@ -1,6 +1,9 @@
#pragma once
#include <vector>
#include "helpers.hpp"
#include "kernel/kernel_types.hpp"
#include "memory.hpp"
#include "result/result.hpp"
@ -65,11 +68,11 @@ namespace Applets {
};
struct Parameter {
u32 senderID; // ID of the parameter sender
u32 destID; // ID of the app to receive parameter
u32 signal; // Signal type (eg request)
u32 object; // Some applets will also respond with shared memory handles for transferring data between the sender and called
std::vector<u8> data; // Misc data
u32 senderID; // ID of the parameter sender
u32 destID; // ID of the app to receive parameter
u32 signal; // Signal type (eg request)
u32 object; // Some applets will also respond with shared memory handles for transferring data between the sender and called
std::vector<u8> data; // Misc data
};
class AppletBase {
@ -81,7 +84,7 @@ namespace Applets {
virtual const char* name() = 0;
// Called by APT::StartLibraryApplet and similar
virtual Result::HorizonResult start() = 0;
virtual Result::HorizonResult start(const MemoryBlock& sharedMem, const std::vector<u8>& parameters) = 0;
// Transfer parameters from application -> applet
virtual Result::HorizonResult receiveParameter(const Parameter& parameter) = 0;
virtual void reset() = 0;