Macro for data of branch spaces (#28)

This commit is contained in:
xCrystal 2023-10-28 20:57:59 +02:00
parent 29f98ccb8c
commit 2d6618f431
2 changed files with 72 additions and 4 deletions

View File

@ -147,6 +147,73 @@ else
endc endc
ENDM ENDM
MACRO branchdir
if !STRCMP("\1", "RIGHT")
DEF _NEXT_SPACE_RIGHT = \2
DEF _TECHNIQUES_RIGHT = \3
elif !STRCMP("\1", "LEFT")
DEF _NEXT_SPACE_LEFT = \2
DEF _TECHNIQUES_LEFT = \3
elif !STRCMP("\1", "UP")
DEF _NEXT_SPACE_UP = \2
DEF _TECHNIQUES_UP = \3
elif !STRCMP("\1", "DOWN")
DEF _NEXT_SPACE_DOWN = \2
DEF _TECHNIQUES_DOWN = \3
endc
ENDM
MACRO endbranch
if DEF(_NEXT_SPACE_RIGHT)
db {_NEXT_SPACE_RIGHT}
PURGE _NEXT_SPACE_RIGHT
else
db -1
endc
if DEF(_NEXT_SPACE_LEFT)
db {_NEXT_SPACE_LEFT}
PURGE _NEXT_SPACE_LEFT
else
db -1
endc
if DEF(_NEXT_SPACE_UP)
db {_NEXT_SPACE_UP}
PURGE _NEXT_SPACE_UP
else
db -1
endc
if DEF(_NEXT_SPACE_DOWN)
db {_NEXT_SPACE_DOWN}
PURGE _NEXT_SPACE_DOWN
else
db -1
endc
if DEF(_TECHNIQUES_RIGHT)
db {_TECHNIQUES_RIGHT}
PURGE _TECHNIQUES_RIGHT
else
db 0
endc
if DEF(_TECHNIQUES_LEFT)
db {_TECHNIQUES_LEFT}
PURGE _TECHNIQUES_LEFT
else
db 0
endc
if DEF(_TECHNIQUES_UP)
db {_TECHNIQUES_UP}
PURGE _TECHNIQUES_UP
else
db 0
endc
if DEF(_TECHNIQUES_DOWN)
db {_TECHNIQUES_DOWN}
PURGE _TECHNIQUES_DOWN
else
db 0
endc
ENDM
MACRO trainer MACRO trainer
;\1: trainer group ;\1: trainer group
;\2: trainer id ;\2: trainer id

View File

@ -19,7 +19,7 @@ DebugLevel5_Map1_MapEvents:
DebugLevel5_Map1_MapSpaces: DebugLevel5_Map1_MapSpaces:
space 2, 4, $0, 1 ; 0 space 2, 4, $0, 1 ; 0
space 4, 4, $0, 2 ; 1 space 4, 4, $0, 2 ; 1
space 6, 4, .BranchDataSpace2 ; 2 space 6, 4, .BS2 ; 2
space 8, 4, $0, 4 ; 3 space 8, 4, $0, 4 ; 3
space 10, 4, $0, 5 ; 4 space 10, 4, $0, 5 ; 4
@ -65,6 +65,7 @@ DebugLevel5_Map1_MapSpaces:
space 16, 2, $0, 43 ; 42 space 16, 2, $0, 43 ; 42
space 16, 4, $0, 8 ; 43 space 16, 4, $0, 8 ; 43
.BranchDataSpace2: .BS2:
db 3, -1, 35, -1 branchdir RIGHT, 3, 0
db 0, 0, 0, 0 branchdir UP, 35, 0
endbranch