20#define MTAPSERV_PORT_OPEN 0x80000901
21#define MTAPSERV_PORT_CLOSE 0x80000902
22#define MTAPSERV_GET_CONNECTION 0x80000903
23#define MTAPSERV_GET_SLOT_NUMBER 0x800009FE
24#define MTAPSERV_CHANGE_SLOT 0x800009FF
29static s32 threadid_rpc1;
33static s32 threadid_rpc2;
37static s32 threadid_rpc3;
41static s32 threadid_rpc4;
45static s32 threadid_rpc5;
50void* rpc_server_change_slot(s32 fno, u32 *data, s32 size)
55 data[1] = mtapChangeSlot( data[0], data[1] );
61void rpc_thread_change_slot(
void *arg)
65 if( sceSifCheckInit() == 0)
67 M_PRINTF(
"Sif not initialized.\n");
72 sceSifSetRpcQueue(&qd5, GetThreadId());
73 sceSifRegisterRpc(&sd5, MTAPSERV_CHANGE_SLOT, (
void*)rpc_server_change_slot, sb, 0, 0, &qd5);
78void* rpc_server_get_slot_number(s32 fno, u32 *data, s32 size)
83 data[1] = mtapGetSlotNumber( data[0] );
89void rpc_thread_get_slot_number(
void *arg)
93 if( sceSifCheckInit() == 0)
95 M_PRINTF(
"Sif not initialized.\n");
100 sceSifSetRpcQueue(&qd4, GetThreadId());
101 sceSifRegisterRpc(&sd4, MTAPSERV_GET_SLOT_NUMBER, (
void*)rpc_server_get_slot_number, sb, 0, 0, &qd4);
105void* RpcServerGetConnection(s32 fno, u32 *data, s32 size)
115void RpcThreadGetConnection(
void *arg)
119 if( sceSifCheckInit() == 0)
121 M_PRINTF(
"Sif not initialized.\n");
126 sceSifSetRpcQueue(&qd3, GetThreadId());
127 sceSifRegisterRpc(&sd3, MTAPSERV_GET_CONNECTION, (
void*)RpcServerGetConnection, sb, 0, 0, &qd3);
131void* RpcServerPortClose(s32 fno, u32 *data, s32 size)
141void RpcThreadPortClose(
void *arg)
145 if( sceSifCheckInit() == 0)
147 M_PRINTF(
"Sif not initialized.\n");
152 sceSifSetRpcQueue(&qd2, GetThreadId());
153 sceSifRegisterRpc(&sd2, MTAPSERV_PORT_CLOSE, (
void*)RpcServerPortClose, sb, 0, 0, &qd2);
157void* RpcServerPortOpen(s32 fno, u32 *data, s32 size)
167void RpcThreadPortOpen(
void *arg)
171 if( sceSifCheckInit() == 0)
173 M_PRINTF(
"Sif not initialized.\n");
178 sceSifSetRpcQueue(&qd1, GetThreadId());
179 sceSifRegisterRpc(&sd1, MTAPSERV_PORT_OPEN, (
void*)RpcServerPortOpen, sb, 0, 0, &qd1);
195 rpc_thread.attr = TH_C;
196 rpc_thread.thread = RpcThreadPortOpen;
197 rpc_thread.stacksize = 0x2000;
198 rpc_thread.priority = 32;
200 threadid_rpc1 = CreateThread(&rpc_thread);
202 if(threadid_rpc1 == 0)
return 0;
204 StartThread(threadid_rpc1, 0);
207 rpc_thread.thread = RpcThreadPortClose;
209 threadid_rpc2 = CreateThread(&rpc_thread);
211 if(threadid_rpc2 == 0)
return 0;
213 StartThread(threadid_rpc2, 0);
216 rpc_thread.thread = RpcThreadGetConnection;
218 threadid_rpc3 = CreateThread(&rpc_thread);
220 if(threadid_rpc3 == 0)
return 0;
222 StartThread(threadid_rpc3, 0);
225 rpc_thread.thread = rpc_thread_get_slot_number;
227 threadid_rpc4 = CreateThread(&rpc_thread);
229 if(threadid_rpc4 == 0)
return 0;
231 StartThread(threadid_rpc4, 0);
234 rpc_thread.thread = rpc_thread_change_slot;
236 threadid_rpc5 = CreateThread(&rpc_thread);
238 if(threadid_rpc5 == 0)
return 0;
240 StartThread(threadid_rpc5, 0);
int mtapGetConnection(int port)
int mtapPortClose(int port)
int mtapPortOpen(int port)