#include <3ds/svc.h>
#include <3ds/srv.h>
#include <3ds/services/ir.h>
+#include <3ds/ipc.h>
static Handle iru_handle=0;
static Handle iru_sharedmem_handle=0;
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x00010000;
+ cmdbuf[0] = IPC_MakeHeader(0x1,0,0); // 0x10000
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
ret = (Result)cmdbuf[1];
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x00020000;
+ cmdbuf[0] = IPC_MakeHeader(0x2,0,0); // 0x20000
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
ret = (Result)cmdbuf[1];
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x00030042;
+ cmdbuf[0] = IPC_MakeHeader(0x3,1,2); // 0x30042
cmdbuf[1] = size;
- cmdbuf[2] = (size<<4) | 10;
+ cmdbuf[2] = IPC_Desc_Buffer(size,IPC_BUFFER_R);
cmdbuf[3] = (u32)buf;
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x00040000;
+ cmdbuf[0] = IPC_MakeHeader(0x4,0,0); // 0x40000
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
ret = (Result)cmdbuf[1];
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x000500C2;
+ cmdbuf[0] = IPC_MakeHeader(0x5,3,2); // 0x500C2
cmdbuf[1] = iru_sharedmem_size;
cmdbuf[2] = size;
cmdbuf[3] = (u8)flag;
- cmdbuf[4] = 0;
+ cmdbuf[4] = IPC_Desc_SharedHandles(1);
cmdbuf[5] = iru_sharedmem_handle;
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x00060000;
+ cmdbuf[0] = IPC_MakeHeader(0x6,0,0); // 0x60000
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
ret = (Result)cmdbuf[1];
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x00090040;
+ cmdbuf[0] = IPC_MakeHeader(0x9,1,0); // 0x90040
cmdbuf[1] = (u32)value;
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x000A0000;
+ cmdbuf[0] = IPC_MakeHeader(0xA,0,0); // 0xA0000
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
ret = (Result)cmdbuf[1];
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x000B0040;
+ cmdbuf[0] = IPC_MakeHeader(0xB,1,0); // 0xB0040
cmdbuf[1] = value;
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = 0x000C0000;
+ cmdbuf[0] = IPC_MakeHeader(0xC,0,0); // 0xC0000
if((ret = svcSendSyncRequest(iru_handle))!=0)return ret;
ret = (Result)cmdbuf[1];