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()
63 if( sceSifCheckInit() == 0)
65 M_PRINTF(
"Sif not initialized.\n");
70 sceSifSetRpcQueue(&qd5, GetThreadId());
71 sceSifRegisterRpc(&sd5, MTAPSERV_CHANGE_SLOT, (
void*)rpc_server_change_slot, sb, 0, 0, &qd5);
76void* rpc_server_get_slot_number(s32 fno, u32 *data, s32 size)
81 data[1] = mtapGetSlotNumber( data[0] );
87void rpc_thread_get_slot_number()
89 if( sceSifCheckInit() == 0)
91 M_PRINTF(
"Sif not initialized.\n");
96 sceSifSetRpcQueue(&qd4, GetThreadId());
97 sceSifRegisterRpc(&sd4, MTAPSERV_GET_SLOT_NUMBER, (
void*)rpc_server_get_slot_number, sb, 0, 0, &qd4);
101void* RpcServerGetConnection(s32 fno, u32 *data, s32 size)
111void RpcThreadGetConnection()
113 if( sceSifCheckInit() == 0)
115 M_PRINTF(
"Sif not initialized.\n");
120 sceSifSetRpcQueue(&qd3, GetThreadId());
121 sceSifRegisterRpc(&sd3, MTAPSERV_GET_CONNECTION, (
void*)RpcServerGetConnection, sb, 0, 0, &qd3);
125void* RpcServerPortClose(s32 fno, u32 *data, s32 size)
135void RpcThreadPortClose()
137 if( sceSifCheckInit() == 0)
139 M_PRINTF(
"Sif not initialized.\n");
144 sceSifSetRpcQueue(&qd2, GetThreadId());
145 sceSifRegisterRpc(&sd2, MTAPSERV_PORT_CLOSE, (
void*)RpcServerPortClose, sb, 0, 0, &qd2);
149void* RpcServerPortOpen(s32 fno, u32 *data, s32 size)
159void RpcThreadPortOpen()
161 if( sceSifCheckInit() == 0)
163 M_PRINTF(
"Sif not initialized.\n");
168 sceSifSetRpcQueue(&qd1, GetThreadId());
169 sceSifRegisterRpc(&sd1, MTAPSERV_PORT_OPEN, (
void*)RpcServerPortOpen, sb, 0, 0, &qd1);
185 rpc_thread.attr = TH_C;
186 rpc_thread.thread = RpcThreadPortOpen;
187 rpc_thread.stacksize = 0x2000;
188 rpc_thread.priority = 32;
190 threadid_rpc1 = CreateThread(&rpc_thread);
192 if(threadid_rpc1 == 0)
return 0;
194 StartThread(threadid_rpc1, 0);
197 rpc_thread.thread = RpcThreadPortClose;
199 threadid_rpc2 = CreateThread(&rpc_thread);
201 if(threadid_rpc2 == 0)
return 0;
203 StartThread(threadid_rpc2, 0);
206 rpc_thread.thread = RpcThreadGetConnection;
208 threadid_rpc3 = CreateThread(&rpc_thread);
210 if(threadid_rpc3 == 0)
return 0;
212 StartThread(threadid_rpc3, 0);
215 rpc_thread.thread = rpc_thread_get_slot_number;
217 threadid_rpc4 = CreateThread(&rpc_thread);
219 if(threadid_rpc4 == 0)
return 0;
221 StartThread(threadid_rpc4, 0);
224 rpc_thread.thread = rpc_thread_change_slot;
226 threadid_rpc5 = CreateThread(&rpc_thread);
228 if(threadid_rpc5 == 0)
return 0;
230 StartThread(threadid_rpc5, 0);
int mtapGetConnection(int port)
int mtapPortClose(int port)
int mtapPortOpen(int port)