Kernel 0.9.1 : Code reorganization & move to CSTR : SHELL, history & command editing

This commit is contained in:
Rémy GIBERT 2017-09-27 08:14:13 +02:00
parent f1a0c7f011
commit 7a753cfbea
4 changed files with 28 additions and 10 deletions

Binary file not shown.

Binary file not shown.

View File

@ -66,13 +66,14 @@ DRV.CS.START .DA STATUS
.DA CLOSE .DA CLOSE
.DA READ .DA READ
.DA WRITE .DA WRITE
L.STAT .DA STAT L.DEVSTAT .DA DEVSTAT
*-------------------------------------- *--------------------------------------
J.CtrlChars .DA ENQ 5 J.CtrlChars .DA ENQ 5
.DA BS 8 .DA BS 8
.DA LF 10 .DA LF 10
.DA CLRSCR 12 .DA CLRSCR 12
.DA CROUT 13 .DA CROUT 13
.DA FS 21
.DA ESC 27 .DA ESC 27
*-------------------------------------- *--------------------------------------
J.EscCodes .DA Scroll.Dn M J.EscCodes .DA Scroll.Dn M
@ -86,7 +87,7 @@ J.EscSequences .DA Esc.DispAttr m
.DA Esc.Home H .DA Esc.Home H
.DA 0 end of relocation .DA 0 end of relocation
*-------------------------------------- *--------------------------------------
STATUS >LDYA L.STAT STATUS >LDYA L.DEVSTAT
clc clc
rts rts
*-------------------------------------- *--------------------------------------
@ -193,7 +194,7 @@ WRITE bit bEscMode
ldy CV ldy CV
jsr SetCharAtXY jsr SetCharAtXY
*-------------------------------------- *--------------------------------------
FSOUT ldx CH FS ldx CH
cpx #79 cpx #79
beq .8 beq .8
@ -833,8 +834,8 @@ KeyRemappedRGHT .HS 1B5B4300 esc[C
TelnetOpt .DA #IAC,#DO,#TELOPT.ECHO TelnetOpt .DA #IAC,#DO,#TELOPT.ECHO
.DA #0 .DA #0
*-------------------------------------- *--------------------------------------
CtrlChars.Cnt .EQ 6 CtrlChars.Cnt .EQ 7
CtrlChars .HS 05080A0C0D1B CtrlChars .HS 05080A0C0D151B
bIACMode .BS 1 bIACMode .BS 1
bEscMode .BS 1 bEscMode .BS 1
bEscModeCSI .BS 1 bEscModeCSI .BS 1
@ -844,7 +845,7 @@ EscSeqParamTmp .BS 2
EscSeqParamCnt .BS 1 EscSeqParamCnt .BS 1
EscSeqParam .BS 4 EscSeqParam .BS 4
*-------------------------------------- *--------------------------------------
STAT .DA #S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ DEVSTAT .DA #S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
.DA #0,#0,#0 .DA #0,#0,#0
>PSTR "ANSI 80c Console" >PSTR "ANSI 80c Console"
.DA #S.DEVSTAT.T.CHAR .DA #S.DEVSTAT.T.CHAR

View File

@ -160,6 +160,9 @@ CS.RUN >LDA.G bReadMode READ Command ?
>LDA.G bCmdBufExec Something to execute ? >LDA.G bCmdBufExec Something to execute ?
bpl .1 bpl .1
>LDA.G CmdBuflen
beq .10 Empty line
jsr CMD.Parse jsr CMD.Parse
>LDA.G CmdBuflen >LDA.G CmdBuflen
@ -370,15 +373,19 @@ CS.CHARIN tax Save Char
* ora #0 * ora #0
* bne .3 ...until ending 0 * bne .3 ...until ending 0
txa
>LDA.G CmdBufPtr Insert char at Ptr >LDA.G CmdBufPtr Insert char at Ptr
tay tay
txa
sta (ZPCMDBuf),y sta (ZPCMDBuf),y
>INC.G CmdBufPtr >INC.G CmdBufPtr
>CMP.G CmdBuflen >CMP.G CmdBuflen
bne .4 bne .4
.4 >LDA.G bSecureRead .4 >LDA.G bSecureRead
bne .8 bne .8
@ -396,7 +403,7 @@ CS.CHARIN.CTRL
* >LDYA L.MSG.HEXBYTE * >LDYA L.MSG.HEXBYTE
* >SYSCALL PrintF.YA * >SYSCALL PrintF.YA
* plx * plx
cpx #13 CR cpx #13 CR
bne .10 bne .10
@ -488,14 +495,24 @@ CmdLine.CLR ldy #0
*-------------------------------------- *--------------------------------------
CmdLine.BS >LDA.G CmdBufPtr CmdLine.BS >LDA.G CmdBufPtr
beq .9 beq .9
dec dec
sta (pData),y sta (pData),y
lda #8 lda #8
>SYSCALL PutChar.A >SYSCALL PutChar.A
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CmdLine.NAK rts CmdLine.NAK >LDA.G CmdBufPtr
>CMP.G CmdBuflen
beq .9
inc
>STA.G CmdBufPtr
lda #21
>SYSCALL PutChar.A
.9 rts
*-------------------------------------- *--------------------------------------
CmdLine.DEL >LDA.G CmdBuflen CmdLine.DEL >LDA.G CmdBuflen
beq .9 beq .9