Reorganize some macros

* tileset data macros go atop their related files, like all the ones in data/
* charmaps are not macros
This commit is contained in:
Remy Oukaour 2018-01-07 13:11:29 -05:00
parent bdd3a55333
commit 6c20ff9e20
8 changed files with 31 additions and 25 deletions

View File

@ -1,3 +1,5 @@
INCLUDE "charmap.asm"
INCLUDE "macros.asm"
INCLUDE "hram.asm"

View File

@ -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"

View File

@ -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 *"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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