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
This commit is contained in:
Melody
2018-12-02 03:37:46 -05:00
parent 145047d438
commit c557ac61ae
354 changed files with 4538 additions and 4531 deletions
+17 -7
View File
@@ -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