-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcia.asm
More file actions
73 lines (60 loc) · 1.34 KB
/
cia.asm
File metadata and controls
73 lines (60 loc) · 1.34 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
70
71
72
73
#importonce
.segmentdef Cia [start=$1c01]
.segment Cia
c128lib_BasicUpstart128($1c10)
* = $1c10 "Entry"
Entry: {
// Clean screen
jsr c128lib.Kernal.CINT
// Set cursor on (0, 5)
clc
ldx #5
ldy #0
jsr c128lib.Kernal.PLOT
// Print string at current cursor position
ldx #0
!:
lda Joy1, x
jsr c128lib.Kernal.BSOUT
inx
cpx #Joy1Length
bne !-
// Set cursor on (0, 6)
clc
ldx #6
ldy #0
jsr c128lib.Kernal.PLOT
// Print string at current cursor position
ldx #0
!:
lda Joy2, x
jsr c128lib.Kernal.BSOUT
inx
cpx #Joy2Length
bne !-
Loop:
c128lib_GetFirePressedPort1()
ConvertAccumulatorInZeroOrOneChar()
sta $400 + c128lib_getTextOffset(27, 5)
c128lib_GetFirePressedPort2()
ConvertAccumulatorInZeroOrOneChar()
sta $400 + c128lib_getTextOffset(27, 6)
jmp Loop
}
Joy1: .text "JOYSTICK 1 (0 IS PRESSED): "
.label Joy1Length = $1B;
Joy2: .text "JOYSTICK 2 (0 IS PRESSED): "
.label Joy2Length = $1B;
.macro ConvertAccumulatorInZeroOrOneChar() {
clc
beq !Zero+
adc #33
jmp !Print+
!Zero:
adc #48
!Print:
}
#import "./common/lib/common-global.asm"
#import "./common/lib/kernal.asm"
#import "./chipset/lib/cia-global.asm"
#import "./chipset/lib/vic2-global.asm"