shithub: pokecrystal

Download patch

ref: 2d6f644cdff491d574595f50cbf3a72707a241e5
parent: 3e830ab884fbfa31c7ff851d6ada613bd041115d
author: yenatch <[email protected]>
date: Sun Feb 23 23:42:42 EST 2014

Map macros because maps are bananas

--- a/macros.asm
+++ b/macros.asm
@@ -138,3 +138,39 @@
 	db $ff
 	ENDM
 
+
+; maps
+
+map: MACRO
+; This is a really silly hack to get around an rgbds bug.
+
+; Ideally:
+;	db GROUP_\1, MAP_\1
+
+\1\@  EQUS "GROUP_\1"
+\1\@2 EQUS "MAP_\1"
+	db \1\@, \1\@2
+ENDM
+
+roam_map: MACRO
+; A map and an arbitrary number of some more maps.
+
+	map \1
+	db \2
+
+IF \2 > 0
+	map \3
+ENDC
+IF \2 > 1
+	map \4
+ENDC
+IF \2 > 2
+	map \5
+ENDC
+IF \2 > 3
+	map \6
+ENDC
+	db 0
+ENDM
+
+