2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2019-07-25 15:10:59 +00:00
|
|
|
|
AUTO 3,1
|
2017-07-05 14:45:19 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* BitBlt
|
2020-10-06 06:27:35 +00:00
|
|
|
|
* S.CB.X1 : Destination X (screen)
|
2020-09-04 15:21:15 +00:00
|
|
|
|
* S.CB.Y1 : Destination Y (screen)
|
|
|
|
|
* S.CB.DstX : X1 in bitmap/mask
|
|
|
|
|
* S.CB.DstY : Y1 in bitmap/mask
|
|
|
|
|
* S.CB.SrcW : width in bitmap/mask
|
|
|
|
|
* S.CB.SrcH : height in bitmap/mask
|
2017-11-16 16:46:18 +00:00
|
|
|
|
* S.CB.SrcPtr : pointer to S.BM
|
2020-10-13 06:24:57 +00:00
|
|
|
|
* S.CB.SrcPtr+1 = 0, Aux hMem in S.CB.SrcPtr
|
2020-10-12 15:36:10 +00:00
|
|
|
|
* S.CB.DstPtr : pointer to Save/restore Buffer
|
2017-07-05 14:45:19 +00:00
|
|
|
|
*--------------------------------------
|
2020-10-12 15:36:10 +00:00
|
|
|
|
BITBLT >LDYA CB.Cache+S.CB.X1
|
|
|
|
|
jsr LBUF.SetBounds1YA
|
|
|
|
|
stx BLT.ScrBitOfs
|
|
|
|
|
|
|
|
|
|
lda CB.Cache+S.CB.X1
|
|
|
|
|
clc
|
|
|
|
|
adc CB.Cache+S.CB.SrcW
|
|
|
|
|
tay
|
|
|
|
|
lda CB.Cache+S.CB.X1+1
|
|
|
|
|
adc CB.Cache+S.CB.SrcW+1
|
|
|
|
|
pha
|
|
|
|
|
tya
|
|
|
|
|
sbc #0
|
|
|
|
|
tay
|
|
|
|
|
pla
|
|
|
|
|
sbc #0
|
|
|
|
|
|
|
|
|
|
jsr LBUF.SetBounds2YA
|
2020-10-13 06:24:57 +00:00
|
|
|
|
|
|
|
|
|
lda CB.Cache+S.CB.SrcH
|
|
|
|
|
sta ZPTmpByte
|
2020-10-12 15:36:10 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
lda CB.Cache+S.CB.OP
|
|
|
|
|
bit #S.CB.OP.RESTORE
|
|
|
|
|
beq BITBLT.0
|
2018-01-15 06:50:44 +00:00
|
|
|
|
|
2020-10-12 15:36:10 +00:00
|
|
|
|
ldy CB.Cache+S.CB.DstPtr
|
|
|
|
|
lda CB.Cache+S.CB.DstPtr+1
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
sta SETREADAUX DstPtr is AUX hMem
|
2018-01-15 06:50:44 +00:00
|
|
|
|
tya
|
2019-07-25 15:10:59 +00:00
|
|
|
|
>SYSCALL2 GetMemPtr
|
2020-10-12 15:36:10 +00:00
|
|
|
|
|
|
|
|
|
.1 >STYA ZPBMSavePtr
|
2020-07-04 19:00:47 +00:00
|
|
|
|
|
2020-10-12 15:36:10 +00:00
|
|
|
|
ldy CB.Cache+S.CB.Y1
|
2020-07-04 19:00:47 +00:00
|
|
|
|
|
2020-10-12 15:36:10 +00:00
|
|
|
|
.2 lda BASEL,y setup line Base Ptr
|
|
|
|
|
sta ZPBasePtr
|
|
|
|
|
lda BASEH,y
|
|
|
|
|
sta ZPBasePtr+1
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
phy
|
|
|
|
|
|
|
|
|
|
ldx LBUF.C1
|
|
|
|
|
|
|
|
|
|
.3 ldy COL.BANK,x
|
|
|
|
|
sta $C000,y
|
|
|
|
|
txa
|
|
|
|
|
lsr
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda (ZPBMSavePtr)
|
|
|
|
|
sta (ZPBasePtr),y
|
|
|
|
|
inc ZPBMSavePtr
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
inc ZPBMSavePtr+1
|
|
|
|
|
|
|
|
|
|
.4 cpx LBUF.C2
|
|
|
|
|
inx
|
|
|
|
|
bcc .3
|
|
|
|
|
|
|
|
|
|
ply
|
2020-10-13 06:24:57 +00:00
|
|
|
|
dec ZPTmpByte
|
2020-10-12 15:36:10 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
sta CLRREADAUX
|
2020-10-26 16:32:51 +00:00
|
|
|
|
BITBLT.RTS rts
|
2020-10-12 15:36:10 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
BITBLT.0 bit #S.CB.OP.SAVE
|
|
|
|
|
beq BITBLT.1
|
2020-07-04 19:00:47 +00:00
|
|
|
|
|
2020-10-26 16:32:51 +00:00
|
|
|
|
ldy CB.Cache+S.CB.DstPtr
|
2020-07-04 19:00:47 +00:00
|
|
|
|
lda CB.Cache+S.CB.DstPtr+1
|
2020-10-12 15:36:10 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
tya DstPtr is AUX hMem
|
|
|
|
|
>SYSCALL2 GetStkObjPtr
|
|
|
|
|
|
|
|
|
|
sta SETWRITEAUX
|
|
|
|
|
|
|
|
|
|
.1 >STYA ZPBMSavePtr
|
|
|
|
|
|
|
|
|
|
ldy CB.Cache+S.CB.Y1
|
|
|
|
|
|
|
|
|
|
.2 lda BASEL,y setup line Base Ptr
|
|
|
|
|
sta ZPBasePtr
|
|
|
|
|
lda BASEH,y
|
|
|
|
|
sta ZPBasePtr+1
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
phy
|
|
|
|
|
|
|
|
|
|
ldx LBUF.C1
|
|
|
|
|
|
|
|
|
|
.3 ldy COL.BANK,x
|
|
|
|
|
sta $C000,y
|
|
|
|
|
txa
|
|
|
|
|
lsr
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda (ZPBasePtr),y
|
|
|
|
|
sta (ZPBMSavePtr)
|
|
|
|
|
inc ZPBMSavePtr
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
inc ZPBMSavePtr+1
|
|
|
|
|
|
|
|
|
|
.4 cpx LBUF.C2
|
|
|
|
|
inx
|
|
|
|
|
bcc .3
|
|
|
|
|
|
|
|
|
|
ply
|
2020-10-13 06:24:57 +00:00
|
|
|
|
dec ZPTmpByte
|
2020-07-04 19:00:47 +00:00
|
|
|
|
bne .2
|
2020-10-12 15:36:10 +00:00
|
|
|
|
|
|
|
|
|
sta CLRWRITEAUX
|
|
|
|
|
|
|
|
|
|
lda CB.Cache+S.CB.OP
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
BITBLT.1 and #$0F
|
2020-10-26 16:32:51 +00:00
|
|
|
|
beq BITBLT.RTS
|
2020-07-04 19:00:47 +00:00
|
|
|
|
|
2020-10-12 15:36:10 +00:00
|
|
|
|
ldy CB.Cache+S.CB.SrcPtr
|
|
|
|
|
lda CB.Cache+S.CB.SrcPtr+1
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
sta SETREADAUX SrcPtr is AUX hMem
|
|
|
|
|
|
2020-07-04 19:00:47 +00:00
|
|
|
|
tya
|
|
|
|
|
>SYSCALL2 GetMemPtr
|
|
|
|
|
|
2020-10-12 15:36:10 +00:00
|
|
|
|
.4 >STYA ZPBMDataPtr
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
BITBLT.2 ldy #S.BM-1
|
2017-11-16 16:46:18 +00:00
|
|
|
|
|
|
|
|
|
.1 lda (ZPBMDataPtr),y
|
|
|
|
|
sta BM.Cache,y
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2017-12-19 07:39:24 +00:00
|
|
|
|
ldx #0
|
2020-10-12 15:36:10 +00:00
|
|
|
|
|
2017-12-19 07:39:24 +00:00
|
|
|
|
lda BM.Cache+S.BM.F
|
|
|
|
|
cmp #S.BM.F.BBP1
|
|
|
|
|
beq .11
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2017-12-19 07:39:24 +00:00
|
|
|
|
ldx #$80
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2017-12-19 07:39:24 +00:00
|
|
|
|
.11 stx BLT.CMASK
|
2017-11-27 07:11:31 +00:00
|
|
|
|
lda ZPBMDataPtr
|
|
|
|
|
clc
|
|
|
|
|
adc BM.Cache+S.BM.MASK.OFS
|
|
|
|
|
sta ZPBMMaskPtr
|
|
|
|
|
lda ZPBMDataPtr+1
|
|
|
|
|
adc BM.Cache+S.BM.MASK.OFS+1
|
|
|
|
|
sta ZPBMMaskPtr+1
|
2020-10-26 16:32:51 +00:00
|
|
|
|
|
2017-11-16 16:46:18 +00:00
|
|
|
|
lda ZPBMDataPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #S.BM
|
|
|
|
|
sta ZPBMDataPtr
|
|
|
|
|
bcc .2
|
|
|
|
|
inc ZPBMDataPtr+1
|
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
.2 >LDYA CB.Cache+S.CB.SrcY
|
2017-11-16 16:46:18 +00:00
|
|
|
|
ldx BM.Cache+S.BM.RowBytes
|
|
|
|
|
jsr YAMultX
|
|
|
|
|
pha
|
|
|
|
|
tya
|
|
|
|
|
clc
|
2017-11-27 07:11:31 +00:00
|
|
|
|
adc ZPBMDataPtr
|
|
|
|
|
sta BLT.BMDataPtr
|
2017-11-16 16:46:18 +00:00
|
|
|
|
pla
|
|
|
|
|
pha
|
2017-11-27 07:11:31 +00:00
|
|
|
|
adc ZPBMDataPtr+1
|
|
|
|
|
sta BLT.BMDataPtr+1
|
2017-11-16 16:46:18 +00:00
|
|
|
|
tya
|
2017-11-27 07:11:31 +00:00
|
|
|
|
adc ZPBMMaskPtr
|
|
|
|
|
sta BLT.BMMaskPtr
|
2017-11-16 16:46:18 +00:00
|
|
|
|
pla
|
2017-11-27 07:11:31 +00:00
|
|
|
|
adc ZPBMMaskPtr+1
|
|
|
|
|
sta BLT.BMMaskPtr+1
|
2020-09-04 15:21:15 +00:00
|
|
|
|
lda CB.Cache+S.CB.SrcX
|
2017-11-17 07:09:39 +00:00
|
|
|
|
pha
|
2017-11-20 06:59:59 +00:00
|
|
|
|
and #7
|
|
|
|
|
sta BLT.BMBitOfs
|
2017-11-17 07:09:39 +00:00
|
|
|
|
pla
|
2020-09-04 15:21:15 +00:00
|
|
|
|
lsr CB.Cache+S.CB.SrcX+1
|
2017-11-17 07:09:39 +00:00
|
|
|
|
ror
|
2020-09-04 15:21:15 +00:00
|
|
|
|
lsr CB.Cache+S.CB.SrcX+1
|
2017-11-17 07:09:39 +00:00
|
|
|
|
ror
|
2020-09-04 15:21:15 +00:00
|
|
|
|
lsr CB.Cache+S.CB.SrcX+1
|
2017-11-17 07:09:39 +00:00
|
|
|
|
ror
|
2017-11-16 16:46:18 +00:00
|
|
|
|
pha
|
|
|
|
|
clc
|
2017-11-27 07:11:31 +00:00
|
|
|
|
adc BLT.BMDataPtr
|
|
|
|
|
sta BLT.BMDataPtr
|
2017-11-16 16:46:18 +00:00
|
|
|
|
bcc .3
|
|
|
|
|
|
2017-11-27 07:11:31 +00:00
|
|
|
|
inc BLT.BMDataPtr+1
|
2017-12-05 16:33:06 +00:00
|
|
|
|
clc
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2017-11-16 16:46:18 +00:00
|
|
|
|
.3 pla
|
2017-11-27 07:11:31 +00:00
|
|
|
|
adc BLT.BMMaskPtr
|
|
|
|
|
sta BLT.BMMaskPtr
|
2017-11-16 16:46:18 +00:00
|
|
|
|
bcc .4
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2017-11-27 07:11:31 +00:00
|
|
|
|
inc BLT.BMMaskPtr+1
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2020-10-26 16:32:51 +00:00
|
|
|
|
.4 lda BM.Cache+S.BM.H
|
|
|
|
|
cmp CB.Cache+S.CB.SrcH
|
|
|
|
|
bcs .5
|
|
|
|
|
|
|
|
|
|
sta CB.Cache+S.CB.SrcH
|
|
|
|
|
|
|
|
|
|
.5 ldx BLT.ScrBitOfs
|
2020-10-15 06:16:45 +00:00
|
|
|
|
bne BITBLT.LOOPx
|
2020-10-12 15:36:10 +00:00
|
|
|
|
|
2017-11-27 16:39:09 +00:00
|
|
|
|
*------------ Shift 0
|
|
|
|
|
|
|
|
|
|
BITBLT.LOOP0 lda CB.Cache+S.CB.OP
|
|
|
|
|
bit #S.CB.OP.MASK
|
|
|
|
|
beq .2
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-27 07:11:31 +00:00
|
|
|
|
>LDYA BLT.BMMaskPtr
|
2017-11-27 16:39:09 +00:00
|
|
|
|
>STYA ZPBMDataPtr
|
2017-11-27 07:11:31 +00:00
|
|
|
|
|
|
|
|
|
lda BLT.BMBitOfs
|
|
|
|
|
sta BLT.BMBitOfsL
|
|
|
|
|
ldx LBUF.C1
|
|
|
|
|
stx BLT.ScrColIdx
|
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
.1 jsr BLT.Get7BMBits we have 0xxxxxxxx in A
|
2017-11-27 16:39:09 +00:00
|
|
|
|
|
|
|
|
|
ldx BLT.ScrColIdx
|
|
|
|
|
sta LBUF.MASK,x
|
|
|
|
|
inc BLT.ScrColIdx
|
|
|
|
|
cpx LBUF.C2
|
|
|
|
|
bne .1
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-27 16:39:09 +00:00
|
|
|
|
.2 >LDYA BLT.BMDataPtr
|
|
|
|
|
>STYA ZPBMDataPtr
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-27 16:39:09 +00:00
|
|
|
|
lda BLT.BMBitOfs
|
|
|
|
|
sta BLT.BMBitOfsL
|
|
|
|
|
ldx LBUF.C1
|
|
|
|
|
stx BLT.ScrColIdx
|
2017-11-27 07:11:31 +00:00
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
.3 jsr BLT.Get7BMBits we have 0xxxxxxxx in A
|
2017-11-23 16:51:52 +00:00
|
|
|
|
|
2017-12-19 07:39:24 +00:00
|
|
|
|
ora BLT.CMASK
|
2017-11-27 07:11:31 +00:00
|
|
|
|
ldx BLT.ScrColIdx
|
2017-11-23 16:51:52 +00:00
|
|
|
|
sta LBUF.DATA,x
|
2017-11-27 07:11:31 +00:00
|
|
|
|
inc BLT.ScrColIdx
|
2017-11-23 16:51:52 +00:00
|
|
|
|
cpx LBUF.C2
|
2017-11-27 16:39:09 +00:00
|
|
|
|
bne .3
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
ldy CB.Cache+S.CB.Y1
|
2017-11-30 07:33:45 +00:00
|
|
|
|
jsr LBUF.DrawAtY
|
2020-10-26 16:32:51 +00:00
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
inc CB.Cache+S.CB.Y1
|
2017-12-01 15:53:29 +00:00
|
|
|
|
dec CB.Cache+S.CB.SrcH
|
2017-11-30 07:33:45 +00:00
|
|
|
|
beq .8
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
lda CB.Cache+S.CB.OP
|
|
|
|
|
bit #S.CB.OP.MASK
|
|
|
|
|
beq .4
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
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
|
2020-10-26 16:32:51 +00:00
|
|
|
|
bcc BITBLT.LOOP0
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
inc BLT.BMDataPtr+1
|
2020-10-12 15:36:10 +00:00
|
|
|
|
|
2020-10-26 16:32:51 +00:00
|
|
|
|
bra BITBLT.LOOP0
|
2017-11-30 07:33:45 +00:00
|
|
|
|
|
2020-10-26 16:32:51 +00:00
|
|
|
|
.8 sta CLRREADAUX
|
2020-07-02 14:14:30 +00:00
|
|
|
|
rts
|
2020-10-15 06:16:45 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
BITBLT.LOOPx ldy Shift.L.LO-1,x X = 1->6
|
|
|
|
|
sty ZPScrShiftPtr
|
|
|
|
|
ldy Shift.L.HI-1,x X = 1->6
|
|
|
|
|
sty ZPScrShiftPtr+1
|
|
|
|
|
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
|
2017-11-27 07:11:31 +00:00
|
|
|
|
|
|
|
|
|
*------------ Shift 1->6 Comment : SCRBitOfs=X=3
|
2020-10-12 15:36:10 +00:00
|
|
|
|
|
2020-10-15 06:16:45 +00:00
|
|
|
|
BITBLT.LOOPx.0 lda CB.Cache+S.CB.OP X = BLT.ScrBitOfs
|
2017-11-27 16:39:09 +00:00
|
|
|
|
bit #S.CB.OP.MASK
|
2017-11-30 07:33:45 +00:00
|
|
|
|
beq BITBLT.LOOPx.4
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-27 16:39:09 +00:00
|
|
|
|
>LDYA BLT.BMMaskPtr
|
|
|
|
|
>STYA ZPBMDataPtr
|
|
|
|
|
|
|
|
|
|
lda BLT.BMBitOfs
|
|
|
|
|
sta BLT.BMBitOfsL
|
|
|
|
|
ldx LBUF.C1
|
|
|
|
|
stx BLT.ScrColIdx
|
|
|
|
|
stz LBUF.MASK,x make sure C1 not ORed with trash in "ora LBUF.DATA,x"
|
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
BITBLT.LOOPx.1 jsr BLT.Get7BMBits we have c6543210 in A, destination : COL=3210xxx, COL+1=xxxx654
|
2017-11-27 16:39:09 +00:00
|
|
|
|
pha save BM byte for 2nd col
|
2017-11-30 07:33:45 +00:00
|
|
|
|
BITBLT.LOOPx.2 and #$ff SELF MODIFIED : MASK WITH #%00001111, keep col1 bits only
|
2017-11-27 16:39:09 +00:00
|
|
|
|
tay
|
|
|
|
|
lda (ZPScrShiftPtr),y make 0000dddd Shift left 3 : 0dddd000
|
|
|
|
|
ldx BLT.ScrColIdx Get actual COL index
|
|
|
|
|
ora LBUF.MASK,x Light proper bits : 0dddd???
|
|
|
|
|
sta LBUF.MASK,x store 0xdddd???
|
|
|
|
|
pla Get back BM Byte
|
2017-11-30 07:33:45 +00:00
|
|
|
|
BITBLT.LOOPx.3 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
|
2017-11-27 16:39:09 +00:00
|
|
|
|
tay
|
|
|
|
|
lda (ZPScrShiftPtr),y shift right 4 (=shift left 3!!!) : 00000ddd
|
|
|
|
|
sta LBUF.MASK+1,x
|
2017-11-30 07:33:45 +00:00
|
|
|
|
inc BLT.ScrColIdx
|
2017-11-27 16:39:09 +00:00
|
|
|
|
cpx LBUF.C2
|
2017-11-30 07:33:45 +00:00
|
|
|
|
bne BITBLT.LOOPx.1
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
BITBLT.LOOPx.4 >LDYA BLT.BMDataPtr
|
2017-11-27 16:39:09 +00:00
|
|
|
|
>STYA ZPBMDataPtr
|
2017-11-27 07:11:31 +00:00
|
|
|
|
|
2017-11-27 16:39:09 +00:00
|
|
|
|
lda BLT.BMBitOfs
|
|
|
|
|
sta BLT.BMBitOfsL
|
|
|
|
|
ldx LBUF.C1
|
|
|
|
|
stx BLT.ScrColIdx
|
|
|
|
|
stz LBUF.DATA,x make sure C1 not ORed with trash in "ora LBUF.DATA,x"
|
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
BITBLT.LOOPx.5 jsr BLT.Get7BMBits we have c6543210 in A, destination : COL=3210xxx, COL+1=xxxx654
|
2017-11-27 07:11:31 +00:00
|
|
|
|
pha save BM byte for 2nd col
|
2017-11-30 07:33:45 +00:00
|
|
|
|
BITBLT.LOOPx.6 and #$ff SELF MODIFIED : MASK WITH #%00001111, keep col1 bits only
|
2017-11-23 16:51:52 +00:00
|
|
|
|
tay
|
2017-11-27 07:11:31 +00:00
|
|
|
|
lda (ZPScrShiftPtr),y make 0000dddd Shift left 3 : 0dddd000
|
2017-12-19 07:39:24 +00:00
|
|
|
|
ora BLT.CMASK
|
|
|
|
|
|
2017-11-27 07:11:31 +00:00
|
|
|
|
ldx BLT.ScrColIdx Get actual COL index
|
|
|
|
|
ora LBUF.DATA,x Light proper bits : 0dddd???
|
|
|
|
|
sta LBUF.DATA,x store 0xdddd???
|
|
|
|
|
pla Get back BM Byte
|
2017-11-30 07:33:45 +00:00
|
|
|
|
BITBLT.LOOPx.7 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
|
2017-11-23 16:51:52 +00:00
|
|
|
|
tay
|
2017-11-27 07:11:31 +00:00
|
|
|
|
lda (ZPScrShiftPtr),y shift right 4 (=shift left 3!!!) : 00000ddd
|
2017-12-19 07:39:24 +00:00
|
|
|
|
ora BLT.CMASK
|
2017-11-27 07:11:31 +00:00
|
|
|
|
sta LBUF.DATA+1,x
|
2017-11-30 07:33:45 +00:00
|
|
|
|
inc BLT.ScrColIdx
|
2017-11-27 07:11:31 +00:00
|
|
|
|
cpx LBUF.C2
|
2017-11-30 07:33:45 +00:00
|
|
|
|
bne BITBLT.LOOPx.5
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
ldy CB.Cache+S.CB.Y1
|
2017-11-23 16:51:52 +00:00
|
|
|
|
jsr LBUF.DrawAtY
|
2020-10-26 16:32:51 +00:00
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
inc CB.Cache+S.CB.Y1
|
2017-12-01 15:53:29 +00:00
|
|
|
|
dec CB.Cache+S.CB.SrcH
|
2017-11-27 16:39:09 +00:00
|
|
|
|
beq .8
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-27 16:39:09 +00:00
|
|
|
|
lda CB.Cache+S.CB.OP
|
|
|
|
|
bit #S.CB.OP.MASK
|
|
|
|
|
beq .1
|
2020-09-01 15:38:55 +00:00
|
|
|
|
|
2017-11-27 16:39:09 +00:00
|
|
|
|
lda BLT.BMMaskPtr
|
2017-11-23 16:51:52 +00:00
|
|
|
|
clc
|
|
|
|
|
adc BM.Cache+S.BM.RowBytes
|
2017-11-27 07:11:31 +00:00
|
|
|
|
sta BLT.BMMaskPtr
|
2017-11-27 16:39:09 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
|
2017-11-27 07:11:31 +00:00
|
|
|
|
inc BLT.BMMaskPtr+1
|
2017-11-27 16:39:09 +00:00
|
|
|
|
|
|
|
|
|
.1 lda BLT.BMDataPtr
|
|
|
|
|
clc
|
|
|
|
|
adc BM.Cache+S.BM.RowBytes
|
|
|
|
|
sta BLT.BMDataPtr
|
|
|
|
|
bcc .2
|
2020-10-12 15:36:10 +00:00
|
|
|
|
|
2017-11-27 16:39:09 +00:00
|
|
|
|
inc BLT.BMDataPtr+1
|
2020-10-12 15:36:10 +00:00
|
|
|
|
|
2020-10-15 06:16:45 +00:00
|
|
|
|
.2 jmp BITBLT.LOOPx.0
|
2017-11-27 07:11:31 +00:00
|
|
|
|
|
2020-10-26 16:32:51 +00:00
|
|
|
|
.8 sta CLRREADAUX
|
2020-07-02 14:14:30 +00:00
|
|
|
|
rts
|
2017-07-05 14:45:19 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-27 16:39:09 +00:00
|
|
|
|
* BM Data/Mask bits :
|
2017-11-20 16:45:12 +00:00
|
|
|
|
* 76543210 76543210
|
|
|
|
|
* ^
|
|
|
|
|
* BMBitOfsL (0->7)
|
|
|
|
|
* LBUF DATA/MASK Bits
|
|
|
|
|
* c6543210 c6543210
|
|
|
|
|
* ^
|
|
|
|
|
*--------------------------------------
|
2017-12-07 07:42:58 +00:00
|
|
|
|
BLT.Get7BMBits ldx BLT.BMBitOfsL
|
2017-11-23 16:51:52 +00:00
|
|
|
|
beq BLT.Get7BMBits0 OFS=0, done! and no need to advance ZPBMDataPtr
|
2017-11-30 07:33:45 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
dex OFS 0->6
|
|
|
|
|
beq BLT.Get7BMBits1 OFS was 1....done and go to next byte, OFS=0
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2019-08-02 14:36:49 +00:00
|
|
|
|
lda Shift.R.LO-1,x X = 1->6
|
2017-12-07 07:42:58 +00:00
|
|
|
|
sta ZPBMShiftPtr
|
2019-08-02 14:36:49 +00:00
|
|
|
|
lda Shift.R.HI-1,x X = 1->6
|
2017-12-07 07:42:58 +00:00
|
|
|
|
sta ZPBMShiftPtr+1
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2017-12-07 07:42:58 +00:00
|
|
|
|
lda (ZPBMDataPtr)
|
|
|
|
|
lsr OFS=1->7, shift one (Range 0->127)
|
2017-11-27 07:11:31 +00:00
|
|
|
|
and Mask7BitsH,x Get only left upper X bits
|
2017-11-23 16:51:52 +00:00
|
|
|
|
tay xxxxx000
|
2017-11-30 07:33:45 +00:00
|
|
|
|
lda (ZPBMShiftPtr),y shift'em RIGHT 000xxxxx
|
2017-11-21 16:27:07 +00:00
|
|
|
|
pha
|
2017-11-30 07:33:45 +00:00
|
|
|
|
inc ZPBMDataPtr Next BM data byte
|
|
|
|
|
bne .1
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
inc ZPBMDataPtr+1
|
2017-11-27 07:11:31 +00:00
|
|
|
|
|
2020-06-09 13:40:21 +00:00
|
|
|
|
.1 lda (ZPBMDataPtr) get next byte
|
2017-11-27 07:11:31 +00:00
|
|
|
|
and Mask7BitsL,x only first Y bits 000000yy
|
2017-11-20 16:45:12 +00:00
|
|
|
|
tay
|
2017-11-23 16:51:52 +00:00
|
|
|
|
pla get back right part bits 000xxxxx
|
2017-11-30 07:33:45 +00:00
|
|
|
|
ora (ZPBMShiftPtr),y shift right 000000yy and ORA with 000xxxxx=0yyxxxxx
|
2017-11-21 16:27:07 +00:00
|
|
|
|
dec BLT.BMBitOfsL X = 1->6, ADD 7 MOD 8.....
|
|
|
|
|
rts
|
2017-11-20 16:45:12 +00:00
|
|
|
|
|
2017-12-07 07:42:58 +00:00
|
|
|
|
BLT.Get7BMBits0 lda #7
|
|
|
|
|
sta BLT.BMBitOfsL Was 0, add 7 bits
|
|
|
|
|
lda (ZPBMDataPtr)
|
|
|
|
|
and #%01111111 Get only 7 needed bits
|
2017-11-20 16:45:12 +00:00
|
|
|
|
rts
|
2020-06-09 13:40:21 +00:00
|
|
|
|
|
2017-12-07 07:42:58 +00:00
|
|
|
|
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
|
|
|
|
|
|
2017-11-30 07:33:45 +00:00
|
|
|
|
inc ZPBMDataPtr go to next byte in BM line
|
|
|
|
|
bne .8
|
2017-12-07 07:42:58 +00:00
|
|
|
|
inc ZPBMDataPtr+1
|
2017-11-30 07:33:45 +00:00
|
|
|
|
.8 rts
|
2017-11-20 06:59:59 +00:00
|
|
|
|
*--------------------------------------
|
2017-07-05 14:45:19 +00:00
|
|
|
|
MAN
|
2020-08-25 14:54:30 +00:00
|
|
|
|
SAVE usr/src/drv/dhgr.drv.s.blt
|
2020-06-09 13:40:21 +00:00
|
|
|
|
LOAD usr/src/drv/dhgr.drv.s
|
2017-07-05 14:45:19 +00:00
|
|
|
|
ASM
|