[nostalgia/player] Replace main with _start in GBA builds

This commit is contained in:
Gary Talent 2019-06-15 12:05:08 -05:00
parent 36d8aeabd3
commit eba7d402c9
2 changed files with 21 additions and 3 deletions

View File

@ -7,8 +7,8 @@ add_executable(
if(COMMAND OBJCOPY_FILE)
set_target_properties(nostalgia
PROPERTIES
LINK_FLAGS ${LINKER_FLAGS}
COMPILER_FLAGS "-mthumb -mthumb-interwork"
LINK_FLAGS ${LINKER_FLAGS}
COMPILER_FLAGS "-mthumb -mthumb-interwork"
)
OBJCOPY_FILE(nostalgia)

View File

@ -12,7 +12,7 @@ using namespace nostalgia::common;
using namespace nostalgia::core;
using namespace nostalgia::world;
int main() {
int run() {
ox::FileSystem32 fs(ox::FileStore32(loadRom(), 33554432)); // 32 MB
Context ctx;
init(&ctx);
@ -22,3 +22,21 @@ int main() {
while (1);
return 0;
}
#ifndef OX_USE_STDLIB
extern "C" {
void _start() {
run();
}
}
#else
int main() {
return run();
}
#endif