LS: Added CS.RUN.ISATTY and fixed EOL handling

This commit is contained in:
Bobbi Webber-Manners 2021-07-04 20:12:18 -04:00
parent 4d20317dd6
commit ddf9321150
1 changed files with 646 additions and 627 deletions

View File

@ -39,7 +39,7 @@ bColumn .BS 1
bFullPath .BS 1
bLong .BS 1
bRecurse .BS 1
bIsTTY .BS 1
ZS.END .ED
*--------------------------------------
@ -90,6 +90,9 @@ CS.INIT clc
rts
*--------------------------------------
CS.RUN
stz bIsTTY
jsr CS.RUN.ISATTY
.1 inc ArgCount
lda ArgCount
>SYSCALL ArgV
@ -689,6 +692,9 @@ CS.RUN.NewLine.1
lda #C.CR
>SYSCALL PutChar
lda bIsTTY
beq CS.RUN.NewLine.8
lda #C.LF
>SYSCALL PutChar
@ -696,6 +702,19 @@ CS.RUN.NewLine.8
clc
rts
*--------------------------------------
CS.RUN.ISATTY ldy #S.PS.hStdOut
lda (pPS),y
tax
lsr
bcc .9
lda Nod.Table.hFD-2,x
>SYSCALL GetMemPtr
>STYA ZPPtr1
lda (ZPPtr1)
beq .9
inc bIsTTY
.9 rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------