pokecrystal/engine/events/poisonstep_pals.asm

48 lines
697 B
NASM
Raw Normal View History

2018-06-24 14:09:41 +00:00
LoadPoisonBGPals:
call .LoadPals
ld a, [hCGB]
and a
ret nz
ret ; ????
2018-06-24 14:09:41 +00:00
.LoadPals:
ld a, [hCGB]
and a
jr nz, .cgb
2018-01-23 22:39:09 +00:00
ld a, [wTimeOfDayPal]
2018-01-16 22:27:50 +00:00
maskbits NUM_DAYTIMES
2018-01-11 17:00:01 +00:00
cp DARKNESS_F
ld a, %00000000
jr z, .convert_pals
ld a, %10101010
.convert_pals
call DmgToCgbBGPals
ld c, 4
call DelayFrames
2017-12-24 17:47:30 +00:00
farcall _UpdateTimePals
ret
.cgb
ld a, [rSVBK]
push af
ld a, BANK(wBGPals2)
ld [rSVBK], a
2018-01-01 14:08:21 +00:00
ld hl, wBGPals2
2018-01-01 13:47:16 +00:00
ld c, 4 palettes
.loop
ld a, LOW(palred 28 + palgreen 21 + palblue 31)
ld [hli], a
ld a, HIGH(palred 28 + palgreen 21 + palblue 31)
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 17:47:30 +00:00
farcall _UpdateTimePals
ret