Kernel 0.93

This commit is contained in:
Rémy GIBERT 2019-05-28 18:00:53 +02:00
parent f6a4d5123d
commit d03eabaa31
4 changed files with 103 additions and 78 deletions

Binary file not shown.

View File

@ -445,18 +445,6 @@ BUF.GetLineAX sta BUF.TmpLine1
.9 sec
rts
*--------------------------------------
BUF.GetCharAtY tya
clc
adc BUF.LOffset
sta BUF.COffset
lda #0
adc BUF.LOffset+1
sta BUF.COffset+1
lda (BufPtr),y
clc
rts
*--------------------------------------
BUF.GetNewYA phy
pha
@ -482,28 +470,40 @@ BUF.GetNewYA phy
.9 rts
*--------------------------------------
BUF.ResetSel >STZW.G SelStart
>STZW.G SelEnd
BUF.ResetSel ldy #SelStart
lda #0
.1 sta (pData),y
iny
cpy #SelEnd+2
bne .1
rts
*--------------------------------------
BUF.CheckSelected
lda BUF.COffset
ldy #SelStart
lda BUF.COffset
cmp (pData),y
lda BUF.COffset+1
iny
lda BUF.COffset+1
sbc (pData),y
bcc .9
lda BUF.COffset
ldy #SelEnd
cmp (pData),y
lda BUF.COffset+1
iny
sbc (pData),y
rts CC if in selection
iny #SelEnd
.9 sec
lda (pData),y
cmp BUF.COffset
iny
lda (pData),y
sbc BUF.COffset+1
.9 rol $80 = selected
rts
*--------------------------------------
* Out : CC if ok, YA=SelLen

View File

@ -27,7 +27,6 @@ NEW
* ^W = Erase line
* ^X = Cut Block
* ^Y = End Of File
* ^Z = Undo
*--------------------------------------
Prompt.Editor cmp #C.DEL
beq Ctrl.DEL

View File

@ -85,7 +85,7 @@ SCRN.UpdateMain >LDA.G ScreenY
lda TmpByte
jsr SCRN.UpdateLineAtALenY
bcs .9
bcs SCRN.UpdateMain.9
.3 inc TmpByte
inc TmpIndex
@ -99,12 +99,12 @@ SCRN.UpdateMain >LDA.G ScreenY
.5 ldx #0
ldy TmpByte
jsr GotoXY
bcs .9
bcs SCRN.UpdateMain.9
>PUSHBI 0
>LDYA L.SEQ.CEOL
>SYSCALL printf
bcs .9
bcs SCRN.UpdateMain.9
inc TmpByte
dec TmpCount
@ -112,7 +112,8 @@ SCRN.UpdateMain >LDA.G ScreenY
jmp SCRN.GotoCurXCurY
.9 rts
SCRN.UpdateMain.9
rts
*--------------------------------------
SCRN.UpdateCurrentLine
>LDA.G ScreenY+1
@ -124,90 +125,115 @@ SCRN.UpdateCurrentLine
bcc .1
inx
.1 jsr BUF.GetLineAX
bcs .9
bcs SCRN.UpdateMain.9
phy
>LDA.G CurY
ply
jsr SCRN.UpdateLineAtALenY
.9 rts
*--------------------------------------
* A = Target Screen Y position
* BufPtr = Text line start, Y = len
*--------------------------------------
SCRN.UpdateLineAtALenY
stz bSelected
sty TmpLen
ldx #0
tay
jsr GotoXY
bcs .9
>LDYA LineBufPtr
>STYA ZPPTR1
>LDA.G ScreenW
tax
>LDA.G ScreenX
cmp TmpLen
bcs .8
tay
.1 cpy TmpLen
bcs .3
clc
adc BUF.LOffset
sta BUF.COffset
lda #0
adc BUF.LOffset+1
sta BUF.COffset+1
jsr BUF.GetCharAtY
beq .3
tya
* clc
adc BufPtr
sta BufPtr
bcc .1
inc BufPtr+1
.1 lda (BufPtr)
beq .8
cmp #C.CR
beq .3
beq .8
phx
phy
pha
jsr BUF.CheckSelected
jsr SCRN.UpdateAttrC
pla
bcs .11
eor bSelected
bpl .5
>SYSCALL PutChar
.11 ply
plx
bcs .9
.2 iny
dex
.5 lda (BufPtr)
jsr SCRN.ToLineBuf
inc BufPtr
bne .6
inc BufPtr+1
.6 inc BUF.COffset
bne .7
inc BUF.COffset+1
.7 dex
bne .1
.3 sec
jsr SCRN.UpdateAttrC
bcs .9
.8 bit bSelected
bpl .80
jsr SCRN.ToggleSel
.80 lda #0
sta (ZPPTR1)
>PUSHBI 0
>LDYA L.SEQ.CEOL
>LDYA LineBufPtr
>SYSCALL printf
bcs .9
rts
.9 jmp Ctrl.Q
*--------------------------------------
* CC = set INV, CS = set NORM
*--------------------------------------
SCRN.UpdateAttrC
bcc .1
bit bSelected
bpl .8
>PUSHBI 0
>LDYA L.SEQ.NORM
>SYSCALL printf
bcs .9
stz bSelected
rts
SCRN.ToggleSel ldy #$0
.1 bit bSelected
bmi .8
>PUSHBI 0
>LDYA L.SEQ.INV
>SYSCALL printf
bcs .9
lda #$ff
lda bSelected
bpl .1
ldy #6
.1 eor #$ff
sta bSelected
.8 clc
rts
.9 jmp Ctrl.Q
.2 lda SEQ.NORM,y
beq .8
jsr SCRN.ToLineBuf
iny
bra .2
.8 rts
*--------------------------------------
SCRN.ToLineBuf sta (ZPPTR1)
inc ZPPTR1
bne .8
inc ZPPTR1+1
.8 rts
*--------------------------------------
SCRN.UpdateStatusBar
>PUSHBI 1