[nostalgia/core/gba] Add test for malloc and unify panic systems
This commit is contained in:
@@ -7,15 +7,21 @@
|
||||
*/
|
||||
|
||||
#include "../core.hpp"
|
||||
#include "panic.hpp"
|
||||
#include "../gfx.hpp"
|
||||
|
||||
namespace nostalgia::core {
|
||||
namespace ox {
|
||||
|
||||
void panic(const char *msg) {
|
||||
using namespace nostalgia::core;
|
||||
|
||||
void panic(const char*, int, const char *msg, ox::Error err) {
|
||||
oxIgnoreError(initGfx(nullptr));
|
||||
oxIgnoreError(initConsole(nullptr));
|
||||
ox::BString<23> serr = "Error code: ";
|
||||
serr += err;
|
||||
puts(nullptr, 32 + 0, 1, "SADNESS...");
|
||||
puts(nullptr, 32 + 0, 4, "UNEXPECTED STATE:");
|
||||
puts(nullptr, 32 + 2, 6, msg);
|
||||
puts(nullptr, 32 + 2, 7, serr.c_str());
|
||||
puts(nullptr, 32 + 0, 10, "PLEASE RESTART THE SYSTEM");
|
||||
// TODO: properly end program execution, this wastes power
|
||||
while (1);
|
||||
|
||||
Reference in New Issue
Block a user