home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar Extras 3
/
Ex3side3.d64
/
disk.src
< prev
next >
Wrap
Text File
|
2022-08-28
|
7KB
|
652 lines
open =$ffc0
readst =$ffb7
setlfs =$ffba
setnam =$ffbd
load =$ffd5
getin =$ffe4
clrchn =$ffcc
close =$ffc3 ;a
chrin =$ffcf
chkout =$ffc9 ;x
chkin =$ffc6 ;x
plot =$fff0
chrout =$ffd2
color'pointer =243
screen'line'pointer =209
print'number =$bdcd ;x,a
clear'line =59903
background =53281
border =53280
unlisten =$ffae
clall =$ffe7
.org $c000
.obj "@0:disk $c000
jmp read
jmp write;3
jmp print'file;6
jmp wipe'marked;9
jmp mark'file;12
jmp read'mark;15
jmp copy'file'buf1;18
jmp copy'file'buf2;21
jmp stash'buf1;24
jmp stash'buf2;27
jmp change'type;30
jmp report'marked
jmp insert'disjointed
jmp report'type
wipe'marked ldy #0
tya
- sta marked'files,y
sta marked'files+256,y
iny
bne -
rts
mark'file stx 251
sty 252
lda <marked'files
clc
adc 251
sta 253
lda >marked'files
adc 252
sta 254
ldy #0
lda (253),y
eor #128
sta (253),y
rts
read'mark stx 251
sty 252
lda <marked'files
clc
adc 251
sta 253
lda >marked'files
adc 252
sta 254
ldy #0
lda (253),y
sta 780
rts
report'type jsr figure'file
lda file'entry
sta 780
rts
read jsr figure
ldx #2
jsr chkin
ldy #0
- jsr getin
jsr rom'out
sta (253),y
jsr rom'in
iny
bne -
jsr clrchn
jsr rom'out
ldy #0
lda (253),y
sta 781
iny
lda (253),y
sta 782
jsr rom'in
ldx 781
ldy 782
lda 253
sta eof
lda 254
sta eof+1
inc eof+1
rts
write lda $c800
sta next'track
lda $c801
sta next'sector
lda <$c900
sta 253
lda >$c900
sta 254
- jsr clrchn
ldx #15
jsr chkout
lda "b"
jsr chrout
lda "-"
jsr chrout
lda "p"
jsr chrout
lda " "
jsr chrout
lda "2"
jsr chrout
lda " "
jsr chrout
lda "0"
jsr chrout
;lda #2
;jsr close
;lda #1
;ldx <name
;ldy >name
;jsr setnam
;lda #2
;ldx 186
;ldy #2
;jsr setlfs
;jsr open
jsr clrchn
ldx #2
jsr chkout
ldy #0
- jsr rom'out
lda (253),y
jsr rom'in
jsr chrout
iny
bne -
jsr clrchn
ldx #15
jsr chkout
lda "u"
jsr chrout
lda "2"
jsr chrout
lda " "
jsr chrout
lda "2"
jsr chrout
lda " "
jsr chrout
lda "0"
jsr chrout
lda " "
jsr chrout
ldx next'track
lda #0
jsr $bdcd
lda " "
jsr chrout
ldx next'sector
lda #0
jsr $bdcd
jsr clrchn
ldy #0
jsr rom'out
lda (253),y
sta next'track
iny
lda (253),y
sta next'sector
jsr rom'in
inc 254
lda next'track
beq +
jmp --
+ lda #15
jsr close
lda #2
jsr close
jmp clrchn
stx 253
sty 254
ldx #2
jsr chkout
ldy #0
- jsr rom'out
lda (253),y
jsr rom'in
jsr chrout
iny
bne -
jsr clrchn
jmp rom'in
figure sta 252
lda #0
sta 251
lda <$c800
sta 253
lda >$c800
sta 254
lda 251
clc
adc 253
sta 253
lda 252
adc 254
sta 254
rts
figure'file stx 251
sty 252
ldy #4
- asl 251
rol 252
dey
bpl -
lda <$c900
sta 253
lda >$c900
sta 254
lda 251
clc
adc 253
sta 253
lda 252
adc 254
sta 254
jsr rom'out
ldy #31
- lda (253),y
sta file'buffer,y
dey
bpl -
jmp rom'in
print'file jsr figure'file
lda file'entry
jsr print'type
ldx file'entry+1
stx temp+1
lda #0
jsr print'number
jsr printsp
jsr fix'space
print'sec ldx file'entry+2
stx temp+1
lda #0
jsr print'number
jsr printsp
jsr fix'space
lda #34
jsr chrout
ldy #3
- lda file'entry,y
cmp #160
beq +
jsr chrout
iny
cpy #19
bne -
+ lda #34
jsr chrout
rts
rom'out pha
sei
lda #$74
sta 1
pla
rts
rom'in pha
lda #$77
sta 1
cli
pla
rts
print'type sta temp
and #15
sta type
asl
tay
lda types,y
sta 251
lda types+1,y
sta 252
ldy #0
- lda (251),y
jsr chrout
iny
cpy #3
bne -
jsr printsp
lda temp
and #$80
bne +
lda "*"
jmp chrout
+ lda temp
and #$c0
bne printsp
lda "<"
jsr chrout
printsp lda " "
jmp chrout
fix'space lda temp+1
cmp #10
bcs +
jsr printsp
jsr printsp
jmp fix'out
+ cmp #100
bcs fix'out
jsr printsp
fix'out rts
copy'file'buf1 jsr figure'file
ldy #31
- lda file'buffer,y
sta buffer1,y
dey
bpl -
rts
copy'file'buf2 jsr figure'file
ldy #31
- lda file'buffer,y
sta buffer2,y
dey
bpl -
rts
stash'buf1 jsr figure'file
jsr rom'out
ldy #2
- lda buffer1,y
sta (253),y
iny
cpy #32
bne -
jmp rom'in
stash'buf2 jsr figure'file
jsr rom'out
ldy #2
- lda buffer2,y
sta (253),y
iny
cpy #32
bne -
jmp rom'in
change'type stx file
sty file+1
sta ctype
jsr figure'file
; and #$80
;beq +
lda file'entry
and #%11111000
ora ctype
ora #$80
sta file'entry
lda ctype
bne +
sta file'entry
+ ldy #31
- lda file'buffer,y
sta buffer1,y
dey
bpl -
ldx file
ldy file+1
jsr stash'buf1
ldx file
ldy file+1
+ jmp print'file
report'marked ldx <marked'files
ldy >marked'files
stx 781
sty 782
rts
insert'disjointed stx insertion'point
sty insertion'point+1
sta number'of'blocks
ldy #0
sta number'of'files
sty number'of'files+1
asl number'of'files
rol number'of'files+1
asl number'of'files
rol number'of'files+1
asl number'of'files
rol number'of'files+1
outer lda #0
sta current'file
sta current'file+1
outer'loop ldx current'file
ldy current'file+1
jsr read'mark
cmp #0
beq next'outer
jsr cut'current
jsr insert'at'ip
next'outer inc current'file
bne +
inc current'file+1
+ lda current'file+1
cmp number'of'files+1
bcc outer'loop
lda current'file
cmp number'of'files
bcc outer'loop
beq outer'loop
lda #255
sta 787
rts
cut'current ldx current'file
ldy current'file+1
jsr copy'file'buf1
lda current'file
clc
adc #1
sta current'cut
lda current'file+1
adc #0
sta current'cut+1
cut'loop ldx current'cut
ldy current'cut+1
jsr copy'file'buf2
ldx current'cut
ldy current'cut+1
dex
cpx #255
bne +
dey
+ jsr stash'buf2
move'marks'too lda <marked'files-1
clc
adc current'cut
sta 251
lda >marked'files-1
adc current'cut+1
sta 252
ldy #1
lda (251),y
dey
sta (251),y
next'cut inc current'cut
bne +
inc current'cut+1
+ lda current'cut+1
cmp number'of'files+1
bcc cut'loop
lda current'cut
cmp number'of'files
bcc cut'loop
beq cut'loop
lda insertion'point+1
cmp current'file+1
bcc +
lda insertion'point
cmp current'file
bcc +
beq +
lda insertion'point
sec
sbc #1
sta insertion'point
lda insertion'point+1
sbc #0
sta insertion'point+1
+ rts
insert'at'ip lda number'of'files
sec
sbc #1
sta current'insert
lda number'of'files+1
sbc #0
sta current'insert+1
insert'loop ldx current'insert
ldy current'insert+1
jsr copy'file'buf2
ldx current'insert
ldy current'insert+1
inx
bne +
iny
+ jsr stash'buf2
move'marks lda <marked'files
clc
adc current'insert
sta 251
lda >marked'files
adc current'insert+1
sta 252
ldy #0
lda (251),y
iny
sta (251),y
next'insert lda current'insert
sec
sbc #1
sta current'insert
lda current'insert+1
sbc #0
sta current'insert+1
cmp #255
beq +
lda insertion'point+1
cmp current'insert+1
bcc insert'loop
lda insertion'point
cmp current'insert
bcc insert'loop
beq insert'loop
+ ldx insertion'point
ldy insertion'point+1
jsr stash'buf1
inc insertion'point
bne +
inc insertion'point+1
+ lda insertion'point+1
cmp current'file+1
bcc +
lda insertion'point
cmp current'file
bcc +
beq +
lda current'file
sec
sbc #1
sta current'file
lda current'file+1
sbc #0
sta current'file+1
+ rts
current'insert .word 0
current'cut .word 0
number'of'blocks .byte 0
number'of'files .word 0
current'file .word 0
insertion'point .word 0
eof .buf 2
file .buf 2
ctype .byt 0
file'buffer .buf 33
buffer1 .buf 33
buffer2 .buf 33
track .byt 0
sector .byt 0
next'track .byt 0
next'sector .byt 0
name .asc "#"
device .byt 0
file'entry =file'buffer+2
type .byte 0
types .word del,seq,prg,usr,rel,cbm,dir
del .asc "del"
seq .asc "seq"
prg .asc "prg"
usr .asc "usr"
rel .asc "rel"
cbm .asc "cbm"
dir .asc "dir"
temp .byt 0,0,0,0,0
marked'files .buf 512