Files
mice-3ds/source/error.c
angel 285351e982
Some checks failed
Build (3DS) / build (push) Failing after 1m13s
YAY
2025-12-06 23:47:15 +00:00

43 lines
850 B
C

#include "error.h"
#include <errno.h>
#include <string.h>
/**
* Return string describing error number. Extends strerror to include some
* custom errors used in mice.
*
* \param err Error number.
*/
char* mice_strerror(int err)
{
char* error;
switch(err)
{
case NDSP_INIT_FAIL:
error = "NDSP Initialisation failed.\nYou may need to dump DSP firmware.\n"
"You can do this within Rosalina (using Luma CFW):\n"
" 1. Press L+Down+Select\n 2. Misc. Options.\n 3. Dump DSP Firmware.\n"
" 4. Restart mice.";
break;
case DECODER_INIT_FAIL:
error = "Unable to initialise decoder";
break;
case FILE_NOT_SUPPORTED:
error = "File type is not supported";
break;
case UNSUPPORTED_CHANNELS:
error = "Unsupported number of channels";
break;
default:
error = strerror(err);
break;
}
return error;
}