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
|
INCLUDE "constants.asm"
SECTION "home/tilemap.asm", ROM0
Function360b::
call ClearSprites
ld hl, wVramState
set 0, [hl]
call Function3657
call LoadFontExtra
call GetMemSGBLayout
jr WaitBGMap
ClearBGPalettes::
call ClearPalettes
WaitBGMap::
; Tell VBlank to update BG Map
ld a, $1
ldh [hBGMapMode], a
; Wait for it to do its magic
ld c, 3
call DelayFrames
ret
SetPalettes::
ld a, %11100100
ldh [rBGP], a
ld a, %11010000
ldh [rOBP0], a
ret
ClearPalettes::
xor a
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
ret
GetMemSGBLayout::
ld b, SGB_RAM
GetSGBLayout::
ld a, [wSGB]
and a
ret z
predef_jump LoadSGBLayout
SetHPPal::
ld a, e
cp 27 ; 56.25%
ld d, $0
jr nc, .done
cp 10 ; 20.83%
inc d
jr nc, .done
inc d
.done:
ld [hl], d
ret
Function3657::
call DisableLCD
callab Function140d9
call LoadFont
call UpdateSprites
call EnableLCD
ret
|