Kernel 0.9.1 : LibGui, Clipping....BugFix

This commit is contained in:
Rémy GIBERT 2017-12-06 17:26:36 +01:00
parent f96a9855c0
commit 3a31ecede6
9 changed files with 144 additions and 111 deletions

Binary file not shown.

Binary file not shown.

View File

@ -14,28 +14,23 @@ HLINE lda CB.Cache+S.CB.MODE
HLINE.MONO >LDYA CB.Cache+S.CB.X1 HLINE.MONO >LDYA CB.Cache+S.CB.X1
jsr LBUF.SetBounds1YA jsr LBUF.SetBounds1YA
>LDYA CB.Cache+S.CB.X2 >LDYA CB.Cache+S.CB.X2
jsr LBUF.SetBounds2YA jsr LBUF.SetBounds2YA
lda CB.Cache+S.CB.MODE lda CB.Cache+S.CB.COLOR
bit #S.CB.MODE.C16
bne HLINE.C16
ldy CB.Cache+S.CB.COLOR
beq .1 beq .1
ldy #%01111111 lda #%01111111
.1 ldx LBUF.C1 .1 ldx LBUF.C1
.2 tya .2 sta LBUF.DATA,x
sta LBUF.DATA,x
cpx LBUF.C2 cpx LBUF.C2
inx inx
bcc .2 bcc .2
ldy CB.Cache+S.CB.Y1 ldy CB.Cache+S.CB.Y1
>DEBUG
jmp LBUF.DrawAtY jmp LBUF.DrawAtY
HLINE.C16 lda CB.Cache+S.CB.X1 HLINE.C16 lda CB.Cache+S.CB.X1

View File

@ -25,10 +25,8 @@ S.GC.X1 .EQ 4
S.GC.Y1 .EQ 6 S.GC.Y1 .EQ 6
S.GC.X2 .EQ 8 S.GC.X2 .EQ 8
S.GC.Y2 .EQ 10 S.GC.Y2 .EQ 10
S.GC.W .EQ 12
S.GC.H .EQ 14
* *
S.GC .EQ 16 S.GC .EQ 12
*-------------------------------------- *--------------------------------------
S.CB.CMD .EQ 0 S.CB.CMD .EQ 0
S.CB.CMD.SETPIXEL .EQ 0 S.CB.CMD.SETPIXEL .EQ 0

View File

