shithub: pokecrystal

Download patch

ref: 47379235f875a3bd07b969ea554b82052191daf9
parent: a63d9dfd4f4b214034c9a88a14b53635c10914d9
author: yenatch <yenatch@gmail.com>
date: Sun May 6 17:35:55 EDT 2018

fix lb/ln and "left shift of negative value" warning

fixes #511

--- a/macros/code.asm
+++ b/macros/code.asm
@@ -1,11 +1,11 @@
 ; Syntactic sugar macros
 
 lb: MACRO ; r, hi, lo
-	ld \1, (\2 & $ff) << 8 + (\3 & $ff)
+	ld \1, (((\2) & $ff) << 8) | (((\3) & $ff))
 ENDM
 
 ln: MACRO ; r, hi, lo
-	ld \1, (\2 & $f) << 4 + (\3 & $f)
+	ld \1, (((\2) & $f) << 4) | (((\3) & $f))
 ENDM
 
 ldpixel: MACRO