diff --git a/nx/include/switch/applets/error.h b/nx/include/switch/applets/error.h index ccd7e0fc..f6dcb1e5 100644 --- a/nx/include/switch/applets/error.h +++ b/nx/include/switch/applets/error.h @@ -142,6 +142,23 @@ Result errorEulaShow(SetRegion RegionCode); */ Result errorSystemUpdateEulaShow(SetRegion RegionCode, ErrorEulaData* eula); +/** + * @brief Launches the applet for displaying an error full-screen, using the specified Result and timestamp. + * @param res Result + * @param timestamp POSIX timestamp. + * @note Wrapper for \ref errorCodeRecordShow. + * @note The applet does not log an error report for this. + */ +Result errorResultRecordShow(Result res, u64 timestamp); + +/** + * @brief Launches the applet for displaying an error full-screen, using the specified ErrorCode and timestamp. + * @param low The module portion of the error, normally this should be set to module + 2000. + * @param desc The error description. + * @note The applet does not log an error report for this. + */ +Result errorCodeRecordShow(u32 low, u32 desc, u64 timestamp); + /** * @brief Creates an ErrorSystemConfig struct. * @param c ErrorSystemConfig struct. diff --git a/nx/source/applets/error.c b/nx/source/applets/error.c index a82e7725..4ed0c468 100644 --- a/nx/source/applets/error.c +++ b/nx/source/applets/error.c @@ -193,7 +193,21 @@ Result errorSystemUpdateEulaShow(SetRegion RegionCode, ErrorEulaData* eula) { // Record -//TODO +Result errorResultRecordShow(Result res, u64 timestamp) { + return errorCodeRecordShow(2000 + R_MODULE(res), R_DESCRIPTION(res), timestamp); +} + +Result errorCodeRecordShow(u32 low, u32 desc, u64 timestamp) { + ErrorRecordArg arg; + + memset(&arg, 0, sizeof(arg)); + arg.hdr.type = 5; + arg.hdr.jumpFlag = 1; + arg.errorCode = (u64)low | ((u64)desc<<32); + arg.timestamp = timestamp; + + return _errorShow(&arg, sizeof(arg), NULL, 0); +} // System