-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreaddata.asm
76 lines (58 loc) · 847 Bytes
/
readdata.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.label SETNAM = $FFBD
.label SETFLS = $FFBA
.label OPEN = $FFC0
.label CHKOUT = $FFC9
.label CHKIN = $FFC6
.label READST = $FFB7
.label CLOSE = $FFC3
.label CLRCHN = $FFCC
.label CHROUT = $FFD2
.label CHRIN = $FFCF
.label spriteaddr = $3000 // block 192
* = $033C
lda #07
ldx #<fname
ldy #>fname
jsr SETNAM
lda #$03
ldx #$08
ldy #$03
jsr SETFLS
jsr OPEN
ldx #$03
jsr CHKIN
lda #<spriteaddr
sta $02
lda #>spriteaddr
sta $03
ldy #$00
topofloop:
tya
pha
jsr CHRIN
tax
pla
tay
txa
sta ($02),Y
iny
cpy #$3F
bne topofloop
// close the file
lda #$03
jsr $FFC3
jsr $FFCC
// turn on sprite #0
lda #$01
sta $D015
// set an x and a y
lda #$64
sta $D000
sta $D001
// set the point to #192 (
lda #$C0
sta $07F8
rts
fname:
// A B C , S , R
.byte 65, 66, 67, 44, 83, 44, 82