Kernel version 0.9 : EDIT improved ANSI/VT100 support, bugfix

This commit is contained in:
Rémy GIBERT 2017-03-06 17:58:05 +01:00
parent 528af99550
commit 01eebfd159
6 changed files with 112 additions and 62 deletions

Binary file not shown.

Binary file not shown.

View File

@ -39,14 +39,16 @@ Ctrl.A ldy #PromptMode
lda #PromptModeHelp
sta (pData),y
ldx #0
ldy #0
jsr GotoXY
>LDYA L.MSG.HELP
>STYA ZPPTR1
.1 lda (ZPPTR1)
stz .1+1
.1 ldy #0
ldx #0
jsr GotoXY
lda (ZPPTR1)
beq .8
>LDYA ZPPTR1
@ -55,13 +57,11 @@ Ctrl.A ldy #PromptMode
>LDYA L.SEQ.CEOL
>SYSCALL CPrintFYA
bcs .9
lda #13
>SYSCALL PutCA
lda #10
>SYSCALL PutCA
sec
inc .1+1
lda (ZPPTR1)
sec
adc ZPPTR1
sta ZPPTR1
bcc .1
@ -520,17 +520,10 @@ Ctrl.Y ldy #FileY+1
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.Z
clc
Ctrl.Z clc
rts
*--------------------------------------
Ctrl.ESC ldy #bEscMode
lda #$ff
sta (pData),y
inc
ldy #EscBuffer
sta (pData),y
clc
Ctrl.ESC clc
rts
*--------------------------------------
Prompt.Editor cmp #127

View File

@ -10,6 +10,7 @@ SCRN.Init ldy #ScreenH
dec
>PUSHA
>LDYA L.SEQ.INIT
>SYSCALL CPrintFYA
bcs .9
lda #12
@ -42,6 +43,30 @@ SCRN.Init ldy #ScreenH
.9 rts
*--------------------------------------
SCRN.UpdateTopBar
lda #1
>PUSHA
>PUSHA
>LDYA L.MSG.GOTOXY
>SYSCALL CPrintFYA
bcs .9
>LDYA L.SEQ.INV
>SYSCALL CPrintFYA
bcs .9
ldy #ScreenW
lda (pData),y
.3 pha
lda #' '
>SYSCALL PutCA
pla
bcs .9
dec
bne .3
ldy #hFileName
lda (pData),y
beq .1
@ -54,10 +79,7 @@ SCRN.UpdateTopBar
>LDYA L.MSG.TOPBAR
>SYSCALL CPrintFYA
bcs .9
clc
.9 rts
*--------------------------------------
SCRN.UpdateMain ldy #ScreenY
@ -411,11 +433,19 @@ SCRN.UpdateViewPort
rts
.9 jmp Ctrl.Q
*--------------------------------------
SCRN.scrollUp lda #$1B
>SYSCALL PutCA
bcs .9
lda #'M'
>SYSCALL PutCA
SCRN.scrollUp ldy #CurX
lda (pData),y
inc
>PUSHA
ldy #CurY
lda (pData),y
inc
inc
>PUSHA
>LDYA L.SEQ.SCROLLUP
>SYSCALL CPrintFYA
bcs .9
ldy #ScreenY+1
@ -438,13 +468,21 @@ SCRN.scrollUp lda #$1B
rts
.9 jmp Ctrl.Q
*--------------------------------------
SCRN.scrollDn lda #$1B
>SYSCALL PutCA
bcs .9
lda #'D'
>SYSCALL PutCA
bcs .9
SCRN.scrollDn ldy #CurX
lda (pData),y
inc
>PUSHA
ldy #CurY
lda (pData),y
inc
inc
>PUSHA
>LDYA L.SEQ.SCROLLDN
>SYSCALL CPrintFYA
bcs .9
ldy #ScreenY+1
lda (pData),y
tax

View File

