This commit is contained in:
wheremyfoodat 2023-09-24 18:53:25 +03:00
parent fe8a23e0d9
commit becc777bd8
2 changed files with 46 additions and 1 deletions

View file

@ -26,6 +26,8 @@ class FRDService {
void getFriendKeyList(u32 messagePointer);
void getFriendPresence(u32 messagePointer);
void getFriendProfile(u32 messagePointer);
void getMyComment(u32 messagePointer);
void getMyFavoriteGame(u32 messagePointer);
void getMyFriendKey(u32 messagePointer);
void getMyMii(u32 messagePointer);
void getMyPresence(u32 messagePointer);
@ -37,6 +39,7 @@ class FRDService {
void setClientSDKVersion(u32 messagePointer);
void setNotificationMask(u32 messagePointer);
void updateGameModeDescription(u32 messagePointer);
void updateMii(u32 messagePointer);
struct Profile {
u8 region;

View file

@ -18,11 +18,15 @@ namespace FRDCommands {
GetMyPresence = 0x00080000,
GetMyScreenName = 0x00090000,
GetMyMii = 0x000A0000,
GetMyFavoriteGame = 0x000D0000,
GetMyComment = 0x000F0000,
GetFriendKeyList = 0x00110080,
GetFriendPresence = 0x00120042,
GetFriendProfile = 0x00150042,
GetFriendAttributeFlags = 0x00170042,
UpdateGameModeDescription = 0x001D0002,
UpdateMii = 0x040C0800,
};
}
@ -36,8 +40,10 @@ void FRDService::handleSyncRequest(u32 messagePointer, FRDService::Type type) {
case FRDCommands::GetFriendKeyList: getFriendKeyList(messagePointer); break;
case FRDCommands::GetFriendPresence: getFriendPresence(messagePointer); break;
case FRDCommands::GetFriendProfile: getFriendProfile(messagePointer); break;
case FRDCommands::GetMyComment: getMyComment(messagePointer); break;
case FRDCommands::GetMyFriendKey: getMyFriendKey(messagePointer); break;
case FRDCommands::GetMyMii: getMyMii(messagePointer); break;
case FRDCommands::GetMyFavoriteGame: getMyFavoriteGame(messagePointer); break;
case FRDCommands::GetMyPresence: getMyPresence(messagePointer); break;
case FRDCommands::GetMyProfile: getMyProfile(messagePointer); break;
case FRDCommands::GetMyScreenName: getMyScreenName(messagePointer); break;
@ -47,7 +53,19 @@ void FRDService::handleSyncRequest(u32 messagePointer, FRDService::Type type) {
case FRDCommands::SetClientSdkVersion: setClientSDKVersion(messagePointer); break;
case FRDCommands::SetNotificationMask: setNotificationMask(messagePointer); break;
case FRDCommands::UpdateGameModeDescription: updateGameModeDescription(messagePointer); break;
default: Helpers::panic("FRD service requested. Command: %08X\n", command);
default:
// FRD:A functions
if (type == Type::A) {
switch (command) {
case FRDCommands::UpdateMii: updateMii(messagePointer); break;
default: Helpers::panic("FRD:A service requested. Command: %08X\n", command); break;
}
} else {
Helpers::panic("FRD service requested. Command: %08X\n", command);
}
break;
}
}
@ -203,6 +221,23 @@ void FRDService::getMyMii(u32 messagePointer) {
mem.write32(messagePointer + 4, Result::Success);
}
void FRDService::getMyFavoriteGame(u32 messagePointer) {
log("FRD::GetMyFavoriteGame (stubbed)\n");
constexpr u64 titleID = 0;
mem.write32(messagePointer, IPC::responseHeader(0xD, 3, 0));
mem.write32(messagePointer + 4, Result::Success);
mem.write64(messagePointer + 8, titleID);
}
void FRDService::getMyComment(u32 messagePointer) {
log("FRD::GetMyComment");
mem.write32(messagePointer, IPC::responseHeader(0xF, 2, 0));
mem.write32(messagePointer + 4, Result::Success);
mem.write32(messagePointer + 8, 0);
}
void FRDService::hasLoggedIn(u32 messagePointer) {
log("FRD::HasLoggedIn\n");
@ -226,4 +261,11 @@ void FRDService::logout(u32 messagePointer) {
mem.write32(messagePointer, IPC::responseHeader(0x4, 1, 0));
mem.write32(messagePointer + 4, Result::Success);
}
void FRDService::updateMii(u32 messagePointer) {
log("FRD::UpdateMii (stubbed)\n");
mem.write32(messagePointer, IPC::responseHeader(0x40C, 1, 0));
mem.write32(messagePointer + 4, Result::Success);
}