Kernel 0.9.1 : GUI, Clipping...

This commit is contained in:
Rémy GIBERT 2017-12-05 08:09:16 +01:00
parent 19cf1081e1
commit a7992673bd
7 changed files with 170 additions and 33 deletions

Binary file not shown.

Binary file not shown.

View File

@ -70,10 +70,11 @@ S.CB .EQ 20
CUR.T.ARROW .EQ 0
CUR.T.RESIZEX .EQ 2
CUR.T.RESIZEY .EQ 4
CUR.T.RESIZEXY .EQ 6
CUR.T.CROSS .EQ 8
CUT.T.TEXT .EQ 10
CUR.T.WAIT .EQ 12
CUR.T.RESIZEXY1 .EQ 6
CUR.T.RESIZEXY2 .EQ 8
CUR.T.CROSS .EQ 10
CUT.T.TEXT .EQ 12
CUR.T.WAIT .EQ 14
*--------------------------------------
S.BM.F .EQ 0
S.BM.F.BBP1 .EQ %00000001

View File

@ -10,9 +10,10 @@ CUR.bVisible .BS 1
CUR.Pos .BS S.POINT
*--------------------------------------
CUR.HotPoints .DA #0,#0 CUR.T.ARROW
.DA #0,#0 CUR.ResizeX
.DA #0,#0 CUR.ResizeY
.DA #0,#0 CUR.ResizeXY
.DA #7,#4 CUR.ResizeX
.DA #6,#5 CUR.ResizeY
.DA #5,#5 CUR.ResizeXY1
.DA #5,#5 CUR.ResizeXY2
.DA #0,#0 CUR.Cross
.DA #0,#0 CUR.Text
.DA #5,#6 CUR.Wait1
@ -64,11 +65,89 @@ CUR.Arrow.MASK .DA %111.11111100
.DA %110.00000000
.DA %110.00001111
*--------------------------------------
CUR.ResizeX
CUR.ResizeX .DA #S.BM.F.BBP1
.DA #2 RowBytes
.DA 14 W
.DA 7 H
.DA CUR.ResizeX.MASK-CUR.ResizeX
.DA %000000.00000000
.DA %000100.00001000
.DA %001100.00001100
.DA %011111.11111110
.DA %001100.00001100
.DA %000100.00001000
.DA %000000.00000000
CUR.ResizeX.MASK
.DA %111001.11100111
.DA %110001.11100011
.DA %100000.00000001
.DA %000000.00000000
.DA %100000.00000001
.DA %110001.11100011
.DA %111001.11100111
*--------------------------------------
CUR.ResizeY
CUR.ResizeY .DA #S.BM.F.BBP1
.DA #2 RowBytes
.DA 9 W
.DA 11 H
.DA CUR.ResizeY.MASK-CUR.ResizeY
.DA %0.00000000
.DA %0.00010000
.DA %0.01111100
.DA %0.11111110
.DA %0.00010000
.DA %0.00010000
.DA %0.00010000
.DA %0.11111110
.DA %0.01111100
.DA %0.00010000
.DA %0.00000000
CUR.ResizeY.MASK
.DA %1.11101111
.DA %1.11000111
.DA %1.00000001
.DA %0.00000000
.DA %0.00000000
.DA %1.11000111
.DA %1.11000111
.DA %0.00000000
.DA %1.00000001
.DA %1.11000111
.DA %1.11101111
*--------------------------------------
CUR.ResizeXY
CUR.ResizeXY1 .DA #S.BM.F.BBP1
.DA #2 RowBytes
.DA 11 W
.DA 10 H
.DA CUR.ResizeXY1.MASK-CUR.ResizeXY1
.DA %000.00000000
.DA %011.11000000
.DA %011.10000000
.DA %011.10000000
.DA %010.01100000
.DA %000.00110010
.DA %000.00011110
.DA %000.00001110
.DA %000.00011110
.DA %000.00000000
CUR.ResizeXY1.MASK
.DA %000.00000111
.DA %000.00001111
.DA %000.00011111
.DA %000.00111110
.DA %000.00011100
.DA %001.11000000
.DA %011.11100000
.DA %111.11000000
.DA %111.10000000
.DA %111.00000000
*--------------------------------------
CUR.ResizeXY2
*--------------------------------------
CUR.Cross
*--------------------------------------

View File

