mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-01 14:50:10 +00:00
817 lines
12 KiB
Plaintext
817 lines
12 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
DLG.Open >STYA ZPPTR2
|
||
lda (ZPPTR2)
|
||
tay
|
||
lda #0
|
||
>SYSCALL getmem
|
||
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
|
||
jsr DLG.DrawInvBar
|
||
.99 bcs .9
|
||
|
||
jsr SCRN.LineBufInitNorm
|
||
|
||
jsr DLG.VBarToLineBuf
|
||
|
||
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
|
||
jsr DLG.DrawInvBar
|
||
bcs .9
|
||
|
||
ldy #S.DLG.Ctrls
|
||
|
||
.5 lda (ZPPTR1),y
|
||
beq .8
|
||
|
||
phy
|
||
tya
|
||
jsr DLG.CTRL.Draw
|
||
ply
|
||
bcs .9
|
||
|
||
iny
|
||
bra .5
|
||
|
||
.8 ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y
|
||
jsr DLG.CTRL.Focus
|
||
|
||
clc
|
||
.9 rts
|
||
*--------------------------------------
|
||
DLG.Run >SYSCALL getchar
|
||
bcs .9
|
||
|
||
cmp #3
|
||
beq .8
|
||
|
||
cmp #C.CR
|
||
beq .8
|
||
|
||
cmp #C.TAB
|
||
beq DLG.NextFocus
|
||
pha
|
||
|
||
ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y get actual focused Ctrl
|
||
|
||
tay
|
||
|
||
pla
|
||
jsr DLG.CTRL.CharIn
|
||
|
||
|
||
bra DLG.Run
|
||
|
||
rts
|
||
|
||
.8 clc
|
||
.9 rts
|
||
*--------------------------------------
|
||
DLG.NextFocus ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y get actual focused Ctrl
|
||
|
||
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
|
||
jsr DLG.CTRL.Focus
|
||
|
||
pla
|
||
jsr DLG.CTRL.Focus
|
||
jmp DLG.Run
|
||
*--------------------------------------
|
||
DLG.Close ldy #S.DLG.Y
|
||
lda (ZPPTR1),y
|
||
|
||
sta TmpByte
|
||
|
||
.1 >LDA.G ScreenY
|
||
clc
|
||
ldy #S.DLG.Y
|
||
adc (ZPPTR1),y
|
||
sta TmpIndex
|
||
|
||
>LDA.G ScreenY+1
|
||
adc #0
|
||
sta TmpIndex+1
|
||
|
||
ldy #S.DLG.H
|
||
lda (ZPPTR1),y
|
||
|
||
jmp SCRN.UpdateMain.1
|
||
*--------------------------------------
|
||
DLG.CTRL.Draw sta TmpByte A=CtrlID
|
||
tay
|
||
lda (ZPPTR1),y Ctrl Definition
|
||
tay
|
||
lda (ZPPTR1),y Ctrl Type
|
||
tax
|
||
jmp (J.DLG.CTRL.Draw,x)
|
||
*--------------------------------------
|
||
DLG.CTRL.Draw.LBL
|
||
jsr SCRN.LineBufInitNorm
|
||
|
||
jsr DLG.CTRL.GotoOrg
|
||
bcs .9
|
||
|
||
ldy TmpByte CtrlID
|
||
lda (ZPPTR1),y
|
||
tay
|
||
|
||
iny
|
||
iny
|
||
iny
|
||
|
||
.1 lda (ZPPTR1),y
|
||
beq .8
|
||
|
||
jsr SCRN.ToLineBuf
|
||
iny
|
||
bra .1
|
||
|
||
.8 jmp SCRN.LineBufOut
|
||
.9 rts
|
||
*--------------------------------------
|
||
DLG.CTRL.Draw.TB
|
||
jsr SCRN.LineBufInitNorm
|
||
|
||
jsr DLG.CTRL.GotoOrg
|
||
bcs .9
|
||
|
||
ldy TmpByte
|
||
lda (ZPPTR1),y
|
||
tay
|
||
|
||
iny
|
||
iny
|
||
iny
|
||
|
||
iny
|
||
|
||
iny
|
||
|
||
lda (ZPPTR1),y
|
||
tay
|
||
lda (pData),y
|
||
|
||
>SYSCALL getmemptr
|
||
>STYA ZPPTR2
|
||
|
||
lda #C.SPACE
|
||
jsr SCRN.ToLineBuf
|
||
|
||
ldy #0
|
||
|
||
.1 lda (ZPPTR2),y
|
||
beq .2
|
||
|
||
jsr SCRN.ToLineBuf
|
||
iny
|
||
bra .1
|
||
|
||
.2 tya
|
||
tax
|
||
|
||
ldy TmpByte
|
||
lda (ZPPTR1),y
|
||
tay
|
||
|
||
iny
|
||
iny
|
||
iny
|
||
|
||
txa
|
||
sta (ZPPTR1),y CURPOS
|
||
iny
|
||
|
||
.3 txa
|
||
eor (ZPPTR1),y MAXCHAR
|
||
beq .8
|
||
|
||
lda #C.SPACE
|
||
jsr SCRN.ToLineBuf
|
||
inx
|
||
bra .3
|
||
|
||
.8 lda #C.SPACE
|
||
jsr SCRN.ToLineBuf
|
||
|
||
jmp SCRN.LineBufOut
|
||
.9 rts
|
||
*--------------------------------------
|
||
DLG.CTRL.Draw.OL
|
||
jsr SCRN.LineBufInitNorm
|
||
|
||
jsr DLG.CTRL.GotoOrg
|
||
bcs .9
|
||
|
||
ldy TmpByte
|
||
lda (ZPPTR1),y
|
||
tay
|
||
|
||
iny
|
||
iny
|
||
iny
|
||
|
||
iny
|
||
iny
|
||
|
||
lda (ZPPTR1),y value
|
||
sta TmpCount
|
||
|
||
iny
|
||
|
||
.1 lda #"("
|
||
jsr SCRN.ToLineBuf
|
||
lda #"o"
|
||
cpx TmpCount
|
||
beq .2
|
||
lda #C.SPACE
|
||
|
||
.2 jsr SCRN.ToLineBuf
|
||
lda #")"
|
||
jsr SCRN.ToLineBuf
|
||
lda #C.SPACE
|
||
jsr SCRN.ToLineBuf
|
||
|
||
.3 lda (ZPPTR1),y
|
||
beq .4
|
||
jsr SCRN.ToLineBuf
|
||
iny
|
||
bra .3
|
||
|
||
.4 lda #C.SPACE
|
||
jsr SCRN.ToLineBuf
|
||
|
||
.8 jmp SCRN.LineBufOut
|
||
.9 rts
|
||
*--------------------------------------
|
||
DLG.CTRL.Draw.BUT
|
||
jsr SCRN.LineBufInitInv
|
||
|
||
jsr DLG.CTRL.GotoOrg
|
||
bcs .9
|
||
|
||
ldy TmpByte CtrlID
|
||
lda (ZPPTR1),y
|
||
tay
|
||
|
||
iny
|
||
iny
|
||
iny
|
||
|
||
iny
|
||
|
||
lda #C.SPACE
|
||
jsr SCRN.ToLineBuf
|
||
|
||
.1 lda (ZPPTR1),y
|
||
beq .8
|
||
|
||
jsr SCRN.ToLineBuf
|
||
iny
|
||
bra .1
|
||
|
||
.8 lda #C.SPACE
|
||
jsr SCRN.ToLineBuf
|
||
|
||
jmp SCRN.LineBufOut
|
||
.9 rts
|
||
*--------------------------------------
|
||
DLG.CTRL.Focus sta TmpByte A=CtrlID
|
||
|
||
jsr SCRN.LineBufInitNorm
|
||
|
||
ldy TmpByte
|
||
lda (ZPPTR1),y Ctrl Definition
|
||
tay
|
||
lda (ZPPTR1),y Ctrl Type
|
||
tax
|
||
jmp (J.DLG.CTRL.Focus,x)
|
||
*--------------------------------------
|
||
DLG.CTRL.Focus.LBL
|
||
clc
|
||
rts
|
||
DLG.CTRL.Focus.TB
|
||
jsr DLG.CTRL.GotoOrg
|
||
|
||
ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y
|
||
eor TmpByte
|
||
bne .1
|
||
sec
|
||
|
||
.1 lda #C.SPACE
|
||
bcc .2
|
||
lda #'['
|
||
.2 jsr SCRN.ToLineBuf
|
||
|
||
jsr DLG.CTRL.GotoEnd
|
||
|
||
ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y
|
||
eor TmpByte
|
||
bne .3
|
||
sec
|
||
|
||
.3 lda #C.SPACE
|
||
bcc .4
|
||
lda #']'
|
||
.4 jsr SCRN.ToLineBuf
|
||
|
||
jsr SCRN.LineBufOut
|
||
|
||
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
|
||
|
||
jmp SCRN.GotoXY
|
||
|
||
DLG.CTRL.Focus.OL
|
||
jsr DLG.CTRL.GotoOrg
|
||
|
||
ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y
|
||
eor TmpByte
|
||
bne .1
|
||
sec
|
||
|
||
.1 lda #'('
|
||
bcc .2
|
||
lda #'['
|
||
.2 jsr SCRN.ToLineBuf
|
||
|
||
jsr DLG.CTRL.GotoEnd
|
||
|
||
ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y
|
||
eor TmpByte
|
||
bne .3
|
||
sec
|
||
|
||
.3 lda #')'
|
||
bcc .4
|
||
lda #']'
|
||
.4 jsr SCRN.ToLineBuf
|
||
|
||
jmp SCRN.LineBufOut
|
||
|
||
DLG.CTRL.Focus.BUT
|
||
jsr DLG.CTRL.GotoOrg
|
||
|
||
ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y
|
||
eor TmpByte
|
||
bne .1
|
||
sec
|
||
|
||
.1 lda #C.SPACE
|
||
bcc .2
|
||
lda #'['
|
||
.2 jsr SCRN.ToLineBuf
|
||
|
||
jsr DLG.CTRL.GotoEnd
|
||
|
||
ldy #S.DLG.Focus
|
||
lda (ZPPTR1),y
|
||
eor TmpByte
|
||
bne .3
|
||
sec
|
||
|
||
.3 lda #C.SPACE
|
||
bcc .4
|
||
lda #']'
|
||
.4 jsr SCRN.ToLineBuf
|
||
|
||
jmp SCRN.LineBufOut
|
||
*--------------------------------------
|
||
DLG.CTRL.GotoOrg
|
||
clc
|
||
.HS B0 BCS
|
||
DLG.CTRL.GotoEnd
|
||
sec
|
||
php
|
||
|
||
ldy TmpByte CtrlID
|
||
lda (ZPPTR1),y
|
||
tay
|
||
|
||
iny skip Ctrl Type
|
||
lda (ZPPTR1),y
|
||
clc
|
||
|
||
ldy #S.DLG.X
|
||
adc (ZPPTR1),y
|
||
plp
|
||
bcc .1
|
||
|
||
>PUSHA
|
||
jsr DLG.CTRL.GetWitdh
|
||
clc
|
||
adc (pStack)
|
||
inc pStack
|
||
|
||
.1 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
|
||
|
||
DLG.CTRL.GotoXY
|
||
txa
|
||
inc
|
||
>PUSHA
|
||
tya
|
||
inc
|
||
inc
|
||
>PUSHA
|
||
>PUSHBI 2
|
||
>PUSHW L.MSG.GOTOXY
|
||
>LDYA LineBufPtr
|
||
>SYSCALL sprintf
|
||
|
||
.2 lda (LineBufPtr)
|
||
beq .8
|
||
inc LineBufPtr
|
||
bne .2
|
||
inc LineBufPtr+1
|
||
bra .2
|
||
|
||
.8 rts
|
||
*--------------------------------------
|
||
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
|
||
*--------------------------------------
|
||
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
|
||
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
|
||
*--------------------------------------
|
||
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
|
||
>SYSCALL getmemptr
|
||
>STYA ZPPTR2
|
||
|
||
ply
|
||
|
||
pla
|
||
pha
|
||
|
||
sta (ZPPTR2),y
|
||
iny
|
||
lda #0
|
||
sta (ZPPTR2),y
|
||
|
||
pla
|
||
>SYSCALL putchar
|
||
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
|
||
>SYSCALL getmemptr
|
||
>STYA ZPPTR2
|
||
|
||
ply
|
||
lda #0
|
||
sta (ZPPTR2),y
|
||
|
||
lda #C.DEL
|
||
>SYSCALL putchar
|
||
clc
|
||
rts
|
||
|
||
.7 pla
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
*--------------------------------------
|
||
DLG.CTRL.CharIn.OL
|
||
cmp #C.SPACE
|
||
bne .8
|
||
|
||
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
*--------------------------------------
|
||
DLG.CTRL.CharIn.BUT
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
DLG.DrawInvBar phy
|
||
jsr SCRN.LineBufInitInv
|
||
|
||
ldy #S.DLG.W
|
||
lda (ZPPTR1),y
|
||
tax
|
||
|
||
ply
|
||
lda (ZPPTR1),y
|
||
tay
|
||
|
||
.1 lda (ZPPTR1),y
|
||
beq .11
|
||
jsr SCRN.ToLineBuf
|
||
dex
|
||
iny
|
||
bra .1
|
||
|
||
.11 lda #C.SPACE
|
||
|
||
.2 jsr SCRN.ToLineBuf
|
||
dex
|
||
bne .2
|
||
|
||
ldy #0
|
||
.3 lda SEQ.NORM,y
|
||
beq .4
|
||
jsr SCRN.ToLineBuf
|
||
iny
|
||
bra .3
|
||
|
||
.4 jsr DLG.VBarToLineBuf
|
||
|
||
jmp SCRN.LineBufOut
|
||
*--------------------------------------
|
||
DLG.VBarToLineBuf
|
||
lda #C.SO
|
||
jsr SCRN.ToLineBuf
|
||
lda #'x'
|
||
jsr SCRN.ToLineBuf
|
||
lda #C.SI
|
||
jmp SCRN.ToLineBuf
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/BIN/EDIT.S.DLG
|
||
LOAD USR/SRC/BIN/EDIT.S
|
||
ASM
|