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