Files
amethyst/source/amethyst.cpp
tobid7 d85610a0bd Add GTrace
Make Fonts an Asset
Add FormatMillis and FormatNanos
2025-12-08 18:37:12 +01:00

36 lines
760 B
C++
Executable File

#include <amethyst.hpp>
#include <exception>
#include <iostream>
#ifdef AMY_3DS
#include <3ds.h>
void NpiD7CxxExceptionHandler() {
gfxInitDefault();
consoleInit(GFX_TOP, nullptr);
std::cout << "[C++ Error Handler]" << std::endl;
try {
std::rethrow_exception(std::current_exception());
} catch (const std::exception& e) {
std::cout << "\n\n" << e.what() << std::endl;
}
aptSetHomeAllowed(false);
aptSetSleepAllowed(false);
while (aptMainLoop()) {
hidScanInput();
if (hidKeysDown() & KEY_START) {
break;
}
}
std::abort();
}
#endif
namespace Amy {
void RegisterCxxExceptionHandler() {
#ifdef AMY_3DS
std::set_terminate(NpiD7CxxExceptionHandler);
#endif
}
} // namespace Amy