A2osX/BIN/EDIT.S.DLG.txt

862 lines
12 KiB
Plaintext
Raw Normal View History

2019-11-20 16:37:09 +00:00
NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
DLG.Open >STYA ZPPTR2
lda (ZPPTR2)
tay
lda #0
2020-02-28 07:21:46 +00:00
>SYSCALL GetMem
2019-11-20 16:37:09 +00:00
bcs .99
>STYA ZPPTR1
txa
>STA.G hDLG
ldy #0
.1 lda (ZPPTR2),y
sta (ZPPTR1),y
iny
tya
cmp (ZPPTR2)
bne .1
jsr DLG.SetOrigin
sty TmpByte
jsr SCRN.GotoXY
bcs .9
ldy #S.DLG.Title
2019-12-09 07:12:14 +00:00
jsr DLG.DrawBar
2019-11-20 16:37:09 +00:00
.99 bcs .9
2019-12-09 07:12:14 +00:00
jsr SCRN.LineBufInitDLG
2019-11-20 16:37:09 +00:00
ldy #S.DLG.W
lda (ZPPTR1),y
dec
tax
lda #C.SPACE
.3 jsr SCRN.ToLineBuf
dex
bne .3
jsr DLG.VBarToLineBuf
ldy #S.DLG.H
lda (ZPPTR1),y
dec
dec
tax
.4 phx
inc TmpByte
ldy #S.DLG.X
lda (ZPPTR1),y
tax
ldy TmpByte
jsr SCRN.GotoXY
bcs .9
jsr SCRN.LineBufOut
bcs .9
plx
dex
bne .4
inc TmpByte
ldy #S.DLG.X
lda (ZPPTR1),y
tax
ldy TmpByte
jsr SCRN.GotoXY
bcs .9
ldy #S.DLG.Status
2019-12-09 07:12:14 +00:00
jsr DLG.DrawBar
2019-11-20 16:37:09 +00:00
bcs .9
2019-12-12 07:09:44 +00:00
jmp DLG.CTRL.DrawAll
2019-11-20 16:37:09 +00:00
.9 rts
*--------------------------------------
2020-02-10 16:24:49 +00:00
DLG.Run jsr GetCh
2019-11-21 15:59:09 +00:00
bcs .9
cmp #3
beq .8
cmp #C.CR
beq .8
2020-02-14 07:21:56 +00:00
2019-11-21 15:59:09 +00:00
cmp #C.TAB
2019-11-28 16:50:08 +00:00
beq DLG.NextFocus
pha
ldy #S.DLG.Focus
lda (ZPPTR1),y get actual focused Ctrl
tay
pla
jsr DLG.CTRL.CharIn
bra DLG.Run
2020-05-17 17:34:32 +00:00
2019-11-21 15:59:09 +00:00
.8 clc
2019-11-28 16:50:08 +00:00
.9 rts
2019-11-21 15:59:09 +00:00
*--------------------------------------
2019-11-25 07:05:07 +00:00
DLG.NextFocus ldy #S.DLG.Focus
lda (ZPPTR1),y get actual focused Ctrl
2019-11-21 15:59:09 +00:00
2019-11-25 07:05:07 +00:00
pha save it...
tax
.1 inx next one
.2 txa
tay
lda (ZPPTR1),y Get Ctrl
bne .3 end of list, get first
ldx #S.DLG.Ctrls
bra .2
.3 tay
lda (ZPPTR1),y Get Ctrl Type
beq .1 LBL
txa
ldy #S.DLG.Focus
sta (ZPPTR1),y
pla get old focused
phx save new focused
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.Focus
2019-11-25 07:05:07 +00:00
2019-11-27 16:47:13 +00:00
pla
2019-11-28 16:50:08 +00:00
jsr DLG.CTRL.Focus
jmp DLG.Run
2019-11-21 15:59:09 +00:00
*--------------------------------------
2019-11-28 16:50:08 +00:00
DLG.Close ldy #S.DLG.Y
2019-11-21 15:59:09 +00:00
lda (ZPPTR1),y
2019-11-22 16:02:59 +00:00
sta TmpByte
2019-11-21 15:59:09 +00:00
2019-12-16 13:14:11 +00:00
>LDA.G ScreenY
2019-11-21 15:59:09 +00:00
clc
2019-11-22 14:05:37 +00:00
ldy #S.DLG.Y
adc (ZPPTR1),y
sta TmpIndex
>LDA.G ScreenY+1
adc #0
sta TmpIndex+1
2019-11-28 16:50:08 +00:00
ldy #S.DLG.H
lda (ZPPTR1),y
2019-11-22 14:05:37 +00:00
2019-12-11 13:14:56 +00:00
jsr SCRN.UpdateMain.1
bcs .9
>LDA.G hDLG
2020-02-28 07:21:46 +00:00
>SYSCALL FreeMem
2019-12-11 13:14:56 +00:00
>STZ.G hDLG
clc
.9 rts
2019-11-21 15:59:09 +00:00
*--------------------------------------
DLG.CTRL.DrawAll
ldy #S.DLG.Ctrls
.5 lda (ZPPTR1),y
beq .8
phy
jsr DLG.CTRL.Draw
ply
bcs .9
iny
bra .5
.8 ldy #S.DLG.Focus
lda (ZPPTR1),y
jmp DLG.CTRL.Focus
.9 rts
*--------------------------------------
2021-07-11 11:42:12 +00:00
DLG.CTRL.Draw sty TmpByte Y=CtrlID
2019-11-25 07:05:07 +00:00
lda (ZPPTR1),y Ctrl Definition
tay
lda (ZPPTR1),y Ctrl Type
tax
jmp (J.DLG.CTRL.Draw,x)
*--------------------------------------
DLG.CTRL.Draw.LBL
2020-02-28 16:30:16 +00:00
jsr SCRN.LineBufInitLBL
2019-11-25 07:05:07 +00:00
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoOrg
2019-11-20 16:37:09 +00:00
bcs .9
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
2019-11-21 07:01:46 +00:00
iny
iny
iny
2019-11-20 16:37:09 +00:00
.1 lda (ZPPTR1),y
beq .8
jsr SCRN.ToLineBuf
iny
bra .1
2019-12-13 16:06:23 +00:00
.8 jmp SCRN.LineBufOut
2019-12-12 07:09:44 +00:00
2019-11-20 16:37:09 +00:00
.9 rts
*--------------------------------------
2019-11-25 07:05:07 +00:00
DLG.CTRL.Draw.TB
2019-12-11 16:54:41 +00:00
jsr SCRN.LineBufInitTB
2019-11-25 07:05:07 +00:00
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoOrg
2019-11-20 16:37:09 +00:00
bcs .9
ldy TmpByte
lda (ZPPTR1),y
tay
2019-11-21 07:01:46 +00:00
iny
iny
iny
2019-11-21 15:59:09 +00:00
2019-11-21 07:01:46 +00:00
iny
2019-11-21 15:59:09 +00:00
2019-11-21 07:01:46 +00:00
iny
lda (ZPPTR1),y
tay
2019-11-20 16:37:09 +00:00
lda (pData),y
2020-02-28 16:30:16 +00:00
>SYSCALL GetMemPtr
2019-11-20 16:37:09 +00:00
>STYA ZPPTR2
2019-11-27 16:47:13 +00:00
lda #C.SPACE
jsr SCRN.ToLineBuf
2019-11-21 15:59:09 +00:00
2019-11-20 16:37:09 +00:00
ldy #0
2019-11-21 07:01:46 +00:00
.1 lda (ZPPTR2),y
2019-11-21 15:59:09 +00:00
beq .2
2019-11-20 16:37:09 +00:00
jsr SCRN.ToLineBuf
iny
bra .1
2019-11-21 15:59:09 +00:00
.2 tya
tax
ldy TmpByte
lda (ZPPTR1),y
tay
iny
iny
iny
2019-11-28 16:50:08 +00:00
txa
sta (ZPPTR1),y CURPOS
2019-11-21 15:59:09 +00:00
iny
.3 txa
2019-11-25 07:05:07 +00:00
eor (ZPPTR1),y MAXCHAR
2019-11-21 15:59:09 +00:00
beq .8
lda #C.SPACE
jsr SCRN.ToLineBuf
inx
bra .3
2019-11-25 07:05:07 +00:00
.8 lda #C.SPACE
2019-11-27 16:47:13 +00:00
jsr SCRN.ToLineBuf
2019-11-21 15:59:09 +00:00
jmp SCRN.LineBufOut
2019-11-20 16:37:09 +00:00
.9 rts
*--------------------------------------
2019-11-25 07:05:07 +00:00
DLG.CTRL.Draw.OL
2020-02-28 16:30:16 +00:00
jsr SCRN.LineBufInitLBL
2019-12-12 07:09:44 +00:00
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoOrg
2019-11-21 15:59:09 +00:00
bcs .9
ldy TmpByte
lda (ZPPTR1),y
tay S.DLG.Ctrl.OL
2019-11-21 15:59:09 +00:00
iny X
iny Y
iny shortcut
2019-11-21 15:59:09 +00:00
iny varptr
lda (ZPPTR1),y
phy
tay
lda (pData),y
ply
2019-11-21 15:59:09 +00:00
iny value
2019-11-21 15:59:09 +00:00
eor (ZPPTR1),y
tax
iny label
2019-11-27 16:47:13 +00:00
lda #"("
2019-11-21 15:59:09 +00:00
jsr SCRN.ToLineBuf
2019-11-21 15:59:09 +00:00
lda #"o"
cpx #0
2019-11-21 15:59:09 +00:00
beq .2
2019-11-21 15:59:09 +00:00
lda #C.SPACE
.2 jsr SCRN.ToLineBuf
lda #")"
jsr SCRN.ToLineBuf
2019-11-21 15:59:09 +00:00
lda #C.SPACE
jsr SCRN.ToLineBuf
.3 lda (ZPPTR1),y
beq .4
2019-11-21 15:59:09 +00:00
jsr SCRN.ToLineBuf
iny
bra .3
.4 lda #C.SPACE
jsr SCRN.ToLineBuf
2019-12-16 13:14:11 +00:00
.8 jmp SCRN.LineBufOut
2019-12-13 16:06:23 +00:00
2019-11-22 14:05:37 +00:00
.9 rts
*--------------------------------------
2019-11-25 07:05:07 +00:00
DLG.CTRL.Draw.BUT
2019-12-09 07:12:14 +00:00
jsr SCRN.LineBufInitBut
2019-11-22 14:05:37 +00:00
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoOrg
2019-11-22 14:05:37 +00:00
bcs .9
2019-11-27 16:47:13 +00:00
ldy TmpByte CtrlID
2019-11-22 14:05:37 +00:00
lda (ZPPTR1),y
tay
iny
iny
iny
iny
2019-11-25 07:05:07 +00:00
lda #C.SPACE
2019-11-27 16:47:13 +00:00
jsr SCRN.ToLineBuf
2019-11-22 14:05:37 +00:00
.1 lda (ZPPTR1),y
beq .8
jsr SCRN.ToLineBuf
iny
bra .1
2019-11-25 07:05:07 +00:00
.8 lda #C.SPACE
2019-11-27 16:47:13 +00:00
jsr SCRN.ToLineBuf
2019-11-25 07:05:07 +00:00
jmp SCRN.LineBufOut
2019-11-21 15:59:09 +00:00
.9 rts
2019-11-20 16:37:09 +00:00
*--------------------------------------
2019-11-25 07:05:07 +00:00
DLG.CTRL.Focus sta TmpByte A=CtrlID
2019-11-28 16:50:08 +00:00
2019-12-09 07:12:14 +00:00
tay
2019-11-25 07:05:07 +00:00
lda (ZPPTR1),y Ctrl Definition
tay
lda (ZPPTR1),y Ctrl Type
tax
2019-12-12 07:09:44 +00:00
2019-11-25 07:05:07 +00:00
jmp (J.DLG.CTRL.Focus,x)
*--------------------------------------
DLG.CTRL.Focus.LBL
2019-11-27 16:47:13 +00:00
clc
rts
2019-11-25 07:05:07 +00:00
DLG.CTRL.Focus.TB
2019-12-11 16:54:41 +00:00
jsr SCRN.LineBufInitTB
2019-12-09 07:12:14 +00:00
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoOrg
ldy #S.DLG.Focus
lda (ZPPTR1),y
eor TmpByte
bne .1
sec
.1 lda #C.SPACE
bcc .2
lda #'['
2019-11-28 16:50:08 +00:00
.2 jsr SCRN.ToLineBuf
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoEnd
ldy #S.DLG.Focus
lda (ZPPTR1),y
eor TmpByte
bne .3
sec
.3 lda #C.SPACE
bcc .4
lda #']'
2019-11-28 16:50:08 +00:00
.4 jsr SCRN.ToLineBuf
jsr SCRN.LineBufOut
2019-11-27 16:47:13 +00:00
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
iny skip Ctrl Type
lda (ZPPTR1),y
clc
ldy #S.DLG.X
adc (ZPPTR1),y
pha
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
iny
iny
iny
pla
sec +1
adc (ZPPTR1),y
tax
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
iny skip Ctrl Type
iny skip X
lda (ZPPTR1),y
clc
ldy #S.DLG.Y
adc (ZPPTR1),y
tay
2020-02-28 16:30:16 +00:00
jmp SCRN.GotoXY
2019-11-27 16:47:13 +00:00
2019-11-25 07:05:07 +00:00
DLG.CTRL.Focus.OL
2020-02-28 16:30:16 +00:00
jsr SCRN.LineBufInitLBL
2019-12-09 07:12:14 +00:00
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoOrg
ldy #S.DLG.Focus
lda (ZPPTR1),y
eor TmpByte
bne .1
sec
.1 lda #'('
bcc .2
lda #'['
2019-11-28 16:50:08 +00:00
.2 jsr SCRN.ToLineBuf
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoEnd
ldy #S.DLG.Focus
lda (ZPPTR1),y
eor TmpByte
bne .3
sec
.3 lda #')'
bcc .4
lda #']'
2019-11-28 16:50:08 +00:00
.4 jsr SCRN.ToLineBuf
2019-12-13 16:06:23 +00:00
lda #C.BS
jsr SCRN.ToLineBuf
jsr SCRN.ToLineBuf
2019-11-28 16:50:08 +00:00
jmp SCRN.LineBufOut
2019-11-27 16:47:13 +00:00
2019-11-25 07:05:07 +00:00
DLG.CTRL.Focus.BUT
2019-12-11 16:54:41 +00:00
jsr SCRN.LineBufInitBut
2019-12-09 07:12:14 +00:00
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoOrg
ldy #S.DLG.Focus
lda (ZPPTR1),y
eor TmpByte
bne .1
sec
.1 lda #C.SPACE
bcc .2
lda #'['
2019-11-28 16:50:08 +00:00
.2 jsr SCRN.ToLineBuf
2019-11-27 16:47:13 +00:00
jsr DLG.CTRL.GotoEnd
ldy #S.DLG.Focus
lda (ZPPTR1),y
eor TmpByte
bne .3
sec
.3 lda #C.SPACE
bcc .4
lda #']'
2019-11-28 16:50:08 +00:00
.4 jsr SCRN.ToLineBuf
2019-11-27 16:47:13 +00:00
2019-11-28 16:50:08 +00:00
jmp SCRN.LineBufOut
2019-11-25 07:05:07 +00:00
*--------------------------------------
2019-11-27 16:47:13 +00:00
DLG.CTRL.GotoOrg
clc
.HS B0 BCS
DLG.CTRL.GotoEnd
sec
php
2019-11-20 16:37:09 +00:00
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
iny skip Ctrl Type
lda (ZPPTR1),y
clc
2019-11-27 16:47:13 +00:00
2019-11-20 16:37:09 +00:00
ldy #S.DLG.X
adc (ZPPTR1),y
2019-11-27 16:47:13 +00:00
plp
bcc .1
2019-11-28 16:50:08 +00:00
2019-11-27 16:47:13 +00:00
>PUSHA
jsr DLG.CTRL.GetWitdh
2019-11-28 16:50:08 +00:00
clc
adc (pStack)
inc pStack
2019-11-20 16:37:09 +00:00
2019-11-27 16:47:13 +00:00
.1 tax
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
iny skip Ctrl Type
iny skip X
2019-11-20 16:37:09 +00:00
lda (ZPPTR1),y
clc
ldy #S.DLG.Y
adc (ZPPTR1),y
tay
DLG.CTRL.GotoXY >PUSHW LineBufPtr
2020-02-14 07:21:56 +00:00
>PUSHW L.MSG.GOTOXY
2019-11-28 16:50:08 +00:00
tya
inc
inc
>PUSHA
2020-02-14 07:21:56 +00:00
txa
inc
>PUSHA
2019-11-28 16:50:08 +00:00
>PUSHBI 2
2020-02-28 16:30:16 +00:00
>SYSCALL SPrintF
2019-11-28 16:50:08 +00:00
.2 lda (LineBufPtr)
beq .8
inc LineBufPtr
bne .2
inc LineBufPtr+1
bra .2
.8 rts
2019-11-25 07:05:07 +00:00
*--------------------------------------
2019-11-20 16:37:09 +00:00
DLG.SetOrigin ldy #S.DLG.X
lda (ZPPTR1),y
bne .1
>LDA.G ScreenW
ldy #S.DLG.W
sec
sbc (ZPPTR1),y
lsr
ldy #S.DLG.X
sta (ZPPTR1),y
.1 tax
ldy #S.DLG.Y
lda (ZPPTR1),y
bne .2
>LDA.G ViewPortHm1
ldy #S.DLG.H
sec
sbc (ZPPTR1),y
lsr
ldy #S.DLG.Y
sta (ZPPTR1),y
.2 tay
rts
*--------------------------------------
2019-11-27 16:47:13 +00:00
DLG.CTRL.GetWitdh
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
lda (ZPPTR1),y
tax
jmp (J.DLG.CTRL.GetWitdh,x)
*--------------------------------------
DLG.CTRL.GetWitdh.LBL
clc
rts
DLG.CTRL.GetWitdh.TB
iny
iny
iny
iny
lda (ZPPTR1),y
2019-12-13 16:06:23 +00:00
inc
2019-11-27 16:47:13 +00:00
rts
DLG.CTRL.GetWitdh.OL
lda #2
rts
iny
iny
iny
iny
ldx #0
.1 inx
iny
lda (ZPPTR1),y
bne .1
txa
rts
DLG.CTRL.GetWitdh.BUT
iny
iny
iny
ldx #0
.1 inx
iny
lda (ZPPTR1),y
bne .1
txa
rts
*--------------------------------------
2019-11-28 16:50:08 +00:00
DLG.CTRL.CharIn sty TmpByte A=CtrlID
pha
lda (ZPPTR1),y Ctrl Definition
tay
lda (ZPPTR1),y Ctrl Type
tax
pla
jmp (J.DLG.CTRL.CharIn,x)
*--------------------------------------
DLG.CTRL.CharIn.LBL
sec
rts
*--------------------------------------
DLG.CTRL.CharIn.TB
cmp #C.DEL
beq .5
pha
iny
iny
iny
lda (ZPPTR1),y CURPOS
iny
cmp (ZPPTR1),y MAXCHAR
beq .7
pha
inc
dey
sta (ZPPTR1),y CURPOS
iny
iny
lda (ZPPTR1),y hMem
tay
lda (pData),y
2020-02-28 16:30:16 +00:00
>SYSCALL GetMemPtr
2019-11-28 16:50:08 +00:00
>STYA ZPPTR2
ply
pla
pha
sta (ZPPTR2),y
iny
lda #0
sta (ZPPTR2),y
pla
2020-02-28 16:30:16 +00:00
>SYSCALL PutChar
2019-11-28 16:50:08 +00:00
clc
rts
.5 iny
iny
iny
lda (ZPPTR1),y CURPOS
beq .8
dec
sta (ZPPTR1),y
pha
iny
iny
lda (ZPPTR1),y hMem
tay
lda (pData),y
2020-02-28 16:30:16 +00:00
>SYSCALL GetMemPtr
2019-11-28 16:50:08 +00:00
>STYA ZPPTR2
ply
lda #0
sta (ZPPTR2),y
lda #C.DEL
2020-02-28 16:30:16 +00:00
>SYSCALL PutChar
2019-11-28 16:50:08 +00:00
clc
rts
.7 pla
.8 clc
rts
*--------------------------------------
DLG.CTRL.CharIn.OL
cmp #C.SPACE
bne .8
iny X
iny Y
iny shortcut
iny varptr
lda (ZPPTR1),y
pha
iny value
lda (ZPPTR1),y
ply
sta (pData),y
2019-11-28 16:50:08 +00:00
jmp DLG.CTRL.DrawAll
2019-11-28 16:50:08 +00:00
.8 clc
rts
*--------------------------------------
DLG.CTRL.CharIn.BUT
clc
rts
*--------------------------------------
2019-12-09 07:12:14 +00:00
DLG.DrawBar phy
jsr SCRN.LineBufInitBar
2019-11-20 16:37:09 +00:00
ldy #S.DLG.W
lda (ZPPTR1),y
tax
ply
lda (ZPPTR1),y
tay
.1 lda (ZPPTR1),y
beq .11
2019-12-09 07:12:14 +00:00
2019-11-20 16:37:09 +00:00
jsr SCRN.ToLineBuf
dex
iny
bra .1
.11 lda #C.SPACE
.2 jsr SCRN.ToLineBuf
dex
bne .2
ldy #0
2019-12-09 07:12:14 +00:00
2019-11-20 16:37:09 +00:00
.3 lda SEQ.NORM,y
beq .4
2019-12-09 07:12:14 +00:00
2019-11-20 16:37:09 +00:00
jsr SCRN.ToLineBuf
iny
bra .3
.4 jsr DLG.VBarToLineBuf
jmp SCRN.LineBufOut
*--------------------------------------
DLG.VBarToLineBuf
2019-12-09 07:12:14 +00:00
ldy #0
.1 lda SEQ.DLG.RIGHT,y
beq .8
2019-11-20 16:37:09 +00:00
jsr SCRN.ToLineBuf
2019-12-09 07:12:14 +00:00
iny
bra .1
.8 rts
2019-11-20 16:37:09 +00:00
*--------------------------------------
MAN
2020-07-27 14:09:19 +00:00
SAVE usr/src/bin/edit.s.dlg
LOAD usr/src/bin/edit.s
2019-11-20 16:37:09 +00:00
ASM