summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/frd/frd.h
blob: 66a87c8cd02760b8f0c88c76e410af84d8d9e7c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include "common/common_types.h"

namespace Service {

class Interface;

namespace FRD {

struct FriendKey {
    u32 friend_id;
    u32 unknown;
    u64 friend_code;
};

struct MyPresence {
    u8 unknown[0x12C];
};

struct Profile {
    u8 region;
    u8 country;
    u8 area;
    u8 language;
    u32 unknown;
};

/**
 * FRD::GetMyPresence service function
 *  Inputs:
 *      64 : sizeof (MyPresence) << 14 | 2
 *      65 : Address of MyPresence structure
 *  Outputs:
 *      1 : Result of function, 0 on success, otherwise error code
 */
void GetMyPresence(Service::Interface* self);

/**
 * FRD::GetFriendKeyList service function
 *  Inputs:
 *      1 : Unknown
 *      2 : Max friends count
 *      65 : Address of FriendKey List
 *  Outputs:
 *      1 : Result of function, 0 on success, otherwise error code
 *      2 : FriendKey count filled
 */
void GetFriendKeyList(Service::Interface* self);

/**
 * FRD::GetFriendProfile service function
 *  Inputs:
 *      1 : Friends count
 *      2 : Friends count << 18 | 2
 *      3 : Address of FriendKey List
 *      64 : (count * sizeof (Profile)) << 10 | 2
 *      65 : Address of Profiles List
 *  Outputs:
 *      1 : Result of function, 0 on success, otherwise error code
 */
void GetFriendProfile(Service::Interface* self);

/**
 * FRD::GetFriendAttributeFlags service function
 *  Inputs:
 *      1 : Friends count
 *      2 : Friends count << 18 | 2
 *      3 : Address of FriendKey List
 *      65 : Address of AttributeFlags
 *  Outputs:
 *      1 : Result of function, 0 on success, otherwise error code
 */
void GetFriendAttributeFlags(Service::Interface* self);

/**
 * FRD::GetMyFriendKey service function
 *  Inputs:
 *      none
 *  Outputs:
 *      1 : Result of function, 0 on success, otherwise error code
 *      2-5 : FriendKey
 */
void GetMyFriendKey(Service::Interface* self);

/**
 * FRD::GetMyScreenName service function
 *  Outputs:
 *      1 : Result of function, 0 on success, otherwise error code
 *      2 : UTF16 encoded name (max 11 symbols)
 */
void GetMyScreenName(Service::Interface* self);

/**
 * FRD::UnscrambleLocalFriendCode service function
 *  Inputs:
 *      1 : Friend code count
 *      2 : ((count * 12) << 14) | 0x402
 *      3 : Pointer to encoded friend codes. Each is 12 bytes large
 *      64 : ((count * 8) << 14) | 2
 *      65 : Pointer to write decoded local friend codes to. Each is 8 bytes large.
 *  Outputs:
 *      1 : Result of function, 0 on success, otherwise error code
 */
void UnscrambleLocalFriendCode(Service::Interface* self);

/**
 * FRD::SetClientSdkVersion service function
 *  Inputs:
 *      1 : Used SDK Version
 *  Outputs:
 *      1 : Result of function, 0 on success, otherwise error code
 */
void SetClientSdkVersion(Service::Interface* self);

/// Initialize FRD service(s)
void Init();

/// Shutdown FRD service(s)
void Shutdown();

} // namespace FRD
} // namespace Service