-
Notifications
You must be signed in to change notification settings - Fork 2
/
DebugMessage.s
38 lines (30 loc) · 1.04 KB
/
DebugMessage.s
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
STRING_DEBUG_ENEMY_INIT_ERROR: db "Enemy is being initialized before its lifecycle ends", 0
;STRING_DEBUG_BIG_ENEMY_INIT_ERROR: db "Big enemy is being initialized before its lifecycle ends", 0
STRING_DEBUG_ENEMY_SHOT_INIT_ERROR: db "Enemy shot is being initialized before its lifecycle ends", 0
; Input:
; HL: pointer to string
DebugMessage:
push hl
; define screen colors
ld a, 15 ; Foreground color
ld (BIOS_FORCLR), a
ld a, 1 ; Background color
ld (BIOS_BAKCLR), a
ld a, 1 ; Border color
ld (BIOS_BDRCLR), a
call BIOS_CHGCLR ; Change Screen Color
call BIOS_INITXT ; initialize screen 0
pop hl
.mainLoop:
call PrintString
.endlessLoop:
jp .endlessLoop
; Input:
; HL: addr of zero-terminated string
PrintString:
ld a, (hl)
or a ; cp 0
ret z
call BIOS_CHPUT
inc hl
jr PrintString