2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-07-05 14:45:19 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2017-07-05 14:45:19 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* SETPIXEL
|
2017-11-17 16:16:05 +00:00
|
|
|
|
* 1 : OP (XOR,SET,ORA)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
* 2 : Mode
|
|
|
|
|
* 3 : Color
|
|
|
|
|
* 4 : SrcX1
|
|
|
|
|
* 6 : SrcY1
|
|
|
|
|
*--------------------------------------
|
2017-12-22 21:24:30 +00:00
|
|
|
|
SETPIXEL lda CB.Cache+S.CB.M
|
|
|
|
|
bit #S.CB.M.C16
|
2017-07-05 14:45:19 +00:00
|
|
|
|
bne SETPIXEL.C16
|
|
|
|
|
|
2017-11-17 16:16:05 +00:00
|
|
|
|
SETPIXEL.MONO >LDYA CB.Cache+S.CB.X1
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
2017-11-17 16:16:05 +00:00
|
|
|
|
jsr DIVMOD7YA
|
|
|
|
|
tay
|
|
|
|
|
lda COL.OFS,y
|
|
|
|
|
phy
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
|
|
|
|
ldy CB.Cache+S.CB.Y1
|
|
|
|
|
clc
|
2017-11-17 16:16:05 +00:00
|
|
|
|
adc BASEL,y
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta ZPBasePtr
|
2017-07-05 14:45:19 +00:00
|
|
|
|
lda BASEH,y
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta ZPBasePtr+1
|
2017-11-17 16:16:05 +00:00
|
|
|
|
|
2017-07-05 14:45:19 +00:00
|
|
|
|
ply
|
|
|
|
|
lda COL.BANK,y
|
|
|
|
|
tay
|
2017-11-17 16:16:05 +00:00
|
|
|
|
sta $C000,y Select proper BANK
|
|
|
|
|
|
2017-07-05 14:45:19 +00:00
|
|
|
|
lda CB.Cache+S.CB.OP
|
2017-11-17 16:16:05 +00:00
|
|
|
|
* cmp #S.CB.OP.XOR
|
|
|
|
|
beq SETPIXEL.MONO.XOR
|
2017-11-17 07:09:39 +00:00
|
|
|
|
|
2017-11-17 16:16:05 +00:00
|
|
|
|
lda CB.Cache+S.CB.COLOR
|
|
|
|
|
bne SETPIXEL.MONO.WHITE
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
2017-11-17 16:16:05 +00:00
|
|
|
|
SETPIXEL.MONO.BLACK
|
|
|
|
|
lda (ZPBasePtr)
|
|
|
|
|
and Mono.NMasks,x
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta (ZPBasePtr)
|
2017-11-17 16:16:05 +00:00
|
|
|
|
|
2017-07-05 14:45:19 +00:00
|
|
|
|
rts
|
2017-11-17 16:16:05 +00:00
|
|
|
|
|
|
|
|
|
SETPIXEL.MONO.WHITE
|
|
|
|
|
lda (ZPBasePtr)
|
2017-11-20 16:45:12 +00:00
|
|
|
|
and #$7f Clear Color Bit
|
2017-11-17 16:16:05 +00:00
|
|
|
|
ora Mono.Masks,x
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta (ZPBasePtr)
|
2017-11-17 16:16:05 +00:00
|
|
|
|
|
2017-07-05 14:45:19 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2017-11-17 16:16:05 +00:00
|
|
|
|
SETPIXEL.MONO.XOR
|
|
|
|
|
lda (ZPBasePtr)
|
2017-11-20 16:45:12 +00:00
|
|
|
|
and #$7f Clear Color Bit
|
2017-11-17 16:16:05 +00:00
|
|
|
|
eor Mono.Masks,x
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta (ZPBasePtr)
|
2017-11-17 16:16:05 +00:00
|
|
|
|
|
2017-07-05 14:45:19 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
SETPIXEL.C16 lda CB.Cache+S.CB.X1
|
|
|
|
|
lsr CB.Cache+S.CB.X1+1 divide by 4
|
|
|
|
|
ror
|
|
|
|
|
lsr CB.Cache+S.CB.X1+1
|
|
|
|
|
ror
|
|
|
|
|
tay Y=X/4 (range 0->139)
|
|
|
|
|
lda DIV7.0,y A=X/4/7 (range 0->19)
|
|
|
|
|
|
|
|
|
|
asl times 2 (range 0->38)
|
|
|
|
|
|
|
|
|
|
ldx CB.Cache+S.CB.Y1
|
2017-11-17 07:09:39 +00:00
|
|
|
|
* clc
|
2017-07-05 14:45:19 +00:00
|
|
|
|
adc BASEL,x setup line Base Ptr (cc by asl)
|
2017-11-17 07:09:39 +00:00
|
|
|
|
sta ZPBasePtr ZPBasePtr now point to first of...
|
2017-07-05 14:45:19 +00:00
|
|
|
|
lda BASEH,x
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta ZPBasePtr+1 ...the 4 columns
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
|
|
|
|
lda MOD7.0,y get MOD
|
|
|
|
|
|
|
|
|
|
asl times 4 to compute index in MASK tables
|
|
|
|
|
asl
|
|
|
|
|
tax set in X for Masks,NMasks
|
|
|
|
|
|
|
|
|
|
lda CB.Cache+S.CB.COLOR
|
|
|
|
|
|
|
|
|
|
asl times 4 to compute index in PIXELS table
|
|
|
|
|
asl
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda Color.Masks,x bits in 1st byte to light?
|
|
|
|
|
beq .10
|
|
|
|
|
and Color.Pixels,y apply color
|
2018-05-04 14:55:29 +00:00
|
|
|
|
sta ZPTmpByte
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
|
|
|
|
sta SETPAGE2
|
|
|
|
|
|
2017-11-15 07:27:12 +00:00
|
|
|
|
lda (ZPBasePtr)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
and Color.NMasks,x reset existing pixel,
|
2018-05-04 14:55:29 +00:00
|
|
|
|
ora ZPTmpByte
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta (ZPBasePtr)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
|
|
|
|
.10 inx
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda Color.Masks,x
|
|
|
|
|
beq .11
|
|
|
|
|
and Color.Pixels,y apply color
|
2018-05-04 14:55:29 +00:00
|
|
|
|
sta ZPTmpByte
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
|
|
|
|
sta CLRPAGE2
|
|
|
|
|
|
2017-11-15 07:27:12 +00:00
|
|
|
|
lda (ZPBasePtr)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
and Color.NMasks,x reset existing pixel,
|
2018-05-04 14:55:29 +00:00
|
|
|
|
ora ZPTmpByte
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta (ZPBasePtr)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
2017-11-15 07:27:12 +00:00
|
|
|
|
.11 inc ZPBasePtr
|
2017-07-05 14:45:19 +00:00
|
|
|
|
inx
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda Color.Masks,x
|
|
|
|
|
beq .12
|
|
|
|
|
and Color.Pixels,y apply color
|
2018-05-04 14:55:29 +00:00
|
|
|
|
sta ZPTmpByte
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
|
|
|
|
sta SETPAGE2
|
|
|
|
|
|
2017-11-15 07:27:12 +00:00
|
|
|
|
lda (ZPBasePtr)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
and Color.NMasks,x reset existing pixel,
|
2018-05-04 14:55:29 +00:00
|
|
|
|
ora ZPTmpByte
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta (ZPBasePtr)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
|
|
|
|
.12 inx
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda Color.Masks,x
|
|
|
|
|
beq .13
|
|
|
|
|
and Color.Pixels,y apply color
|
2018-05-04 14:55:29 +00:00
|
|
|
|
sta ZPTmpByte
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
|
|
|
|
sta CLRPAGE2
|
|
|
|
|
|
2017-11-15 07:27:12 +00:00
|
|
|
|
lda (ZPBasePtr)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
and Color.NMasks,x reset existing pixel,
|
2018-05-04 14:55:29 +00:00
|
|
|
|
ora ZPTmpByte
|
2017-11-15 07:27:12 +00:00
|
|
|
|
sta (ZPBasePtr)
|
2017-07-05 14:45:19 +00:00
|
|
|
|
|
2017-11-14 16:57:34 +00:00
|
|
|
|
.13 rts
|
2017-07-05 14:45:19 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* GETPIXEL
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GETPIXEL rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE /A2OSX.SRC/DRV/DHGR.DRV.S.PIX
|
|
|
|
|
LOAD /A2OSX.SRC/DRV/DHGR.DRV.S
|
|
|
|
|
ASM
|