-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlibScoringSystem.asm
49 lines (38 loc) · 1.21 KB
/
libScoringSystem.asm
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
;===============================================================================
; Macros/Subroutines
defm LIBSCORING_ADDSCORE_AA ; /1 = Address of Score to Add (0-255)
; /2 = Address of the score
sed ; set decimal mode
clc
lda /1 ; x points scored
adc /2 ; ones and tens
sta /2
lda /2+1 ; hundreds and thousands
adc #00
sta /2+1
lda /2+2 ; ten-thousands and hundred-thousands
adc #00
sta /2+2
cld
endm
defm LIBSCORING_DISPLAYSCORESET_AA ; /1 = Score Address Location
; /2 = Screen Position Address
lda /1
and #$f0 ; hundred-thousands
lsr
lsr
lsr
lsr
ora #$30 ; -->ascii
sta /2 ; print on screen
lda /1
and #$0f ; ten-thousands
ora #$30 ; -->ascii
sta /2+1 ; print on next screen position
endm
defm LIBSCORING_DISPLAYSCORE_AA ; /1 = Score Address Location
; /2 = Screen Position Address
LIBSCORING_DISPLAYSCORESET_AA /1+2, /2
LIBSCORING_DISPLAYSCORESET_AA /1+1, /2+2
LIBSCORING_DISPLAYSCORESET_AA /1, /2+4
endm