Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Start::
- di
- ld sp, $D000
- InitDone::
- call StopLCD
- ld a, $e4
- ld [rBGP], a
- xor a
- ld [rSCX], a
- ld [rSCY], a
- ld hl, Font
- ld de, _VRAM
- ld bc, FontEnd - Font
- call CopyDoubleForwards
- ld hl, Text_HelloWorld
- ld de, $9800+3+(SCRN_VY_B*7)
- ld bc, 13
- call CopyForwards
- call StartLCD
- Finished::
- jr Finished
- Text_HelloWorld::
- db "Hello, world!"
- CopyForwards::
- ;copy bc bytes forward from hl to de
- ld a, b
- or c
- ret z
- ld a, [hli]
- ld [de], a
- inc de
- dec bc
- jr CopyForwards
- CopyDoubleForwards::
- ;copy bc bytes forward from hl to de, twice for each byte
- ld a, b
- or c
- ret z
- ld a, [hli]
- ld [de], a
- inc de
- ld [de], a
- inc de
- dec bc
- jr CopyForwards
- ; CopyBackwards::
- ; ;copy bc bytes backward from hl to de
- ; ld a, b
- ; or c
- ; ret z
- ; ld a, [hld]
- ; ld [de], a
- ; dec de
- ; inc bc
- ; jr CopyBackwards
- StopLCD::
- ld a, [rLCDC]
- rlca
- ret nc
- .wait
- ld a, [rLY]
- cp 145
- jr nz, .wait
- ld a, [rLCDC]
- res 7, a
- ld [rLCDC], a
- ret
- StartLCD::
- ld a, LCDCF_ON|LCDCF_BG8000|LCDCF_BG9800|LCDCF_BGON|LCDCF_OBJ16|LCDCF_OBJOFF
- ld [rLCDC], a
- ret
- Font::
- INCBIN "font.1bpp"
- FontEnd::
- ;*** End Of File ***
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement