2018-01-16 11:30:10 -08:00
|
|
|
LoadPoisonBGPals: ; cbcdd
|
2017-12-15 18:22:26 -08:00
|
|
|
call .LoadPals
|
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
|
|
|
ret nz
|
|
|
|
ret ; ????
|
|
|
|
|
|
|
|
.LoadPals: ; cbce5
|
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
|
|
|
jr nz, .cgb
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTimeOfDayPal]
|
2018-01-16 14:27:50 -08:00
|
|
|
maskbits NUM_DAYTIMES
|
2018-01-11 09:00:01 -08:00
|
|
|
cp DARKNESS_F
|
2017-12-15 18:22:26 -08:00
|
|
|
ld a, %00000000
|
|
|
|
jr z, .convert_pals
|
|
|
|
ld a, %10101010
|
|
|
|
|
|
|
|
.convert_pals
|
|
|
|
call DmgToCgbBGPals
|
|
|
|
ld c, 4
|
|
|
|
call DelayFrames
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall _UpdateTimePals
|
2017-12-15 18:22:26 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.cgb
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wBGPals2)
|
2017-12-15 18:22:26 -08:00
|
|
|
ld [rSVBK], a
|
2018-01-01 06:08:21 -08:00
|
|
|
ld hl, wBGPals2
|
2018-01-01 05:47:16 -08:00
|
|
|
ld c, 4 palettes
|
2017-12-15 18:22:26 -08:00
|
|
|
.loop
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, LOW(palred 28 + palgreen 21 + palblue 31)
|
2017-12-15 18:22:26 -08:00
|
|
|
ld [hli], a
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, HIGH(palred 28 + palgreen 21 + palblue 31)
|
2017-12-15 18:22:26 -08:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .loop
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, $1
|
|
|
|
ld [hCGBPalUpdate], a
|
|
|
|
ld c, 4
|
|
|
|
call DelayFrames
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall _UpdateTimePals
|
2017-12-15 18:22:26 -08:00
|
|
|
ret
|