aboutsummaryrefslogtreecommitdiffstats
path: root/microshmup/microshmup_core.S
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-10-23 20:52:14 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-10-23 20:52:14 -0500
commit35c4fbebeb3531b84dd0952aefd5d399046c00cb (patch)
tree8074b3beefb442132cad950dc88a0f9a0c19f265 /microshmup/microshmup_core.S
parent498b575a5262305f2c41d5c06baafc976ded48d1 (diff)
downloaddemos-35c4fbebeb3531b84dd0952aefd5d399046c00cb.tar.gz
demos-35c4fbebeb3531b84dd0952aefd5d399046c00cb.zip
microshmup: split into multiple files
Diffstat (limited to 'microshmup/microshmup_core.S')
-rw-r--r--microshmup/microshmup_core.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/microshmup/microshmup_core.S b/microshmup/microshmup_core.S
new file mode 100644
index 0000000..cbb8bfb
--- /dev/null
+++ b/microshmup/microshmup_core.S
@@ -0,0 +1,29 @@
+// ================================================================================================
+// Macros
+// ================================================================================================
+
+#ifdef __APPLE__
+# define LBL(name) L ## name
+# define SYM(name) _##name
+# define SECTION_BSS .section __DATA,__bss
+# define SECTION_RODATA .section __TEXT,__const
+# define SECTION_TEXT .section __TEXT,__text
+#else
+# define LBL(name) .L ## name
+# define SYM(name) name
+# define SECTION_BSS .section .bss
+# define SECTION_RODATA .section .rodata
+# define SECTION_TEXT .section .text
+#endif
+
+.macro LOADADDR reg, sym
+#ifdef __APPLE__
+ adrp \reg, \sym\()@PAGE
+ add \reg, \reg, \sym\()@PAGEOFF
+#else
+ adrp \reg, \sym
+ add \reg, \reg, :lo12:\sym
+#endif
+.endm
+
+