@ -14,8 +14,8 @@ CUR.HotPoints .DA #0,#0 CUR.T.ARROW
.DA #6,#5 CUR.ResizeY .DA #6,#5 CUR.ResizeY
.DA #5,#5 CUR.ResizeXY1 .DA #5,#5 CUR.ResizeXY1
.DA #5,#5 CUR.ResizeXY2 .DA #5,#5 CUR.ResizeXY2
.DA #0,#0 CUR.Cross .DA #5,#5 CUR.Cross
.DA #0,#0 CUR.Text .DA #5,#3 CUR.Text
.DA #5,#6 CUR.Wait1 .DA #5,#6 CUR.Wait1
.DA #5,#6 CUR.Wait2 .DA #5,#6 CUR.Wait2
.DA #5,#6 CUR.Wait3 .DA #5,#6 CUR.Wait3
@ -27,9 +27,9 @@ CUR.CB .DA #S.CB.CMD.BITBLT
.BS 1 .BS 1
.DA #S.CB.MODE.MONO .DA #S.CB.MODE.MONO
.DA #0 .DA #0
.BS 16 .BS S.CB-4
*-------------------------------------- *--------------------------------------
CUR.SaveBuf .BS 48 16*3 CUR.SaveBuf .BS 64 16*4
*-------------------------------------- *--------------------------------------
CUR.Arrow .DA #S.BM.F.BBP1 CUR.Arrow .DA #S.BM.F.BBP1
.DA #2 RowBytes .DA #2 RowBytes
@ -147,11 +147,95 @@ CUR.ResizeXY1.MASK
.DA %111.11000000 .DA %111.11000000
.DA %111.10000000 .DA %111.10000000
*-------------------------------------- *--------------------------------------
CUR.ResizeXY2 CUR.ResizeXY2 .DA #S.BM.F.BBP1
.DA #2 RowBytes
.DA 11 W
.DA 11 H
.DA CUR.ResizeXY2.MASK-CUR.ResizeXY2
.DA %000.00000000
.DA %000.00011110
.DA %000.00001110
.DA %000.00001110
.DA %000.00010010
.DA %000.00100000
.DA %010.01000000
.DA %011.10000000
.DA %011.10000000
.DA %011.11000000
.DA %000.00000000
CUR.ResizeXY2.MASK
.DA %111.10000000
.DA %111.11000000
.DA %111.11100000
.DA %111.11100000
.DA %011.11000000
.DA %001.10001100
.DA %000.00011110
.DA %000.00111111
.DA %000.00111111
.DA %000.00011111
.DA %000.00001111
*-------------------------------------- *--------------------------------------
CUR.Cross CUR.Cross .DA #S.BM.F.BBP1
.DA #2 RowBytes
.DA 11 W
.DA 11 H
.DA CUR.Cross.MASK-CUR.Cross
.DA %000.00100000
.DA %000.01010000
.DA %000.01010000
.DA %000.01010000
.DA %011.11011110
.DA %100.00000001
.DA %011.11011110
.DA %000.01010000
.DA %000.01010000
.DA %000.01010000
.DA %000.00100000
CUR.Cross.MASK
.DA %111.11011111
.DA %111.10001111
.DA %111.10001111
.DA %111.10001111
.DA %100.00000001
.DA %000.00100000
.DA %100.00000001
.DA %111.10001111
.DA %111.10001111
.DA %111.10001111
.DA %111.11011111
*-------------------------------------- *--------------------------------------
CUR.Text CUR.Text .DA #S.BM.F.BBP1
.DA #1 RowBytes
.DA 7 W
.DA 11 H
.DA CUR.Text.MASK-CUR.Text
.DA #%0000000
.DA #%0000000
.DA #%0000000
.DA #%0000000
.DA #%0000000
.DA #%0000000
.DA #%0000000
.DA #%0000000
.DA #%0000000
.DA #%0000000
.DA #%0000000
CUR.Text.MASK
.DA #%0011100
.DA #%1101011
.DA #%1110111
.DA #%1110111
.DA #%1110111
.DA #%1110111
.DA #%1110111
.DA #%1110111
.DA #%1110111
.DA #%1101011
.DA #%0011100
*-------------------------------------- *--------------------------------------
CUR.Wait1 .DA #S.BM.F.BBP1 CUR.Wait1 .DA #S.BM.F.BBP1
.DA #2 RowBytes .DA #2 RowBytes

View File

@ -60,7 +60,7 @@ CLIP.BitBlt lda CB.Cache+S.CB.DstX
sta CB.Cache+S.CB.SrcW+1 sta CB.Cache+S.CB.SrcW+1
bcc CLIP.BitBlt.99 Negative!!!! nothing to do,exit... bcc CLIP.BitBlt.99 Negative!!!! nothing to do,exit...
lda CB.Cache+S.CB.DstX Dst.Y+=D lda CB.Cache+S.CB.DstX S.CB.DstX+=D
clc clc
adc D adc D
sta CB.Cache+S.CB.DstX sta CB.Cache+S.CB.DstX

View File

@ -49,7 +49,6 @@ SetCursor.A sta CUR.T
lda (ZPPtr1),y lda (ZPPtr1),y
sta CUR.CB+S.CB.SrcH sta CUR.CB+S.CB.SrcH
iny iny
lda (ZPPtr1),y lda (ZPPtr1),y

View File

