summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorDiegoisawesome <Diegoisawesome@users.noreply.github.com>2018-12-02 12:31:54 -0600
committerGitHub <noreply@github.com>2018-12-02 12:31:54 -0600
commitc123b8d6f1787abce2d1e3920d40192811b5fa39 (patch)
tree37d1541b2e6babc04bd029a8ed4ec32ea03fa75d /asm/macros
parentee05197eba782b9796b042f153890be10c4b492c (diff)
parent862265b73a6eab7d070e628d3cb77663543bc368 (diff)
Merge pull request #417 from melthelesbian/msgbox_documentation
adds constants, cleans up callstd and msgbox code
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/event.inc31
1 files changed, 24 insertions, 7 deletions
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index 6b9227442..e59f18b32 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,12 @@
.macro givedecoration_std decoration
setorcopyvar 0x8000, \decoration
- callstd 7
+ callstd STD_OBTAIN_DECORATION
+ .endm
+
+ .macro register_matchcall trainer
+ setvar VAR_0x8004, \trainer
+ special SetMatchCallRegisteredFlag
+ setorcopyvar VAR_0x8000, \trainer
+ callstd STD_REGISTER_MATCH_CALL
.endm