@ -44,6 +44,8 @@ CS.START cld
L.SEQ.DETECT .DA SEQ.DETECT
L.SEQ.INIT .DA SEQ.INIT
L.SEQ.RESET .DA SEQ.RESET
L.SEQ.SCROLLUP .DA SEQ.SCROLLUP
L.SEQ.SCROLLDN .DA SEQ.SCROLLDN
L.SEQ.INV .DA SEQ.INV
L.SEQ.NORM .DA SEQ.NORM
L.SEQ.CEOL .DA SEQ.CEOL
@ -131,7 +133,7 @@ CS.INIT lda #$ff
.9 rts
*--------------------------------------
CS.RUN >LDYA L.SEQ.DETECT
>SYSCALL CPrintFYA Send Query for term W & H
>SYSCALL CPrintFYA Send Query for term W & H
bcs .9
.1 >SYSCALL Sleep
@ -188,9 +190,6 @@ CS.QUIT ldy #hBuffer
.8 >LDYA L.SEQ.RESET
>SYSCALL CPrintFYA
bcs .9
lda #12
>SYSCALL PutCA
.9 rts
*--------------------------------------
CharIn tax
@ -199,7 +198,7 @@ CharIn tax
lda (pData),y
asl
txa
bcc .1
bcc .1 Not in ESC mode
cmp #'['
beq .8
@ -221,15 +220,25 @@ CharIn tax
jsr CharIn.Esc
bcs .8 Not translated, exit
.1 pha
.1 cmp #27 Esc ?
bne .2
ldy #bEscMode
lda #$ff
sta (pData),y
inc
ldy #EscBuffer
sta (pData),y
.8 clc
rts
.2 pha
ldy #PromptMode
lda (pData),y
tax
pla
jmp (J.PROMPT,x)
.8 clc
rts
*--------------------------------------
CharIn.Esc ldy #bEscMode
lda #0
@ -246,6 +255,7 @@ CharIn.Esc ldy #bEscMode
ldx EscChars
.1 cmp EscChars,x
beq .2
dex
bne .1
@ -363,14 +373,22 @@ LoadFile >PUSHWI 0 Aux type
>SYSCALL GetMemPtrA
>STYA ZPPTR1
>LDYA TmpLen
>STYA TmpCount
lda TmpLen
eor #$ff
tax
lda TmpLen+1
eor #$ff
pha
ldy #0
.5 jsr DecTmpCount
beq .6
lda (ZPPTR1),y
.5 inx
bne .6
pla
inc
beq .7
pha
.6 lda (ZPPTR1),y
sta (ZPPTR2),y
iny
bne .5
@ -378,7 +396,7 @@ LoadFile >PUSHWI 0 Aux type
inc ZPPTR2+1
bra .5
.6 ldy #FileLen
.7 ldy #FileLen
lda TmpLen
sta (pData),y
iny
@ -434,12 +452,14 @@ DecTmpCount lda TmpCount
*--------------------------------------
CS.END
SEQ.DETECT >CSTR "Querying terminal capabilities...\e[999;999H\e[6n"
SEQ.INIT >CSTR "\ec\e[2;%dr"
SEQ.INIT >CSTR "\ec\e[2;%dr" \e[?6h
SEQ.RESET >CSTR "\ec"
SEQ.SCROLLUP >CSTR "\e[%d;%dH\eD"
SEQ.SCROLLDN >CSTR "\e[%d;%dH\eM"
SEQ.INV >CSTR "\e[7m"
SEQ.NORM >CSTR "\e[0m"
SEQ.CEOL >CSTR "\e[K"
MSG.TOPBAR >CSTR "\e[1;1H\e[7mA2osX Edit:%S\e[K\e[0m"
MSG.TOPBAR >CSTR "\e[1;1HA2osX Edit:%S"
MSG.STATUSBAR >CSTR "\e[%d;1H\e[7mPress Ctrl-A For Help Length:%D Col:%d Line:%D\e[K\e[0m"
MSG.STATUSBAR.H >CSTR "\e[%d;1H\e[7mPress any key to exit this screen:\e[K\e[0m"
MSG.STATUSBAR.F >CSTR "\e[%d;1H\e[7mFind:%S\e[K\e[0m"

View File

@ -72,12 +72,12 @@ L.STAT .DA STAT
J.CtrlChars .DA ENQ 5
.DA BS 8
.DA LF 10
.DA HOME 12
.DA CLRSCR 12
.DA CROUT 13
.DA ESC 27
*--------------------------------------
J.EscCodes .DA Scroll.Dn D
.DA Scroll.Up M
J.EscCodes .DA Scroll.Dn M
.DA Scroll.Up D
.DA RESET c
*--------------------------------------
J.EscSequences .DA Esc.DispAttr m
@ -106,7 +106,6 @@ OPEN stz CURON
sta A2osX.SCRNDEVS DEV.ID in A
jsr RESET
jsr HOME
ldy #0
@ -321,7 +320,8 @@ COUT.ExecEscSeq stz EscSeqParamCnt
*--------------------------------------
* PRIVATE
*--------------------------------------
RESET lda #0
RESET jsr CLRSCR
lda #0
sta SCROLLTOP
lda #23
sta SCROLLBOT
@ -367,7 +367,7 @@ BS ldx CH
ldy CV
jmp SetCharAtXY
*--------------------------------------
HOME stz CH
ClrScr stz CH
stz CV
ldx #23
@ -377,8 +377,7 @@ HOME stz CH
lda BASEH,x
sta ZPBaseL1+1
lda #' '
ora INVFLG
lda #" "
php
sei
@ -794,7 +793,7 @@ Char.Out.Get sec
.9 rts
*--------------------------------------
DRV.CS.END
EscCodes >PSTR "DMc"
EscCodes >PSTR "MDc"
EscSeqCmds >PSTR "mnrKH"
BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07
@ -820,7 +819,7 @@ KeyRemappedUP .HS 1B5B4100 esc[A
KeyRemappedCR .HS 0D0A00 crlf
KeyRemappedRGHT .HS 1B5B4300 esc[C
TelnetOpt .DA #IAC,#DO,#TELOPT.ECHO
.DA #13,#10,#0
.DA #0
*--------------------------------------
CtrlChars.Cnt .EQ 6
CtrlChars .HS 05080A0C0D1B