mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-25 14:55:50 +12:00
[APT] Add inquireNotification/setScreencapPermission
This commit is contained in:
parent
9396b1ec9c
commit
70dd8b2e9d
2 changed files with 39 additions and 0 deletions
|
@ -27,14 +27,33 @@ class APTService {
|
||||||
void checkNew3DSApp(u32 messagePointer);
|
void checkNew3DSApp(u32 messagePointer);
|
||||||
void enable(u32 messagePointer);
|
void enable(u32 messagePointer);
|
||||||
void initialize(u32 messagePointer);
|
void initialize(u32 messagePointer);
|
||||||
|
void inquireNotification(u32 messagePointer);
|
||||||
void notifyToWait(u32 messagePointer);
|
void notifyToWait(u32 messagePointer);
|
||||||
void receiveParameter(u32 messagePointer);
|
void receiveParameter(u32 messagePointer);
|
||||||
void replySleepQuery(u32 messagePointer);
|
void replySleepQuery(u32 messagePointer);
|
||||||
void setApplicationCpuTimeLimit(u32 messagePointer);
|
void setApplicationCpuTimeLimit(u32 messagePointer);
|
||||||
|
void setScreencapPostPermission(u32 messagePointer);
|
||||||
|
|
||||||
// Percentage of the syscore available to the application, between 5% and 89%
|
// Percentage of the syscore available to the application, between 5% and 89%
|
||||||
u32 cpuTimeLimit;
|
u32 cpuTimeLimit;
|
||||||
|
|
||||||
|
enum class NotificationType : u32 {
|
||||||
|
None = 0,
|
||||||
|
HomeButton1 = 1,
|
||||||
|
HomeButton2 = 2,
|
||||||
|
SleepQuery = 3,
|
||||||
|
SleepCanceledByOpen = 4,
|
||||||
|
SleepAccepted = 5,
|
||||||
|
SleepAwake = 6,
|
||||||
|
Shutdown = 7,
|
||||||
|
PowerButtonClick = 8,
|
||||||
|
PowerButtonClear = 9,
|
||||||
|
TrySleep = 10,
|
||||||
|
OrderToClose = 11
|
||||||
|
};
|
||||||
|
|
||||||
|
u32 screencapPostPermission;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
APTService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
|
APTService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
|
||||||
void reset();
|
void reset();
|
||||||
|
|
|
@ -6,12 +6,14 @@ namespace APTCommands {
|
||||||
GetLockHandle = 0x00010040,
|
GetLockHandle = 0x00010040,
|
||||||
Initialize = 0x00020080,
|
Initialize = 0x00020080,
|
||||||
Enable = 0x00030040,
|
Enable = 0x00030040,
|
||||||
|
InquireNotification = 0x000B0040,
|
||||||
ReceiveParameter = 0x000D0080,
|
ReceiveParameter = 0x000D0080,
|
||||||
ReplySleepQuery = 0x003E0080,
|
ReplySleepQuery = 0x003E0080,
|
||||||
NotifyToWait = 0x00430040,
|
NotifyToWait = 0x00430040,
|
||||||
AppletUtility = 0x004B00C2,
|
AppletUtility = 0x004B00C2,
|
||||||
SetApplicationCpuTimeLimit = 0x004F0080,
|
SetApplicationCpuTimeLimit = 0x004F0080,
|
||||||
GetApplicationCpuTimeLimit = 0x00500040,
|
GetApplicationCpuTimeLimit = 0x00500040,
|
||||||
|
SetScreencapPostPermission = 0x00550040,
|
||||||
CheckNew3DSApp = 0x01010000,
|
CheckNew3DSApp = 0x01010000,
|
||||||
CheckNew3DS = 0x01020000
|
CheckNew3DS = 0x01020000
|
||||||
};
|
};
|
||||||
|
@ -49,12 +51,14 @@ void APTService::handleSyncRequest(u32 messagePointer) {
|
||||||
case APTCommands::CheckNew3DSApp: checkNew3DSApp(messagePointer); break;
|
case APTCommands::CheckNew3DSApp: checkNew3DSApp(messagePointer); break;
|
||||||
case APTCommands::Enable: enable(messagePointer); break;
|
case APTCommands::Enable: enable(messagePointer); break;
|
||||||
case APTCommands::Initialize: initialize(messagePointer); break;
|
case APTCommands::Initialize: initialize(messagePointer); break;
|
||||||
|
case APTCommands::InquireNotification: inquireNotification(messagePointer); break;
|
||||||
case APTCommands::GetApplicationCpuTimeLimit: getApplicationCpuTimeLimit(messagePointer); break;
|
case APTCommands::GetApplicationCpuTimeLimit: getApplicationCpuTimeLimit(messagePointer); break;
|
||||||
case APTCommands::GetLockHandle: getLockHandle(messagePointer); break;
|
case APTCommands::GetLockHandle: getLockHandle(messagePointer); break;
|
||||||
case APTCommands::NotifyToWait: notifyToWait(messagePointer); break;
|
case APTCommands::NotifyToWait: notifyToWait(messagePointer); break;
|
||||||
case APTCommands::ReceiveParameter: receiveParameter(messagePointer); break;
|
case APTCommands::ReceiveParameter: receiveParameter(messagePointer); break;
|
||||||
case APTCommands::ReplySleepQuery: replySleepQuery(messagePointer); break;
|
case APTCommands::ReplySleepQuery: replySleepQuery(messagePointer); break;
|
||||||
case APTCommands::SetApplicationCpuTimeLimit: setApplicationCpuTimeLimit(messagePointer); break;
|
case APTCommands::SetApplicationCpuTimeLimit: setApplicationCpuTimeLimit(messagePointer); break;
|
||||||
|
case APTCommands::SetScreencapPostPermission: setScreencapPostPermission(messagePointer); break;
|
||||||
default: Helpers::panic("APT service requested. Command: %08X\n", command);
|
default: Helpers::panic("APT service requested. Command: %08X\n", command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +103,13 @@ void APTService::initialize(u32 messagePointer) {
|
||||||
mem.write32(messagePointer + 16, resumeEvent.value()); // Resume Event Handle
|
mem.write32(messagePointer + 16, resumeEvent.value()); // Resume Event Handle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void APTService::inquireNotification(u32 messagePointer) {
|
||||||
|
log("APT::InquireNotification\n");
|
||||||
|
|
||||||
|
mem.write32(messagePointer + 4, Result::Success);
|
||||||
|
mem.write32(messagePointer + 8, static_cast<u32>(NotificationType::None));
|
||||||
|
}
|
||||||
|
|
||||||
void APTService::getLockHandle(u32 messagePointer) {
|
void APTService::getLockHandle(u32 messagePointer) {
|
||||||
log("APT::GetLockHandle\n");
|
log("APT::GetLockHandle\n");
|
||||||
|
|
||||||
|
@ -160,3 +171,12 @@ void APTService::getApplicationCpuTimeLimit(u32 messagePointer) {
|
||||||
mem.write32(messagePointer + 4, Result::Success);
|
mem.write32(messagePointer + 4, Result::Success);
|
||||||
mem.write32(messagePointer + 8, cpuTimeLimit);
|
mem.write32(messagePointer + 8, cpuTimeLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void APTService::setScreencapPostPermission(u32 messagePointer) {
|
||||||
|
u32 perm = mem.read32(messagePointer + 4);
|
||||||
|
log("APT::SetScreencapPostPermission (perm = %d)\n");
|
||||||
|
|
||||||
|
// Apparently only 1-3 are valid values, but I see 0 used in some games like Pokemon Rumble
|
||||||
|
mem.write32(messagePointer, Result::Success);
|
||||||
|
screencapPostPermission = perm;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue