Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-11-20 17:37:09 +01:00
parent b8cadb371a
commit 7d37e7cfad
4 changed files with 321 additions and 241 deletions

Binary file not shown.

276
BIN/EDIT.S.DLG.txt Normal file
View File

@ -0,0 +1,276 @@
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
sty TmpByte
.5 lda (ZPPTR1),y
beq .8
tay
lda (ZPPTR1),y Ctrl Type
tax
>DEBUG
jsr .6
bcs .9
ldy TmpByte
iny
bra .5
.8 clc
.9 rts
.6 >LDYA.G LineBufBase
>STYA LineBufPtr
jmp (J.DLG.DrawCtrls,x)
*--------------------------------------
DLG.DrawCtrls.L jsr DLG.DrawCtrls.GotoXY
bcs .9
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
lda (ZPPTR1),y
inc
inc
inc
tay
.1 lda (ZPPTR1),y
beq .8
jsr SCRN.ToLineBuf
iny
bra .1
.8 jmp SCRN.LineBufOut
.9 rts
*--------------------------------------
DLG.DrawCtrls.TB
jsr DLG.DrawCtrls.GotoXY
bcs .9
ldy TmpByte
lda (ZPPTR1),y
inc
inc
inc
inc
inc
tay
lda (pData),y
>SYSCALL getmemptr
>STYA ZPPTR2
ldy #0
.1 lda (TmpLen),y
beq .8
jsr SCRN.ToLineBuf
iny
bra .1
.8 jmp SCRN.LineBufOut
.9 rts
*--------------------------------------
DLG.DrawCtrls.OL
clc
rts
*--------------------------------------
DLG.DrawCtrls.GotoXY
ldy TmpByte CtrlID
lda (ZPPTR1),y
tay
iny skip Ctrl Type
lda (ZPPTR1),y
clc
phy
ldy #S.DLG.X
adc (ZPPTR1),y
tax
ply
iny
lda (ZPPTR1),y
clc
ldy #S.DLG.Y
adc (ZPPTR1),y
tay
jmp SCRN.GotoXY
*--------------------------------------
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.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
*--------------------------------------
MAN
SAVE USR/SRC/BIN/EDIT.S.DLG
LOAD USR/SRC/BIN/EDIT.S
ASM

View File

@ -534,184 +534,6 @@ SCRN.scrollDn >PUSHBI 0
.9 rts
*--------------------------------------
DLG.Open >STYA ZPPTR1
jsr DLG.GetOrigin
stx TmpIndex
sty TmpIndex+1
stx TmpLen
sty TmpLen+1
jsr SCRN.GotoXY
bcs .9
ldy #4 T
jsr DLG.InvBar
bcs .9
jsr SCRN.LineBufInitNorm
jsr SCRN.VBarToLineBuf
ldy #2 W
lda (ZPPTR1),y
dec
tax
lda #C.SPACE
.3 jsr SCRN.ToLineBuf
dex
bne .3
jsr SCRN.VBarToLineBuf
ldy #3 H
lda (ZPPTR1),y
dec
dec
sta TmpCount
.4 inc tmpLen+1 Y
ldx TmpLen
ldy TmpLen+1
jsr SCRN.GotoXY
bcs .9
jsr SCRN.LineBufOut
bcs .9
dec TmpCount
bne .4
inc tmpLen+1 Y
ldx TmpLen
ldy TmpLen+1
jsr SCRN.GotoXY
bcs .9
ldy #5 S
jsr DLG.InvBar
bcs .9
ldy #6
sty TmpByte
.5 lda (ZPPTR1),y
beq .8
tax
>LDYA.G LineBufBase
>STYA LineBufPtr
jsr .6
bcs .9
ldy TmpByte
iny
bra .5
.6 jmp (J.DLG.DrawCtrls-2,x)
.8 clc
.9 rts
*--------------------------------------
DLG.DrawCtrls.L jsr DLG.DrawCtrls.GotoXY
bcs .9
ldy TmpByte
lda (ZPPTR1),y
tay
.1 lda (ZPPTR1),y
beq .8
jsr SCRN.ToLineBuf
iny
bra .1
.8 jmp SCRN.LineBufOut
.9 rts
DLG.DrawCtrls.TB
jsr DLG.DrawCtrls.GotoXY
bcs .9
ldy TmpByte
iny
iny
iny
lda (ZPPTR1),y
sty TmpByte
>DEBUG
tay
lda (pData),y
>SYSCALL getmemptr
>STYA TmpLen
ldy #0
.1 lda (TmpLen),y
beq .8
jsr SCRN.ToLineBuf
iny
bra .1
.8 jmp SCRN.LineBufOut
.9 rts
*--------------------------------------
DLG.DrawCtrls.GotoXY
ldy TmpByte
iny
lda (ZPPTR1),y
clc
adc TmpIndex
tax
iny
lda (ZPPTR1),y
clc
adc TmpIndex+1
iny
sty TmpByte
tay
jmp SCRN.GotoXY
*--------------------------------------
DLG.GetOrigin lda (ZPPTR1) X
bne .1
>LDA.G ScreenW
ldy #2 W
sec
sbc (ZPPTR1),y
lsr
.1 tax
ldy #1
lda (ZPPTR1),y Y
bne .2
>LDA.G ViewPortHm1
ldy #3 H
sec
sbc (ZPPTR1),y
lsr
.2 tay
rts
*--------------------------------------
SCRN.LineBufInitNorm
clc
.HS B0 BCS
@ -733,48 +555,6 @@ SCRN.LineBufInitInv
rts
*--------------------------------------
DLG.InvBar phy
jsr SCRN.LineBufInitInv
ldy #2 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 SCRN.VBarToLineBuf
jmp SCRN.LineBufOut
*--------------------------------------
SCRN.VBarToLineBuf
lda #C.SO
jsr SCRN.ToLineBuf
lda #'x'
jsr SCRN.ToLineBuf
lda #C.SI
*--------------------------------------
SCRN.ToLineBuf sta (LineBufPtr)
inc LineBufPtr
bne .8

