[gbastartup] Add main parameters for GBA build
This commit is contained in:
parent
04727ae57a
commit
03fc6280c9
18
deps/gbastartup/cstartup.cpp
vendored
18
deps/gbastartup/cstartup.cpp
vendored
@ -1,10 +1,15 @@
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
|
||||
extern void (*__preinit_array_start[]) (void);
|
||||
extern void (*__preinit_array_end[]) (void);
|
||||
extern void (*__init_array_start[]) (void);
|
||||
extern void (*__init_array_end[]) (void);
|
||||
|
||||
extern "C" void __libc_init_array() {
|
||||
extern "C" {
|
||||
|
||||
void __libc_init_array() {
|
||||
auto preInits = __preinit_array_end - __preinit_array_start;
|
||||
for (decltype(preInits) i = 0; i < preInits; i++) {
|
||||
__preinit_array_start[i]();
|
||||
@ -14,3 +19,14 @@ extern "C" void __libc_init_array() {
|
||||
__preinit_array_start[i]();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv);
|
||||
|
||||
void c_start() {
|
||||
const char *args[2] = {"", "rom.oxfs"};
|
||||
main(2, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
4
deps/gbastartup/gba_crt0.s
vendored
4
deps/gbastartup/gba_crt0.s
vendored
@ -183,9 +183,7 @@ CEW0Skip:
|
||||
@---------------------------------------------------------------------------------
|
||||
@ Jump to user code
|
||||
@---------------------------------------------------------------------------------
|
||||
mov r0, #0 @ int argc
|
||||
mov r1, #0 @ char *argv[]
|
||||
ldr r3, =main
|
||||
ldr r3, =c_start
|
||||
bl _blx_r3_stub
|
||||
@---------------------------------------------------------------------------------
|
||||
@ Clear memory to 0x00 if length != 0
|
||||
|
Loading…
Reference in New Issue
Block a user