mirror of
https://github.com/A2osX/A2osX.git
synced 2024-06-14 18:29:32 +00:00
Kernel 0.9.1 : GUI, BitBlt debugging....
This commit is contained in:
parent
940866d6ed
commit
37d8e6090b
Binary file not shown.
Binary file not shown.
|
@ -121,15 +121,21 @@ BITBLT >LDYA CB.CACHE+S.CB.SrcPtr
|
|||
sta BLT.DY
|
||||
|
||||
ldx BLT.SCRBitOfs
|
||||
beq BITBLT.LOOP
|
||||
beq BITBLT.LOOP0
|
||||
|
||||
ldy Shift.L.LO,x X = 1->6
|
||||
sty ZPScrShiftPtr
|
||||
ldy Shift.L.HI,x X = 1->6
|
||||
sty ZPScrShiftPtr+1
|
||||
|
||||
BITBLT.LOOP ldx BLT.SCRBitOfs
|
||||
bne BITBLT.LOOPx
|
||||
lda Shift7BitsCol1,x get #%00001111, BM bits that go in Col1
|
||||
sta BITBLT.LOOPx.2+1
|
||||
sta BITBLT.LOOPx.6+1
|
||||
lda Shift7BitsCol2,x get #%01110000, BM bits that go in Col2
|
||||
sta BITBLT.LOOPx.3+1
|
||||
sta BITBLT.LOOPx.7+1
|
||||
|
||||
jmp BITBLT.LOOPx
|
||||
|
||||
*------------ Shift 0
|
||||
|
||||
|
@ -142,13 +148,12 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
|
|||
|
||||
lda BLT.BMBitOfs
|
||||
sta BLT.BMBitOfsL
|
||||
stz BLT.BMIdx
|
||||
|
||||
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.Get7BMDBits we have 0xxxxxxxx in A
|
||||
.1 jsr BLT.Get7BMBits we have 0xxxxxxxx in A
|
||||
|
||||
ldx BLT.ScrColIdx
|
||||
sta LBUF.MASK,x
|
||||
|
@ -161,13 +166,12 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
|
|||
|
||||
lda BLT.BMBitOfs
|
||||
sta BLT.BMBitOfsL
|
||||
stz BLT.BMIdx
|
||||
|
||||
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.Get7BMDBits we have 0xxxxxxxx in A
|
||||
.3 jsr BLT.Get7BMBits we have 0xxxxxxxx in A
|
||||
|
||||
ldx BLT.ScrColIdx
|
||||
sta LBUF.DATA,x
|
||||
|
@ -175,35 +179,58 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
|
|||
cpx LBUF.C2
|
||||
bne .3
|
||||
|
||||
jmp BITBLT.DRAW
|
||||
ldy CB.Cache+S.CB.DestY
|
||||
jsr LBUF.DrawAtY
|
||||
inc CB.Cache+S.CB.DestY
|
||||
dec BLT.DY
|
||||
beq .8
|
||||
|
||||
lda CB.Cache+S.CB.OP
|
||||
bit #S.CB.OP.MASK
|
||||
beq .4
|
||||
|
||||
lda BLT.BMMaskPtr
|
||||
clc
|
||||
adc BM.Cache+S.BM.RowBytes
|
||||
sta BLT.BMMaskPtr
|
||||
bcc .4
|
||||
|
||||
inc BLT.BMMaskPtr+1
|
||||
|
||||
.4 lda BLT.BMDataPtr
|
||||
clc
|
||||
adc BM.Cache+S.BM.RowBytes
|
||||
sta BLT.BMDataPtr
|
||||
bcc .5
|
||||
|
||||
inc BLT.BMDataPtr+1
|
||||
|
||||
.5 jmp BITBLT.LOOP0
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
*------------ Shift 1->6 Comment : SCRBitOfs=X=3
|
||||
|
||||
BITBLT.LOOPx lda CB.Cache+S.CB.OP X = BLT.SCRBitOfs
|
||||
bit #S.CB.OP.MASK
|
||||
beq .4
|
||||
|
||||
lda Shift7BitsCol1,x get #%00001111, BM bits that go in Col1
|
||||
sta .2+1
|
||||
lda Shift7BitsCol2,x get #%01110000, BM bits that go in Col2
|
||||
sta .3+1
|
||||
beq BITBLT.LOOPx.4
|
||||
|
||||
>LDYA BLT.BMMaskPtr
|
||||
>STYA ZPBMDataPtr
|
||||
|
||||
lda BLT.BMBitOfs
|
||||
sta BLT.BMBitOfsL
|
||||
stz BLT.BMIdx
|
||||
|
||||
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.Get7BMDBits we have c6543210 in A, destination : COL=3210xxx, COL+1=xxxx654
|
||||
BITBLT.LOOPx.1 jsr BLT.Get7BMBits we have c6543210 in A, destination : COL=3210xxx, COL+1=xxxx654
|
||||
|
||||
pha save BM byte for 2nd col
|
||||
|
||||
.2 and #$ff SELF MODIFIED : MASK WITH #%00001111, keep col1 bits only
|
||||
BITBLT.LOOPx.2 and #$ff SELF MODIFIED : MASK WITH #%00001111, keep col1 bits only
|
||||
tay
|
||||
|
||||
lda (ZPScrShiftPtr),y make 0000dddd Shift left 3 : 0dddd000
|
||||
|
@ -214,41 +241,32 @@ BITBLT.LOOPx lda CB.Cache+S.CB.OP X = BLT.SCRBitOfs
|
|||
|
||||
pla Get back BM Byte
|
||||
|
||||
.3 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
|
||||
BITBLT.LOOPx.3 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
|
||||
tay
|
||||
|
||||
lda (ZPScrShiftPtr),y shift right 4 (=shift left 3!!!) : 00000ddd
|
||||
|
||||
sta LBUF.MASK+1,x
|
||||
|
||||
inx
|
||||
stx BLT.ScrColIdx
|
||||
inc BLT.ScrColIdx
|
||||
cpx LBUF.C2
|
||||
bne .1
|
||||
|
||||
ldx BLT.SCRBitOfs
|
||||
bne BITBLT.LOOPx.1
|
||||
|
||||
.4 lda Shift7BitsCol1,x get #%00001111, BM bits that go in Col1
|
||||
sta .6+1
|
||||
lda Shift7BitsCol2,x get #%01110000, BM bits that go in Col2
|
||||
sta .7+1
|
||||
|
||||
>LDYA BLT.BMDataPtr
|
||||
BITBLT.LOOPx.4 >LDYA BLT.BMDataPtr
|
||||
>STYA ZPBMDataPtr
|
||||
|
||||
lda BLT.BMBitOfs
|
||||
sta BLT.BMBitOfsL
|
||||
stz BLT.BMIdx
|
||||
|
||||
ldx LBUF.C1
|
||||
stx BLT.ScrColIdx
|
||||
stz LBUF.DATA,x make sure C1 not ORed with trash in "ora LBUF.DATA,x"
|
||||
|
||||
.5 jsr BLT.Get7BMDBits we have c6543210 in A, destination : COL=3210xxx, COL+1=xxxx654
|
||||
BITBLT.LOOPx.5 jsr BLT.Get7BMBits we have c6543210 in A, destination : COL=3210xxx, COL+1=xxxx654
|
||||
|
||||
pha save BM byte for 2nd col
|
||||
|
||||
.6 and #$ff SELF MODIFIED : MASK WITH #%00001111, keep col1 bits only
|
||||
BITBLT.LOOPx.6 and #$ff SELF MODIFIED : MASK WITH #%00001111, keep col1 bits only
|
||||
tay
|
||||
|
||||
lda (ZPScrShiftPtr),y make 0000dddd Shift left 3 : 0dddd000
|
||||
|
@ -259,19 +277,18 @@ BITBLT.LOOPx lda CB.Cache+S.CB.OP X = BLT.SCRBitOfs
|
|||
|
||||
pla Get back BM Byte
|
||||
|
||||
.7 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
|
||||
BITBLT.LOOPx.7 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
|
||||
tay
|
||||
|
||||
lda (ZPScrShiftPtr),y shift right 4 (=shift left 3!!!) : 00000ddd
|
||||
|
||||
sta LBUF.DATA+1,x
|
||||
|
||||
inx
|
||||
stx BLT.ScrColIdx
|
||||
inc BLT.ScrColIdx
|
||||
cpx LBUF.C2
|
||||
bne .5
|
||||
bne BITBLT.LOOPx.5
|
||||
|
||||
BITBLT.DRAW ldy CB.Cache+S.CB.DestY
|
||||
ldy CB.Cache+S.CB.DestY
|
||||
jsr LBUF.DrawAtY
|
||||
inc CB.Cache+S.CB.DestY
|
||||
dec BLT.DY
|
||||
|
@ -297,7 +314,7 @@ BITBLT.DRAW ldy CB.Cache+S.CB.DestY
|
|||
|
||||
inc BLT.BMDataPtr+1
|
||||
|
||||
.2 jmp BITBLT.LOOP
|
||||
.2 jmp BITBLT.LOOPx
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
@ -310,11 +327,11 @@ BITBLT.DRAW ldy CB.Cache+S.CB.DestY
|
|||
* c6543210 c6543210
|
||||
* ^
|
||||
*--------------------------------------
|
||||
BLT.Get7BMDBits ldy BLT.BMIdx
|
||||
lda (ZPBMDataPtr),y
|
||||
BLT.Get7BMBits lda (ZPBMDataPtr)
|
||||
|
||||
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
|
||||
|
@ -328,20 +345,21 @@ BLT.Get7BMDBits ldy BLT.BMIdx
|
|||
and Mask7BitsH,x Get only left upper X bits
|
||||
tay xxxxx000
|
||||
|
||||
lda (ZPBMShiftPtr),y shift'em RIGHT 000xxxxx
|
||||
lda (ZPBMShiftPtr),y shift'em RIGHT 000xxxxx
|
||||
pha
|
||||
|
||||
inc BLT.BMIdx Next BM data byte
|
||||
inc ZPBMDataPtr Next BM data byte
|
||||
bne .1
|
||||
inc ZPBMDataPtr+1
|
||||
|
||||
ldy BLT.BMIdx
|
||||
lda (ZPBMDataPtr),y get next byte
|
||||
.1 lda (ZPBMDataPtr) get next byte
|
||||
|
||||
and Mask7BitsL,x only first Y bits 000000yy
|
||||
tay
|
||||
|
||||
pla get back right part bits 000xxxxx
|
||||
|
||||
ora (ZPBMShiftPtr),y shift right 000000yy and ORA with 000xxxxx=0yyxxxxx
|
||||
ora (ZPBMShiftPtr),y shift right 000000yy and ORA with 000xxxxx=0yyxxxxx
|
||||
dec BLT.BMBitOfsL X = 1->6, ADD 7 MOD 8.....
|
||||
rts
|
||||
|
||||
|
@ -350,9 +368,12 @@ BLT.Get7BMBits0 and #%01111111 Get only 7 needed bits
|
|||
stx BLT.BMBitOfsL Was 0, add 7 bits
|
||||
rts
|
||||
|
||||
BLT.Get7BMBits1 stz BLT.BMBitOfsL Was 1, add 7 bits, MOD 8=0
|
||||
inc BLT.BMIdx go to next byte in BM line
|
||||
rts LSR did already 0xxxxxxx
|
||||
BLT.Get7BMBits1 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
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE /A2OSX.SRC/DRV/DHGR.DRV.S.RECT
|
||||
|
|
|
@ -107,19 +107,19 @@ LBUF.DrawAtY.AND.XOR
|
|||
.8 rts
|
||||
*--------------------------------------
|
||||
LBUF.DrawAtY.SET
|
||||
LBUF.DrawAtY.AND.SET
|
||||
ldx LBUF.C1 x C1->C2
|
||||
|
||||
ldy COL.BANK,x
|
||||
sta $C000,y
|
||||
ldy COL.OFS,x
|
||||
|
||||
lda (ZPBasePtr),y data for Get C1
|
||||
and LBUF.C1.MASK clear ONLY bits starting at X1 mod 7
|
||||
lda (ZPBasePtr),y Clear screen at C1
|
||||
and LBUF.C1.MASK with MASK bits
|
||||
sta GBYTE
|
||||
|
||||
lda LBUF.DATA,x get DATA bits
|
||||
and LBUF.C1.DATA set ONLY bits starting at X1 mod 7
|
||||
ora GBYTE
|
||||
ora GBYTE ora with screen bits
|
||||
sta (ZPBasePtr),y update screen
|
||||
|
||||
inx
|
||||
|
@ -145,6 +145,7 @@ LBUF.DrawAtY.AND.SET
|
|||
lda (ZPBasePtr),y Get C2
|
||||
and LBUF.C2.MASK clear ONLY bits ending at X2 mod 7
|
||||
sta GBYTE
|
||||
|
||||
lda LBUF.DATA,x get DATA bits
|
||||
and LBUF.C2.DATA set ONLY bits ending at X2 mod 7
|
||||
ora GBYTE
|
||||
|
@ -152,6 +153,9 @@ LBUF.DrawAtY.AND.SET
|
|||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
LBUF.DrawAtY.AND.SET
|
||||
rts
|
||||
*--------------------------------------
|
||||
LBUF.DrawAtY.ORA
|
||||
ldx LBUF.C1 x C1->C2
|
||||
|
||||
|
@ -162,6 +166,7 @@ LBUF.DrawAtY.ORA
|
|||
lda (ZPBasePtr),y Get C1
|
||||
and LBUF.C1.MASK clear ONLY bits starting at X1 mod 7
|
||||
sta GBYTE
|
||||
|
||||
lda LBUF.DATA,x get DATA bits
|
||||
and LBUF.C1.DATA set ONLY bits starting at X1 mod 7
|
||||
ora GBYTE
|
||||
|
@ -189,14 +194,15 @@ LBUF.DrawAtY.ORA
|
|||
sta $C000,y
|
||||
ldy COL.OFS,x
|
||||
|
||||
lda (ZPBasePtr),y Get C2
|
||||
and LBUF.C2.MASK clear ONLY bits ending at X2 mod 7
|
||||
lda LBUF.MASK,x get MASK bits
|
||||
ora LBUF.C2.MASK
|
||||
and (ZPBasePtr),y
|
||||
sta GBYTE
|
||||
|
||||
lda LBUF.DATA,x get DATA bits
|
||||
and LBUF.C2.DATA set ONLY bits ending at X2 mod 7
|
||||
ora GBYTE
|
||||
ora (ZPBasePtr),y
|
||||
sta (ZPBasePtr),y update screen
|
||||
sta (ZPBasePtr),y update screen
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
|
@ -239,7 +245,6 @@ LBUF.DrawAtY.AND.ORA
|
|||
sta $C000,y
|
||||
ldy COL.OFS,x
|
||||
|
||||
* >DEBUG
|
||||
lda LBUF.MASK,x get MASK bits
|
||||
ora LBUF.C2.MASK
|
||||
and (ZPBasePtr),y
|
||||
|
|
|
@ -410,7 +410,6 @@ BLT.DX .BS 2
|
|||
BLT.DY .BS 1
|
||||
BLT.BMBitOfs .BS 1
|
||||
BLT.BMBitOfsL .BS 1
|
||||
BLT.BMIdx .BS 1
|
||||
BLT.SCRBitOfs .BS 1
|
||||
BLT.ScrColIdx .BS 1
|
||||
*--------------------------------------
|
||||
|
|
|
@ -35,7 +35,7 @@ Shift7BitsCol2 .DA #%00000000 Useless
|
|||
.DA #%01110000
|
||||
.DA #%01111000
|
||||
.DA #%01111100
|
||||
.DA #%01111111
|
||||
.DA #%01111110
|
||||
*--------------------------------------
|
||||
C1.MASK .DA #%10000000 Clear (AND) Col 1 bits
|
||||
.DA #%10000001
|
||||
|
|
|
@ -63,8 +63,8 @@ S.GC.H .EQ 14
|
|||
S.GC .EQ 16
|
||||
*--------------------------------------
|
||||
CUR.T.ARROW .EQ 0
|
||||
CUR.T.PLUS .EQ 2
|
||||
CUR.T.WAIT .EQ 4
|
||||
CUR.T.WAIT .EQ 2
|
||||
CUR.T.PLUS .EQ 4
|
||||
CUR.T.RESIZEX .EQ 6
|
||||
CUR.T.RESIZEY .EQ 8
|
||||
CUR.T.RESIZEXY .EQ 10
|
||||
|
|
|
@ -198,24 +198,14 @@ Destop.Paint >PUSHW L.Rect.CB
|
|||
* >PUSHW L.DrawLines.CB
|
||||
* >LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
>LDYAI 105
|
||||
>STYA BitBlT.CB+S.CB.DestX
|
||||
>PUSHW L.BitBlt.CB
|
||||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
>LDYAI 246
|
||||
>STYA BitBlT.CB+S.CB.DestX
|
||||
>PUSHW L.BitBlt.CB
|
||||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
>LDYAI 387
|
||||
>STYA BitBlT.CB+S.CB.DestX
|
||||
>PUSHW L.BitBlt.CB
|
||||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
>LDYA L.BM.Arrow
|
||||
>STYA MousePtr.CB+S.CB.SrcPtr
|
||||
|
||||
>LDYAI 139
|
||||
>STYA MousePtr.CB+S.CB.DestX
|
||||
>PUSHW L.MousePtr.CB
|
||||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
>LDYAI 7
|
||||
>STYA MousePtr.CB+S.CB.DestX
|
||||
>PUSHW L.MousePtr.CB
|
||||
|
@ -246,10 +236,21 @@ Destop.Paint >PUSHW L.Rect.CB
|
|||
>PUSHW L.MousePtr.CB
|
||||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
>LDYAI 139
|
||||
>STYA MousePtr.CB+S.CB.DestX
|
||||
>PUSHW L.MousePtr.CB
|
||||
>LDYAI 105
|
||||
>STYA BitBlT.CB+S.CB.DestX
|
||||
>PUSHW L.BitBlt.CB
|
||||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
>LDYAI 246
|
||||
>STYA BitBlT.CB+S.CB.DestX
|
||||
>PUSHW L.BitBlt.CB
|
||||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
>LDYAI 387
|
||||
>STYA BitBlT.CB+S.CB.DestX
|
||||
>PUSHW L.BitBlt.CB
|
||||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
*--------------------------------------
|
||||
|
@ -405,7 +406,7 @@ MousePtr.CB .DA #S.CB.CMD.BITBLT
|
|||
.DA #0
|
||||
.DA 0 X1
|
||||
.DA 0 Y1
|
||||
.DA 11 X2
|
||||
.DA 10 X2
|
||||
.DA 12 y2
|
||||
.BS 2 DestX
|
||||
.DA 1 DestY
|
||||
|
@ -423,41 +424,39 @@ SetPixel.Y .BS 2
|
|||
|
||||
.DA #0
|
||||
*--------------------------------------
|
||||
.LIST ON
|
||||
BM.Arrow .DA #S.BM.F.BBP1
|
||||
.DA #2 RowBytes
|
||||
.DA 12 W
|
||||
.DA 11 W
|
||||
.DA 13 H
|
||||
.DA BM.Arrow.MASK-BM.Arrow
|
||||
|
||||
BM.Arrow.DATA .DA %0000.00000000
|
||||
.DA %0000.00000010
|
||||
.DA %0000.00000110
|
||||
.DA %0000.00001110
|
||||
.DA %0000.00011110
|
||||
.DA %0000.00111110
|
||||
.DA %0000.01111110
|
||||
.DA %0000.11111110
|
||||
.DA %0001.11111110
|
||||
.DA %0010.01111110
|
||||
.DA %0000.11110010
|
||||
.DA %0000.11100000
|
||||
.DA %0000.00000000
|
||||
BM.Arrow.DATA .DA %000.00000000
|
||||
.DA %000.00000010
|
||||
.DA %000.00000110
|
||||
.DA %000.00001110
|
||||
.DA %000.00011110
|
||||
.DA %000.00111110
|
||||
.DA %000.01111110
|
||||
.DA %000.11111110
|
||||
.DA %001.11111110
|
||||
.DA %010.01111110
|
||||
.DA %000.11110010
|
||||
.DA %000.11100000
|
||||
.DA %000.00000000
|
||||
|
||||
BM.Arrow.MASK .DA %1111.11111100
|
||||
.DA %1111.11111000
|
||||
.DA %1111.11110000
|
||||
.DA %1111.11100000
|
||||
.DA %1111.11000000
|
||||
.DA %1111.10000000
|
||||
.DA %1111.00000000
|
||||
.DA %1110.00000000
|
||||
.DA %1100.00000000
|
||||
.DA %1000.00000000
|
||||
.DA %1000.00000000
|
||||
.DA %1110.00000000
|
||||
.DA %1110.00001111
|
||||
.LIST OFF
|
||||
BM.Arrow.MASK .DA %111.11111100
|
||||
.DA %111.11111000
|
||||
.DA %111.11110000
|
||||
.DA %111.11100000
|
||||
.DA %111.11000000
|
||||
.DA %111.10000000
|
||||
.DA %111.00000000
|
||||
.DA %110.00000000
|
||||
.DA %100.00000000
|
||||
.DA %000.00000000
|
||||
.DA %000.00000000
|
||||
.DA %110.00000000
|
||||
.DA %110.00001111
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user