PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
rpc_client.c
1
#include <
stdio.h
>
2
#include <
thbase.h
>
3
#include <
thsemap.h
>
4
#include <
loadcore.h
>
5
#include <
sysmem.h
>
6
#include <
intrman.h
>
7
#include <sifcmd.h>
8
#include <libsd.h>
9
#include <
sysclib.h
>
10
11
#include <audsrv.h>
12
#include "
audsrv_internal.h
"
13
#include "
rpc_client.h
"
14
15
static
SifRpcClientData_t
client;
16
static
int
rpc_sema;
17
18
void
initialize_rpc_client(
void
)
19
{
20
rpc_sema = CreateMutex(IOP_MUTEX_UNLOCKED);
21
22
client.server = NULL;
23
while
(sceSifBindRpc(&client, AUDSRV_IRX, 0) < 0 || client.server == NULL) DelayThread(500);
24
}
25
26
void
deinitialize_rpc_client(
void
)
27
{
28
memset(&client, 0,
sizeof
(client));
29
DeleteSema(rpc_sema);
30
}
31
32
static
void
call_end_callback(
void
*end_param)
33
{
34
(void)end_param;
35
36
iSignalSema(rpc_sema);
37
}
38
39
void
call_client_callback(
int
id
)
40
{
41
WaitSema(rpc_sema);
42
sceSifCallRpc(&client,
id
,
SIF_RPC_M_NOWAIT
, NULL, 0, NULL, 0, &call_end_callback, NULL);
43
}
audsrv_internal.h
SIF_RPC_M_NOWAIT
#define SIF_RPC_M_NOWAIT
Definition
sifrpc.h:24
intrman.h
t_SifRpcClientData
Definition
sifrpc.h:136
rpc_client.h
loadcore.h
stdio.h
sysclib.h
sysmem.h
thbase.h
thsemap.h
iop
sound
audsrv
src
rpc_client.c
Generated on Thu Nov 14 2024 05:25:25 for PS2SDK by
1.9.8