Kernel 0.9.1 : GUI, Clipping...BitiBlt working

This commit is contained in:
Rémy GIBERT 2017-12-07 08:42:58 +01:00
parent 3a31ecede6
commit e7681cc3d5
8 changed files with 59 additions and 56 deletions

Binary file not shown.

Binary file not shown.

View File

@ -146,7 +146,6 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
ldx LBUF.C1
stx BLT.ScrColIdx
stz LBUF.MASK,x make sure C1 not ORed with trash in "ora LBUF.DATA,x"
.1 jsr BLT.Get7BMBits we have 0xxxxxxxx in A
@ -164,7 +163,6 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
ldx LBUF.C1
stx BLT.ScrColIdx
stz LBUF.DATA,x make sure C1 not ORed with trash in "ora LBUF.DATA,x"
.3 jsr BLT.Get7BMBits we have 0xxxxxxxx in A
@ -176,6 +174,7 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
ldy CB.Cache+S.CB.DstY
jsr LBUF.DrawAtY
inc CB.Cache+S.CB.DstY
dec CB.Cache+S.CB.SrcH
beq .8
@ -202,8 +201,7 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
.5 jmp BITBLT.LOOP0
.8 clc
rts
.8 rts
*------------ Shift 1->6 Comment : SCRBitOfs=X=3
@ -311,8 +309,7 @@ BITBLT.LOOPx.7 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
.2 jmp BITBLT.LOOPx
.8 clc
rts
.8 rts
*--------------------------------------
* BM Data/Mask bits :
* 76543210 76543210
@ -322,20 +319,20 @@ BITBLT.LOOPx.7 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
* c6543210 c6543210
* ^
*--------------------------------------
BLT.Get7BMBits lda (ZPBMDataPtr)
ldx BLT.BMBitOfsL
BLT.Get7BMBits ldx BLT.BMBitOfsL
beq BLT.Get7BMBits0 OFS=0, done! and no need to advance ZPBMDataPtr
lsr OFS=1->7, shift one (Range 0->127)
dex OFS 0->6
beq BLT.Get7BMBits1 OFS was 1....done and go to next byte, OFS=0
ldy Shift.R.LO,x X = 1->6
sty ZPBMShiftPtr
lda Shift.R.LO,x X = 1->6
sta ZPBMShiftPtr
ldy Shift.R.HI,x X = 1->6
sty ZPBMShiftPtr+1
lda Shift.R.HI,x X = 1->6
sta ZPBMShiftPtr+1
lda (ZPBMDataPtr)
lsr OFS=1->7, shift one (Range 0->127)
and Mask7BitsH,x Get only left upper X bits
tay xxxxx000
@ -358,16 +355,21 @@ BLT.Get7BMBits lda (ZPBMDataPtr)
dec BLT.BMBitOfsL X = 1->6, ADD 7 MOD 8.....
rts
BLT.Get7BMBits0 and #%01111111 Get only 7 needed bits
ldx #7
stx BLT.BMBitOfsL Was 0, add 7 bits
BLT.Get7BMBits0 lda #7
sta BLT.BMBitOfsL Was 0, add 7 bits
lda (ZPBMDataPtr)
and #%01111111 Get only 7 needed bits
rts
BLT.Get7BMBits1 stz BLT.BMBitOfsL LSR did already 0xxxxxxx, Was 1, add 7 bits, MOD 8=0
BLT.Get7BMBits1 lda (ZPBMDataPtr)
lsr OFS=1->7, shift one (Range 0->127)
stz BLT.BMBitOfsL LSR did already 0xxxxxxx, Was 1, add 7 bits, MOD 8=0
inc ZPBMDataPtr go to next byte in BM line
bne .8
inc ZPBMDataPtr+1
inc ZPBMDataPtr+1
.8 rts
*--------------------------------------
MAN

View File

@ -33,8 +33,8 @@ LBUF.SetBounds2YA
sta LBUF.C1.MASK
lda C1.DATA,x
and C2.DATA,x
sta LBUF.C2.DATA
ora C2.DATA,x
sta LBUF.C1.DATA
rts
*--------------------------------------
LBUF.DrawAtY lda BASEL,y setup line Base Ptr
@ -199,7 +199,7 @@ LBUF.DrawAtY.SET
.7 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
lda (ZPBasePtr),y Get C2
and LBUF.C2.MASK clear ONLY bits ending at X2 mod 7
sta GBYTE

View File

@ -30,7 +30,6 @@ HLINE.MONO >LDYA CB.Cache+S.CB.X1
bcc .2
ldy CB.Cache+S.CB.Y1
>DEBUG
jmp LBUF.DrawAtY
HLINE.C16 lda CB.Cache+S.CB.X1

View File

