diff --git a/deps/teagba/src/cstartup.cpp b/deps/teagba/src/cstartup.cpp index ea4a62c0..e3845e03 100644 --- a/deps/teagba/src/cstartup.cpp +++ b/deps/teagba/src/cstartup.cpp @@ -4,17 +4,20 @@ #include +#include +#include + namespace mgba { void initConsole(); } -#define MEM_EWRAM_BEGIN reinterpret_cast(0x02000000) -#define MEM_EWRAM_END reinterpret_cast(0x0203FFFF) +#define MEM_HEAP_BEGIN reinterpret_cast(0x02000000) +#define MEM_HEAP_END reinterpret_cast(0x0203FFFF) -#define HEAP_BEGIN reinterpret_cast(MEM_EWRAM_BEGIN) +#define HEAP_BEGIN reinterpret_cast(MEM_HEAP_BEGIN) // set size to half of EWRAM -#define HEAP_SIZE ((MEM_EWRAM_END - MEM_EWRAM_BEGIN) / 2) -#define HEAP_END reinterpret_cast(MEM_EWRAM_BEGIN + HEAP_SIZE) +#define HEAP_SIZE ((MEM_HEAP_END - MEM_HEAP_BEGIN) / 2) +#define HEAP_END reinterpret_cast(MEM_HEAP_BEGIN + HEAP_SIZE) extern void (*__preinit_array_start[]) (void); extern void (*__preinit_array_end[]) (void); @@ -25,6 +28,14 @@ int main(int argc, const char **argv); extern "C" { +void abort() { + REG_IE = 0; + teagba::intrwait(0, 0); + while (true); +} + +void *__gxx_personality_v0{}; + void __libc_init_array() { auto preInits = __preinit_array_end - __preinit_array_start; for (decltype(preInits) i = 0; i < preInits; i++) {