ANSI Support for CON,SysScreen & Shell

This commit is contained in:
Rémy GIBERT 2015-12-13 22:29:51 +01:00
parent 4b10684611
commit adc8ad9630
3 changed files with 75 additions and 24 deletions

View File

@ -589,7 +589,7 @@ CURON .BS 1
CURCHAR .BS 1
*--------------------------------------
KeyRemapIdx .BS 1
KeyRemapped .HS 0508090A0D15 L,D,U,CR,R
KeyRemapped .HS 05080A0B0D15 L,D,U,CR,R
KeyRemappedIdx .HS 050004080C0F
KeyRemappedTable .EQ *
KeyRemappedLEFT .HS 1B5B4400 esc[D

View File

@ -193,12 +193,17 @@ CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
lda #0
sta (pData),y
bra .8
clc
rts
.9 sec
rts
.11 ldy #hInputFile Batch mode ?
lda (pData),y
beq .10
* Batch Mode
cpx #3 test Ctrl-c
bne .12
@ -215,9 +220,33 @@ CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
ldy #bPause
lda #$80
sta (pData),y
clc
rts
* interactive mode
.10 ldy #bEscMode
lda (pData),y
beq .13
cpx #'['
beq .8
lda #0
sta (pData),y
txa
ldx EscChars
.17 cmp EscChars,x
beq .18
dex
bne .17
bra .8
.10 cpx #$20
.18 lda EscAscii,x
tax
.13 cpx #$20
bcs .1
jsr CS.EVENT.CTRL.CHAR
bra .8
@ -225,7 +254,8 @@ CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
.1 cpx #$7f
bne .2
jsr CmdBuffer.DEL
bra .8
clc
rts
.2 lda (pData) CmdBuffer
@ -242,9 +272,6 @@ CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
.8 clc
rts
.9 sec
rts
*--------------------------------------
CS.EVENT.CTRL.CHAR
cpx #13 CR
@ -257,7 +284,16 @@ CS.EVENT.CTRL.CHAR
clc
rts
.10 cpx #3 Ctrl-C
.10 cpx #$1B esc
bne .11
ldy #bEscMode
lda #$ff
sta (pData),y
clc
rts
.11 cpx #3 Ctrl-C
bne .1
jsr CmdBuffer.CLR
@ -451,6 +487,8 @@ MSG.GREETINGS >PSTRING "\nA2osX-Shell on Dev=%h\n\n"
MSG.ERROR >PSTRING "[%h]\n"
*MSG.NOTFOUND >CSTRING "Command Not Found\n"
*MSG.SYNERR >CSTRING "Syntax Error Or Invalid Pathname\n"
EscChars >PSTRING "DBAC"
EscAscii .HS 04080A0B15
hLIBSTR .BS 1
hNEWPATH .BS 1
hExecCmd .BS 1
@ -464,18 +502,19 @@ ExecCmdIdx .BS 1
.DUMMY
.OR 0
DS.START
CmdBuffer .BS CmdBuffer.MAX+1
CmdBuffer .BS CmdBuffer.MAX+1 (pData)
bEscMode .BS 1
bPause .BS 1
bExit .BS 1
bEchoOff .BS 1
bExitOnEOF .BS 1
hCmdLine .BS 1
hCmdHistory .BS 1
CmdHistory.IDX .BS 1
bExitOnEOF .BS 1
CmdHistory.END .BS 1
hInputFile .BS 1
hInputArgs .BS 1
hInputBuffer .BS 1
CmdHistory.END .BS 1
DS.END
.ED
*--------------------------------------

View File

@ -268,20 +268,30 @@ DevMgr.SYS.GetEvent
*--------------------------------------
DevMgr.SYS.COut phx
phy
cmp #13
bne .1
jsr DevMgr.SYS.CROut
ply
plx
clc
rts
.1 ldy DevMgr.SYS.CH
cmp #' '
bcc .1
ldy DevMgr.SYS.CH
ldx DevMgr.SYS.CV
ora #$80
jsr DevMgr.SYS.SetCharAtYX
jsr DevMgr.SYS.FSOut
ply
bra .8
.1 cmp #10
bne .2
jsr DevMgr.SYS.LF
bra .8
.2 cmp #13
bne .3
jsr DevMgr.SYS.CROut
bra .8
.3 ora #$20
jsr DevMgr.SYS.SetCharAtYX
jsr DevMgr.SYS.FSOut
.8 ply
plx
clc
rts
@ -289,15 +299,17 @@ DevMgr.SYS.COut phx
DevMgr.SYS.FSOut
lda DevMgr.SYS.CH
cmp #79
beq DevMgr.SYS.CROut1
beq DevMgr.SYS.LF1
inc DevMgr.SYS.CH
rts
*--------------------------------------
DevMgr.SYS.CROut
jsr DevMgr.SYS.ClrEOL
DevMgr.SYS.CROut1
stz DevMgr.SYS.CH
ldx DevMgr.SYS.CV
rts
*--------------------------------------
DevMgr.SYS.LF1 stz DevMgr.SYS.CH
DevMgr.SYS.LF ldx DevMgr.SYS.CV
cpx #23
beq DevMgr.SYS.Scroll
inc DevMgr.SYS.CV