Kernel version 0.8 : EDIT, added Ctrl-O,P,T,Y and W

This commit is contained in:
Rémy GIBERT 2016-11-07 16:13:25 +01:00
parent e0ae89dd6c
commit 2bc7a49825
5 changed files with 142 additions and 53 deletions

Binary file not shown.

Binary file not shown.

View File

@ -89,13 +89,6 @@ Ctrl.C jsr BUF.SelToClipboard
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.D jsr BUF.DelSel
bcs .9
jsr SCRN.UpdateMain
bcs .9
jmp SCRN.UpdateStatusBar
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.E jsr BUF.ComputeCOffset
lda BUF.COffset
ldy #SelEnd
@ -274,13 +267,77 @@ Ctrl.N
clc
rts
*--------------------------------------
Ctrl.O
clc
Ctrl.O ldy #FileY+1
lda (pData),y
tax
dey
lda (pData),y
ldy #ViewPortH
sec
sbc (pData),y
pha
txa
sbc #0
bcc .8
ldy #FileY+1
sta (pData),y
dey
pla
sta (pData),y
lda #0
ldy #FileX
sta (pData),y
jsr SCRN.UpdateViewPort
bcs .9
rts
.9 jmp Ctrl.Q
.8 pla
jmp Ctrl.T
*--------------------------------------
Ctrl.P
Ctrl.P ldy #FileY+1
lda (pData),y
tax
dey
lda (pData),y
ldy #ViewPortH
clc
adc (pData),y
bcc .1
inx
.1 pha
phx
jsr BUF.GetLineAX A,X = FileY+PAGE
bcs .8
tya Y = line length
ldy #FileX
sta (pData),y
ldy #FileY+1
pla
sta (pData),y
dey
pla
sta (pData),y
jsr SCRN.UpdateViewPort
bcs .9
rts
.9 jmp Ctrl.Q
.8 pla
pla
jmp Ctrl.Y
*--------------------------------------
Ctrl.Q lda #$FF
ldy #bCANCEL
@ -390,19 +447,39 @@ Ctrl.V jsr BUF.InsertClipboard
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.W
clc
rts
Ctrl.W jsr BUF.ComputeCOffset Y=line len
phy
lda BUF.LOffset
ldy #SelStart
sta (pData),y
lda BUF.LOffset+1
iny
sta (pData),y
pla
sec +1 for CR
adc BUF.LOffset
ldy #SelEnd
sta (pData),y
lda BUF.LOffset+1
adc #0
iny
sta (pData),y
bra Ctrl.D
*--------------------------------------
Ctrl.X jsr BUF.SelToClipboard
bcs .99
jsr BUF.DelSel
bcs Ctrl.X.RTS
Ctrl.D jsr BUF.DelSel
bcs .9
jsr SCRN.UpdateMain
bcs .9
jmp SCRN.UpdateStatusBar
.9 jmp Ctrl.Q
.99 rts
.9 jmp Ctrl.Q
Ctrl.X.RTS rts
*--------------------------------------
Ctrl.Y ldy #FileY+1
lda (pData),y

View File

@ -70,10 +70,8 @@ SCRN.UpdateMain ldy #ScreenY
lda #0
sta TmpByte
ldy #ScreenH
ldy #ViewPortH
lda (pData),y
dec
dec
sta TmpCount
.1 >LDAX TmpIndex
@ -333,7 +331,7 @@ SCRN.UpdateViewPort
sbc (pData),y
bcs .4 out of top border ?
ldy #ScreenY
ldy #ScreenY move viewport up one line....
lda (pData),y
sbc #0 CC from BCS
sta (pData),y
@ -344,37 +342,31 @@ SCRN.UpdateViewPort
bit bNotRepaint
bpl .3
jsr SCRN.scrollDn
jsr SCRN.scrollDn ...and move content one line down
bcc .3
jmp Ctrl.Q
.4 clc
ldy #ScreenY
.4 ldy #ScreenY+1
lda (pData),y
ldy #ScreenH
adc (pData),y
pha
ldy #ScreenY+1
lda (pData),y
adc #0
tax
pla
sec
sbc #3
bcs .41
dex
sec
.41 ldy #FileY
sbc (pData),y
txa
iny
sbc (pData),y
bcs .5 out of bottom border ?
dey
lda (pData),y
ldy #ViewPortHm1
clc
ldy #ScreenY
adc (pData),y
bcc .41
inx
.41 ldy #FileY A,X = screen bottom
cmp (pData),y
txa
iny FileY > screen bottom ?
sbc (pData),y
bcs .5 CS : fileY>= screen bottom
* clc from BCS
ldy #ScreenY move viewport down one line....
lda (pData),y
adc #1
sta (pData),y
@ -382,10 +374,12 @@ SCRN.UpdateViewPort
lda (pData),y
adc #0
sta (pData),y
bit bNotRepaint
bit bNotRepaint
bpl .4
jsr SCRN.scrollUp
jsr SCRN.scrollUp ...and move content one line up
bcs .9
bra .4
.5 sec
ldy #FileX
@ -430,13 +424,15 @@ SCRN.scrollUp lda #$1B
dey
lda (pData),y
clc
adc #21
ldy #ViewPortHm1
adc (pData),y
bcc .1
inx
.1 jsr BUF.GetLineAX
bcs .9
lda #21
ldy #ViewPortHm1
lda (pData),y
jsr SCRN.UpdateLineAtALenY
bcs .9
rts
@ -449,7 +445,12 @@ SCRN.scrollDn lda #$1B
>SYSCALL COutA
bcs .9
jsr BUF.GetLine
ldy #ScreenY+1
lda (pData),y
tax
dey
lda (pData),y
jsr BUF.GetLineAX
bcs .9
lda #0

View File

@ -275,9 +275,18 @@ CS.DOEVENT.Esc ldy #bEscMode
bra .4
.5 phy
lda TmpByte
ldy #ScreenH
sta (pData),y
dec Remove 2 (top & status bar) for viewportH
dec
ldy #ViewPortH
sta (pData),y
dec
ldy #ViewPortHm1 Remove 1 more to store offsert to last line of viewport
sta (pData),y
ply
stz TmpByte
@ -466,14 +475,14 @@ MSG.HELP >PSTR "All commands: (* = Not yet implemented)"
>PSTR " Ctrl-G : Go to start of current line"
>PSTR " Ctrl-L : Go to end of current line"
>PSTR " Ctrl-N : * Find next"
>PSTR " Ctrl-O : * Page up"
>PSTR " Ctrl-P : * Page down"
>PSTR " Ctrl-O : Page up"
>PSTR " Ctrl-P : Page down"
>PSTR " Ctrl-Q : Quit"
>PSTR " Ctrl-R : * Replace found string with..."
>PSTR " Ctrl-S : Save file to disk..."
>PSTR " Ctrl-T : Go to top of file"
>PSTR " Ctrl-V : Past clipboard at cursor position"
>PSTR " Ctrl-W : * Erase current line"
>PSTR " Ctrl-W : Erase current line"
>PSTR " Ctrl-X : Cut block to clipboard"
>PSTR " Ctrl-Y : Go to end of file"
>PSTR " Ctrl-Z : * Undo previous change"
@ -516,6 +525,8 @@ hClipBoard .BS 1
ClipBoardLen .BS 2
ScreenW .BS 1
ScreenH .BS 1
ViewPortH .BS 1
ViewPortHm1 .BS 1
ScreenX .BS 1
ScreenY .BS 2
CurX .BS 1