-
-
Save ddevault/826a15520391e338291c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.nolist | |
#include "kernel.inc" ; Kernel routines like loadLibrary | |
#include "macros.inc" | |
#include "keys.inc" ; Key codes | |
#include "libtext.inc" ; For drawing text | |
#include "applib.inc" ; For drawing UI | |
.list | |
; Header | |
.db %00000010 | |
.db 50 ; Stack size | |
; Program | |
.org 0 | |
; Get hardware locks | |
call getLcdLock | |
call getKeypadLock | |
; Load dependencies | |
kld de, libtextPath | |
call loadLibrary | |
kld de, applibPath | |
call loadLibrary | |
; Draw window | |
xor a ; Window flags (defaults) | |
kld hl, windowTitle | |
applib(drawWindow) | |
; Draw text | |
ld de, $0208 ; D = X, E = Y | |
kld hl, helloWorld | |
libtext(drawString) | |
; Loop until Clear is pressed | |
loop: | |
applib(appGetKey) ; Same as getKey, but watches for UI hotkeys | |
cp kClear | |
ret z | |
jr loop | |
helloWorld: | |
.db "Hello, world!", 0 | |
windowTitle: | |
.db "Hello World", 0 | |
libtextPath: | |
.db "/lib/libtext", 0 | |
applibPath: | |
.db "/lib/applib", 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment