Fix PTMSYSM_CheckNew3DS, closes #540

This commit is contained in:
TuxSH 2024-03-13 19:24:54 +01:00
parent a6a6548348
commit faf5162b60
2 changed files with 6 additions and 4 deletions

View File

@ -109,9 +109,10 @@ Result PTMSYSM_GetRtcTime(s64 *outMsY2k);
Result PTMSYSM_SetRtcTime(s64 msY2k);
/**
* @brief Returns 1 if it's a New 3DS, otherwise 0.
* @brief Checks whether the system is a New 3DS.
* @param[out] out Pointer to write the New 3DS flag to.
*/
Result PTMSYSM_CheckNew3DS(void);
Result PTMSYSM_CheckNew3DS(bool *out);
/**
* @brief Configures the New 3DS' CPU clock speed and L2 cache.

View File

@ -98,13 +98,14 @@ Result PTMSYSM_Awaken(void)
return (Result)cmdbuf[1];
}
Result PTMSYSM_CheckNew3DS(void)
Result PTMSYSM_CheckNew3DS(bool *out)
{
Result ret;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x040A,0,0); // 0x040A0000
if(R_FAILED(ret = svcSendSyncRequest(ptmSysmHandle)))return 0;
if(R_FAILED(ret = svcSendSyncRequest(ptmSysmHandle)))return ret;
*out = (bool)cmdbuf[2]; // if cmdbuf[1] is != 0 then this is uninitialized (this is fine)
return (Result)cmdbuf[1];
}