ref: 14ef9d3066ddf48f392b8afb698d85f0a7583f6f
parent: a73c532738d055bb3d28a46b59f7fc87d2c998d4
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Mon Jan 22 14:57:35 EST 2018
PALETTE_SIZE
--- a/constants/gfx_constants.asm
+++ b/constants/gfx_constants.asm
@@ -4,6 +4,7 @@
NUM_PAL_COLORS EQU 4
PAL_COLOR_SIZE EQU 2
+PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE
PALRGB_WHITE EQUS "palred 31 + palgreen 31 + palblue 31" ; $7fff
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -497,7 +497,7 @@
push af
ld a, BANK(wOBPals1)
ld [rSVBK], a
- ld c, $8
+ ld c, PALETTE_SIZE
.loop
ld a, [hli]
ld [de], a
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -280,7 +280,7 @@
jr nz, .loop
; de += 8 (next pal)
- ld a, NUM_PAL_COLORS * PAL_COLOR_SIZE
+ ld a, PALETTE_SIZE
add e
jr nc, .ok
inc d
--- a/macros/gfx.asm
+++ b/macros/gfx.asm
@@ -11,9 +11,9 @@
palgreen EQUS "(1 << 5) *"
palblue EQUS "(1 << 10) *"
-palettes EQUS "* 8"
-palette EQUS "+ 8 *"
-color EQUS "+ 2 *"
+palettes EQUS "* PALETTE_SIZE"
+palette EQUS "+ PALETTE_SIZE *"
+color EQUS "+ PAL_COLOR_SIZE *"
tiles EQUS "* LEN_2BPP_TILE"
tile EQUS "+ LEN_2BPP_TILE *"