[BOSS[ Stub optout flag

This commit is contained in:
wheremyfoodat 2023-03-12 04:39:09 +02:00
parent e69e95af69
commit c41d9b4462
2 changed files with 14 additions and 2 deletions

View file

@ -11,7 +11,9 @@ class BOSSService {
// Service commands // Service commands
void initializeSession(u32 messagePointer); void initializeSession(u32 messagePointer);
void getOptoutFlag(u32 messagePointer);
s8 optoutFlag;
public: public:
BOSSService(Memory& mem) : mem(mem) {} BOSSService(Memory& mem) : mem(mem) {}
void reset(); void reset();

View file

@ -2,7 +2,8 @@
namespace BOSSCommands { namespace BOSSCommands {
enum : u32 { enum : u32 {
InitializeSession = 0x00010082 InitializeSession = 0x00010082,
GetOptoutFlag = 0x000A0000
}; };
} }
@ -12,11 +13,14 @@ namespace Result {
}; };
} }
void BOSSService::reset() {} void BOSSService::reset() {
optoutFlag = 0;
}
void BOSSService::handleSyncRequest(u32 messagePointer) { void BOSSService::handleSyncRequest(u32 messagePointer) {
const u32 command = mem.read32(messagePointer); const u32 command = mem.read32(messagePointer);
switch (command) { switch (command) {
case BOSSCommands::GetOptoutFlag: getOptoutFlag(messagePointer); break;
case BOSSCommands::InitializeSession: initializeSession(messagePointer); break; case BOSSCommands::InitializeSession: initializeSession(messagePointer); break;
default: Helpers::panic("BOSS service requested. Command: %08X\n", command); default: Helpers::panic("BOSS service requested. Command: %08X\n", command);
} }
@ -25,4 +29,10 @@ void BOSSService::handleSyncRequest(u32 messagePointer) {
void BOSSService::initializeSession(u32 messagePointer) { void BOSSService::initializeSession(u32 messagePointer) {
log("BOSS::InitializeSession (stubbed)\n"); log("BOSS::InitializeSession (stubbed)\n");
mem.write32(messagePointer + 4, Result::Success); mem.write32(messagePointer + 4, Result::Success);
}
void BOSSService::getOptoutFlag(u32 messagePointer) {
log("BOSS::getOptoutFlag\n");
mem.write32(messagePointer + 4, Result::Success);
mem.write8(messagePointer + 8, optoutFlag);
} }