mirror of https://github.com/pret/pokecrystal.git
Wrap macro arguments with parentheses.
Arguments are passed in as string literals.
This commit is contained in:
parent
da799c80d4
commit
ffdc3e4c12
10
macros.asm
10
macros.asm
|
@ -40,7 +40,7 @@ dbbw: MACRO
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
dn: MACRO
|
dn: MACRO
|
||||||
db \1 << 4 + \2
|
db (\1) << 4 + (\2)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
dt: MACRO ; three-byte (big-endian)
|
dt: MACRO ; three-byte (big-endian)
|
||||||
|
@ -67,7 +67,7 @@ callba: MACRO ; bank, address
|
||||||
|
|
||||||
|
|
||||||
lb: MACRO ; r, hi, lo
|
lb: MACRO ; r, hi, lo
|
||||||
ld \1, \2 << 8 + \3
|
ld \1, (\2) << 8 + (\3)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,12 +95,12 @@ TX_FAR: MACRO
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
RGB: MACRO
|
RGB: MACRO
|
||||||
dw ((\3 << 10) | (\2 << 5) | (\1))
|
dw (((\3) << 10) | ((\2) << 5) | (\1))
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
note: MACRO
|
note: MACRO
|
||||||
db \1 << 4 + (\2 - 1)
|
db (\1) << 4 + ((\2) - 1)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
; pitch
|
; pitch
|
||||||
|
@ -192,7 +192,7 @@ x = 0
|
||||||
rept $20
|
rept $20
|
||||||
; Round up.
|
; Round up.
|
||||||
dw (sin(x) + (sin(x) & $ff)) >> 8
|
dw (sin(x) + (sin(x) & $ff)) >> 8
|
||||||
x = x + \1 * $40000
|
x = x + (\1) * $40000
|
||||||
endr
|
endr
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue