summaryrefslogtreecommitdiff
path: root/agbx/source/priv
diff options
context:
space:
mode:
Diffstat (limited to 'agbx/source/priv')
-rw-r--r--agbx/source/priv/init.c14
-rw-r--r--agbx/source/priv/init.s23
2 files changed, 23 insertions, 14 deletions
diff --git a/agbx/source/priv/init.c b/agbx/source/priv/init.c
deleted file mode 100644
index 3ba1f17..0000000
--- a/agbx/source/priv/init.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- Copyright 2022 Gabriel Jensen.
- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
- If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
-*/
-
-#include <agbx/priv.h>
-
-agbx_err agbx_main(void);
-
-[[noreturn]] void __agbx_init(void) {
- agbx_err const err = agbx_main();
- agbx_done(err);
-}
diff --git a/agbx/source/priv/init.s b/agbx/source/priv/init.s
new file mode 100644
index 0000000..ec0b6df
--- /dev/null
+++ b/agbx/source/priv/init.s
@@ -0,0 +1,23 @@
+@ Copyright 2022 Gabriel Jensen.
+@ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+@ If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
+
+.syntax unified
+
+.cpu arm7tdmi
+.thumb
+
+.extern agbx_done
+.extern agbx_main
+
+.globl __agbx_init
+
+.func
+
+.thumb_func
+
+__agbx_init:
+ bl agbx_main
+ bl agbx_done @ The return value is already in r0, so there's no need to move it.
+
+.endfunc