aboutsummaryrefslogtreecommitdiffstats
path: root/home/cgb_palettes.asm
blob: 86d28ece390a11e5c1d29bd487db2cfabe04d637 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
UpdateCGBPal_BGP::
	push af
	ldh a, [hOnCGB]
	and a
	jr z, .notCGB
	push bc
	push de
	push hl
	ldh a, [rBGP]
	ld b, a
	ld a, [wLastBGP]
	cp b
	jr z, .noChangeInBGP
	farcall _UpdateCGBPal_BGP
.noChangeInBGP
	pop hl
	pop de
	pop bc
.notCGB
	pop af
	ret

UpdateCGBPal_OBP0::
	push af
	ldh a, [hOnCGB]
	and a
	jr z, .notCGB
	push bc
	push de
	push hl
	ldh a, [rOBP0]
	ld b, a
	ld a, [wLastOBP0]
	cp b
	jr z, .noChangeInOBP0
	ld b, BANK(_UpdateCGBPal_OBP)
	ld hl, _UpdateCGBPal_OBP
	ld c, CONVERT_OBP0
	call Bankswitch
.noChangeInOBP0
	pop hl
	pop de
	pop bc
.notCGB
	pop af
	ret

UpdateCGBPal_OBP1::
	push af
	ldh a, [hOnCGB]
	and a
	jr z, .notCGB
	push bc
	push de
	push hl
	ldh a, [rOBP1]
	ld b, a
	ld a, [wLastOBP1]
	cp b
	jr z, .noChangeInOBP1
	ld b, BANK(_UpdateCGBPal_OBP)
	ld hl, _UpdateCGBPal_OBP
	ld c, CONVERT_OBP1
	call Bankswitch
.noChangeInOBP1
	pop hl
	pop de
	pop bc
.notCGB
	pop af
	ret

Func_3082::
	ldh a, [hLoadedROMBank]
	push af
	call FadeOutAudio
	ld a, BANK(Music_DoLowHealthAlarm)
	call BankswitchCommon
	call Music_DoLowHealthAlarm
	ld a, BANK(Audio1_UpdateMusic)
	call BankswitchCommon
	call Audio1_UpdateMusic
	pop af
	call BankswitchCommon
	ret