A2osX/BIN/EDIT.S.CTRL.txt

605 lines
9.6 KiB
Plaintext
Raw Normal View History

2016-01-04 07:25:43 +00:00
PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
* ^A = Help
* ^B = Begin Block
* ^C = Copy Block
* ^D = Delete Block
* ^E = End Block
* ^F = Find...
* ^G = Go To SOL
***** ^H
* ^I =
***** J,K
* ^L = Go To EOL
***** ^M
* ^N = Find Next
* ^O = Page Up
* ^P = Page Down
* ^Q = Quit
* ^R = Replace...
* ^S = Save
* ^T = Go To Top of file
***** ^U
* ^V = Paste Block
2016-02-25 17:02:57 +00:00
* ^W = Erase line
2016-01-04 07:25:43 +00:00
* ^X = Cut Block
2016-02-25 17:02:57 +00:00
* ^Y = End Of File
2016-01-04 07:25:43 +00:00
* ^Z = Undo
*--------------------------------------
Ctrl.Invalid
clc
rts
*--------------------------------------
Ctrl.A ldy #PromptMode
lda #PromptModeHelp
sta (pData),y
ldx #0
ldy #0
jsr GotoXY
>LDYA L.MSG.HELP
>STYA ZPPTR1
.1 lda (ZPPTR1)
beq .8
>PUSHW L.SEQ.CEOL
>PUSHW ZPPTR1
>LDYA L.MSG.HELPLINE
>SYSCALL SYS.PrintFYA
2016-01-04 07:25:43 +00:00
bcs .9
sec
lda (ZPPTR1)
adc ZPPTR1
sta ZPPTR1
bcc .1
2016-01-04 07:25:43 +00:00
inc ZPPTR1+1
bra .1
2016-01-21 07:05:23 +00:00
.8 jsr SCRN.UpdateStatusBar
2016-01-04 07:25:43 +00:00
bcs .9
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.B jsr BUF.ComputeCOffset
lda BUF.COffset
ldy #SelStart
sta (pData),y
lda BUF.COffset+1
iny
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateMain
2016-01-04 07:25:43 +00:00
bcs .9
rts
.9 jmp Ctrl.Q
*--------------------------------------
2016-01-29 17:05:08 +00:00
Ctrl.C jsr BUF.SelToClipboard
bcs .9
2016-01-04 07:25:43 +00:00
.8 clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
2016-02-25 17:02:57 +00:00
Ctrl.D jsr BUF.DelSel
bcs .9
jsr SCRN.UpdateMain
bcs .9
jmp SCRN.UpdateStatusBar
.9 jmp Ctrl.Q
2016-01-04 07:25:43 +00:00
*--------------------------------------
Ctrl.E jsr BUF.ComputeCOffset
lda BUF.COffset
ldy #SelEnd
sta (pData),y
lda BUF.COffset+1
iny
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateMain
2016-01-04 07:25:43 +00:00
bcs .9
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.F lda #PromptModeFind
ldy #PromptMode
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateStatusBar
2016-01-04 07:25:43 +00:00
bcs .9
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.G ldy #FileX
lda (pData),y
beq .8
lda #0
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateViewPort
2016-01-04 07:25:43 +00:00
bcs .9
.8 clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.BS ldy #FileX
lda (pData),y
beq .1 already at begining of line
dec
sta (pData),y
bra .3
.1 ldy #FileY+1
lda (pData),y
tax
dey
ora (pData),y
beq .8
lda (pData),y
bne .2
dex
.2 dec
jsr BUF.GetLineAX
bcs .8
tya
ldy #FileX
sta (pData),y
sec
ldy #FileY
lda (pData),y
sbc #1
sta (pData),y
iny
lda (pData),y
sbc #0
sta (pData),y
2016-01-21 07:05:23 +00:00
.3 jsr SCRN.UpdateViewPort
2016-01-04 07:25:43 +00:00
bcs .9
.8 clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.TAB
clc
rts
*--------------------------------------
Ctrl.LF ldy #FileY+1
lda (pData),y
tax
dey
lda (pData),y
inc
bne .1
inx
.1 jsr BUF.GetLineAX
bcs .8
tya Y = line length
ldy #FileX
cmp (pData),y
bcs .2
sta (pData),y
.2 ldy #FileY
lda (pData),y
inc
sta (pData),y
bne .3
iny
lda (pData),y
inc
sta (pData),y
2016-01-21 07:05:23 +00:00
.3 jsr SCRN.UpdateViewPort
2016-01-04 07:25:43 +00:00
bcs .9
.8 clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.VT ldy #FileY+1
lda (pData),y
tax
dey
ora (pData),y
beq .8
lda (pData),y
bne .1
dex
.1 dec
jsr BUF.GetLineAX
bcs .8
tya Y = line length
ldy #FileX
cmp (pData),y
bcs .2
sta (pData),y
.2 sec
ldy #FileY
lda (pData),y
sbc #1
sta (pData),y
iny
lda (pData),y
sbc #0
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateViewPort
2016-01-04 07:25:43 +00:00
bcs .9
.8 clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.L ldy #FileY+1
lda (pData),y
tax
dey
lda (pData),y
jsr BUF.GetLineAX
bcs .8
tya Y = line length
ldy #FileX
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateViewPort
2016-01-04 07:25:43 +00:00
bcs .9
.8 clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.CR lda #13
jsr BUF.InsertA
bcs .9
ldy #FileX
lda #0
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateMain
2016-01-04 07:25:43 +00:00
bcs .9
clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.N
clc
rts
*--------------------------------------
Ctrl.O
clc
rts
*--------------------------------------
Ctrl.P
clc
rts
*--------------------------------------
Ctrl.Q lda #$FF
ldy #bCANCEL
sta (pData),y
clc
rts
*--------------------------------------
Ctrl.R lda #PromptModeReplace
ldy #PromptMode
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateStatusBar
2016-01-04 07:25:43 +00:00
bcs .9
clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Ctrl.S lda #PromptModeSave
ldy #PromptMode
sta (pData),y
ldy #hFileName
lda (pData),y
beq .2
>SYSCALL SYS.GetMemPtrA
>STYA ZPPTR1
lda (ZPPTR1)
tay
.1 lda (ZPPTR1),y
sta (pData),y
dey
bpl .1
2016-01-21 07:05:23 +00:00
.2 jsr SCRN.UpdateStatusBar
2016-01-04 07:25:43 +00:00
bcs .9
clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
2016-02-25 17:02:57 +00:00
Ctrl.T lda #0
ldy #FileX
sta (pData),y
ldy #FileY
sta (pData),y
iny
sta (pData),y
jsr SCRN.UpdateViewPort
bcs .9
2016-01-04 07:25:43 +00:00
rts
2016-02-25 17:02:57 +00:00
.9 jmp Ctrl.Q
2016-01-04 07:25:43 +00:00
*--------------------------------------
Ctrl.FS ldy #FileY+1
lda (pData),y
tax
dey
lda (pData),y
jsr BUF.GetLineAX
bcs .8
tya Y = line length
ldy #FileX
cmp (pData),y
beq .1 already at end of line
lda (pData),y
inc
sta (pData),y
bra .3
.1 ldy #FileY+1
lda (pData),y
tax
dey
lda (pData),y
inc
bne .2
inx
.2 jsr BUF.GetLineAX
bcs .8
ldy #FileY CC
lda (pData),y
adc #1
sta (pData),y
iny
lda (pData),y
adc #0
sta (pData),y
ldy #FileX
lda #0
sta (pData),y
2016-01-21 07:05:23 +00:00
.3 jsr SCRN.UpdateViewPort
2016-01-04 07:25:43 +00:00
bcs .9
.8 clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
2016-01-29 17:05:08 +00:00
Ctrl.V jsr BUF.InsertClipboard
bcs .9
jsr SCRN.UpdateMain
bcs .9
jsr SCRN.UpdateStatusBar
bcs .9
2016-01-04 07:25:43 +00:00
rts
2016-01-29 17:05:08 +00:00
.9 jmp Ctrl.Q
2016-01-04 07:25:43 +00:00
*--------------------------------------
Ctrl.W
clc
rts
*--------------------------------------
2016-02-25 17:02:57 +00:00
Ctrl.X jsr BUF.SelToClipboard
bcs .99
jsr BUF.DelSel
bcs .9
jsr SCRN.UpdateMain
bcs .9
jmp SCRN.UpdateStatusBar
.9 jmp Ctrl.Q
.99 rts
2016-01-04 07:25:43 +00:00
*--------------------------------------
Ctrl.Y
clc
rts
*--------------------------------------
Ctrl.Z
clc
rts
*--------------------------------------
Ctrl.ESC ldy #bEscMode
lda #$ff
sta (pData),y
inc
ldy #EscBuffer
sta (pData),y
clc
rts
*--------------------------------------
Prompt.Editor pha
ldy #bInit
lda (pData),y
asl
pla
bcs .1
cmp #$1B
beq Ctrl.ESC
cmp #3 Ctrl-C ?
beq .9
clc
rts
.1 cmp #127
beq .4
cmp #$20
bcs .7
asl
tax
jmp (J.CTRL,x)
2016-01-09 22:33:47 +00:00
.4 jsr BUF.Del
bcs .9
2016-01-28 17:03:51 +00:00
cmp #13
bne .5
jsr SCRN.UpdateMain
2016-01-09 22:33:47 +00:00
bcs .9
2016-01-28 17:03:51 +00:00
bra .6
.5 jsr SCRN.UpdateCurrentLine
bcs .9
.6 jsr SCRN.UpdateStatusBar
2016-01-09 22:33:47 +00:00
bcs .9
rts
2016-01-04 07:25:43 +00:00
.7 jsr BUF.InsertA
bcs .9
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateCurrentLine
2016-01-04 07:25:43 +00:00
bcs .9
jsr Ctrl.FS
bcs .9
rts
.9 jmp Ctrl.Q
*--------------------------------------
Prompt.Help ldy #PromptMode
lda #0
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateMain
2016-01-04 07:25:43 +00:00
bcs .9
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateStatusBar
2016-01-04 07:25:43 +00:00
bcs .9
rts
.9 jmp Ctrl.Q
*--------------------------------------
Prompt.Find cmp #3
bne .1
ldy #PromptMode
lda #0
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateStatusBar
2016-01-04 07:25:43 +00:00
bcs .9
rts
.1 cmp #13
bne .2
.2
clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Prompt.Replace cmp #3
bne .1
ldy #PromptMode
lda #0
sta (pData),y
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateStatusBar
2016-01-04 07:25:43 +00:00
bcs .9
rts
.1 cmp #13
bne .2
.2
clc
rts
.9 jmp Ctrl.Q
*--------------------------------------
Prompt.Save cmp #3
bne .1
ldy #PromptMode
lda #0
sta (pData),y
2016-01-05 17:04:47 +00:00
bra .80
2016-01-04 07:25:43 +00:00
.1 cmp #13
bne .2
2016-01-05 17:04:47 +00:00
lda (pData)
beq .8
2016-01-04 07:25:43 +00:00
ldy #hFileName
lda (pData),y
beq .11
>SYSCALL SYS.FreeMemA
.11 >LDYA pData
>SYSCALL SYS.NewPStrYA
2016-08-17 06:25:58 +00:00
txa
ldy #hFileName
sta (pData),y
2016-01-05 17:04:47 +00:00
ldy #PromptMode
lda #0
sta (pData),y
jsr SaveFile
bcc .81
2016-01-21 07:05:23 +00:00
jsr SCRN.UpdateStatusBarErrA
2016-01-09 22:33:47 +00:00
bcs .9
rts
2016-01-05 17:04:47 +00:00
.2 cmp #127
bne .3
lda (pData)
beq .8
dec
sta (pData)
bra .80
.3 cmp #$20
2016-01-05 17:04:47 +00:00
bcc .8
pha
lda (pData)
tay
pla
cpy #PromptBufferMax
beq .8
iny
sta (pData),y
tya
sta (pData)
bra .80
2016-01-04 07:25:43 +00:00
.8 clc
rts
2016-01-21 07:05:23 +00:00
.81 jsr SCRN.UpdateTopBar
2016-01-09 22:33:47 +00:00
bcs .9
2016-01-21 07:05:23 +00:00
.80 jsr SCRN.UpdateStatusBar
2016-01-05 17:04:47 +00:00
bcs .9
rts
2016-01-04 07:25:43 +00:00
.9 jmp Ctrl.Q
*--------------------------------------
MAN
SAVE BIN/EDIT.S.CTRL
LOAD BIN/EDIT.S
ASM