2019-10-16 06:09:13 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
2022-04-27 19:24:41 +00:00
|
|
|
|
*--------------------------------------
|
2023-06-10 10:16:06 +00:00
|
|
|
|
VolListPtr .EQ $65
|
|
|
|
|
*
|
|
|
|
|
SelectedIndex .EQ $67 name counter
|
|
|
|
|
filecount .EQ $68 # of displayable files in directory
|
|
|
|
|
FilenameLen .EQ $69 length of filename
|
|
|
|
|
|
|
|
|
|
bInSubDir .EQ $6B directory level
|
|
|
|
|
FilenamePtr .EQ $6C filename storage pointer (16 bit)
|
|
|
|
|
*
|
|
|
|
|
DirEntLen .EQ $6E directory entry length
|
|
|
|
|
DirEntPerBlk .EQ $6F directory entries/block
|
|
|
|
|
FileCntInDir .EQ $70 directory file count (16 bit)
|
|
|
|
|
*
|
|
|
|
|
blkfl .EQ $72 block flag / file counter
|
|
|
|
|
ScrollIndex .EQ $73 index # of top name in display
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.FileBuf .EQ $1800 1k
|
|
|
|
|
SEL1.DirEntry .EQ $1C00 512b
|
|
|
|
|
SEL1.filetypes .EQ $1F00
|
|
|
|
|
SEL1.Filenames .EQ $2000
|
2019-10-16 06:09:13 +00:00
|
|
|
|
*--------------------------------------
|
2022-04-27 19:24:41 +00:00
|
|
|
|
SEL1.START cld
|
|
|
|
|
bit RROMBNK2 read ROM
|
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
* stz softev
|
|
|
|
|
* lda #$10 set reset vector to 'dispadr'
|
|
|
|
|
* sta softev+1
|
|
|
|
|
* jsr setpwrc create power-up byte
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$A0
|
|
|
|
|
jsr $C300 initialize 80 column text card
|
|
|
|
|
|
|
|
|
|
* set up memory bitmap in global page
|
|
|
|
|
|
2022-04-27 19:24:41 +00:00
|
|
|
|
ldx #0
|
|
|
|
|
jsr GP.TOOLBOX reset MEMTABL
|
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$02
|
2023-06-10 10:16:06 +00:00
|
|
|
|
sta SEL1.SetMarkP init set mark parms pcount.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
*--------------------------------------
|
2023-06-10 10:16:06 +00:00
|
|
|
|
ldx DEVCNT
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
|
|
|
|
.1 lda DEVLST,x
|
|
|
|
|
and #$F0
|
|
|
|
|
cmp DEVNUM
|
2023-06-10 10:16:06 +00:00
|
|
|
|
beq SEL1.GetVol
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bra .1
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.NextVol ldx VolListPtr get device list pointer.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
bne .1
|
2019-10-16 06:09:13 +00:00
|
|
|
|
|
2019-11-09 12:19:41 +00:00
|
|
|
|
ldx DEVCNT get device count.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
inx
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
|
|
|
|
.1 dex
|
|
|
|
|
lda DEVLST,x get unit number from list.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.GetVol stx VolListPtr
|
|
|
|
|
sta SEL1.OnLineP+1 store unit number for online.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
jsr MLI
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.DA #MLIONLINE
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.DA SEL1.OnLineP
|
2022-04-27 19:24:41 +00:00
|
|
|
|
bcs SEL1.NextVol error check.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
stz bInSubDir haven't read root directory yet.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda pbuf+1 load description byte.
|
|
|
|
|
and #$0F mask for name length.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
beq SEL1.NextVol if 0, then try next unit.
|
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
* clc
|
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
adc #$02 add 2 to length.
|
|
|
|
|
tax name length in x.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.OpenDir stx pbuf save the name length
|
|
|
|
|
lda #'/'
|
2019-10-16 06:09:13 +00:00
|
|
|
|
sta pbuf+1 slash before and
|
|
|
|
|
sta pbuf,x after name.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
stz pbuf+1,x now "/VOLNAME/0
|
2019-10-16 06:09:13 +00:00
|
|
|
|
|
2022-04-27 19:24:41 +00:00
|
|
|
|
jsr MLI
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.DA #MLIOPEN
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.DA SEL1.OpenP
|
|
|
|
|
bcc SEL1.EnumDir good open.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
lda bInSubDir trying to open root directory ?
|
2022-04-27 19:24:41 +00:00
|
|
|
|
beq SEL1.NextVol yes, just move to next volume.
|
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
jsr bell1 no, generate bell tone
|
2023-06-10 10:16:06 +00:00
|
|
|
|
jsr SEL1.FullPath.. and stay at same level.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
stx pbuf
|
|
|
|
|
jmp keyloop
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.EnumDir stz filecount zero file count.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
lda #1 File Ref Num=1
|
|
|
|
|
sta SEL1.ReadP+1 store in read
|
|
|
|
|
sta SEL1.SetMarkP+1 and setmark parm lists.
|
|
|
|
|
|
|
|
|
|
stz SEL1.ReadP+2
|
|
|
|
|
lda /SEL1.DirEntry
|
|
|
|
|
sta SEL1.ReadP+3
|
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$2B set read parm list for
|
2023-06-10 10:16:06 +00:00
|
|
|
|
sta SEL1.ReadP+4 directory header length.
|
|
|
|
|
stz SEL1.ReadP+5
|
|
|
|
|
|
2022-04-27 19:24:41 +00:00
|
|
|
|
jsr SEL1.ReadEntry read directory
|
2023-06-10 10:16:06 +00:00
|
|
|
|
bcs SEL1.CloseDir1
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ldx #$03
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.1 lda SEL1.DirEntry+$23,x copy directory info
|
|
|
|
|
sta DirEntLen,x to zero page.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
dex
|
2023-06-10 10:16:06 +00:00
|
|
|
|
bpl .1
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
sta SEL1.ReadP+4 put entry length in read parm list.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$01 set block file counter to 1.
|
|
|
|
|
sta blkfl
|
2023-06-10 10:16:06 +00:00
|
|
|
|
stz SEL1.SetMarkP+3 zero out msb's of file position
|
|
|
|
|
stz SEL1.SetMarkP+4 in setmark parm list.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.EnumDirNext
|
|
|
|
|
lda FileCntInDir
|
|
|
|
|
ora FileCntInDir+1
|
|
|
|
|
beq SEL1.CloseDir
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.EnumDirNext1
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.1 lda #$01 reset lsb
|
|
|
|
|
trb SEL1.SetMarkP+3
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ldy blkfl block file counter
|
|
|
|
|
lda #$00
|
2023-06-10 10:16:06 +00:00
|
|
|
|
cpy DirEntPerBlk have we read all entries in this block ?
|
|
|
|
|
bcc .3 if not, continue.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
tay if so, zero y-reg and
|
|
|
|
|
sty blkfl reset block counter / flag
|
2023-06-10 10:16:06 +00:00
|
|
|
|
inc SEL1.SetMarkP+3
|
2019-10-16 06:09:13 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.2 inc SEL1.SetMarkP+3
|
2019-10-16 06:09:13 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.3 dey decrement file block counter
|
2019-10-16 06:09:13 +00:00
|
|
|
|
clc
|
2023-06-10 10:16:06 +00:00
|
|
|
|
bmi .4
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
adc DirEntLen add entry length to acc.
|
|
|
|
|
bcc .3 determine if we flopped into 2nd half of
|
|
|
|
|
bcs .2 block, if so inc mid byte position.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.4 adc #$04 add 4 and put in
|
|
|
|
|
sta SEL1.SetMarkP+2 low byte of setmark.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
jsr MLI call mli
|
2022-04-27 19:24:41 +00:00
|
|
|
|
.DA #MLISETMARK
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.DA SEL1.SetMarkP
|
|
|
|
|
bcs SEL1.CloseDir
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2022-04-27 19:24:41 +00:00
|
|
|
|
jsr SEL1.ReadEntry
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.CloseDir1 bcs SEL1.CloseDir
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
inc blkfl increase count of files read.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
lda SEL1.DirEntry file type/length.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
and #$F0 mask off high nibble.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
beq SEL1.EnumDirNext1
|
|
|
|
|
|
|
|
|
|
lda FileCntInDir
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
dec FileCntInDir+1
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.5 dec FileCntInDir
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
ror SEL1.DirEntry+$1E check access bit.
|
|
|
|
|
bcc SEL1.EnumDirNext if no read, try next file.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
lda SEL1.DirEntry+$10 get file type.
|
|
|
|
|
ldx filecount get valid files read.
|
|
|
|
|
inx
|
|
|
|
|
beq SEL1.CloseDir
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
stx filecount
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
dex
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
sta SEL1.filetypes,x else store filetype in zero page
|
|
|
|
|
jsr SEL1.SetFNPtrX and go set up storage area.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
ldy #15
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.6 lda SEL1.DirEntry,y get byte of filename
|
|
|
|
|
sta (FilenamePtr),y store in directed area
|
2019-10-16 06:09:13 +00:00
|
|
|
|
dey
|
2023-06-10 10:16:06 +00:00
|
|
|
|
bpl .6
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
and #$0F mask off low nibble (name length)
|
2023-06-10 10:16:06 +00:00
|
|
|
|
sta (FilenamePtr) restore in name buffer
|
|
|
|
|
bra SEL1.EnumDirNext
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2022-04-27 19:24:41 +00:00
|
|
|
|
L5E26 jmp SEL1.NextVol error. try next unit.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.CloseDir jsr MLI close directory file
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.DA #MLICLOSE
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.DA SEL1.CloseP
|
2019-10-16 06:09:13 +00:00
|
|
|
|
bcs L5E26 error.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
jsr settxt use full screen for windows
|
|
|
|
|
jsr home
|
2023-06-10 10:16:06 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$17 cursor at bottom of screen.
|
|
|
|
|
jsr TABV set vertical position.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$14 horizontal position.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
sta ch
|
|
|
|
|
|
|
|
|
|
ldy #0 Footer
|
|
|
|
|
jsr SET1.MsgOutY
|
|
|
|
|
lda #$99
|
|
|
|
|
jsr cout cursor to upper/left.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ldx #$00
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.1 lda pbuf+1,x
|
|
|
|
|
beq .2
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
jsr SEL1.COut
|
2019-10-16 06:09:13 +00:00
|
|
|
|
inx
|
2023-06-10 10:16:06 +00:00
|
|
|
|
bne .1
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.2 stz SelectedIndex
|
|
|
|
|
stz ScrollIndex init top filename index.
|
|
|
|
|
ldx filecount # of valid files.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
beq keyloop if no files.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
cpx #21 more than what will fit on screen ?
|
|
|
|
|
bcc .3 no.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
ldx #20 limit to 20 files on the screen.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.3 lda #2 set window dimensions
|
2019-10-16 06:09:13 +00:00
|
|
|
|
sta wndtop
|
|
|
|
|
sta wndlft
|
2023-06-10 10:16:06 +00:00
|
|
|
|
|
|
|
|
|
lda #22
|
2019-10-16 06:09:13 +00:00
|
|
|
|
sta wndwdth
|
2020-08-30 17:50:57 +00:00
|
|
|
|
sta wndbot
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.4 phx
|
|
|
|
|
|
|
|
|
|
jsr SEL1.PrintFN
|
|
|
|
|
inc SelectedIndex
|
|
|
|
|
|
|
|
|
|
plx
|
|
|
|
|
dex
|
|
|
|
|
bne .4
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
stz SelectedIndex
|
2019-10-16 06:09:13 +00:00
|
|
|
|
beq L5EAA if last file, it needs to be inverse.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
uparrow jsr SEL1.PrintFN print old name in normal.
|
|
|
|
|
ldx SelectedIndex
|
2019-10-16 06:09:13 +00:00
|
|
|
|
beq L5EAA if already at the top name
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
dec SelectedIndex
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda cv current cursor line.
|
|
|
|
|
cmp #$02 at top line of window ?
|
|
|
|
|
bne L5EAA no, move up normally.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
dec ScrollIndex fix offset index
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$16 else sroll windows down a line.
|
|
|
|
|
bne L5EA7 branch always.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
dnarrow jsr SEL1.PrintFN print old name in normal.
|
|
|
|
|
ldx SelectedIndex
|
2019-10-16 06:09:13 +00:00
|
|
|
|
inx add one.
|
|
|
|
|
cpx filecount
|
|
|
|
|
bcs L5EAA if already at last filename
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
stx SelectedIndex
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda cv current cursor line.
|
|
|
|
|
cmp #$15 at bottom line of window ?
|
|
|
|
|
bne L5EAA no, move cursor normally.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
inc ScrollIndex update offset index
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$17 else scroll up a line.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
L5EA7 jsr cout
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
L5EAA jsr setinv set inverse text mode.
|
|
|
|
|
jsr SEL1.PrintFN output last filename.
|
|
|
|
|
*--------------------------------------
|
2019-10-16 06:09:13 +00:00
|
|
|
|
keyloop lda kbd get keyboard input.
|
|
|
|
|
bpl keyloop loop until key pressed.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
sta KBDSTROBE clear strobe.
|
|
|
|
|
jsr setnorm set normal text mode.
|
|
|
|
|
ldx filecount are any files displayed ?
|
|
|
|
|
beq L5ECB no, don't accept arrow keys or return.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
cmp #$8D return ?
|
|
|
|
|
beq L5EF4 then run selected file.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
cmp #$8A down ?
|
|
|
|
|
beq dnarrow move down a name.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
cmp #$8B up ?
|
|
|
|
|
beq uparrow move up a name.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
L5ECB cmp #$89 tab ?
|
|
|
|
|
beq L5EED new volume.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
cmp #$9B esc ?
|
|
|
|
|
bne keyloop no, try again else pop up a directory.
|
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
jsr SEL1.FullPath.. CD ..
|
|
|
|
|
jmp SEL1.OpenDir
|
|
|
|
|
*--------------------------------------
|
2022-04-27 19:24:41 +00:00
|
|
|
|
L5EED jmp SEL1.NextVol set up new unit number.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
L5EF4 ldy SelectedIndex
|
|
|
|
|
lda SEL1.filetypes,y get file type.
|
|
|
|
|
cmp #S.FI.T.DIR
|
|
|
|
|
bne .1 branch if directory.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
jsr SEL1.SetFullPath
|
|
|
|
|
bcs L5EED
|
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
inx
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
jmp SEL1.OpenDir get new directory info.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.1 cmp #S.FI.T.SYS
|
|
|
|
|
bne keyloop
|
|
|
|
|
|
|
|
|
|
jsr SEL1.SetFullPath
|
|
|
|
|
bcs L5EED
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
jsr MLI open file
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.DA #MLIOPEN
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.DA SEL1.OpenP
|
|
|
|
|
bcs L5EED
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
lda SEL1.OpenP+5 move reference number
|
|
|
|
|
sta SEL1.ReadP+1 for read.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
lda #$20
|
|
|
|
|
sta SEL1.ReadP+3 read at $2000
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
dec SEL1.ReadP+5 was $002B, now $FF2B
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
|
|
|
|
jsr SEL1.Read read selected file.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
php save possible error.
|
|
|
|
|
jsr MLI close file. ignore any error from close
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.DA #MLICLOSE
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.DA SEL1.CloseP
|
2019-10-16 06:09:13 +00:00
|
|
|
|
plp restore status from read.
|
|
|
|
|
bcs L5EED if any errors.
|
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
jsr settxt reset to full window.
|
|
|
|
|
jsr home makes for no flash.
|
|
|
|
|
lda #$95 ctrl-u
|
|
|
|
|
jsr cout turn off 80 columns.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
jmp $2000 execute selected system file.
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SET1.MsgOutY lda SEL1.Footer,y
|
|
|
|
|
beq .8
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
jsr cout
|
|
|
|
|
iny
|
2023-06-10 10:16:06 +00:00
|
|
|
|
bne SET1.MsgOutY
|
2019-10-16 06:09:13 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.PrintFN ldx SelectedIndex
|
2019-10-16 06:09:13 +00:00
|
|
|
|
txa
|
|
|
|
|
sec
|
2023-06-10 10:16:06 +00:00
|
|
|
|
sbc ScrollIndex calculate line # to display name
|
2019-10-16 06:09:13 +00:00
|
|
|
|
inc
|
|
|
|
|
inc
|
|
|
|
|
jsr TABV set vertical position.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
|
|
|
|
|
lda SEL1.filetypes,x get filetype (x is unchanged by tabv).
|
|
|
|
|
cmp #S.FI.T.DIR
|
|
|
|
|
bne .1 branch if not a DIR
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
stz ch80col adjust cursor position.
|
2023-06-10 10:16:06 +00:00
|
|
|
|
lda invflg Save current inverse setting
|
2019-10-16 06:09:13 +00:00
|
|
|
|
pha
|
2023-06-10 10:16:06 +00:00
|
|
|
|
ldy #SEL1.DirIcon-SEL1.Footer
|
|
|
|
|
jsr SET1.MsgOutY display the folder.
|
2019-10-16 06:09:13 +00:00
|
|
|
|
pla restore inverse setting.
|
|
|
|
|
sta invflg
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.1 lda #$03
|
|
|
|
|
sta ch80col
|
|
|
|
|
|
|
|
|
|
jsr SEL1.SPOut output a space.
|
|
|
|
|
jsr SEL1.SetFNPtrX calc name location.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
ldy #0
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.2 iny
|
|
|
|
|
lda (FilenamePtr),y get name character.
|
|
|
|
|
jsr SEL1.COut put on screen.
|
|
|
|
|
cpy FilenameLen end of name ?
|
|
|
|
|
bcc .2 no.
|
2019-11-06 20:48:15 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.SPOut lda #' ' SPACE
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.COut ora #$80 set high bit.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
jmp cout output to screen.
|
|
|
|
|
|
|
|
|
|
SEL1.ReadEntry jsr SEL1.Read
|
|
|
|
|
bcs SEL1.Read.RTS
|
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
ldy #SEL1.DirEntry
|
|
|
|
|
lda /SEL1.DirEntry
|
2022-04-27 19:24:41 +00:00
|
|
|
|
ldx #2
|
|
|
|
|
jmp GP.TOOLBOX
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
2022-04-27 19:24:41 +00:00
|
|
|
|
SEL1.Read jsr MLI mli read call
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.DA #MLIREAD
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.DA SEL1.ReadP
|
2022-04-27 19:24:41 +00:00
|
|
|
|
SEL1.Read.RTS rts
|
|
|
|
|
*--------------------------------------
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.SetFullPath
|
|
|
|
|
jsr MLI
|
|
|
|
|
.DA #MLISETPREFIX
|
|
|
|
|
.DA SEL1.SetPrefixP
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldx SelectedIndex
|
|
|
|
|
jsr SEL1.SetFNPtrX set up name storage area (on return y=0)
|
|
|
|
|
|
|
|
|
|
ldx pbuf get prefix length.
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 iny start at y = 1.
|
|
|
|
|
lda (FilenamePtr),y get character of name.
|
|
|
|
|
inx
|
|
|
|
|
sta pbuf,x store in prefix buffer.
|
|
|
|
|
cpy FilenameLen check length of name.
|
|
|
|
|
bcc .1 loop until all transferred.
|
|
|
|
|
|
|
|
|
|
stx pbuf put prefix length into buffer.
|
|
|
|
|
|
|
|
|
|
inc bInSubDir
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.FullPath.. ldx pbuf
|
|
|
|
|
|
|
|
|
|
.1 dex
|
|
|
|
|
lda pbuf,x
|
|
|
|
|
cmp #'/'
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
cpx #$01
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldx pbuf
|
|
|
|
|
|
|
|
|
|
.9 dec bInSubDir
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.SetFNPtrX lda /SEL1.Filenames/16
|
|
|
|
|
sta FilenamePtr+1
|
|
|
|
|
txa
|
|
|
|
|
|
|
|
|
|
ldx #4
|
|
|
|
|
|
|
|
|
|
.1 asl
|
|
|
|
|
rol FilenamePtr+1
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
sta FilenamePtr
|
|
|
|
|
|
|
|
|
|
lda (FilenamePtr)
|
|
|
|
|
sta FilenameLen
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-10-16 06:09:13 +00:00
|
|
|
|
* data area
|
2022-04-27 19:24:41 +00:00
|
|
|
|
*--------------------------------------
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.Footer .AS -"RETURN:Select,TAB:Chg Vol,ESC:Back"
|
2022-04-27 19:24:41 +00:00
|
|
|
|
.HS 00
|
2019-10-16 06:09:13 +00:00
|
|
|
|
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.DirIcon .HS 0F inverse control code
|
2019-10-16 06:09:13 +00:00
|
|
|
|
.HS 1B enable mousetext
|
|
|
|
|
.AS -"XY" folder characters
|
|
|
|
|
.HS 18 disable mousetext
|
|
|
|
|
.HS 0E normal control code
|
|
|
|
|
.HS 00
|
2022-04-27 19:24:41 +00:00
|
|
|
|
*--------------------------------------
|
2023-06-10 10:16:06 +00:00
|
|
|
|
SEL1.OpenP .DA #3 Param Count
|
2019-10-16 06:09:13 +00:00
|
|
|
|
.DA pbuf pathname
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.DA SEL1.FileBuf file buffer
|
|
|
|
|
.HS 01 reference number
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.CloseP .DA #1 Param Count
|
|
|
|
|
.HS 01 reference number.
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.OnLineP .DA #2 Param Count
|
|
|
|
|
.HS 60 unit number, default = s6, d1
|
2019-10-16 06:09:13 +00:00
|
|
|
|
.DA pbuf+1 data buffer
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.SetPrefixP .DA #1 Param Count
|
2019-10-16 06:09:13 +00:00
|
|
|
|
.DA pbuf pathname
|
2023-06-10 10:16:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEL1.ReadP .DA #4 Param Count
|
2022-04-27 19:24:41 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.LIST ON
|
|
|
|
|
SEL1.LEN .EQ *-SEL1.START
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.DUMMY
|
2023-06-10 10:16:06 +00:00
|
|
|
|
.BS 1 RefNum
|
|
|
|
|
.BS 2 MemPtr
|
|
|
|
|
.BS 2 requested length
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.BS 2 actual length
|
2023-06-10 10:16:06 +00:00
|
|
|
|
|
|
|
|
|
SEL1.SetMarkP .BS 1 Param Count
|
|
|
|
|
.BS 1 RefNum
|
|
|
|
|
.BS 3 FPos
|
2019-11-06 20:48:15 +00:00
|
|
|
|
.ED
|
2019-10-16 06:09:13 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2020-08-30 17:50:57 +00:00
|
|
|
|
SAVE usr/src/prodos.fx/prodos.s.sel1
|
|
|
|
|
LOAD usr/src/prodos.fx/prodos.s
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ASM
|