ref: ee32ff009d7f52df463d471ef0cbb5a4a7a48388
parent: 76c0308b5a176509c481724b8ac58f265b7db323
author: Sawakita <sawakitanoodles@gmail.com>
date: Tue Jan 3 19:25:21 EST 2012
Add macro for 'Event Displacement' and 'Fly-Warp' formula. hg-commit-id: 70445835998b
--- a/constants.asm
+++ b/constants.asm
@@ -6,6 +6,20 @@
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