mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-04 12:55:22 +12:00
Merge pull request #158 from wheremyfoodat/mii_selector
Initial work on HLE applets
This commit is contained in:
commit
3908900bca
13 changed files with 283 additions and 6 deletions
88
include/applets/applet.hpp
Normal file
88
include/applets/applet.hpp
Normal file
|
@ -0,0 +1,88 @@
|
|||
#pragma once
|
||||
|
||||
#include "helpers.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "result/result.hpp"
|
||||
|
||||
namespace Applets {
|
||||
namespace AppletIDs {
|
||||
enum : u32 {
|
||||
None = 0,
|
||||
SysAppletMask = 0x100,
|
||||
HomeMenu = 0x101,
|
||||
AltMenu = 0x103,
|
||||
Camera = 0x110,
|
||||
Friends = 0x112,
|
||||
GameNotes = 0x113,
|
||||
Browser = 0x114,
|
||||
InstructionManual = 0x115,
|
||||
Notifications = 0x116,
|
||||
Miiverse = 0x117,
|
||||
MiiversePosting = 0x118,
|
||||
AmiiboSettings = 0x119,
|
||||
SysLibraryAppletMask = 0x200,
|
||||
SoftwareKeyboard = 0x201,
|
||||
MiiSelector = 0x202,
|
||||
PNote = 0x204, // TODO: What dis?
|
||||
SNote = 0x205, // What is this too?
|
||||
ErrDisp = 0x206,
|
||||
EshopMint = 0x207,
|
||||
CirclePadProCalib = 0x208,
|
||||
Notepad = 0x209,
|
||||
Application = 0x300,
|
||||
EshopTiger = 0x301,
|
||||
LibraryAppletMask = 0x400,
|
||||
SoftwareKeyboard2 = 0x401,
|
||||
MiiSelector2 = 0x402,
|
||||
Pnote2 = 0x404,
|
||||
SNote2 = 0x405,
|
||||
ErrDisp2 = 0x406,
|
||||
EshopMint2 = 0x407,
|
||||
CirclePadProCalib2 = 0x408,
|
||||
Notepad2 = 0x409,
|
||||
};
|
||||
}
|
||||
|
||||
enum class APTSignal : u32 {
|
||||
None = 0x0,
|
||||
Wakeup = 0x1,
|
||||
Request = 0x2,
|
||||
Response = 0x3,
|
||||
Exit = 0x4,
|
||||
Message = 0x5,
|
||||
HomeButtonSingle = 0x6,
|
||||
HomeButtonDouble = 0x7,
|
||||
DspSleep = 0x8,
|
||||
DspWakeup = 0x9,
|
||||
WakeupByExit = 0xA,
|
||||
WakeupByPause = 0xB,
|
||||
WakeupByCancel = 0xC,
|
||||
WakeupByCancelAll = 0xD,
|
||||
WakeupByPowerButtonClick = 0xE,
|
||||
WakeupToJumpHome = 0xF,
|
||||
RequestForSysApplet = 0x10,
|
||||
WakeupToLaunchApplication = 0x11,
|
||||
};
|
||||
|
||||
struct Parameter {
|
||||
u32 senderID;
|
||||
u32 destID;
|
||||
APTSignal signal;
|
||||
std::vector<u8> data;
|
||||
};
|
||||
|
||||
class AppletBase {
|
||||
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) {}
|
||||
};
|
||||
} // namespace Applets
|
17
include/applets/applet_manager.hpp
Normal file
17
include/applets/applet_manager.hpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "applets/mii_selector.hpp"
|
||||
#include "applets/software_keyboard.hpp"
|
||||
#include "helpers.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "result/result.hpp"
|
||||
|
||||
namespace Applets {
|
||||
class AppletManager {
|
||||
MiiSelectorApplet miiSelector;
|
||||
SoftwareKeyboardApplet swkbd;
|
||||
|
||||
public:
|
||||
AppletManager(Memory& mem);
|
||||
void reset();
|
||||
AppletBase* getApplet(u32 id);
|
||||
};
|
||||
} // namespace Applets
|
13
include/applets/mii_selector.hpp
Normal file
13
include/applets/mii_selector.hpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include "applets/applet.hpp"
|
||||
|
||||
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) {}
|
||||
};
|
||||
} // namespace Applets
|
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
|
|
@ -6,6 +6,8 @@
|
|||
#include "memory.hpp"
|
||||
#include "result/result.hpp"
|
||||
|
||||
#include "applets/applet_manager.hpp"
|
||||
|
||||
// Yay, more circular dependencies
|
||||
class Kernel;
|
||||
|
||||
|
@ -23,6 +25,7 @@ class APTService {
|
|||
std::optional<Handle> resumeEvent = std::nullopt;
|
||||
|
||||
ConsoleModel model = ConsoleModel::Old3DS;
|
||||
Applets::AppletManager appletManager;
|
||||
|
||||
MAKE_LOG_FUNCTION(log, aptLogger)
|
||||
|
||||
|
@ -33,17 +36,22 @@ class APTService {
|
|||
void checkNew3DS(u32 messagePointer);
|
||||
void checkNew3DSApp(u32 messagePointer);
|
||||
void enable(u32 messagePointer);
|
||||
void getAppletInfo(u32 messagePointer);
|
||||
void getSharedFont(u32 messagePointer);
|
||||
void getWirelessRebootInfo(u32 messagePointer);
|
||||
void glanceParameter(u32 messagePointer);
|
||||
void initialize(u32 messagePointer);
|
||||
void inquireNotification(u32 messagePointer);
|
||||
void isRegistered(u32 messagePointer);
|
||||
void notifyToWait(u32 messagePointer);
|
||||
void preloadLibraryApplet(u32 messagePointer);
|
||||
void prepareToStartLibraryApplet(u32 messagePointer);
|
||||
void receiveParameter(u32 messagePointer);
|
||||
void replySleepQuery(u32 messagePointer);
|
||||
void setApplicationCpuTimeLimit(u32 messagePointer);
|
||||
void setScreencapPostPermission(u32 messagePointer);
|
||||
void sendParameter(u32 messagePointer);
|
||||
void startLibraryApplet(u32 messagePointer);
|
||||
void theSmashBrosFunction(u32 messagePointer);
|
||||
|
||||
// Percentage of the syscore available to the application, between 5% and 89%
|
||||
|
@ -67,7 +75,7 @@ class APTService {
|
|||
u32 screencapPostPermission;
|
||||
|
||||
public:
|
||||
APTService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
|
||||
APTService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel), appletManager(mem) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
};
|
|
@ -63,7 +63,9 @@ class GPUService {
|
|||
// Service commands
|
||||
void acquireRight(u32 messagePointer);
|
||||
void flushDataCache(u32 messagePointer);
|
||||
void importDisplayCaptureInfo(u32 messagePointer);
|
||||
void registerInterruptRelayQueue(u32 messagePointer);
|
||||
void saveVramSysArea(u32 messagePointer);
|
||||
void setAxiConfigQoSMode(u32 messagePointer);
|
||||
void setBufferSwap(u32 messagePointer);
|
||||
void setInternalPriorities(u32 messagePointer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue