summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSawakita <sawakitanoodles@gmail.com>2012-01-04 00:25:21 +0100
committerSawakita <sawakitanoodles@gmail.com>2012-01-04 00:25:21 +0100
commitee32ff009d7f52df463d471ef0cbb5a4a7a48388 (patch)
tree198634f3a23165f4462f2a2c77af97f5c96728d2
parent76c0308b5a176509c481724b8ac58f265b7db323 (diff)
Add macro for 'Event Displacement' and 'Fly-Warp' formula.
hg-commit-id: 70445835998b
-rw-r--r--constants.asm14
1 files changed, 14 insertions, 0 deletions
diff --git a/constants.asm b/constants.asm
index 1dd556cb..8e2abd2f 100644
--- a/constants.asm
+++ b/constants.asm
@@ -6,6 +6,20 @@ FuncCoord: MACRO
Coord = $C3A0 + 20 * \2 + \1
ENDM
+;\1 = Map Width
+;\2 = Rows above (Y-blocks)
+;\3 = X movement (X-blocks)
+EVENT_DISP: MACRO
+ dw ($C6EF + (\1) + ((\1) + 6) * ((\2) >> 1) + ((\3) >> 1)) ; Ev.Disp
+ db \2,\3 ;Y,X
+ ENDM
+
+FLYWARP_DATA: MACRO
+ EVENT_DISP \1,\2,\3
+ db ((\2) & $01) ;sub-block Y
+ db ((\3) & $01) ;sub-block X
+ ENDM
+
; external map entry macro
EMAP: MACRO ; emap x-coordinate,y-coordinate,textpointer
; the appearance of towns and routes in the town map, indexed by map id