dev: add uc_pause() for C (not only C++)

This commit is contained in:
Zy 2024-10-08 19:36:38 +02:00
parent 97db58cd33
commit d82da8811b
2 changed files with 44 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1,27 @@
/**
* utilsconsole.cpp
* by Zy
*/
#include <iostream>
extern "C" {
#include "utilsconsole_pause.h"
#include <3ds.h>
#include <stdarg.h>
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();
}
}
}