shithub: pokecrystal

Download patch

ref: ffdc3e4c12d32ccee1fdb1e72083238caea78a87
parent: da799c80d4f6f3c1b22687b6177ff09fecf6c324
author: yenatch <[email protected]>
date: Thu Aug 14 19:43:41 EDT 2014

Wrap macro arguments with parentheses.

Arguments are passed in as string literals.

--- a/macros.asm
+++ b/macros.asm
@@ -40,7 +40,7 @@
 	ENDM
 
 dn: MACRO
-	db \1 << 4 + \2
+	db (\1) << 4 + (\2)
 	ENDM
 
 dt: MACRO ; three-byte (big-endian)
@@ -67,7 +67,7 @@
 
 
 lb: MACRO ; r, hi, lo
-	ld \1, \2 << 8 + \3
+	ld \1, (\2) << 8 + (\3)
 	ENDM
 
 
@@ -95,12 +95,12 @@
 	ENDM
 
 RGB: MACRO
-	dw ((\3 << 10) | (\2 << 5) | (\1))
+	dw (((\3) << 10) | ((\2) << 5) | (\1))
 	ENDM
 
 
 note: MACRO
-	db \1 << 4 + (\2 - 1)
+	db (\1) << 4 + ((\2) - 1)
 	ENDM
 
 ; pitch
@@ -192,7 +192,7 @@
 	rept $20
 	; Round up.
 	dw (sin(x) + (sin(x) & $ff)) >> 8
-x = x + \1 * $40000
+x = x + (\1) * $40000
 	endr
 ENDM