Skip to content

Commit

Permalink
Let CheckEitherEventSet reuse A like CheckBothEventsSet
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Dec 16, 2024
1 parent 67084c9 commit f92ebdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion macros/scripts/events.asm
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,13 @@ ENDM
; returns the complement of whether either event is set in Z flag
;\1 = event index 1
;\2 = event index 2
;\3 = try to reuse a (optional)
MACRO CheckEitherEventSet
IF ((\1) / 8) == ((\2) / 8)
ld a, [wEventFlags + ((\1) / 8)]
IF (_NARG < 3) || (((\1) / 8) != event_byte)
DEF event_byte = ((\1) / 8)
ld a, [wEventFlags + ((\1) / 8)]
ENDC
and (1 << ((\1) % 8)) | (1 << ((\2) % 8))
ELSE
; This case doesn't happen in the original ROM.
Expand Down
3 changes: 1 addition & 2 deletions scripts/MtMoonB2F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ MtMoonB2FSuperNerdText:
text_asm
CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
jr z, .beat_super_nerd
; CheckEitherEventSetReuseA EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL
and (1 << (EVENT_GOT_DOME_FOSSIL % 8)) | (1 << (EVENT_GOT_HELIX_FOSSIL % 8))
CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL, 1
jr nz, .got_a_fossil
ld hl, MtMoonB2fSuperNerdEachTakeOneText
call PrintText
Expand Down

0 comments on commit f92ebdc

Please sign in to comment.