shithub: pokecrystal

Download patch

ref: 8d2b9f3fcbe7c0b2d52f0394650dd5c3dcb18b02
parent: fd8804472d6f2244ae8c74bcd5017967c8cb6b7e
author: yenatch <[email protected]>
date: Tue Jun 3 21:18:54 EDT 2014

Remove the FuncCoord macro.

Variables can't use labels, so a macro that doesn't use variables is better suited.

--- a/macros.asm
+++ b/macros.asm
@@ -117,24 +117,16 @@
 B_ EQU 12
 
 
-; It's better to use *coord than FuncCoord.
-FuncCoord: MACRO
-Coord = $c4a0 + 20 * \2 + \1
-	ENDM
-
 bccoord: MACRO
-	FuncCoord \1, \2
-	ld bc, Coord
+	ld bc, TileMap + SCREEN_WIDTH * \2 + \1
 	ENDM
 	
 decoord: MACRO
-	FuncCoord \1, \2
-	ld de, Coord
+	ld de, TileMap + SCREEN_WIDTH * \2 + \1
 	ENDM
 
 hlcoord: MACRO
-	FuncCoord \1, \2
-	ld hl, Coord
+	ld hl, TileMap + SCREEN_WIDTH * \2 + \1
 	ENDM
 
 
--- a/main.asm
+++ b/main.asm
@@ -75181,8 +75181,7 @@
 macro_8c490: MACRO
 	db \1
 	dw \2
-	FuncCoord \3, \4
-	dw Coord
+	dw TileMap + SCREEN_WIDTH * \4 + \3
 ENDM
 
 	macro_8c490 0, Unknown_8c538,  1,  6