Skip to content

Commit 8ac8ad6

Browse files
committed
Fix palette constant and a few comments
1 parent 263da90 commit 8ac8ad6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/home/palettes.asm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ FlushPalettesIfRequested::
7979

8080
FlushAllCGBPalettes::
8181
; flush 8 BGP palettes
82-
xor a
82+
xor a ; start with BGP0 (wBackgroundPalettesCGB)
8383
ld b, 8 palettes
8484
call CopyCGBPalettes
8585
; flush 8 OBP palettes
86-
ld a, PAL_SIZE
86+
ld a, NUM_BACKGROUND_PALETTES ; skip all background palettes and start with OBP0 (wObjectPalettesCGB)
8787
ld b, 8 palettes
8888
call CopyCGBPalettes
8989
jr FlushPalettesIfRequested.done
9090

9191
; copy b bytes of CGB palette data starting at
9292
; (wBackgroundPalettesCGB + a palettes) into rBGPD or rOBPD.
9393
CopyCGBPalettes::
94-
add a
95-
add a
96-
add a
94+
add a ; *2
95+
add a ; *4
96+
add a ; *8 (PAL_SIZE)
9797
ld e, a
9898
ld d, $0
9999
ld hl, wBackgroundPalettesCGB

0 commit comments

Comments
 (0)