shithub: pokecrystal

Download patch

ref: 4d93741a54172754aa7ac4d0162343bc0121849d
parent: ea480fa31e57dd2880de82f2bdc2116cbb4d205c
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Fri Jan 26 16:25:49 EST 2018

use PAL_COLOR_SIZE

--- a/engine/color.asm
+++ b/engine/color.asm
@@ -497,7 +497,7 @@
 	push af
 	ld a, BANK(wOBPals1)
 	ld [rSVBK], a
-	ld c, PALETTE_SIZE
+	ld c, 1 palettes
 .loop
 	ld a, [hli]
 	ld [de], a
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -253,7 +253,7 @@
 
 ; get pal color
 	ld a, b
-	and %11 ; color
+	maskbits 1 << PAL_COLOR_SIZE
 ; 2 bytes per color
 	add a
 	ld l, a
@@ -271,8 +271,9 @@
 	ld [hl], d
 	inc hl
 ; next pal color
+rept PAL_COLOR_SIZE
 	srl b
-	srl b
+endr
 ; source
 	pop de
 ; done pal?