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

@ -26,10 +26,7 @@ class SystemSaveDataArchive : public ArchiveBase {
Rust::Result<ArchiveBase*, HorizonResult> openArchive(const FSPath& path) override;
//Rust::Result<DirectorySession, HorizonResult> openDirectory(const FSPath& path) override;
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override {
Helpers::panic("Unimplemented OpenFile for SystemSaveData archive");
return {};
}
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override {
Helpers::panic("Unimplemented ReadFile for SystemSaveData archive");

View file

@ -25,7 +25,8 @@ namespace KernelHandles {
HID, // HID service (Handles input-related things including gyro. Does NOT handle New3DS controls or CirclePadPro)
HTTP, // HTTP service (Handles HTTP requests)
IR_USER, // One of 3 infrared communication services
FRD, // Friend service (Miiverse friend service)
FRD_A, // Friend service (Miiverse friend service)
FRD_U,
FS, // Filesystem service
GPU, // GPU service
LCD, // LCD service (Used for configuring the displays)
@ -82,7 +83,8 @@ namespace KernelHandles {
case HID: return "HID";
case HTTP: return "HTTP";
case IR_USER: return "IR:USER";
case FRD: return "FRD";
case FRD_A: return "FRD:A";
case FRD_U: return "FRD:U";
case FS: return "FS";
case GPU: return "GSP::GPU";
case LCD: return "GSP::LCD";

View file

@ -15,7 +15,6 @@ struct FriendKey {
static_assert(sizeof(FriendKey) == 16);
class FRDService {
Handle handle = KernelHandles::FRD;
Memory& mem;
MAKE_LOG_FUNCTION(log, frdLogger)
@ -48,7 +47,13 @@ class FRDService {
static_assert(sizeof(Profile) == 8);
public:
enum class Type {
A, // frd:a
N, // frd:n
U, // frd:u
};
FRDService(Memory& mem) : mem(mem) {}
void reset();
void handleSyncRequest(u32 messagePointer);
void handleSyncRequest(u32 messagePointer, Type type);
};