diff --git a/include/fs/archive_save_data.hpp b/include/fs/archive_save_data.hpp index 9b25f008..5b1ba489 100644 --- a/include/fs/archive_save_data.hpp +++ b/include/fs/archive_save_data.hpp @@ -5,7 +5,7 @@ class SaveDataArchive : public ArchiveBase { public: SaveDataArchive(Memory& mem) : ArchiveBase(mem) {} - u64 getFreeBytes() override { Helpers::panic("SaveData::GetFreeBytes unimplemented"); return 0; } + u64 getFreeBytes() override { return 32_MB; } std::string name() override { return "SaveData"; } HorizonResult createDirectory(const FSPath& path) override; diff --git a/include/services/boss.hpp b/include/services/boss.hpp index f47c5ae4..4bfaeebd 100644 --- a/include/services/boss.hpp +++ b/include/services/boss.hpp @@ -17,7 +17,8 @@ class BOSSService { void getOptoutFlag(u32 messagePointer); void getStorageEntryInfo(u32 messagePointer); // Unknown what this is, name taken from Citra void getTaskIdList(u32 messagePointer); - void getTaskInfo(u32 messagePOinter); + void getTaskInfo(u32 messagePointer); + void getTaskStatus(u32 messagePointer); void getTaskStorageInfo(u32 messagePointer); void receiveProperty(u32 messagePointer); void registerStorageEntry(u32 messagePointer); diff --git a/src/core/services/boss.cpp b/src/core/services/boss.cpp index 10342de9..a541afec 100644 --- a/src/core/services/boss.cpp +++ b/src/core/services/boss.cpp @@ -12,9 +12,10 @@ namespace BOSSCommands { GetNsDataIdList = 0x00100102, ReceiveProperty = 0x00160082, CancelTask = 0x001E0042, + GetTaskStatus = 0x00200082, GetTaskInfo = 0x00250082, RegisterStorageEntry = 0x002F0140, - GetStorageEntryInfo = 0x00300000 + GetStorageEntryInfo = 0x00300000, }; } @@ -31,6 +32,7 @@ void BOSSService::handleSyncRequest(u32 messagePointer) { case BOSSCommands::GetStorageEntryInfo: getStorageEntryInfo(messagePointer); break; case BOSSCommands::GetTaskIdList: getTaskIdList(messagePointer); break; case BOSSCommands::GetTaskInfo: getTaskInfo(messagePointer); break; + case BOSSCommands::GetTaskStatus: getTaskStatus(messagePointer); break; case BOSSCommands::GetTaskStorageInfo: getTaskStorageInfo(messagePointer); break; case BOSSCommands::InitializeSession: initializeSession(messagePointer); break; case BOSSCommands::ReceiveProperty: receiveProperty(messagePointer); break; @@ -48,17 +50,29 @@ void BOSSService::initializeSession(u32 messagePointer) { } void BOSSService::getOptoutFlag(u32 messagePointer) { - log("BOSS::getOptoutFlag\n"); + log("BOSS::GetOptoutFlag\n"); mem.write32(messagePointer, IPC::responseHeader(0xA, 2, 0)); mem.write32(messagePointer + 4, Result::Success); mem.write8(messagePointer + 8, optoutFlag); } +void BOSSService::getTaskStatus(u32 messagePointer) { + const u32 taskIDBufferSize = mem.read32(messagePointer + 4); + const u32 taskIDDataPointer = mem.read32(messagePointer + 16); + log("BOSS::GetTaskStatus (task buffer size: %08X, task data pointer: %08X) (stubbed)\n", taskIDBufferSize, taskIDDataPointer); + + mem.write32(messagePointer, IPC::responseHeader(0x20, 2, 2)); + mem.write32(messagePointer + 4, Result::Success); + mem.write8(messagePointer + 8, 0); // TODO: What is this? +} + void BOSSService::getTaskStorageInfo(u32 messagePointer) { log("BOSS::GetTaskStorageInfo (stubbed)\n"); mem.write32(messagePointer, IPC::responseHeader(0x4, 2, 0)); mem.write32(messagePointer + 4, Result::Success); - mem.write32(messagePointer + 8, 0); // Seems to be unknown what this is? + mem.write32(messagePointer + 8, 0); // TaskStatus: Report the task finished successfully + mem.write32(messagePointer + 12, 0); // Same + mem.write32(messagePointer + 16, 5); // TODO: Figure out what this should be } void BOSSService::getTaskIdList(u32 messagePointer) {