This commit is contained in:
Irmen de Jong 2020-09-22 23:22:20 +02:00
parent 6f78a32e64
commit 8c63d7cf5b

View File

@ -12,28 +12,29 @@ main {
ldx #<dirname
ldy #>dirname
jsr c64.SETNAM
lda #$08
sta $BA ; device #8
lda #$60
sta $B9 ; secondary chn
jsr $F3D5 ; open for serial bus devices ; SETLFS + OPEN?
jsr $F219 ; set input device
lda #1
ldx #8
ldy #0
jsr c64.SETLFS
jsr c64.OPEN ; OPEN 1,8,0
ldx #1
jsr c64.CHKIN ; define input channel
ldy #$04
labl1 jsr c64.ACPTR ; input byte on serial bus
labl1 jsr c64.CHRIN ; input byte on serial bus
dey
bne labl1 ; get rid of Y bytes
lda $C6 ; key pressed?
ora $90 ; or EOF?
bne labl2 ; if yes exit
jsr c64.ACPTR ; now get the size of the file
jsr c64.CHRIN ; now get the size of the file
pha
jsr c64.ACPTR
jsr c64.CHRIN
tay
pla
jsr txt.print_uw
lda #32
jsr c64.CHROUT
labl3 jsr c64.ACPTR ; now the filename
labl3 jsr c64.CHRIN ; now the filename
jsr c64.CHROUT ; put a character to screen
cmp #0
bne labl3 ; while not 0 encountered
@ -41,7 +42,8 @@ labl3 jsr c64.ACPTR ; now the filename
jsr c64.CHROUT ; put a CR , end line
ldy #$02 ; set 2 bytes to skip
bne labl1 ; repeat
labl2 jsr $F642 ; close serial bus device
labl2 lda #1
jsr c64.CLOSE ; close serial bus device
jsr c64.CLRCHN ; restore I/O devices to default
rts