mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-05 22:55:41 +13:00
Add error/EULA applet
This commit is contained in:
parent
6e6c84eebb
commit
f0c20d70bc
7 changed files with 58 additions and 7 deletions
|
@ -188,7 +188,9 @@ set(FS_SOURCE_FILES src/core/fs/archive_self_ncch.cpp src/core/fs/archive_save_d
|
|||
src/core/fs/ivfc.cpp src/core/fs/archive_user_save_data.cpp src/core/fs/archive_system_save_data.cpp
|
||||
)
|
||||
|
||||
set(APPLET_SOURCE_FILES src/core/applets/applet.cpp src/core/applets/mii_selector.cpp src/core/applets/software_keyboard.cpp src/core/applets/applet_manager.cpp)
|
||||
set(APPLET_SOURCE_FILES src/core/applets/applet.cpp src/core/applets/mii_selector.cpp src/core/applets/software_keyboard.cpp src/core/applets/applet_manager.cpp
|
||||
src/core/applets/error_applet.cpp
|
||||
)
|
||||
set(RENDERER_SW_SOURCE_FILES src/core/renderer_sw/renderer_sw.cpp)
|
||||
|
||||
# Frontend source files
|
||||
|
@ -244,7 +246,7 @@ set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/termcolor.hpp
|
|||
include/services/news_u.hpp include/applets/software_keyboard.hpp include/applets/applet_manager.hpp include/fs/archive_user_save_data.hpp
|
||||
include/services/amiibo_device.hpp include/services/nfc_types.hpp include/swap.hpp include/services/csnd.hpp include/services/nwm_uds.hpp
|
||||
include/fs/archive_system_save_data.hpp include/lua_manager.hpp include/memory_mapped_file.hpp include/hydra_icon.hpp
|
||||
include/PICA/dynapica/shader_rec_emitter_arm64.hpp include/scheduler.hpp
|
||||
include/PICA/dynapica/shader_rec_emitter_arm64.hpp include/scheduler.hpp include/applets/error_applet.hpp
|
||||
)
|
||||
|
||||
cmrc_add_resource_library(
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
#include <optional>
|
||||
|
||||
#include "applets/error_applet.hpp"
|
||||
#include "applets/mii_selector.hpp"
|
||||
#include "applets/software_keyboard.hpp"
|
||||
#include "helpers.hpp"
|
||||
|
@ -11,6 +12,7 @@ namespace Applets {
|
|||
class AppletManager {
|
||||
MiiSelectorApplet miiSelector;
|
||||
SoftwareKeyboardApplet swkbd;
|
||||
ErrorApplet error;
|
||||
std::optional<Applets::Parameter> nextParameter = std::nullopt;
|
||||
|
||||
public:
|
||||
|
|
15
include/applets/error_applet.hpp
Normal file
15
include/applets/error_applet.hpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <string>
|
||||
|
||||
#include "applets/applet.hpp"
|
||||
|
||||
namespace Applets {
|
||||
class ErrorApplet final : public AppletBase {
|
||||
public:
|
||||
virtual const char* name() override { return "Error/EULA Agreement"; }
|
||||
virtual Result::HorizonResult start(const MemoryBlock* sharedMem, const std::vector<u8>& parameters, u32 appID) override;
|
||||
virtual Result::HorizonResult receiveParameter(const Applets::Parameter& parameter) override;
|
||||
virtual void reset() override;
|
||||
|
||||
ErrorApplet(Memory& memory, std::optional<Parameter>& nextParam) : AppletBase(memory, nextParam) {}
|
||||
};
|
||||
} // namespace Applets
|
|
@ -4,13 +4,14 @@
|
|||
|
||||
using namespace Applets;
|
||||
|
||||
AppletManager::AppletManager(Memory& mem) : miiSelector(mem, nextParameter), swkbd(mem, nextParameter) {}
|
||||
AppletManager::AppletManager(Memory& mem) : miiSelector(mem, nextParameter), swkbd(mem, nextParameter), error(mem, nextParameter) {}
|
||||
|
||||
void AppletManager::reset() {
|
||||
nextParameter = std::nullopt;
|
||||
|
||||
miiSelector.reset();
|
||||
swkbd.reset();
|
||||
error.reset();
|
||||
}
|
||||
|
||||
AppletBase* AppletManager::getApplet(u32 id) {
|
||||
|
@ -21,6 +22,9 @@ AppletBase* AppletManager::getApplet(u32 id) {
|
|||
case AppletIDs::SoftwareKeyboard:
|
||||
case AppletIDs::SoftwareKeyboard2: return &swkbd;
|
||||
|
||||
case AppletIDs::ErrDisp:
|
||||
case AppletIDs::ErrDisp2: return &error;
|
||||
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
32
src/core/applets/error_applet.cpp
Normal file
32
src/core/applets/error_applet.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "applets/error_applet.hpp"
|
||||
#include "kernel/handles.hpp"
|
||||
|
||||
using namespace Applets;
|
||||
|
||||
void ErrorApplet::reset() {}
|
||||
|
||||
Result::HorizonResult ErrorApplet::start(const MemoryBlock* sharedMem, const std::vector<u8>& parameters, u32 appID) {
|
||||
Applets::Parameter param = Applets::Parameter{
|
||||
.senderID = appID,
|
||||
.destID = AppletIDs::Application,
|
||||
.signal = static_cast<u32>(APTSignal::WakeupByExit),
|
||||
.object = 0,
|
||||
.data = parameters, // TODO: Figure out how the data format for this applet
|
||||
};
|
||||
|
||||
nextParameter = param;
|
||||
return Result::Success;
|
||||
}
|
||||
|
||||
Result::HorizonResult ErrorApplet::receiveParameter(const Applets::Parameter& parameter) {
|
||||
Applets::Parameter param = Applets::Parameter{
|
||||
.senderID = parameter.destID,
|
||||
.destID = AppletIDs::Application,
|
||||
.signal = static_cast<u32>(APTSignal::Response),
|
||||
.object = KernelHandles::APTCaptureSharedMemHandle,
|
||||
.data = {},
|
||||
};
|
||||
|
||||
nextParameter = param;
|
||||
return Result::Success;
|
||||
}
|
|
@ -35,8 +35,6 @@ Result::HorizonResult MiiSelectorApplet::start(const MemoryBlock* sharedMem, con
|
|||
}
|
||||
|
||||
Result::HorizonResult MiiSelectorApplet::receiveParameter(const Applets::Parameter& parameter) {
|
||||
Helpers::warn("Mii Selector: Unimplemented ReceiveParameter");
|
||||
|
||||
Applets::Parameter param = Applets::Parameter{
|
||||
.senderID = parameter.destID,
|
||||
.destID = AppletIDs::Application,
|
||||
|
|
|
@ -10,8 +10,6 @@ using namespace Applets;
|
|||
void SoftwareKeyboardApplet::reset() {}
|
||||
|
||||
Result::HorizonResult SoftwareKeyboardApplet::receiveParameter(const Applets::Parameter& parameter) {
|
||||
Helpers::warn("Software keyboard: Unimplemented ReceiveParameter");
|
||||
|
||||
switch (parameter.signal) {
|
||||
// Signal == request -> Applet is asking swkbd for a shared memory handle for backing up the framebuffer before opening the applet
|
||||
case u32(APTSignal::Request): {
|
||||
|
|
Loading…
Add table
Reference in a new issue