Skip to content

Commit

Permalink
Add BOSS:SetOptoutFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Sep 14, 2023
1 parent 88eebbc commit 103cb6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/services/boss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class BOSSService {
void registerStorageEntry(u32 messagePointer);
void registerTask(u32 messagePointer);
void sendProperty(u32 messagePointer);
void setOptoutFlag(u32 messagePointer);
void startTask(u32 messagePointer);
void unregisterStorage(u32 messagePointer);
void unregisterTask(u32 messagePointer);
Expand Down
11 changes: 11 additions & 0 deletions src/core/services/boss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace BOSSCommands {
UnregisterStorage = 0x00030000,
GetTaskStorageInfo = 0x00040000,
RegisterNewArrivalEvent = 0x00080002,
SetOptoutFlag = 0x00090040,
GetOptoutFlag = 0x000A0000,
RegisterTask = 0x000B00C2,
UnregisterTask = 0x000C0082,
Expand Down Expand Up @@ -53,6 +54,7 @@ void BOSSService::handleSyncRequest(u32 messagePointer) {
case BOSSCommands::RegisterStorageEntry: registerStorageEntry(messagePointer); break;
case BOSSCommands::RegisterTask: registerTask(messagePointer); break;
case BOSSCommands::SendProperty: sendProperty(messagePointer); break;
case BOSSCommands::SetOptoutFlag: setOptoutFlag(messagePointer); break;
case BOSSCommands::StartTask: startTask(messagePointer); break;
case BOSSCommands::UnregisterStorage: unregisterStorage(messagePointer); break;
case BOSSCommands::UnregisterTask: unregisterTask(messagePointer); break;
Expand All @@ -66,6 +68,15 @@ void BOSSService::initializeSession(u32 messagePointer) {
mem.write32(messagePointer + 4, Result::Success);
}

void BOSSService::setOptoutFlag(u32 messagePointer) {
const s8 flag = static_cast<s8>(mem.read8(messagePointer + 4));
log("BOSS::SetOptoutFlag (flag = %d)\n", flag);
optoutFlag = flag;

mem.write32(messagePointer, IPC::responseHeader(0x9, 1, 0));
mem.write32(messagePointer + 4, Result::Success);
}

void BOSSService::getOptoutFlag(u32 messagePointer) {
log("BOSS::GetOptoutFlag\n");
mem.write32(messagePointer, IPC::responseHeader(0xA, 2, 0));
Expand Down

0 comments on commit 103cb6a

Please sign in to comment.