summaryrefslogtreecommitdiff
path: root/macros/predef.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-03 16:37:47 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-03 16:37:47 -0400
commit9878f01e29b1443d6c894c1332cbf381fa12646e (patch)
tree8e763ca94f2b90faaa470416055c320dbdb89cbf /macros/predef.asm
parentccb01731fe8cd44ae4c8840ee8ddc02e6bdea97e (diff)
Organize macros/ like pokecrystal
While doing so I replaced the StopAllMusic macro with a SFX_STOP_ALL_MUSIC constant and applied it throughout the code.
Diffstat (limited to 'macros/predef.asm')
-rw-r--r--macros/predef.asm49
1 files changed, 49 insertions, 0 deletions
diff --git a/macros/predef.asm b/macros/predef.asm
new file mode 100644
index 00000000..fda42004
--- /dev/null
+++ b/macros/predef.asm
@@ -0,0 +1,49 @@
+predef_const: MACRO
+ const \1PredefID
+ENDM
+
+add_predef: MACRO
+\1Predef::
+ db BANK(\1)
+ dw \1
+ENDM
+
+predef_id: MACRO
+ ld a, (\1Predef - PredefPointers) / 3
+ENDM
+
+predef: MACRO
+ predef_id \1
+ call Predef
+ENDM
+
+predef_jump: MACRO
+ predef_id \1
+ jp Predef
+ENDM
+
+tx_pre_const: MACRO
+ const \1_id
+ENDM
+
+add_tx_pre: MACRO
+\1_id:: dw \1
+ENDM
+
+db_tx_pre: MACRO
+ db (\1_id - TextPredefs) / 2 + 1
+ENDM
+
+tx_pre_id: MACRO
+ ld a, (\1_id - TextPredefs) / 2 + 1
+ENDM
+
+tx_pre: MACRO
+ tx_pre_id \1
+ call PrintPredefTextID
+ENDM
+
+tx_pre_jump: MACRO
+ tx_pre_id \1
+ jp PrintPredefTextID
+ENDM