@ -127,39 +127,27 @@ InitGUI lda GC.Screen+S.GC.hDev
>STYA ZPPtr1 >STYA ZPPtr1
ldy #S.DSTAT.GFX.W+1 ldy #S.DSTAT.GFX.W
lda (ZPPtr1),y
sta GC.Screen+S.GC.W+1
sta MouseClamp+3
lsr
sta CUR.Pos+S.POINT.X+1
dey
lda (ZPPtr1),y lda (ZPPtr1),y
sta MouseClamp+2 clc
sta GC.Screen+S.GC.W sbc #0
ror sta GC.Screen+S.GC.X2
sta CUR.Pos+S.POINT.X iny
lda (ZPPtr1),y
sbc #0
sta GC.Screen+S.GC.X2+1
ldy #S.DSTAT.GFX.H+1 iny #S.DSTAT.GFX.H
lda (ZPPtr1),y lda (ZPPtr1),y
sta MouseClamp+7 clc
sta GC.Screen+S.GC.H+1 sbc #0
lsr sta GC.Screen+S.GC.Y2
sta CUR.Pos+S.POINT.Y+1 iny
dey
lda (ZPPtr1),y lda (ZPPtr1),y
sta MouseClamp+6 sbc #0
sta GC.Screen+S.GC.H sta GC.Screen+S.GC.Y2+1
ror
sta CUR.Pos+S.POINT.Y
>LDYA L.GC.Screen
jsr GC.SetX2Y2
.1 >LDYA L.DEVNAME.MOUSE .1 >LDYA L.DEVNAME.MOUSE
>SYSCALL GetDevByName.YA >SYSCALL GetDevByName.YA
@ -176,6 +164,8 @@ InitGUI lda GC.Screen+S.GC.hDev
clc clc
.9 rts .9 rts
* Mouse Setup
.2 stx hDevMouse .2 stx hDevMouse
>STYA GoDevMouse+1 >STYA GoDevMouse+1
@ -183,6 +173,26 @@ InitGUI lda GC.Screen+S.GC.hDev
ldx #DEVMGR.OPEN ldx #DEVMGR.OPEN
jsr GoDevMouse jsr GoDevMouse
lda GC.Screen+S.GC.X2+1
sta MouseClamp+3
lsr
sta CUR.Pos+S.POINT.X+1
lda GC.Screen+S.GC.X2
sta MouseClamp+2
ror
sta CUR.Pos+S.POINT.X
lda GC.Screen+S.GC.Y2+1
sta MouseClamp+7
lsr
sta CUR.Pos+S.POINT.Y+1
lda GC.Screen+S.GC.Y2
sta MouseClamp+6
ror
sta CUR.Pos+S.POINT.Y
>LDYA L.MouseClamp >LDYA L.MouseClamp
ldx #DEVMGR.CONTROL ldx #DEVMGR.CONTROL
jsr GoDevMouse jsr GoDevMouse
@ -215,59 +225,6 @@ GC.Get >STYA .1+1
rts rts
*-------------------------------------- *--------------------------------------
GC.SetX2Y2 >STYA ZPPtr1
ldy #S.GC.X1+1
lda (ZPPtr1),y
tax
dey
lda (ZPPtr1),y
clc
ldy #S.GC.W
adc (ZPPtr1),y
pha
iny
txa
adc (ZPPtr1),y
tax
pla
sbc #0
bcs .1
dex
.1 ldy #S.GC.X2
sta (ZPPtr1),y
iny
txa
sta (ZPPtr1),y
ldy #S.GC.Y1+1
lda (ZPPtr1),y
tax
dey
lda (ZPPtr1),y
clc
ldy #S.GC.H
adc (ZPPtr1),y
pha
iny
txa
adc (ZPPtr1),y
tax
pla
sbc #0
bcs .2
dex
.2 ldy #S.GC.Y2
sta (ZPPtr1),y
iny
txa
sta (ZPPtr1),y
rts
*--------------------------------------
CB.Get >STYA .1+1 CB.Get >STYA .1+1
ldx #S.CB-1 ldx #S.CB-1

View File

@ -191,12 +191,12 @@ CB.Rect .DA #S.CB.CMD.FILLRECT
.DA #S.CB.CMD.FILLRECT .DA #S.CB.CMD.FILLRECT
.DA #S.CB.OP.SET .DA #S.CB.OP.SET
.DA #S.CB.MODE.C16 .DA #S.CB.MODE.MONO
.DA #0 .DA #0
.DA 50 X1 .DA 1 X1
.DA 50 Y1 .DA 1 Y1
.DA 449 X2 .DA 558 X2
.DA 149 Y2 .DA 190 Y2
.DA #0 .DA #0
*-------------------------------------- *--------------------------------------
@ -208,8 +208,8 @@ CB.BitBlt .DA #S.CB.CMD.BITBLT
.DA 0 Y1 .DA 0 Y1
.BS 2 W .BS 2 W
.BS 2 H .BS 2 H
.DA 130 DestX .DA 50 DestX
.DA 20 DestY .DA 51 DestY
.BS 2 SrcPtr .BS 2 SrcPtr
.DA 0 .DA 0