summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemy Oukaour <remy.oukaour@gmail.com>2018-01-07 13:11:29 -0500
committerRemy Oukaour <remy.oukaour@gmail.com>2018-01-07 13:11:29 -0500
commit6c20ff9e200499f7c245653a9e5aa269649c8639 (patch)
treee5da46ba249d6a3e0d438a1345111dd063367500
parentbdd3a55333d0acd1d764327dcebb4a14d9586f05 (diff)
Reorganize some macros
* tileset data macros go atop their related files, like all the ones in data/ * charmaps are not macros
-rw-r--r--charmap.asm (renamed from macros/charmap.asm)0
-rw-r--r--constants.asm2
-rw-r--r--macros.asm4
-rw-r--r--macros/color.asm10
-rwxr-xr-xmacros/tilesets.asm15
-rw-r--r--macros/tmhm.asm (renamed from macros/base_stats.asm)8
-rw-r--r--tilesets/data.asm6
-rw-r--r--tilesets/palette_maps.asm11
8 files changed, 31 insertions, 25 deletions
diff --git a/macros/charmap.asm b/charmap.asm
index fd2d371fd..fd2d371fd 100644
--- a/macros/charmap.asm
+++ b/charmap.asm
diff --git a/constants.asm b/constants.asm
index 7de20dfe2..4e52c9e42 100644
--- a/constants.asm
+++ b/constants.asm
@@ -1,3 +1,5 @@
+INCLUDE "charmap.asm"
+
INCLUDE "macros.asm"
INCLUDE "hram.asm"
diff --git a/macros.asm b/macros.asm
index b6598c933..692178353 100644
--- a/macros.asm
+++ b/macros.asm
@@ -1,13 +1,11 @@
INCLUDE "macros/enum.asm"
-INCLUDE "macros/charmap.asm"
INCLUDE "macros/predef.asm"
INCLUDE "macros/rst.asm"
INCLUDE "macros/data.asm"
INCLUDE "macros/code.asm"
INCLUDE "macros/coords.asm"
INCLUDE "macros/color.asm"
-INCLUDE "macros/base_stats.asm"
-INCLUDE "macros/tilesets.asm"
+INCLUDE "macros/tmhm.asm"
INCLUDE "macros/scripts/audio.asm"
INCLUDE "macros/scripts/maps.asm"
diff --git a/macros/color.asm b/macros/color.asm
index 35d69fe6f..5ebaae218 100644
--- a/macros/color.asm
+++ b/macros/color.asm
@@ -1,15 +1,15 @@
RGB: MACRO
rept _NARG / 3
- dw ((\3) << 10) + ((\2) << 5) + (\1)
+ dw palred (\1) + palgreen (\2) + palblue (\3)
shift
shift
shift
endr
ENDM
+palred EQUS "(1 << 0) *"
+palgreen EQUS "(1 << 5) *"
+palblue EQUS "(1 << 10) *"
+
palettes EQUS "* 8"
palette EQUS "+ 8 *"
-
-palred EQUS "$0001 *"
-palgreen EQUS "$0020 *"
-palblue EQUS "$0400 *"
diff --git a/macros/tilesets.asm b/macros/tilesets.asm
deleted file mode 100755
index 4aeb38dc5..000000000
--- a/macros/tilesets.asm
+++ /dev/null
@@ -1,15 +0,0 @@
-; Used in tilesets/*.asm
-
-tilepal: MACRO
-; vram bank, pals
-x = \1 << OAM_TILE_BANK
-rept (_NARG +- 1) / 2
- dn (x | PAL_BG_\3), (x | PAL_BG_\2)
- shift
- shift
-endr
-ENDM
-
-tilecoll: MACRO
- db COLL_\1, COLL_\2, COLL_\3, COLL_\4
-ENDM
diff --git a/macros/base_stats.asm b/macros/tmhm.asm
index 1a2ce8529..631b07bd9 100644
--- a/macros/base_stats.asm
+++ b/macros/tmhm.asm
@@ -1,11 +1,12 @@
-; Used in data/pokemon/base_stats/*.asm
-
define: MACRO
if !DEF(\1)
\1 EQUS \2
endc
ENDM
+
+; Used in constants/item_constants.asm
+
const_value = 0
add_tm: MACRO
@@ -31,6 +32,9 @@ add_mt: MACRO
enum \1_TMNUM
ENDM
+
+; Used in data/pokemon/base_stats/*.asm
+
; N TMs/HMs need (N+7)/8 bytes for their bit flags.
; The rgbasm integers tms1, tms2, tms3 each hold 3 bytes, or 24 bits.
tmhm: MACRO
diff --git a/tilesets/data.asm b/tilesets/data.asm
index c26b7d3d1..2df9c0949 100644
--- a/tilesets/data.asm
+++ b/tilesets/data.asm
@@ -1,3 +1,9 @@
+tilecoll: MACRO
+; used in tilesets/*_collision.asm
+ db COLL_\1, COLL_\2, COLL_\3, COLL_\4
+ENDM
+
+
SECTION "Tileset Data 1", ROMX
TilesetKantoGFX: ; 0x18000
diff --git a/tilesets/palette_maps.asm b/tilesets/palette_maps.asm
index 55391aeac..c893c767c 100644
--- a/tilesets/palette_maps.asm
+++ b/tilesets/palette_maps.asm
@@ -1,3 +1,14 @@
+tilepal: MACRO
+; vram bank, pals
+x = \1 << OAM_TILE_BANK
+rept (_NARG +- 1) / 2
+ dn (x | PAL_BG_\3), (x | PAL_BG_\2)
+ shift
+ shift
+endr
+ENDM
+
+
TilesetKantoPalMap: ; 0x4c075
INCLUDE "tilesets/kanto_palette_map.asm"
; 0x4c0e5