@ -30,10 +30,7 @@ CLIP.BitBlt.9 pla
CLIP.BitBlt.99 sec
rts
CLIP.BitBlt clc
rts
lda CB.Cache+S.CB.DestX
CLIP.BitBlt lda CB.Cache+S.CB.DestX
ldx CB.Cache+S.CB.DestX+1
pha
@ -102,18 +99,68 @@ CLIP.BitBlt.Y lda CB.Cache+S.CB.DestY
pha
>SCMPAX GC.Cache+S.GC.Y2 DestY after Y2....exit
bpl .9
bmi .10
sec
rts
pla
.10 pla
>SCMPAX GC.Cache+S.GC.Y1
bpl .1 DestY Inside Y1-Y2, go check if Y1+H fit in
* S.CB.DestY above S.GC.Y1: D=S.GC.Y1-S.CB.DestY, S.CB.SrcH-=D, S.CB.DestY=0, S.CB.Y1+=D
lda GC.Cache+S.GC.Y1 Compute D....
sec
sbc CB.Cache+S.CB.DestY
sta D
lda GC.Cache+S.GC.Y1+1
sbc CB.Cache+S.CB.DestY+1
sta D+1 ....always positive
lda CB.Cache+S.CB.SrcH S.CB.SrcH-=D
sec
sbc D
sta CB.Cache+S.CB.SrcH
iny
lda CB.Cache+S.CB.SrcH+1
sbc D
sta CB.Cache+S.CB.SrcH+1
bcc .99 Negative!!!! nothing to do,exit...
stz CB.Cache+S.CB.DestY Dext.X=0
stz CB.Cache+S.CB.DestY+1
lda CB.Cache+S.CB.Y1 S.CB.Y1+=D
clc
adc D
sta CB.Cache+S.CB.Y1
lda CB.Cache+S.CB.Y1+1
adc D+1
sta CB.Cache+S.CB.Y1+1 S.CB.DestY=0, new between S.GC.Y1 & S.GC.Y2....
* S.CB.DestY between S.GC.Y1 & S.GC.Y2: D=S.GC.Y2-S.CB.DestY
.1
clc
.1 lda GC.Cache+S.GC.Y2
sec
sbc CB.Cache+S.CB.DestY
sta D
lda GC.Cache+S.GC.Y2+1
sbc CB.Cache+S.CB.DestY+1
sta D+1 Always positive...
lda D
cmp CB.Cache+S.CB.SrcH
lda D+1
sbc CB.Cache+S.CB.SrcH+1
bcs .8 D >= SrcH....nothing to clip
lda D SrcH < D, make SrcH=D
sta CB.Cache+S.CB.SrcH
lda D+1
sta CB.Cache+S.CB.SrcH+1
.8 clc
rts
.9 pla

View File

@ -83,7 +83,8 @@ L.CUR.SaveBuf .DA CUR.SaveBuf
L.Cursors .DA CUR.Arrow
.DA CUR.ResizeX
.DA CUR.ResizeY
.DA CUR.ResizeXY
.DA CUR.ResizeXY1
.DA CUR.ResizeXY2
.DA CUR.Cross
.DA CUR.Text
.DA CUR.Wait1

View File

@ -66,22 +66,19 @@ CS.INIT >LDYA L.MSG.INIT
>STYA CB.BitBlt+S.CB.SrcPtr
>STYA ZPPtr1
ldy #S.BM.W
lda (ZPPtr1),y
sta CB.BitBlt+S.CB.SrcW
iny
lda (ZPPtr1),y
sta CB.BitBlt+S.CB.SrcW+1
iny
lda (ZPPtr1),y
sta CB.BitBlt+S.CB.SrcH
iny
lda (ZPPtr1),y
sta CB.BitBlt+S.CB.SrcH+1
ldy #S.BM.W+3
ldx #3
.1 lda (ZPPtr1),y
sta CB.BitBlt+S.CB.SrcW,x
dey
dex
bpl .1
jsr Destop.Paint
lda #CUR.T.WAIT
lda #CUR.T.ARROW
>STA.G CUR.T
>LIBCALL hLIBGUI,LIBGUI.SetCursor.A
>LIBCALL hLIBGUI,LIBGUI.ShowCursor
@ -113,6 +110,17 @@ CS.RUN lda A2osX.ASCREEN GUI screen active ?
.1 bit #S.MOUSE.S.CLK
beq .4
>LDA.G CUR.T
inc
inc
cmp #CUR.T.WAIT+2
bne .2
lda #CUR.T.ARROW
.2 >STA.G CUR.T
>LIBCALL hLIBGUI,LIBGUI.SetCursor.A
lda MouseData+S.MOUSE.X1
sta CB.BitBlt+S.CB.DestX
lda MouseData+S.MOUSE.X1+1
@ -204,6 +212,7 @@ CB.DrawLine .DA #0
.DUMMY
.OR 0
DS.START
CUR.T .BS 1
DS.END
.ED
MAN