Add SystemSaveData::OpenFile and split up frd:u and frd:a

This commit is contained in:
wheremyfoodat 2023-09-13 23:21:30 +03:00
parent c48f8327c6
commit 7c2167e0f2
7 changed files with 61 additions and 12 deletions

View file

@ -27,7 +27,7 @@ namespace FRDCommands {
void FRDService::reset() { loggedIn = false; }
void FRDService::handleSyncRequest(u32 messagePointer) {
void FRDService::handleSyncRequest(u32 messagePointer, FRDService::Type type) {
const u32 command = mem.read32(messagePointer);
switch (command) {
case FRDCommands::AttachToEventNotification: attachToEventNotification(messagePointer); break;

View file

@ -53,6 +53,7 @@ void FSService::initializeFilesystem() {
const auto savePath = IOFile::getAppData() / "SaveData"; // Create SaveData
const auto formatPath = IOFile::getAppData() / "FormatInfo"; // Create folder for storing archive formatting info
const auto systemSaveDataPath = IOFile::getAppData() / ".." / "SharedFiles" / "SystemSaveData";
namespace fs = std::filesystem;
@ -71,6 +72,10 @@ void FSService::initializeFilesystem() {
if (!fs::is_directory(formatPath)) {
fs::create_directories(formatPath);
}
if (!fs::is_directory(systemSaveDataPath)) {
fs::create_directories(systemSaveDataPath);
}
}
ArchiveBase* FSService::getArchiveFromID(u32 id, const FSPath& archivePath) {

View file

@ -111,7 +111,8 @@ static std::map<std::string, Handle> serviceMap = {
{ "hid:USER", KernelHandles::HID },
{ "http:C", KernelHandles::HTTP },
{ "ir:USER", KernelHandles::IR_USER },
{ "frd:u", KernelHandles::FRD },
{ "frd:a", KernelHandles::FRD_A },
{ "frd:u", KernelHandles::FRD_U },
{ "fs:USER", KernelHandles::FS },
{ "gsp::Gpu", KernelHandles::GPU },
{ "gsp::Lcd", KernelHandles::LCD },
@ -211,7 +212,8 @@ void ServiceManager::sendCommandToService(u32 messagePointer, Handle handle) {
case KernelHandles::HID: hid.handleSyncRequest(messagePointer); break;
case KernelHandles::HTTP: http.handleSyncRequest(messagePointer); break;
case KernelHandles::IR_USER: ir_user.handleSyncRequest(messagePointer); break;
case KernelHandles::FRD: frd.handleSyncRequest(messagePointer); break;
case KernelHandles::FRD_A: frd.handleSyncRequest(messagePointer, FRDService::Type::A); break;
case KernelHandles::FRD_U: frd.handleSyncRequest(messagePointer, FRDService::Type::U); break;
case KernelHandles::LCD: gsp_lcd.handleSyncRequest(messagePointer); break;
case KernelHandles::LDR_RO: ldr.handleSyncRequest(messagePointer); break;
case KernelHandles::MCU_HWC: mcu_hwc.handleSyncRequest(messagePointer); break;