View File

@ -30,16 +30,17 @@ BUF.TmpLine2 .BS 2
FileLen .BS 2
BufLen .BS 2
SelLen .BS 2
ZPPTR1 .BS 2
bRepaint .BS 1
bSelected .BS 1
ZPPTR2 .EQ *
TmpLen .BS 2
TmpIndex .BS 2
ZPPTR1 .BS 2
TmpCount .BS 1
TmpByte .BS 1
bRepaint .BS 1
bSelected .BS 1
ZS.END .ED
*--------------------------------------
@ -135,6 +136,7 @@ J.CTRL .DA Ctrl.Invalid
L.DLG.SAVE .DA DLG.SAVE
J.DLG.DrawCtrls .DA DLG.DrawCtrls.L
.DA DLG.DrawCtrls.TB
.DA DLG.DrawCtrls.OL
.DA 0
*--------------------------------------
CS.INIT clc
@ -361,6 +363,7 @@ CharIn.Esc >STZ.G bEscMode
*--------------------------------------
.INB USR/SRC/BIN/EDIT.S.BUF
.INB USR/SRC/BIN/EDIT.S.CTRL
.INB USR/SRC/BIN/EDIT.S.DLG
.INB USR/SRC/BIN/EDIT.S.FILE
.INB USR/SRC/BIN/EDIT.S.SCRN
*--------------------------------------
@ -419,37 +422,57 @@ EscChars .AS "DBAC"
EscChars.Cnt .EQ *-EscChars
EscAscii .HS 080A0B15
*--------------------------------------
DLG.SAVE .DA #0 X
S.DLG.Size .EQ 0
S.DLG.X .EQ 1
S.DLG.Y .EQ 2
S.DLG.W .EQ 3
S.DLG.H .EQ 4
S.DLG.Title .EQ 5
S.DLG.Status .EQ 6
S.DLG.Focus .EQ 7
S.DLG.Ctrls .EQ 8
S.DLG.Ctrl.LBL .EQ 0
S.DLG.Ctrl.TB .EQ 2
S.DLG.Ctrl.OL .EQ 4
*--------------------------------------
DLG.SAVE .DA #DLG.SAVE.LEN Size
.DA #0 X
.DA #0 Y
.DA #70 W
.DA #8 H
.DA #DLG.SAVE.T-DLG.SAVE Title
.DA #DLG.SAVE.S-DLG.SAVE Status
.DA #2,#3,#2 LABEL,x,y
.DA #DLG.SAVE.L.FN-DLG.SAVE
.DA #4,#3,#3,#1,#64,#hFileName TEXTBOX,x,y,ID,MAXCHAR,hMem
.DA #2,#3,#4 LABEL,x,y
.DA #DLG.SAVE.L.FT-DLG.SAVE
.DA #0 Focus
.DA #DLG.SAVE.1-DLG.SAVE
.DA #DLG.SAVE.2-DLG.SAVE
.DA #DLG.SAVE.3-DLG.SAVE
.DA #DLG.SAVE.4-DLG.SAVE
.DA #0
.DA #6,#3,#5,#2 OPTIONLIST,x,y,ID
.DA #3
DLG.SAVE.1 .DA #S.DLG.Ctrl.LBL,#3,#2
.AZ "Filename :"
DLG.SAVE.2 .DA #S.DLG.Ctrl.TB,4,#3,#3
.DA #0,#64,#hFileName CURPOS,MAXCHAR,hMem
DLG.SAVE.3 .DA #S.DLG.Ctrl.LBL,#3,#4
.AZ "Filetype :"
DLG.SAVE.4 .DA #S.DLG.Ctrl.OL,#3,#5
.DA #20 Ctrl-T
.DA #0 Value
.DA #3 Count
.DA #DLG.SAVE.OL.CR
.DA #DLG.SAVE.OL.LF
.DA #DLG.SAVE.OL.ASM
.DA #0
DLG.SAVE.T .AZ "Save As..." Title
DLG.SAVE.L.FN .AZ "Filename :"
DLG.SAVE.L.FT .AZ "Filetype :"
DLG.SAVE.S .AZ "CR:Save, Ctrl-T:Change Type, Ctrl-C:Cancel"
DLG.SAVE.OL.CR .AZ "TXT/CR"
DLG.SAVE.OL.LF .AZ "TXT/CRLF"
DLG.SAVE.OL.ASM .AZ "S-C/ASM"
DLG.SAVE.S .AZ "CR:Save, Ctrl-T:Change Type, Ctrl-C:Cancel"
DLG.SAVE.LEN .EQ *-DLG.SAVE
*--------------------------------------
.DUMMY
.OR 0
@ -484,6 +507,7 @@ ScreenX .BS 1
ScreenY .BS 2
CurX .BS 1
CurY .BS 1
hDLG .BS 1
STATBUF .BS S.STAT
DS.END
.ED