mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
Implement APT::Initialize
This commit is contained in:
parent
7b8cac8d43
commit
514ddf39bd
3 changed files with 21 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
namespace APTCommands {
|
||||
enum : u32 {
|
||||
GetLockHandle = 0x00010040,
|
||||
Initialize = 0x00020080,
|
||||
Enable = 0x00030040,
|
||||
ReceiveParameter = 0x000D0080,
|
||||
ReplySleepQuery = 0x003E0080,
|
||||
|
@ -34,7 +35,10 @@ void APTService::reset() {
|
|||
// Set the default CPU time limit to 30%. Seems safe, as this is what Metroid 2 uses by default
|
||||
cpuTimeLimit = 30;
|
||||
|
||||
// Reset the handles for the various service objects
|
||||
lockHandle = std::nullopt;
|
||||
notificationEvent = std::nullopt;
|
||||
resumeEvent = std::nullopt;
|
||||
}
|
||||
|
||||
void APTService::handleSyncRequest(u32 messagePointer) {
|
||||
|
@ -44,6 +48,7 @@ void APTService::handleSyncRequest(u32 messagePointer) {
|
|||
case APTCommands::CheckNew3DS: checkNew3DS(messagePointer); break;
|
||||
case APTCommands::CheckNew3DSApp: checkNew3DSApp(messagePointer); break;
|
||||
case APTCommands::Enable: enable(messagePointer); break;
|
||||
case APTCommands::Initialize: initialize(messagePointer); break;
|
||||
case APTCommands::GetApplicationCpuTimeLimit: getApplicationCpuTimeLimit(messagePointer); break;
|
||||
case APTCommands::GetLockHandle: getLockHandle(messagePointer); break;
|
||||
case APTCommands::NotifyToWait: notifyToWait(messagePointer); break;
|
||||
|
@ -82,6 +87,18 @@ void APTService::enable(u32 messagePointer) {
|
|||
mem.write32(messagePointer + 4, Result::Success);
|
||||
}
|
||||
|
||||
void APTService::initialize(u32 messagePointer) {
|
||||
log("APT::Initialize\n");
|
||||
|
||||
notificationEvent = kernel.makeEvent(ResetType::OneShot);
|
||||
resumeEvent = kernel.makeEvent(ResetType::OneShot);
|
||||
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
mem.write32(messagePointer + 8, 0x04000000); // Translation descriptor
|
||||
mem.write32(messagePointer + 12, notificationEvent.value()); // Notification Event Handle
|
||||
mem.write32(messagePointer + 12, resumeEvent.value()); // Resume Event Handle
|
||||
}
|
||||
|
||||
void APTService::getLockHandle(u32 messagePointer) {
|
||||
log("APT::GetLockHandle\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue