Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/home/load_font.asm
1270 views
1
LoadFontTilePatterns::
2
ldh a, [rLCDC]
3
bit B_LCDC_ENABLE, a
4
jr nz, .on
5
.off
6
ld hl, FontGraphics
7
ld de, vFont
8
ld bc, FontGraphicsEnd - FontGraphics
9
ld a, BANK(FontGraphics)
10
jp FarCopyDataDouble ; if LCD is off, transfer all at once
11
.on
12
ld de, FontGraphics
13
ld hl, vFont
14
lb bc, BANK(FontGraphics), (FontGraphicsEnd - FontGraphics) / $8
15
jp CopyVideoDataDouble ; if LCD is on, transfer during V-blank
16
17
LoadTextBoxTilePatterns::
18
ldh a, [rLCDC]
19
bit B_LCDC_ENABLE, a
20
jr nz, .on
21
.off
22
ld hl, TextBoxGraphics
23
ld de, vChars2 tile $60
24
ld bc, TextBoxGraphicsEnd - TextBoxGraphics
25
ld a, BANK(TextBoxGraphics)
26
jp FarCopyData2 ; if LCD is off, transfer all at once
27
.on
28
ld de, TextBoxGraphics
29
ld hl, vChars2 tile $60
30
lb bc, BANK(TextBoxGraphics), (TextBoxGraphicsEnd - TextBoxGraphics) / $10
31
jp CopyVideoData ; if LCD is on, transfer during V-blank
32
33
LoadHpBarAndStatusTilePatterns::
34
ldh a, [rLCDC]
35
bit B_LCDC_ENABLE, a
36
jr nz, .on
37
.off
38
ld hl, HpBarAndStatusGraphics
39
ld de, vChars2 tile $62
40
ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics
41
ld a, BANK(HpBarAndStatusGraphics)
42
jp FarCopyData2 ; if LCD is off, transfer all at once
43
.on
44
ld de, HpBarAndStatusGraphics
45
ld hl, vChars2 tile $62
46
lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10
47
jp CopyVideoData ; if LCD is on, transfer during V-blank
48
49