Sync compare macros, some event_scripts.s doc, begin map_scripts constants
This commit is contained in:
@@ -1641,11 +1641,11 @@ _0806D570:
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _0806D5A4
|
||||
ldr r0, _0806D5A0 @ =EventScript_1A6AC8
|
||||
ldr r0, _0806D5A0 @ =EventScript_UseSurf
|
||||
b _0806D5E2
|
||||
.align 2, 0
|
||||
_0806D59C: .4byte 0x00000824
|
||||
_0806D5A0: .4byte EventScript_1A6AC8
|
||||
_0806D5A0: .4byte EventScript_UseSurf
|
||||
_0806D5A4:
|
||||
adds r0, r4, 0
|
||||
bl MetatileBehavior_IsWaterfall
|
||||
|
||||
@@ -234,14 +234,12 @@
|
||||
.endm
|
||||
|
||||
@ Generic compare macro which attempts to deduce argument types based on their values
|
||||
@ Any values between 0x4000 to 0x4FFF and 0x8000 to 0x8FFF are considered event variable identifiers
|
||||
.macro compare arg1, arg2
|
||||
.if ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && ((\arg2 >> 12) == 4 || (\arg2 >> 12) == 8)
|
||||
compare_var_to_var \arg1, \arg2
|
||||
.elseif ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && (\arg2 >= 0 && \arg2 <= 0xFFFF)
|
||||
compare_var_to_value \arg1, \arg2
|
||||
@ Any values between 0x4000 to 0x40FF and 0x8000 to 0x8014 are considered event variable identifiers
|
||||
.macro compare var:req, arg:req
|
||||
.if ((\arg >= VARS_START && \arg <= VARS_END) || (\arg >= SPECIAL_VARS_START && \arg <= SPECIAL_VARS_END))
|
||||
compare_var_to_var \var, \arg
|
||||
.else
|
||||
.error "Invalid arguments for 'compare'"
|
||||
compare_var_to_value \var, \arg
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@@ -1424,7 +1422,7 @@
|
||||
.endm
|
||||
|
||||
.macro case condition, dest
|
||||
compare_var_to_value 0x8000, \condition
|
||||
compare_var_to_value VAR_0x8000, \condition
|
||||
goto_if_eq \dest
|
||||
.endm
|
||||
|
||||
@@ -1461,5 +1459,5 @@
|
||||
|
||||
.macro set_gym_trainers gym:req
|
||||
setvar VAR_0x8008, \gym
|
||||
call EventScript_1A6B18
|
||||
call EventScript_SetGymTrainers
|
||||
.endm
|
||||
|
||||
Reference in New Issue
Block a user