@ -402,14 +402,14 @@ LBUF.C1.DATA .BS 1 Bits to SET/ORA/XOR : 000ccccc cccccccc cc000000
LBUF.C2 .BS 1 C1 C2
LBUF.C2.MASK .BS 1
LBUF.C2.DATA .BS 1
LBUF.MASK .BS 80
LBUF.DATA .BS 80
LBUF.MASK .BS 81 81 because of sta LBUF.DATA+1,x!!!
LBUF.DATA .BS 81
*--------------------------------------
BLT.BMDataPtr .BS 2
BLT.BMMaskPtr .BS 2
BLT.BMDataPtr .BS 2
BLT.BMBitOfs .BS 1
BLT.BMBitOfsL .BS 1
BLT.SCRBitOfs .BS 1
BLT.ScrBitOfs .BS 1
BLT.ScrColIdx .BS 1
*--------------------------------------
GBYTE .BS 1

View File

@ -76,25 +76,27 @@ CLIP.BitBlt lda CB.Cache+S.CB.DstX
adc D+1
sta CB.Cache+S.CB.X1+1 S.CB.DstX=0, new between S.GC.X1 & S.GC.X2....
* S.CB.DstX between S.GC.X1 & S.GC.X2: D=S.GC.X2-S.CB.DstX
* S.CB.DstX between S.GC.X1 & S.GC.X2: D=(S.GC.X2+1)-S.CB.DstX
.1 lda GC.Cache+S.GC.X2
.1 lda GC.Cache+S.GC.X2 Compute D in X,Y
sec
sbc CB.Cache+S.CB.DstX
sta D
tax
lda GC.Cache+S.GC.X2+1
sbc CB.Cache+S.CB.DstX+1
sta D+1 Always positive...
ldx D
inx
bne .2
inc
.2 tay
cpx CB.Cache+S.CB.SrcW
lda D+1
sbc CB.Cache+S.CB.SrcW+1
bcs CLIP.BitBlt.Y D >= SrcW....nothing to clip
stx CB.Cache+S.CB.SrcW SrcW < D, make SrcW=D
lda D+1
sta CB.Cache+S.CB.SrcW+1
sty CB.Cache+S.CB.SrcW+1
CLIP.BitBlt.Y lda CB.Cache+S.CB.DstY
ldx CB.Cache+S.CB.DstY+1
@ -144,25 +146,27 @@ CLIP.BitBlt.Y lda CB.Cache+S.CB.DstY
adc D+1
sta CB.Cache+S.CB.Y1+1 S.CB.DstY=0, new between S.GC.Y1 & S.GC.Y2....
* S.CB.DstY between S.GC.Y1 & S.GC.Y2: D=S.GC.Y2-S.CB.DstY
* S.CB.DstY between S.GC.Y1 & S.GC.Y2: D=(S.GC.Y2+1)-S.CB.DstY
.1 lda GC.Cache+S.GC.Y2
.1 lda GC.Cache+S.GC.Y2 Compute D in X,Y
sec
sbc CB.Cache+S.CB.DstY
sta D
tax
lda GC.Cache+S.GC.Y2+1
sbc CB.Cache+S.CB.DstY+1
sta D+1 Always positive...
inx
bne .2
inc
.2 tay
ldx D
cpx CB.Cache+S.CB.SrcH
lda D+1
sbc CB.Cache+S.CB.SrcH+1
bcs .8 D >= SrcH....nothing to clip
stx CB.Cache+S.CB.SrcH SrcH < D, make SrcH=D
lda D+1
sta CB.Cache+S.CB.SrcH+1
sty CB.Cache+S.CB.SrcH+1
.8 clc
rts

View File

@ -193,10 +193,10 @@ CB.Rect .DA #S.CB.CMD.FILLRECT
.DA #S.CB.OP.SET
.DA #S.CB.MODE.MONO
.DA #0
.DA 1 X1
.DA 1 Y1
.DA 558 X2
.DA 190 Y2
.DA 40 X1
.DA 40 Y1
.DA 519 X2
.DA 151 Y2
.DA #0
*--------------------------------------
@ -208,8 +208,8 @@ CB.BitBlt .DA #S.CB.CMD.BITBLT
.DA 0 Y1
.BS 2 W
.BS 2 H
.DA 50 DestX
.DA 51 DestY
.DA 200 DestX
.DA 60 DestY
.BS 2 SrcPtr
.DA 0
@ -232,12 +232,10 @@ GC.Clip .DA #0
.DA #0
.DA #0
.DA 50
.DA 50
.DA 449
.DA 149
.DA 400
.DA 100
.DA 40 X1
.DA 40 Y1
.DA 519 X2
.DA 151 Y2
*--------------------------------------
.DUMMY
.OR 0