pokecrystal-board/home/fade.asm

65 lines
1.4 KiB
NASM
Raw Normal View History

2013-08-29 15:50:59 -07:00
; Functions to fade the screen in and out.
2018-06-24 07:09:41 -07:00
RotateFourPalettesRight::
2013-08-29 15:50:59 -07:00
ld hl, IncGradGBPalTable_00
ld b, 4
2015-11-20 08:47:52 -08:00
jr RotatePalettesRight
2013-08-29 15:50:59 -07:00
2018-06-24 07:09:41 -07:00
RotateThreePalettesRight::
2013-08-29 15:50:59 -07:00
ld hl, IncGradGBPalTable_05
ld b, 3
2018-06-24 07:09:41 -07:00
RotatePalettesRight::
2015-11-20 08:47:52 -08:00
; Rotate palettes to the right and fill with loaded colors from the left
; If we're already at the leftmost color, fill with the leftmost color
2013-08-29 15:50:59 -07:00
push de
ld a, [hli]
call DmgToCgbBGPals
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
call DmgToCgbObjPals
ld c, 8
call DelayFrames
pop de
dec b
2015-11-20 08:47:52 -08:00
jr nz, RotatePalettesRight
2013-08-29 15:50:59 -07:00
ret
2018-06-24 07:09:41 -07:00
RotateFourPalettesLeft::
2013-08-29 15:50:59 -07:00
ld hl, IncGradGBPalTable_04 - 1
ld b, 4
2015-11-20 08:47:52 -08:00
jr RotatePalettesLeft
2013-08-29 15:50:59 -07:00
2018-06-24 07:09:41 -07:00
RotateThreePalettesLeft::
2013-08-29 15:50:59 -07:00
ld hl, IncGradGBPalTable_07 - 1
ld b, 3
2018-06-24 07:09:41 -07:00
RotatePalettesLeft::
2015-11-20 08:47:52 -08:00
; Rotate palettes to the left and fill with loaded colors from the right
; If we're already at the rightmost color, fill with the rightmost color
2013-08-29 15:50:59 -07:00
push de
ld a, [hld]
ld d, a
ld a, [hld]
ld e, a
call DmgToCgbObjPals
ld a, [hld]
call DmgToCgbBGPals
ld c, 8
call DelayFrames
pop de
dec b
2015-11-20 08:47:52 -08:00
jr nz, RotatePalettesLeft
2013-08-29 15:50:59 -07:00
ret
IncGradGBPalTable_00:: dc 3,3,3,3, 3,3,3,3, 3,3,3,3
IncGradGBPalTable_01:: dc 3,3,3,2, 3,3,3,2, 3,3,3,2
IncGradGBPalTable_02:: dc 3,3,2,1, 3,3,2,1, 3,3,2,1
IncGradGBPalTable_03:: dc 3,2,1,0, 3,2,1,0, 3,2,1,0
2015-11-20 08:47:52 -08:00
IncGradGBPalTable_04:: dc 3,2,1,0, 3,2,1,0, 3,2,1,0
IncGradGBPalTable_05:: dc 2,1,0,0, 2,1,0,0, 2,1,0,0
IncGradGBPalTable_06:: dc 1,0,0,0, 1,0,0,0, 1,0,0,0
2015-11-20 08:47:52 -08:00
IncGradGBPalTable_07:: dc 0,0,0,0, 0,0,0,0, 0,0,0,0