3DS: More error detection for audio

This commit is contained in:
Clownacy 2020-10-20 00:47:38 +01:00
parent 8a560eb873
commit ccd436bce7

View file

@ -94,8 +94,10 @@ static int AllocateChannel(AudioBackend_Sound *sound)
bool AudioBackend_Init(void) bool AudioBackend_Init(void)
{ {
ndspInit(); Result rc = ndspInit();
if (R_SUCCEEDED(rc))
{
ndspSetOutputMode(NDSP_OUTPUT_STEREO); ndspSetOutputMode(NDSP_OUTPUT_STEREO);
LightLock_Init(&organya_mutex); LightLock_Init(&organya_mutex);
@ -109,6 +111,16 @@ bool AudioBackend_Init(void)
organya_thread = threadCreate(OrganyaThread, NULL, 32 * 1024, priority, -1, false); organya_thread = threadCreate(OrganyaThread, NULL, 32 * 1024, priority, -1, false);
return true; return true;
}
else
{
if (R_SUMMARY(rc) == RS_NOTFOUND && R_MODULE(rc) == RM_DSP)
Backend_PrintError("Could not load DSP firmware - you might need to dump yours manually");
else
Backend_PrintError("ndspInit failed in AudioBackend_Init");
}
return false;
} }
void AudioBackend_Deinit(void) void AudioBackend_Deinit(void)