-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhud.asm
More file actions
69 lines (64 loc) · 1.18 KB
/
Copy pathhud.asm
File metadata and controls
69 lines (64 loc) · 1.18 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
score .EQU 8900H ;Score
level .EQU 8902H ;Score
fruits .EQU 8904H ;Score
printHud:
CALL printScore
CALL printLives
CALL printLevel
CALL printFruit
RET
;Hud elements
printScore:
LD C, $03
LD B, $19
CALL moveCursor
LD HL, scoreHUD
CALL print
LD HL, (score)
CALL HLToDec
RET
printLevel:
LD C, $03
LD B, $1A
CALL moveCursor
LD HL, levelHUD
CALL print
LD HL, (level)
CALL HLToDec
RET
printLives:
LD C, $03
LD B, $1B
CALL moveCursor
LD HL, livesHUD
CALL print
LD A,(pacLives)
DEC A
OR A
JP Z,removeOldLives
LD B,A
printLivesLoop: LD HL, pacman
CALL print
DJNZ printLivesLoop
removeOldLives: LD HL, liveBlanking
CALL print
RET
printFruit:
LD C, $03
LD B, $1C
CALL moveCursor
LD HL, fruitHud
CALL print
LD A,(fruits)
OR A
RET Z
LD B,A
printFruitLoop: LD HL, superFruit
CALL print
DJNZ printFruitLoop
RET
scoreHUD: .BYTE "Score: ",0
levelHUD: .BYTE "Level: ",0
livesHUD: .BYTE "Lives: ",0
fruitHud: .BYTE "Fruit: ",0
liveBlanking .BYTE " ",0