summaryrefslogtreecommitdiff
path: root/home/load_font.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2020-11-04 00:06:44 -0600
committerdannye <33dannye@gmail.com>2020-11-04 00:06:44 -0600
commit5647ca687b92954dcf37a6ea6bfbc9a341c32de4 (patch)
treedde1937a1bfdb3a835f4155e1c2eb8f1aaf86f63 /home/load_font.asm
parent53fcd05aa24693093d8af1dc8ec4fedd3957decc (diff)
Sync with pokered
Diffstat (limited to 'home/load_font.asm')
-rw-r--r--home/load_font.asm47
1 files changed, 47 insertions, 0 deletions
diff --git a/home/load_font.asm b/home/load_font.asm
new file mode 100644
index 00000000..8ed0f0a7
--- /dev/null
+++ b/home/load_font.asm
@@ -0,0 +1,47 @@
+LoadFontTilePatterns::
+ ldh a, [rLCDC]
+ bit 7, a ; is the LCD enabled?
+ 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 7, a ; is the LCD enabled?
+ jr nz, .on
+.off
+ ld hl, TextBoxGraphics
+ ld de, vChars2 tile $60
+ ld bc, TextBoxGraphicsEnd - TextBoxGraphics
+ ld a, BANK(TextBoxGraphics)
+ jp FarCopyData ; 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 7, a ; is the LCD enabled?
+ jr nz, .on
+.off
+ ld hl, HpBarAndStatusGraphics
+ ld de, vChars2 tile $62
+ ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics
+ ld a, BANK(HpBarAndStatusGraphics)
+ jp FarCopyData ; 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