mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 22:25:41 +12:00
Add swkbd applet
This commit is contained in:
parent
0bd3729417
commit
f099cc12fa
8 changed files with 55 additions and 4 deletions
|
@ -150,7 +150,7 @@ set(FS_SOURCE_FILES src/core/fs/archive_self_ncch.cpp src/core/fs/archive_save_d
|
|||
src/core/fs/ivfc.cpp
|
||||
)
|
||||
|
||||
set(APPLET_SOURCE_FILES src/core/applets/applet.cpp src/core/applets/mii_selector.cpp)
|
||||
set(APPLET_SOURCE_FILES src/core/applets/applet.cpp src/core/applets/mii_selector.cpp src/core/applets/software_keyboard.cpp)
|
||||
set(RENDERER_SW_SOURCE_FILES src/core/renderer_sw/renderer_sw.cpp)
|
||||
|
||||
set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/termcolor.hpp
|
||||
|
@ -180,7 +180,7 @@ set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/termcolor.hpp
|
|||
include/action_replay.hpp include/renderer_sw/renderer_sw.hpp include/compiler_builtins.hpp
|
||||
include/fs/romfs.hpp include/fs/ivfc.hpp include/discord_rpc.hpp include/services/http.hpp include/result/result_cfg.hpp
|
||||
include/applets/applet.hpp include/applets/mii_selector.hpp include/math_util.hpp include/services/soc.hpp
|
||||
include/services/news_u.hpp
|
||||
include/services/news_u.hpp include/applets/software_keyboard.hpp
|
||||
)
|
||||
|
||||
cmrc_add_resource_library(
|
||||
|
|
|
@ -47,8 +47,12 @@ namespace Applets {
|
|||
Memory& mem;
|
||||
|
||||
public:
|
||||
virtual const char* name() = 0;
|
||||
|
||||
// Called by APT::StartLibraryApplet and similar
|
||||
virtual Result::HorizonResult start() = 0;
|
||||
// Transfer parameters from application -> applet
|
||||
virtual Result::HorizonResult receiveParameter() = 0;
|
||||
virtual void reset() = 0;
|
||||
|
||||
AppletBase(Memory& mem) : mem(mem) {}
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
namespace Applets {
|
||||
class MiiSelectorApplet final : public AppletBase {
|
||||
public:
|
||||
virtual const char* name() override { return "Mii Selector"; }
|
||||
virtual Result::HorizonResult start() override;
|
||||
virtual Result::HorizonResult receiveParameter() override;
|
||||
virtual void reset() override;
|
||||
|
||||
MiiSelectorApplet(Memory& memory) : AppletBase(memory) {}
|
||||
|
|
13
include/applets/software_keyboard.hpp
Normal file
13
include/applets/software_keyboard.hpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include "applets/applet.hpp"
|
||||
|
||||
namespace Applets {
|
||||
class SoftwareKeyboardApplet final : public AppletBase {
|
||||
public:
|
||||
virtual const char* name() override { return "Software Keyboard"; }
|
||||
virtual Result::HorizonResult start() override;
|
||||
virtual Result::HorizonResult receiveParameter() override;
|
||||
virtual void reset() override;
|
||||
|
||||
SoftwareKeyboardApplet(Memory& memory) : AppletBase(memory) {}
|
||||
};
|
||||
} // namespace Applets
|
|
@ -7,6 +7,7 @@
|
|||
#include "result/result.hpp"
|
||||
|
||||
#include "applets/mii_selector.hpp"
|
||||
#include "applets/software_keyboard.hpp"
|
||||
|
||||
// Yay, more circular dependencies
|
||||
class Kernel;
|
||||
|
@ -28,6 +29,7 @@ class APTService {
|
|||
|
||||
// Applets here
|
||||
Applets::MiiSelectorApplet miiSelector;
|
||||
Applets::SoftwareKeyboardApplet swkbd;
|
||||
Applets::AppletBase* getApplet(u32 id);
|
||||
|
||||
MAKE_LOG_FUNCTION(log, aptLogger)
|
||||
|
@ -78,7 +80,7 @@ class APTService {
|
|||
u32 screencapPostPermission;
|
||||
|
||||
public:
|
||||
APTService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel), miiSelector(mem) {}
|
||||
APTService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel), miiSelector(mem), swkbd(mem) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
};
|
|
@ -3,4 +3,9 @@
|
|||
using namespace Applets;
|
||||
|
||||
void MiiSelectorApplet::reset() {}
|
||||
Result::HorizonResult MiiSelectorApplet::start() { return Result::Success; }
|
||||
Result::HorizonResult MiiSelectorApplet::start() { return Result::Success; }
|
||||
|
||||
Result::HorizonResult MiiSelectorApplet::receiveParameter() {
|
||||
Helpers::panic("Mii Selector received parameter");
|
||||
return Result::Success;
|
||||
}
|
11
src/core/applets/software_keyboard.cpp
Normal file
11
src/core/applets/software_keyboard.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include "applets/software_keyboard.hpp"
|
||||
|
||||
using namespace Applets;
|
||||
|
||||
void SoftwareKeyboardApplet::reset() {}
|
||||
Result::HorizonResult SoftwareKeyboardApplet::start() { return Result::Success; }
|
||||
|
||||
Result::HorizonResult SoftwareKeyboardApplet::receiveParameter() {
|
||||
Helpers::panic("Software keyboard received parameter");
|
||||
return Result::Success;
|
||||
}
|
|
@ -76,6 +76,9 @@ Applets::AppletBase* APTService::getApplet(u32 id) {
|
|||
case AppletIDs::MiiSelector:
|
||||
case AppletIDs::MiiSelector2: return &miiSelector;
|
||||
|
||||
case AppletIDs::SoftwareKeyboard:
|
||||
case AppletIDs::SoftwareKeyboard2: return &swkbd;
|
||||
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -257,6 +260,17 @@ void APTService::sendParameter(u32 messagePointer) {
|
|||
mem.write32(messagePointer, IPC::responseHeader(0x0C, 1, 0));
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
|
||||
if (sourceAppID != Applets::AppletIDs::Application) {
|
||||
Helpers::warn("APT::SendParameter: Unimplemented source applet ID");
|
||||
}
|
||||
|
||||
Applets::AppletBase* destApplet = getApplet(destAppID);
|
||||
if (destApplet == nullptr) {
|
||||
Helpers::warn("APT::SendParameter: Unimplemented dest applet ID");
|
||||
} else {
|
||||
auto result = destApplet->receiveParameter();
|
||||
}
|
||||
|
||||
kernel.signalEvent(resumeEvent.value());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue