-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathload_font.asm
47 lines (45 loc) · 1.33 KB
/
load_font.asm
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
LoadFontTilePatterns::
ldh a, [rLCDC]
bit rLCDC_ENABLE, a
jr nz, .on
.off
ld hl, FontGraphics
ld de, vFont
ld bc, FontGraphicsEnd - FontGraphics
ld a, BANK(FontGraphics)
jp FarCopyDataDouble ; if LCD is off, transfer all at once
.on
ld de, FontGraphics
ld hl, vFont
lb bc, BANK(FontGraphics), (FontGraphicsEnd - FontGraphics) / $8
jp CopyVideoDataDouble ; if LCD is on, transfer during V-blank
LoadTextBoxTilePatterns::
ldh a, [rLCDC]
bit rLCDC_ENABLE, a
jr nz, .on
.off
ld hl, TextBoxGraphics
ld de, vChars2 tile $60
ld bc, TextBoxGraphicsEnd - TextBoxGraphics
ld a, BANK(TextBoxGraphics)
jp FarCopyData2 ; if LCD is off, transfer all at once
.on
ld de, TextBoxGraphics
ld hl, vChars2 tile $60
lb bc, BANK(TextBoxGraphics), (TextBoxGraphicsEnd - TextBoxGraphics) / $10
jp CopyVideoData ; if LCD is on, transfer during V-blank
LoadHpBarAndStatusTilePatterns::
ldh a, [rLCDC]
bit rLCDC_ENABLE, a
jr nz, .on
.off
ld hl, HpBarAndStatusGraphics
ld de, vChars2 tile $62
ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics
ld a, BANK(HpBarAndStatusGraphics)
jp FarCopyData2 ; if LCD is off, transfer all at once
.on
ld de, HpBarAndStatusGraphics
ld hl, vChars2 tile $62
lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10
jp CopyVideoData ; if LCD is on, transfer during V-blank