diff --git a/SourceX/platform/ctr/system.cpp b/SourceX/platform/ctr/system.cpp index b12e30c85..0115cbd6f 100644 --- a/SourceX/platform/ctr/system.cpp +++ b/SourceX/platform/ctr/system.cpp @@ -1,10 +1,31 @@ #include +#include #include <3ds.h> #include "platform/ctr/system.h" +bool isN3DS; + +bool ctr_check_dsp() +{ + FILE *dsp = fopen("sdmc:/3ds/dspfirm.cdc", "r"); + if (dsp == NULL) { + fclose(dsp); + gfxInitDefault(); + errorConf error; + errorInit(&error, ERROR_TEXT, CFG_LANGUAGE_EN); + errorText(&error, "Cannot find DSP firmware!\n\n\"sdmc:/3ds/dspfirm.cdc\"\n\nRun \'DSP1\' atleast once to\ndump your DSP firmware."); + errorDisp(&error); + gfxExit(); + return false; + } + fclose(dsp); + return true; +} + void ctr_sys_init() { - bool isN3DS; + if( ctr_check_dsp() == false ) + exit(0); APT_CheckNew3DS(&isN3DS); if(isN3DS) diff --git a/SourceX/platform/ctr/system.h b/SourceX/platform/ctr/system.h index 1db8ad2e8..8e2f4b277 100644 --- a/SourceX/platform/ctr/system.h +++ b/SourceX/platform/ctr/system.h @@ -1,4 +1,5 @@ #pragma once -void ctr_sys_init(); +bool ctr_check_dsp(); +void ctr_sys_init();