summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorMelody <melody@pallet.town>2018-12-02 03:37:46 -0500
committerMelody <melody@pallet.town>2018-12-02 03:37:46 -0500
commitc557ac61aef788f1630d3960dd2366bf000db8e0 (patch)
tree305dfa97c9dbceaa197cc3de648d69962a14c26d /asm/macros
parent145047d4389c68052ed8a5f4c1760238112004f3 (diff)
adds constants, cleans up callstd and msgbox code
* adds some constants for standard script names and messagebox types * replaces some callstd calls with msgbox calls where equivalent * replaces msgbox and callstd calls using raw digits with versions that use the constants
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/event.inc24
1 files changed, 17 insertions, 7 deletions
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index 6b9227442..a1b0b0c62 100644
--- a/asm/macros/event.inc
+++ b/asm/macros/event.inc
@@ -50,6 +50,12 @@
.byte \function
.endm
+ @ callstd function names
+ STD_OBTAIN_ITEM = 0
+ STD_FIND_ITEM = 1
+ STD_OBTAIN_DECORATION = 7
+ STD_REGISTER_MATCH_CALL = 8
+
@ Calls the standard function at index function.
.macro callstd function
.byte 0x09
@@ -262,7 +268,7 @@
.2byte \output
.2byte SPECIAL_\function
.endm
-
+
@ temporary solution
.macro specialvar_ output, functionId
.byte 0x26
@@ -1523,17 +1529,21 @@
goto_eq \dest
.endm
- .macro msgbox text, type=4
- loadword 0, \text
- callstd \type
- .endm
-
@ Message box types
+ MSGBOX_NPC = 2
+ MSGBOX_SIGN = 3
+ MSGBOX_DEFAULT = 4
MSGBOX_YESNO = 5
+ MSGBOX_AUTOCLOSE = 6
YES = 1
NO = 0
+ .macro msgbox text, type=MSGBOX_DEFAULT
+ loadword 0, \text
+ callstd \type
+ .endm
+
.macro giveitem_std item, amount=1, function=0
setorcopyvar 0x8000, \item
setorcopyvar 0x8001, \amount
@@ -1542,5 +1552,5 @@
.macro givedecoration_std decoration
setorcopyvar 0x8000, \decoration
- callstd 7
+ callstd STD_OBTAIN_DECORATION
.endm