[teagba] Add symbols needed for enabling exceptions
This commit is contained in:
parent
dd50bd0249
commit
6cff526647
21
deps/teagba/src/cstartup.cpp
vendored
21
deps/teagba/src/cstartup.cpp
vendored
@ -4,17 +4,20 @@
|
|||||||
|
|
||||||
#include <ox/std/heapmgr.hpp>
|
#include <ox/std/heapmgr.hpp>
|
||||||
|
|
||||||
|
#include <teagba/bios.hpp>
|
||||||
|
#include <teagba/registers.hpp>
|
||||||
|
|
||||||
namespace mgba {
|
namespace mgba {
|
||||||
void initConsole();
|
void initConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MEM_EWRAM_BEGIN reinterpret_cast<char*>(0x02000000)
|
#define MEM_HEAP_BEGIN reinterpret_cast<char*>(0x02000000)
|
||||||
#define MEM_EWRAM_END reinterpret_cast<char*>(0x0203FFFF)
|
#define MEM_HEAP_END reinterpret_cast<char*>(0x0203FFFF)
|
||||||
|
|
||||||
#define HEAP_BEGIN reinterpret_cast<char*>(MEM_EWRAM_BEGIN)
|
#define HEAP_BEGIN reinterpret_cast<char*>(MEM_HEAP_BEGIN)
|
||||||
// set size to half of EWRAM
|
// set size to half of EWRAM
|
||||||
#define HEAP_SIZE ((MEM_EWRAM_END - MEM_EWRAM_BEGIN) / 2)
|
#define HEAP_SIZE ((MEM_HEAP_END - MEM_HEAP_BEGIN) / 2)
|
||||||
#define HEAP_END reinterpret_cast<char*>(MEM_EWRAM_BEGIN + HEAP_SIZE)
|
#define HEAP_END reinterpret_cast<char*>(MEM_HEAP_BEGIN + HEAP_SIZE)
|
||||||
|
|
||||||
extern void (*__preinit_array_start[]) (void);
|
extern void (*__preinit_array_start[]) (void);
|
||||||
extern void (*__preinit_array_end[]) (void);
|
extern void (*__preinit_array_end[]) (void);
|
||||||
@ -25,6 +28,14 @@ int main(int argc, const char **argv);
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
void abort() {
|
||||||
|
REG_IE = 0;
|
||||||
|
teagba::intrwait(0, 0);
|
||||||
|
while (true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *__gxx_personality_v0{};
|
||||||
|
|
||||||
void __libc_init_array() {
|
void __libc_init_array() {
|
||||||
auto preInits = __preinit_array_end - __preinit_array_start;
|
auto preInits = __preinit_array_end - __preinit_array_start;
|
||||||
for (decltype(preInits) i = 0; i < preInits; i++) {
|
for (decltype(preInits) i = 0; i < preInits; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user