diff --git a/include/utilsconsole_pause.h b/include/utilsconsole_pause.h new file mode 100644 index 0000000..396eadd --- /dev/null +++ b/include/utilsconsole_pause.h @@ -0,0 +1,17 @@ +/** + * utilsconsole_pause.h + * by Zy + */ + +/** + * utilsconsole_pause.h (uc_pause() function) + */ + +#ifndef UTILSCONSOLE_PAUSE_H +# define UTILSCONSOLE_PAUSE_H + +/// @brief Blocks the program until the user presses A. +/// @details Will also return if aptMainLoop() becomes false. +void uc_pause(void); + +#endif diff --git a/source/utilsconsole_pause.cpp b/source/utilsconsole_pause.cpp new file mode 100644 index 0000000..59e92fd --- /dev/null +++ b/source/utilsconsole_pause.cpp @@ -0,0 +1,27 @@ +/** + * utilsconsole.cpp + * by Zy + */ + + +#include + +extern "C" { + +#include "utilsconsole_pause.h" +#include <3ds.h> +#include + +using namespace std; + +void uc_pause(void) { + cout << "\e[0;2mPress (A) to continue...\e[0m" << endl; + while (aptMainLoop()) { + hidScanInput(); + if (hidKeysDown() & KEY_A) + break; + gfxFlushBuffers(); + } +} + +}