mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-16 10:23:34 +12:00

Pushing everything I've done, currently doesn't build because the Galarian Birds filesize is too thicc for the section but I need to push this before I go mad
57 lines
1.7 KiB
NASM
57 lines
1.7 KiB
NASM
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 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 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)
|
|
call FarCopyData ; if LCD is off, transfer all at once
|
|
ld hl, EXPBarGraphics
|
|
ld de, vChars1 tile $40
|
|
ld bc, EXPBarGraphicsEnd - EXPBarGraphics
|
|
ld a, BANK(EXPBarGraphics)
|
|
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
|
|
call CopyVideoData ; if LCD is on, transfer during V-blank
|
|
ld hl, EXPBarGraphics
|
|
ld de, vChars1 tile $40
|
|
lb bc, BANK(EXPBarGraphics), (EXPBarGraphicsEnd - EXPBarGraphics) / $10
|
|
jp CopyVideoData ; if LCD is on, transfer during V-blank
|