2017-07-05 14:45:19 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.BUILD
|
|
|
|
|
LOMEM $A00
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* BitBlt
|
2017-11-16 16:46:18 +00:00
|
|
|
|
* S.CB.X1 : SrcX1 in bitmap/mask
|
|
|
|
|
* S.CB.Y1 : SrcY1
|
|
|
|
|
* S.CB.X2 : SrcX2
|
|
|
|
|
* S.CB.Y2 : SrcY2
|
|
|
|
|
|
|
|
|
|
* S.CB.DestX : Destination X (screen)
|
|
|
|
|
* S.CB.DestY : Destination Y (screen)
|
|
|
|
|
|
|
|
|
|
* S.CB.SrcPtr : pointer to S.BM
|
|
|
|
|
* S.CB.DstPtr : pointer to Save Buffer
|
2017-07-05 14:45:19 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-16 16:46:18 +00:00
|
|
|
|
BITBLT >LDYA CB.CACHE+S.CB.SrcPtr
|
|
|
|
|
>STYA ZPBMDataPtr
|
|
|
|
|
|
|
|
|
|
ldy #S.BM-1
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPBMDataPtr),y
|
|
|
|
|
sta BM.Cache,y
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
lda ZPBMDataPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #S.BM
|
|
|
|
|
sta ZPBMDataPtr
|
|
|
|
|
bcc .2
|
|
|
|
|
|
|
|
|
|
inc ZPBMDataPtr+1
|
|
|
|
|
|
|
|
|
|
.2 >LDYA CB.Cache+S.CB.Y1
|
|
|
|
|
ldx BM.Cache+S.BM.RowBytes
|
|
|
|
|
|
|
|
|
|
jsr YAMultX
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
tya
|
|
|
|
|
clc
|
|
|
|
|
adc ZPBMDataPtr
|
|
|
|
|
sta ZPBMDataPtr
|
|
|
|
|
pla
|
|
|
|
|
pha
|
|
|
|
|
adc ZPBMDataPtr+1
|
|
|
|
|
sta ZPBMDataPtr+1
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
adc BM.Cache+S.BM.MASK.OFS
|
|
|
|
|
sta ZPBMMaskPtr
|
|
|
|
|
pla
|
|
|
|
|
adc BM.Cache+S.BM.MASK.OFS+1
|
|
|
|
|
sta ZPBMMaskPtr+1
|
|
|
|
|
|
|
|
|
|
lda CB.Cache+S.CB.X1
|
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
|
|
|
|
|
|
|
|
|
|
lsr CB.Cache+S.CB.X1+1
|
|
|
|
|
ror
|
|
|
|
|
lsr CB.Cache+S.CB.X1+1
|
|
|
|
|
ror
|
|
|
|
|
lsr CB.Cache+S.CB.X1+1
|
|
|
|
|
ror
|
2017-11-16 16:46:18 +00:00
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
clc
|
|
|
|
|
adc ZPBMDataPtr
|
|
|
|
|
sta ZPBMDataPtr
|
|
|
|
|
bcc .3
|
|
|
|
|
|
|
|
|
|
inc ZPBMDataPtr+1
|
|
|
|
|
|
|
|
|
|
.3 pla
|
|
|
|
|
adc ZPBMMaskPtr
|
|
|
|
|
sta ZPBMMaskPtr
|
|
|
|
|
bcc .4
|
|
|
|
|
|
|
|
|
|
inc ZPBMMaskPtr+1
|
|
|
|
|
|
2017-11-20 06:59:59 +00:00
|
|
|
|
.4 lda S.CB.X2
|
|
|
|
|
sec
|
|
|
|
|
sbc S.CB.X1
|
|
|
|
|
sta BLT.DX
|
|
|
|
|
|
|
|
|
|
lda S.CB.X2+1
|
|
|
|
|
sbc S.CB.X1+1
|
|
|
|
|
sta BLT.DX+1
|
|
|
|
|
|
|
|
|
|
>LDYA S.CB.DestX
|
|
|
|
|
jsr LBUF.SetBounds1YA
|
|
|
|
|
stx BLT.SCRBitOfs
|
|
|
|
|
|
|
|
|
|
lda S.CB.DestX
|
|
|
|
|
clc
|
|
|
|
|
adc BLT.DX
|
|
|
|
|
tay
|
|
|
|
|
lda S.CB.DestX+1
|
|
|
|
|
adc BLT.DX+1
|
|
|
|
|
jsr LBUF.SetBounds2YA
|
|
|
|
|
|
2017-11-20 16:45:12 +00:00
|
|
|
|
.5 lda BLT.BMBitOfs
|
|
|
|
|
sta BLT.BMBitOfsL
|
2017-11-16 16:46:18 +00:00
|
|
|
|
|
2017-11-20 16:45:12 +00:00
|
|
|
|
.6 jsr BLT.Get7BMBits
|
|
|
|
|
|
2017-07-05 14:45:19 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-11-20 16:45:12 +00:00
|
|
|
|
* BMD/BMM bits :
|
|
|
|
|
* 76543210 76543210
|
|
|
|
|
* ^
|
|
|
|
|
* BMBitOfsL (0->7)
|
|
|
|
|
* LBUF DATA/MASK Bits
|
|
|
|
|
* c6543210 c6543210
|
|
|
|
|
* ^
|
|
|
|
|
* SCRBitOfsL (0->6)
|
|
|
|
|
*--------------------------------------
|
2017-11-21 16:27:07 +00:00
|
|
|
|
BLT.Get7BMBits lda (ZPBMDataPtr)
|
|
|
|
|
|
|
|
|
|
ldx BLT.BMBitOfsL
|
|
|
|
|
beq BLT.Get7BMBits0 done! and no need to advance ZPBMDataPtr
|
|
|
|
|
lsr Range 0->127
|
|
|
|
|
dex Range 0->6
|
|
|
|
|
beq BLT.Get7BMBits1
|
2017-11-20 16:45:12 +00:00
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
ldy Shift7.LO-1,x X = 1->6
|
|
|
|
|
sty ZPBMShiftPtr+1
|
2017-11-20 16:45:12 +00:00
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
ldy Shift7.HI-1,x X = 1->6
|
|
|
|
|
sty ZPBMShiftPtr+1
|
2017-11-20 16:45:12 +00:00
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
and Mask7BitsL,x Get only needed bits
|
|
|
|
|
tay
|
2017-11-20 16:45:12 +00:00
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
lda (ZPBMShiftPtr),y
|
|
|
|
|
pha
|
2017-11-20 16:45:12 +00:00
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
inc ZPBMDataPtr Next BM data byte
|
2017-11-20 16:45:12 +00:00
|
|
|
|
bne .1
|
|
|
|
|
inc ZPBMDataPtr+1
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPBMDataPtr)
|
2017-11-21 16:27:07 +00:00
|
|
|
|
and Mask7BitsH,x
|
2017-11-20 16:45:12 +00:00
|
|
|
|
tay
|
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
pla
|
2017-11-20 16:45:12 +00:00
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
ora (ZPBMShiftPtr),y
|
2017-11-20 16:45:12 +00:00
|
|
|
|
|
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-11-21 16:27:07 +00:00
|
|
|
|
BLT.Get7BMBits0 and #%01111111 Get only 7 needed bits
|
|
|
|
|
ldx #7
|
|
|
|
|
stx BLT.BMBitOfsL Was 0, add 7 bits
|
2017-11-20 16:45:12 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
BLT.Get7BMBits1 stz BLT.BMBitOfsL Was 1, add 7 bits, MOD 8=0
|
|
|
|
|
|
|
|
|
|
inc ZPBMDataPtr go to next byte
|
|
|
|
|
bne .1
|
|
|
|
|
inc ZPBMDataPtr+1
|
|
|
|
|
|
|
|
|
|
.1 rts LSR did already 0xxxxxxx
|
2017-11-20 06:59:59 +00:00
|
|
|
|
*--------------------------------------
|
2017-07-05 14:45:19 +00:00
|
|
|
|
MAN
|
2017-11-14 16:57:34 +00:00
|
|
|
|
SAVE /A2OSX.SRC/DRV/DHGR.DRV.S.RECT
|
2017-07-05 14:45:19 +00:00
|
|
|
|
LOAD /A2OSX.SRC/DRV/DHGR.DRV.S
|
|
|
|
|
ASM
|