aboutsummaryrefslogtreecommitdiffstats
path: root/constants/event_macros.asm
diff options
context:
space:
mode:
authorpikalaxalt <PikalaxALT@gmail.com>2016-05-28 17:43:51 -0400
committerpikalaxalt <PikalaxALT@gmail.com>2016-05-28 17:43:51 -0400
commitc93574436f30106fd2211abea452fe3a96948211 (patch)
tree3147c82a48ccd933576cdc485e54d7e13677df85 /constants/event_macros.asm
parentViridian pokecenter (diff)
downloadpokeyellow-c93574436f30106fd2211abea452fe3a96948211.tar.gz
pokeyellow-c93574436f30106fd2211abea452fe3a96948211.tar.xz
pokeyellow-c93574436f30106fd2211abea452fe3a96948211.zip
Viridian Mart
Diffstat (limited to 'constants/event_macros.asm')
-rw-r--r--constants/event_macros.asm21
1 files changed, 21 insertions, 0 deletions
diff --git a/constants/event_macros.asm b/constants/event_macros.asm
index 9f24ace7..5eb73147 100644
--- a/constants/event_macros.asm
+++ b/constants/event_macros.asm
@@ -125,6 +125,27 @@ CheckAndResetEventA: MACRO
ld [wEventFlags + ((\1) / 8)], a
ENDM
+CheckAndSetEventReuseHL: MACRO
+ IF event_byte != ((\1) / 8)
+event_byte = ((\1) / 8)
+ ld hl, wEventFlags + event_byte
+ ENDC
+
+ bit (\1) % 8, [hl]
+ set (\1) % 8, [hl]
+ ENDM
+
+CheckAndResetEventReuseHL: MACRO
+ IF event_byte != ((\1) / 8)
+event_byte = ((\1) / 8)
+ ld hl, wEventFlags + event_byte
+ ENDC
+
+ bit (\1) % 8, [hl]
+ res (\1) % 8, [hl]
+ ENDM
+
+
;\1 = event index
SetEvent: MACRO
event_byte = ((\1) / 8)