Merge branch 'master' into great-refactor
Conflicts: libctru/include/3ds/services/apt.h libctru/source/services/apt.c
This commit is contained in:
commit
649e95cd39
@ -97,6 +97,7 @@ Result APT_Finalize(NS_APPID appId);
|
|||||||
Result APT_HardwareResetAsync(void);
|
Result APT_HardwareResetAsync(void);
|
||||||
Result APT_Enable(u32 a);
|
Result APT_Enable(u32 a);
|
||||||
Result APT_GetAppletManInfo(u8 inval, u8 *outval8, u32 *outval32, NS_APPID *menu_appid, NS_APPID *active_appid);
|
Result APT_GetAppletManInfo(u8 inval, u8 *outval8, u32 *outval32, NS_APPID *menu_appid, NS_APPID *active_appid);
|
||||||
|
Result APT_GetAppletProgramInfo(u32 id, u32 flags, u16 *titleversion);
|
||||||
Result APT_PrepareToJumpToHomeMenu(void);
|
Result APT_PrepareToJumpToHomeMenu(void);
|
||||||
Result APT_JumpToHomeMenu(u32 a, u32 b, u32 c);
|
Result APT_JumpToHomeMenu(u32 a, u32 b, u32 c);
|
||||||
Result APT_PrepareToJumpToApplication(u32 a);
|
Result APT_PrepareToJumpToApplication(u32 a);
|
||||||
|
@ -23,7 +23,7 @@ Result httpcReceiveData(httpcContext *context, u8* buffer, u32 size);
|
|||||||
Result httpcGetRequestState(httpcContext *context, httpcReqStatus* out);
|
Result httpcGetRequestState(httpcContext *context, httpcReqStatus* out);
|
||||||
Result httpcGetDownloadSizeState(httpcContext *context, u32* downloadedsize, u32* contentsize);
|
Result httpcGetDownloadSizeState(httpcContext *context, u32* downloadedsize, u32* contentsize);
|
||||||
Result httpcGetResponseStatusCode(httpcContext *context, u32* out, u64 delay);//delay isn't used yet. This writes the HTTP status code from the server to out.
|
Result httpcGetResponseStatusCode(httpcContext *context, u32* out, u64 delay);//delay isn't used yet. This writes the HTTP status code from the server to out.
|
||||||
|
Result httpcGetResponseHeader(httpcContext *context, char* name, char* value, u32 valuebuf_maxsize);
|
||||||
Result httpcDownloadData(httpcContext *context, u8* buffer, u32 size, u32 *downloadedsize);//The *entire* content must be downloaded before using httpcCloseContext(), otherwise httpcCloseContext() will hang.
|
Result httpcDownloadData(httpcContext *context, u8* buffer, u32 size, u32 *downloadedsize);//The *entire* content must be downloaded before using httpcCloseContext(), otherwise httpcCloseContext() will hang.
|
||||||
|
|
||||||
//Using the below functions directly is not recommended, use the above functions. See also the http example.
|
//Using the below functions directly is not recommended, use the above functions. See also the http example.
|
||||||
@ -38,5 +38,6 @@ Result HTTPC_BeginRequest(Handle handle, Handle contextHandle);
|
|||||||
Result HTTPC_ReceiveData(Handle handle, Handle contextHandle, u8* buffer, u32 size);
|
Result HTTPC_ReceiveData(Handle handle, Handle contextHandle, u8* buffer, u32 size);
|
||||||
Result HTTPC_GetRequestState(Handle handle, Handle contextHandle, httpcReqStatus* out);
|
Result HTTPC_GetRequestState(Handle handle, Handle contextHandle, httpcReqStatus* out);
|
||||||
Result HTTPC_GetDownloadSizeState(Handle handle, Handle contextHandle, u32* downloadedsize, u32* contentsize);
|
Result HTTPC_GetDownloadSizeState(Handle handle, Handle contextHandle, u32* downloadedsize, u32* contentsize);
|
||||||
|
Result HTTPC_GetResponseHeader(Handle handle, Handle contextHandle, char* name, char* value, u32 valuebuf_maxsize);
|
||||||
Result HTTPC_GetResponseStatusCode(Handle handle, Handle contextHandle, u32* out);
|
Result HTTPC_GetResponseStatusCode(Handle handle, Handle contextHandle, u32* out);
|
||||||
|
|
||||||
|
@ -792,6 +792,21 @@ Result APT_GetAppletManInfo(u8 inval, u8 *outval8, u32 *outval32, NS_APPID *menu
|
|||||||
return cmdbuf[1];
|
return cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result APT_GetAppletProgramInfo(u32 id, u32 flags, u16 *titleversion)
|
||||||
|
{
|
||||||
|
u32* cmdbuf=getThreadCommandBuffer();
|
||||||
|
cmdbuf[0]=0x004D0080; //request header code
|
||||||
|
cmdbuf[1]=id;
|
||||||
|
cmdbuf[2]=flags;
|
||||||
|
|
||||||
|
Result ret=0;
|
||||||
|
if((ret=svcSendSyncRequest(aptuHandle)))return ret;
|
||||||
|
|
||||||
|
if(titleversion)*titleversion=cmdbuf[2];
|
||||||
|
|
||||||
|
return cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
Result APT_IsRegistered(NS_APPID appID, u8* out)
|
Result APT_IsRegistered(NS_APPID appID, u8* out)
|
||||||
{
|
{
|
||||||
u32* cmdbuf=getThreadCommandBuffer();
|
u32* cmdbuf=getThreadCommandBuffer();
|
||||||
|
@ -149,14 +149,14 @@ void hidScanInput(void)
|
|||||||
if(Id>7)Id=7;
|
if(Id>7)Id=7;
|
||||||
if(hidCheckSectionUpdateTime(&hidSharedMem[66], Id)==0)
|
if(hidCheckSectionUpdateTime(&hidSharedMem[66], Id)==0)
|
||||||
{
|
{
|
||||||
aVec = *(accelVector*)&hidSharedMem[66 + 8 + Id*2];
|
aVec = ((accelVector*)&hidSharedMem[66 + 8])[Id];
|
||||||
}
|
}
|
||||||
|
|
||||||
Id = hidSharedMem[86 + 4];//Gyroscope
|
Id = hidSharedMem[86 + 4];//Gyroscope
|
||||||
if(Id>31)Id=31;
|
if(Id>31)Id=31;
|
||||||
if(hidCheckSectionUpdateTime(&hidSharedMem[86], Id)==0)
|
if(hidCheckSectionUpdateTime(&hidSharedMem[86], Id)==0)
|
||||||
{
|
{
|
||||||
gRate = *(angularRate*)&hidSharedMem[86 + 8 + Id*2];
|
gRate = ((angularRate*)&hidSharedMem[86 + 8])[Id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +95,11 @@ Result httpcGetDownloadSizeState(httpcContext *context, u32* downloadedsize, u32
|
|||||||
return HTTPC_GetDownloadSizeState(context->servhandle, context->httphandle, downloadedsize, contentsize);
|
return HTTPC_GetDownloadSizeState(context->servhandle, context->httphandle, downloadedsize, contentsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result httpcGetResponseHeader(httpcContext *context, char* name, char* value, u32 valuebuf_maxsize)
|
||||||
|
{
|
||||||
|
return HTTPC_GetResponseHeader(context->servhandle, context->httphandle, name, value, valuebuf_maxsize);
|
||||||
|
}
|
||||||
|
|
||||||
Result httpcGetResponseStatusCode(httpcContext *context, u32* out, u64 delay)
|
Result httpcGetResponseStatusCode(httpcContext *context, u32* out, u64 delay)
|
||||||
{
|
{
|
||||||
return HTTPC_GetResponseStatusCode(context->servhandle, context->httphandle, out);
|
return HTTPC_GetResponseStatusCode(context->servhandle, context->httphandle, out);
|
||||||
@ -294,6 +299,27 @@ Result HTTPC_GetDownloadSizeState(Handle handle, Handle contextHandle, u32* down
|
|||||||
return cmdbuf[1];
|
return cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result HTTPC_GetResponseHeader(Handle handle, Handle contextHandle, char* name, char* value, u32 valuebuf_maxsize)
|
||||||
|
{
|
||||||
|
u32* cmdbuf=getThreadCommandBuffer();
|
||||||
|
|
||||||
|
int name_len=strlen(name)+1;
|
||||||
|
|
||||||
|
cmdbuf[0]=0x001e00c4; //request header code
|
||||||
|
cmdbuf[1]=contextHandle;
|
||||||
|
cmdbuf[2]=name_len;
|
||||||
|
cmdbuf[3]=valuebuf_maxsize;
|
||||||
|
cmdbuf[4]=(name_len<<14)|0xC02;
|
||||||
|
cmdbuf[5]=(u32)name;
|
||||||
|
cmdbuf[6]=(valuebuf_maxsize<<4)|0xC;
|
||||||
|
cmdbuf[7]=(u32)value;
|
||||||
|
|
||||||
|
Result ret=0;
|
||||||
|
if((ret=svcSendSyncRequest(handle)))return ret;
|
||||||
|
|
||||||
|
return cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
Result HTTPC_GetResponseStatusCode(Handle handle, Handle contextHandle, u32* out)
|
Result HTTPC_GetResponseStatusCode(Handle handle, Handle contextHandle, u32* out)
|
||||||
{
|
{
|
||||||
u32* cmdbuf=getThreadCommandBuffer();
|
u32* cmdbuf=getThreadCommandBuffer();
|
||||||
|
Loading…
Reference in New Issue
Block a user