2015-08-05 20:38:05 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
|
|
|
|
.TF /A2OSX.BOOT/BIN/EDIT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPPTR1 .EQ ZPBIN
|
|
|
|
|
ZPPTR2 .EQ ZPBIN+2
|
2016-01-04 07:25:43 +00:00
|
|
|
|
BufPtr .EQ ZPBIN+4
|
|
|
|
|
BufPtrBackup .EQ ZPBIN+6
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
PromptBufferMax .EQ 64
|
|
|
|
|
PromptModeHelp .EQ 2
|
|
|
|
|
PromptModeFind .EQ 4
|
|
|
|
|
PromptModeReplace .EQ 6
|
|
|
|
|
PromptModeSave .EQ 8
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START Code Length To Relocate
|
|
|
|
|
.DA DS.END-DS.START Data Segment to Allocate
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
2016-01-04 07:25:43 +00:00
|
|
|
|
L.SEQ.DETECT .DA SEQ.DETECT
|
|
|
|
|
L.SEQ.INIT .DA SEQ.INIT
|
|
|
|
|
L.SEQ.RESET .DA SEQ.RESET
|
2015-11-29 22:19:10 +00:00
|
|
|
|
L.SEQ.INV .DA SEQ.INV
|
|
|
|
|
L.SEQ.NORM .DA SEQ.NORM
|
2016-01-04 07:25:43 +00:00
|
|
|
|
L.SEQ.CEOL .DA SEQ.CEOL
|
2015-11-29 22:19:10 +00:00
|
|
|
|
L.MSG.TOPBAR .DA MSG.TOPBAR
|
2016-01-04 07:25:43 +00:00
|
|
|
|
L.MSG.STATUSBAR .DA MSG.STATUSBAR
|
|
|
|
|
L.MSG.STATUSBAR.H .DA MSG.STATUSBAR.H
|
|
|
|
|
L.MSG.STATUSBAR.F .DA MSG.STATUSBAR.F
|
|
|
|
|
L.MSG.STATUSBAR.R .DA MSG.STATUSBAR.R
|
|
|
|
|
L.MSG.STATUSBAR.S .DA MSG.STATUSBAR.S
|
2016-01-06 22:07:28 +00:00
|
|
|
|
L.MSG.STATUSBAR.E .DA MSG.STATUSBAR.E
|
2015-11-29 22:19:10 +00:00
|
|
|
|
L.MSG.NEWFILE .DA MSG.NEWFILE
|
2016-01-04 07:25:43 +00:00
|
|
|
|
L.MSG.GOTOXY .DA MSG.GOTOXY
|
|
|
|
|
L.MSG.HELP .DA MSG.HELP
|
|
|
|
|
J.PROMPT .DA Prompt.Editor
|
|
|
|
|
.DA Prompt.Help
|
|
|
|
|
.DA Prompt.Find
|
|
|
|
|
.DA Prompt.Replace
|
|
|
|
|
.DA Prompt.Save
|
|
|
|
|
J.CTRL .DA Ctrl.Invalid
|
|
|
|
|
.DA Ctrl.A
|
|
|
|
|
.DA Ctrl.B
|
|
|
|
|
.DA Ctrl.C
|
|
|
|
|
.DA Ctrl.D
|
|
|
|
|
.DA Ctrl.E
|
|
|
|
|
.DA Ctrl.F
|
|
|
|
|
.DA Ctrl.G
|
|
|
|
|
.DA Ctrl.BS
|
|
|
|
|
.DA Ctrl.TAB
|
|
|
|
|
.DA Ctrl.LF
|
|
|
|
|
.DA Ctrl.VT
|
|
|
|
|
.DA Ctrl.L
|
|
|
|
|
.DA Ctrl.CR
|
|
|
|
|
.DA Ctrl.N
|
|
|
|
|
.DA Ctrl.O
|
|
|
|
|
.DA Ctrl.P
|
|
|
|
|
.DA Ctrl.Q
|
|
|
|
|
.DA Ctrl.R
|
|
|
|
|
.DA Ctrl.S
|
|
|
|
|
.DA Ctrl.T
|
|
|
|
|
.DA Ctrl.FS
|
|
|
|
|
.DA Ctrl.V
|
|
|
|
|
.DA Ctrl.W
|
|
|
|
|
.DA Ctrl.X
|
|
|
|
|
.DA Ctrl.Y
|
|
|
|
|
.DA Ctrl.Z
|
|
|
|
|
.DA Ctrl.ESC
|
|
|
|
|
.DA Ctrl.Invalid
|
|
|
|
|
.DA Ctrl.Invalid
|
|
|
|
|
.DA Ctrl.Invalid
|
|
|
|
|
.DA Ctrl.Invalid
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2016-01-04 07:25:43 +00:00
|
|
|
|
CS.INIT stz hFile
|
|
|
|
|
stz TmpLen
|
|
|
|
|
stz TmpLen+1
|
|
|
|
|
|
|
|
|
|
lda #$ff
|
|
|
|
|
ldy #bSaved
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2015-08-05 20:38:05 +00:00
|
|
|
|
ldy #S.PS.hARGS
|
|
|
|
|
lda (pPs),y
|
2016-01-04 07:25:43 +00:00
|
|
|
|
beq .3
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
|
|
|
|
>SYSCALL SYS.GetMemPtrA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
>STYA ZPPTR1
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda (ZPPTR1)
|
2015-08-05 20:38:05 +00:00
|
|
|
|
cmp #'/'
|
2016-01-04 07:25:43 +00:00
|
|
|
|
bne .1
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.hARGS
|
|
|
|
|
lda (pPs),y
|
2015-11-29 22:19:10 +00:00
|
|
|
|
>SYSCALL SYS.PStrCpyA
|
2016-01-04 07:25:43 +00:00
|
|
|
|
bra .2
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.1 ldy #S.PS.hARGS
|
2015-08-05 20:38:05 +00:00
|
|
|
|
lda (pPs),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
>SYSCALL SYS.PStrCat
|
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.2 ldy #hFileName
|
2015-08-05 20:38:05 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
>SYSCALL SYS.LoadFileA
|
2016-01-06 22:07:28 +00:00
|
|
|
|
bcs .3
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-01-06 22:07:28 +00:00
|
|
|
|
stx hFile
|
2016-01-04 07:25:43 +00:00
|
|
|
|
>STYA TmpLen
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.3 >LDYA TmpLen
|
2015-08-05 20:38:05 +00:00
|
|
|
|
iny
|
2016-01-04 07:25:43 +00:00
|
|
|
|
bne .4
|
|
|
|
|
inc
|
|
|
|
|
|
|
|
|
|
.4 >PUSHYA
|
|
|
|
|
>PUSHBI S.MEM.F.INIT0
|
|
|
|
|
>SYSCALL SYS.GetMem
|
|
|
|
|
bcs .98
|
|
|
|
|
>STYA ZPPTR2
|
2015-08-05 20:38:05 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #hBuffer
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
lda hFile
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
>SYSCALL SYS.GetMemPtrA
|
|
|
|
|
>STYA ZPPTR1
|
|
|
|
|
|
|
|
|
|
>LDYA TmpLen
|
|
|
|
|
>STYA TmpCount
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.5 jsr DecTmpCount
|
|
|
|
|
beq .6
|
|
|
|
|
lda (ZPPTR1),y
|
|
|
|
|
sta (ZPPTR2),y
|
|
|
|
|
iny
|
|
|
|
|
bne .5
|
|
|
|
|
inc ZPPTR1+1
|
|
|
|
|
inc ZPPTR2+1
|
|
|
|
|
bra .5
|
|
|
|
|
|
|
|
|
|
.6 jsr .98
|
|
|
|
|
|
|
|
|
|
.7 ldy #FileLen
|
|
|
|
|
lda TmpLen
|
2015-11-22 22:30:06 +00:00
|
|
|
|
sta (pData),y
|
2016-01-04 07:25:43 +00:00
|
|
|
|
iny
|
|
|
|
|
lda TmpLen+1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2015-08-05 20:38:05 +00:00
|
|
|
|
lda (pPs)
|
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
|
|
|
|
sta (pPs)
|
|
|
|
|
clc
|
2016-01-04 07:25:43 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.98 lda hFile
|
|
|
|
|
beq .99
|
|
|
|
|
>SYSCALL SYS.FreeMemA
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-04 07:25:43 +00:00
|
|
|
|
CS.RUN ldy #bCancel
|
2015-08-05 20:38:05 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .9
|
2016-01-04 07:25:43 +00:00
|
|
|
|
|
|
|
|
|
ldy #bInit
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
>LDYA L.SEQ.DETECT
|
|
|
|
|
>SYSCALL SYS.PSTRoutYA Send Query for term W & H
|
|
|
|
|
bcs .9
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.1 ldy #bCancel
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
>SYSCALL SYS.Sleep
|
|
|
|
|
|
|
|
|
|
ldy #ScreenW Wait for Response from terminal
|
|
|
|
|
lda (pData),y for W & H
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
jsr InitScreen
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #bInit
|
|
|
|
|
lda #$ff
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
.8 clc
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
ldy #S.PS.hINDEV
|
|
|
|
|
cmp (pPs),y
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
lda (pEvent)
|
|
|
|
|
and #S.EVT.F.KEY is it a KEY event?
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
|
|
|
|
|
lda (pEvent),y
|
2016-01-04 07:25:43 +00:00
|
|
|
|
bmi .9 test only OA, bug in Applewin for #,@...
|
|
|
|
|
* bne .9
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATALO
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #bEscMode
|
|
|
|
|
lda (pData),y
|
|
|
|
|
asl
|
|
|
|
|
txa
|
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
cmp #'['
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldy #EscBuffer
|
|
|
|
|
lda (pData),y
|
|
|
|
|
inc
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
adc #EscBuffer
|
|
|
|
|
tay
|
|
|
|
|
txa
|
2015-08-05 20:38:05 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
cmp #64
|
|
|
|
|
|
|
|
|
|
bcc .8
|
|
|
|
|
jsr CS.DOEVENT.Esc
|
|
|
|
|
bcs .8 Not translated, exit
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.1 pha
|
|
|
|
|
ldy #PromptMode
|
|
|
|
|
lda (pData),y
|
|
|
|
|
tax
|
|
|
|
|
pla
|
|
|
|
|
jmp (J.PROMPT,x)
|
|
|
|
|
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.8 clc
|
2016-01-04 07:25:43 +00:00
|
|
|
|
rts
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
|
|
|
|
.9 sec
|
2016-01-04 07:25:43 +00:00
|
|
|
|
rts
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-04 07:25:43 +00:00
|
|
|
|
CS.DOEVENT.Esc ldy #bEscMode
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
ldy #EscBuffer
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda (pData),y
|
2016-01-04 07:25:43 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #EscBuffer
|
|
|
|
|
tay
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
lda (pData),y
|
2016-01-04 07:25:43 +00:00
|
|
|
|
|
|
|
|
|
ldx EscChars
|
|
|
|
|
.1 cmp EscChars,x
|
|
|
|
|
beq .2
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
cmp #'R' Response to cursor position query?
|
|
|
|
|
beq .3
|
|
|
|
|
sec
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
2016-01-04 07:25:43 +00:00
|
|
|
|
|
|
|
|
|
.2 lda EscAscii,x
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2016-01-04 22:15:29 +00:00
|
|
|
|
.3 stz TmpByte
|
|
|
|
|
|
|
|
|
|
ldy #EscBuffer+1
|
2016-01-04 07:25:43 +00:00
|
|
|
|
|
|
|
|
|
.4 lda (pData),y
|
|
|
|
|
cmp #';'
|
|
|
|
|
beq .5
|
|
|
|
|
|
|
|
|
|
and #$0f
|
|
|
|
|
pha
|
2016-01-04 22:15:29 +00:00
|
|
|
|
lda TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
clc
|
2016-01-04 22:15:29 +00:00
|
|
|
|
adc TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
asl
|
2016-01-04 22:15:29 +00:00
|
|
|
|
sta TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
pla
|
|
|
|
|
clc
|
2016-01-04 22:15:29 +00:00
|
|
|
|
adc TmpByte
|
|
|
|
|
sta TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
iny
|
|
|
|
|
bra .4
|
|
|
|
|
|
|
|
|
|
.5 phy
|
2016-01-04 22:15:29 +00:00
|
|
|
|
lda TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
ldy #ScreenH
|
2015-11-29 22:19:10 +00:00
|
|
|
|
sta (pData),y
|
2016-01-04 07:25:43 +00:00
|
|
|
|
ply
|
|
|
|
|
|
2016-01-04 22:15:29 +00:00
|
|
|
|
stz TmpByte
|
|
|
|
|
|
|
|
|
|
iny
|
2016-01-04 07:25:43 +00:00
|
|
|
|
|
|
|
|
|
.6 lda (pData),y
|
|
|
|
|
cmp #'R'
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
and #$0f
|
|
|
|
|
pha
|
2016-01-04 22:15:29 +00:00
|
|
|
|
lda TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
clc
|
2016-01-04 22:15:29 +00:00
|
|
|
|
adc TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
asl
|
2016-01-04 22:15:29 +00:00
|
|
|
|
sta TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
pla
|
|
|
|
|
clc
|
2016-01-04 22:15:29 +00:00
|
|
|
|
adc TmpByte
|
|
|
|
|
sta TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
iny
|
|
|
|
|
bra .6
|
|
|
|
|
|
2016-01-04 22:15:29 +00:00
|
|
|
|
.7 lda TmpByte
|
2016-01-04 07:25:43 +00:00
|
|
|
|
ldy #ScreenW
|
2015-11-29 22:19:10 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
clc
|
2016-01-04 07:25:43 +00:00
|
|
|
|
rts
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-04 07:25:43 +00:00
|
|
|
|
CS.QUIT ldy #hBuffer
|
2015-11-29 22:19:10 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .1
|
2016-01-04 07:25:43 +00:00
|
|
|
|
>SYSCALL SYS.FreeMemA
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.1 ldy #hBufferBackup
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .2
|
|
|
|
|
>SYSCALL SYS.FreeMemA
|
|
|
|
|
|
|
|
|
|
.2 ldy #hClipBoard
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .3
|
|
|
|
|
>SYSCALL SYS.FreeMemA
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.3 ldy #hFileName
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .8
|
|
|
|
|
>SYSCALL SYS.FreeMemA
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.8 >LDYA L.SEQ.RESET
|
2015-11-29 22:19:10 +00:00
|
|
|
|
>SYSCALL SYS.PSTRoutYA
|
|
|
|
|
bcs .9
|
2016-01-04 07:25:43 +00:00
|
|
|
|
lda #12
|
|
|
|
|
>SYSCALL SYS.CoutA
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.9 rts
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-09 22:33:47 +00:00
|
|
|
|
SaveFile >PUSHWI 0 Aux type
|
|
|
|
|
>PUSHBI 4 type=TXT
|
|
|
|
|
>PUSHBI $C3 access=RW
|
|
|
|
|
ldy #hFileName
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL SYS.GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>SYSCALL SYS.MLICreateFile
|
|
|
|
|
bcc .1
|
|
|
|
|
cmp #$47 File Exists error?
|
|
|
|
|
bne .9 no, sec;rts
|
|
|
|
|
|
|
|
|
|
.1 ldy #hFileName
|
2016-01-06 22:07:28 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL SYS.MLIOpenA
|
|
|
|
|
bcs .9
|
|
|
|
|
sta hFile
|
|
|
|
|
stx TmpByte
|
|
|
|
|
|
|
|
|
|
ldy #FileLen+1
|
|
|
|
|
>PUSHB (pData),y
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (pData),y
|
|
|
|
|
|
|
|
|
|
ldy #hBuffer
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL SYS.GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
|
|
|
|
>PUSHB hFile
|
|
|
|
|
>SYSCALL SYS.MLIWrite
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr .99
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2016-01-09 22:33:47 +00:00
|
|
|
|
.99 pha
|
|
|
|
|
lda hFile
|
2016-01-06 22:07:28 +00:00
|
|
|
|
>SYSCALL SYS.MLICloseA
|
|
|
|
|
lda TmpByte
|
|
|
|
|
>SYSCALL SYS.FreeMemA
|
2016-01-09 22:33:47 +00:00
|
|
|
|
pla
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2016-01-06 22:07:28 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-04 07:25:43 +00:00
|
|
|
|
DecTmpCount lda TmpCount
|
|
|
|
|
bne .1
|
|
|
|
|
lda TmpCount+1
|
|
|
|
|
beq .9
|
|
|
|
|
dec TmpCount+1
|
|
|
|
|
.1 dec TmpCount
|
|
|
|
|
ora #$ff make sure NZ
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB BIN/EDIT.S.BUF
|
|
|
|
|
.INB BIN/EDIT.S.CTRL
|
|
|
|
|
.INB BIN/EDIT.S.SCRN
|
|
|
|
|
*--------------------------------------
|
2015-08-05 20:38:05 +00:00
|
|
|
|
CS.END
|
2016-01-04 07:25:43 +00:00
|
|
|
|
SEQ.DETECT >PSTRING "Querying terminal capabilities...\e[999;999H\e[6n"
|
|
|
|
|
SEQ.INIT >PSTRING "\ec\e[2;%dr"
|
|
|
|
|
SEQ.RESET >PSTRING "\ec"
|
2015-11-29 22:19:10 +00:00
|
|
|
|
SEQ.INV >PSTRING "\e[7m"
|
|
|
|
|
SEQ.NORM >PSTRING "\e[0m"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
SEQ.CEOL >PSTRING "\e[K"
|
|
|
|
|
MSG.TOPBAR >PSTRING "\e[1;1H\e[7mA2osX Edit:%S\e[K\e[0m"
|
2016-01-06 22:07:28 +00:00
|
|
|
|
MSG.STATUSBAR >PSTRING "\e[%d;1H\e[7mPress Ctrl-A For Help Length:%D Col:%d Line:%D\e[K\e[0m"
|
|
|
|
|
MSG.STATUSBAR.H >PSTRING "\e[%d;1H\e[7mPress any key to exit this screen:\e[K\e[0m"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
MSG.STATUSBAR.F >PSTRING "\e[%d;1H\e[7mFind:%S\e[K\e[0m"
|
|
|
|
|
MSG.STATUSBAR.R >PSTRING "\e[%d;1H\e[7mReplace:%S\e[K\e[0m"
|
|
|
|
|
MSG.STATUSBAR.S >PSTRING "\e[%d;1H\e[7mSave:%S\e[K\e[0m"
|
2016-01-06 22:07:28 +00:00
|
|
|
|
MSG.STATUSBAR.E >PSTRING "\e[%d;1H\e[7mError:%h\e[K\e[0m"
|
2015-11-29 22:19:10 +00:00
|
|
|
|
MSG.NEWFILE >PSTRING "(new file)"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
MSG.GOTOXY >PSTRING "\e[%d;%dH"
|
2016-01-06 22:07:28 +00:00
|
|
|
|
MSG.HELP >PSTRING "All commands:"
|
|
|
|
|
>PSTRING "(* = Not yet implemented)"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
>PSTRING " Ctrl-A : This help screen"
|
|
|
|
|
>PSTRING " Ctrl-B : Mark begining of block"
|
2016-01-06 22:07:28 +00:00
|
|
|
|
>PSTRING " Ctrl-C : * Copy block to clipboard"
|
|
|
|
|
>PSTRING " Ctrl-D : * Delete marked block"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
>PSTRING " Ctrl-E : Mark end of block"
|
2016-01-06 22:07:28 +00:00
|
|
|
|
>PSTRING " Ctrl-F : * Find a string..."
|
2016-01-04 07:25:43 +00:00
|
|
|
|
>PSTRING " Ctrl-G : Go to start of current line"
|
|
|
|
|
>PSTRING " Ctrl-L : Go to end of current line"
|
2016-01-06 22:07:28 +00:00
|
|
|
|
>PSTRING " Ctrl-N : * Find next"
|
|
|
|
|
>PSTRING " Ctrl-O : * Page up"
|
|
|
|
|
>PSTRING " Ctrl-P : * Page down"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
>PSTRING " Ctrl-Q : Quit"
|
2016-01-06 22:07:28 +00:00
|
|
|
|
>PSTRING " Ctrl-R : * Replace found string with..."
|
|
|
|
|
>PSTRING " Ctrl-S : Save file to disk..."
|
|
|
|
|
>PSTRING " Ctrl-T : * Go to top of file"
|
|
|
|
|
>PSTRING " Ctrl-V : * Past clipboard"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
>PSTRING " Ctrl-W : "
|
2016-01-06 22:07:28 +00:00
|
|
|
|
>PSTRING " Ctrl-X : * Cut block to clipboard"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
>PSTRING " Ctrl-Y : "
|
2016-01-06 22:07:28 +00:00
|
|
|
|
>PSTRING " Ctrl-Z : * Undo previous change"
|
2016-01-04 07:25:43 +00:00
|
|
|
|
.HS 00
|
|
|
|
|
EscChars >PSTRING "DBAC"
|
|
|
|
|
EscAscii .HS 04080A0B15
|
|
|
|
|
hFile .BS 1
|
2016-01-04 22:15:29 +00:00
|
|
|
|
TmpByte .BS 1
|
2016-01-04 07:25:43 +00:00
|
|
|
|
TmpLen .BS 2
|
|
|
|
|
TmpCount .BS 2
|
|
|
|
|
TmpIndex .BS 2
|
|
|
|
|
BUF.LOffset .BS 2
|
|
|
|
|
BUF.COffset .BS 2
|
|
|
|
|
BUF.TmpLine1 .BS 2
|
|
|
|
|
BUF.TmpLine2 .BS 2
|
|
|
|
|
bNotRepaint .BS 1
|
|
|
|
|
bSelected .BS 1
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2016-01-04 07:25:43 +00:00
|
|
|
|
PromptBuffer .BS PromptBufferMax+1
|
|
|
|
|
PromptMode .BS 1
|
|
|
|
|
bCancel .BS 1
|
|
|
|
|
bInit .BS 1
|
|
|
|
|
bSaved .BS 1
|
|
|
|
|
bEscMode .BS 1
|
|
|
|
|
EscBuffer .BS 16
|
2015-08-05 20:38:05 +00:00
|
|
|
|
hFileName .BS 1
|
2016-01-04 07:25:43 +00:00
|
|
|
|
hFind .BS 1
|
|
|
|
|
hReplace .BS 1
|
2015-08-05 20:38:05 +00:00
|
|
|
|
hBuffer .BS 1
|
2016-01-04 07:25:43 +00:00
|
|
|
|
hBufferBackup .BS 1
|
|
|
|
|
hClipBoard .BS 1
|
2015-08-05 20:38:05 +00:00
|
|
|
|
FileLen .BS 2
|
2016-01-04 07:25:43 +00:00
|
|
|
|
ScreenW .BS 1
|
|
|
|
|
ScreenH .BS 1
|
|
|
|
|
ScreenX .BS 1
|
|
|
|
|
ScreenY .BS 2
|
|
|
|
|
CurX .BS 1
|
|
|
|
|
CurY .BS 1
|
|
|
|
|
FileX .BS 1
|
|
|
|
|
FileY .BS 2
|
|
|
|
|
SelStart .BS 2
|
|
|
|
|
SelEnd .BS 2
|
2015-08-05 20:38:05 +00:00
|
|
|
|
DS.END
|
|
|
|
|
.ED
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE BIN/EDIT.S
|
|
|
|
|
ASM
|