BUGFIX #5 : TYPE not expanding to full path properly

This commit is contained in:
Rémy GIBERT 2016-10-27 10:14:13 +02:00
parent 89612444b8
commit 2e1283ddd2
4 changed files with 56 additions and 18 deletions

Binary file not shown.

Binary file not shown.

View File

@ -421,53 +421,89 @@ Cmd.Exec.TIME clc
rts
*--------------------------------------
Cmd.Exec.ECHO lda ARGS
beq .9
beq Cmd.Exec.ECHO.SYN
>PUSHW L.ARGS
>LDYA L.MSG.PSTR
>SYSCALL PrintFYA
clc
rts
.9 lda #SYSMGR.ERRSYN
Cmd.Exec.ECHO.SYN
lda #SYSMGR.ERRSYN
sec
Cmd.Exec.ECHO.RTS
rts
*--------------------------------------
Cmd.Exec.TYPE lda ARGS
beq .98
beq Cmd.Exec.ECHO.SYN
>LDYA L.ARGS
>SYSCALL GetFullPathYA
bcs Cmd.Exec.ECHO.RTS
>STYA ZPPTR1
stx hFullPath
>PUSHWI 0 Aux type
>PUSHBI 4 S.FILEINFO.TYPE.TXT
>PUSHBI SYS.FOPEN.R
>PUSHW L.ARGS
>PUSHW ZPPTR1
>SYSCALL LoadFile
bcs .99
bcs .98
stx hTextFile
eor #$ff
sta ZPPTR2+1
tya
eor #$ff
sta ZPPTR2 store file !len
>STYA ZPPTR2 store file len
phx
txa
>SYSCALL GetMemPtrA
>STYA ZPPTR1
.1 lda ZPPTR2
ldy #0
lda #13 if len=0, exit print CR
.1 inc ZPPTR2
bne .2
lda ZPPTR2+1
beq .3
dec ZPPTR2+1
.2 dec ZPPTR2
lda (ZPPTR1)
inc ZPPTR2+1
beq .8
.2 lda (ZPPTR1)
>SYSCALL COutA
bcs .97
lda (ZPPTR1) get last char in A
inc ZPPTR1
bne .1
inc ZPPTR1+1
bra .1
.3 pla
>SYSCALL FreeMemA
.8 cmp #13 is last char printed a CR ?
beq .81
lda #13
>SYSCALL COutA no, add one
bcs .97
.81 jsr .97 cleanup...
clc
rts
.98 lda #SYSMGR.ERRSYN
.97 pha
lda hTextFile
>SYSCALL FreeMemA
pla
.98 pha
lda hFullPath
>SYSCALL FreeMemA
pla
sec
.99 rts
rts
*--------------------------------------
Cmd.Exec.READ
clc

View File

@ -454,6 +454,8 @@ STAT .BS S.STAT
hNEWPATH .BS 1
hCmdLine .BS 1
Cmd.Exec.Mode .BS 1
hFullPath .BS 1
hTextFile .BS 1
*--------------------------------------
.DUMMY
.OR 0