summaryrefslogtreecommitdiff
path: root/home/palettes.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/palettes.asm')
-rw-r--r--home/palettes.asm57
1 files changed, 17 insertions, 40 deletions
diff --git a/home/palettes.asm b/home/palettes.asm
index 9f10da118..d5b6abff5 100644
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -1,7 +1,6 @@
; Functions dealing with palettes.
-
-UpdatePalsIfCGB:: ; c2f
+UpdatePalsIfCGB::
; update bgp data from wBGPals2
; update obp data from wOBPals2
; return carry if successful
@@ -11,17 +10,14 @@ UpdatePalsIfCGB:: ; c2f
and a
ret z
-
-UpdateCGBPals:: ; c33
+UpdateCGBPals::
; return carry if successful
; any pals to update?
ld a, [hCGBPalUpdate]
and a
ret z
-
-ForceUpdateCGBPals:: ; c37
-
+ForceUpdateCGBPals::
ld a, [rSVBK]
push af
ld a, BANK(wBGPals2)
@@ -68,10 +64,8 @@ endr
scf
ret
-; c9f
-
-DmgToCgbBGPals:: ; c9f
+DmgToCgbBGPals::
; exists to forego reinserting cgb-converted image data
; input: a -> bgp
@@ -114,10 +108,8 @@ DmgToCgbBGPals:: ; c9f
.end
pop af
ret
-; ccb
-
-DmgToCgbObjPals:: ; ccb
+DmgToCgbObjPals::
; exists to forego reinserting cgb-converted image data
; input: d -> obp1
@@ -160,10 +152,8 @@ DmgToCgbObjPals:: ; ccb
pop de
pop hl
ret
-; cf8
-
-DmgToCgbObjPal0:: ; cf8
+DmgToCgbObjPal0::
ld [rOBP0], a
push af
@@ -200,9 +190,8 @@ DmgToCgbObjPal0:: ; cf8
.dmg
pop af
ret
-; d24
-DmgToCgbObjPal1:: ; d24
+DmgToCgbObjPal1::
ld [rOBP1], a
push af
@@ -238,11 +227,8 @@ DmgToCgbObjPal1:: ; d24
.dmg
pop af
ret
-; d50
-
-
-CopyPals:: ; d50
+CopyPals::
; copy c palettes in order b from de to hl
push bc
@@ -253,7 +239,7 @@ CopyPals:: ; d50
; 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 +257,9 @@ CopyPals:: ; d50
ld [hl], d
inc hl
; next pal color
+rept PAL_COLOR_SIZE
srl b
- srl b
+endr
; source
pop de
; done pal?
@@ -280,7 +267,7 @@ CopyPals:: ; d50
jr nz, .loop
; de += 8 (next pal)
- ld a, NUM_PAL_COLORS * 2
+ ld a, PALETTE_SIZE
add e
jr nc, .ok
inc d
@@ -292,10 +279,8 @@ CopyPals:: ; d50
dec c
jr nz, CopyPals
ret
-; d79
-
-ClearVBank1:: ; d79
+ClearVBank1::
ld a, [hCGB]
and a
ret z
@@ -311,15 +296,11 @@ ClearVBank1:: ; d79
ld a, 0
ld [rVBK], a
ret
-; d90
-
-ret_d90:: ; d90
+ret_d90::
ret
-; d91
-
-ReloadSpritesNoPalettes:: ; d91
+ReloadSpritesNoPalettes::
ld a, [hCGB]
and a
ret z
@@ -337,15 +318,11 @@ ReloadSpritesNoPalettes:: ; d91
ld [hCGBPalUpdate], a
call DelayFrame
ret
-; db1
-
-FarCallSwapTextboxPalettes:: ; db1
+FarCallSwapTextboxPalettes::
homecall SwapTextboxPalettes
ret
-; dbd
-FarCallScrollBGMapPalettes:: ; dbd
+FarCallScrollBGMapPalettes::
homecall ScrollBGMapPalettes
ret
-; dc9