A2osX/DRV/DHGR.DRV.S.PIX.txt

138 lines
2.6 KiB
Plaintext
Raw Permalink Normal View History

2017-12-22 21:24:30 +00:00
NEW
2019-07-25 15:10:59 +00:00
AUTO 3,1
*--------------------------------------
* SETPIXEL
* 1 : OP (XOR,SET,ORA)
* 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
bne SETPIXEL.C16
SETPIXEL.MONO >LDYA CB.Cache+S.CB.X1
jsr DIVMOD7YA
2020-09-01 15:38:55 +00:00
lsr
2021-06-04 17:14:36 +00:00
php
2021-06-05 15:48:54 +00:00
ldy CB.Cache+S.CB.Y1
clc
adc BASEL,y
2017-11-15 07:27:12 +00:00
sta ZPBasePtr
lda BASEH,y
2017-11-15 07:27:12 +00:00
sta ZPBasePtr+1
2021-06-05 15:48:54 +00:00
2021-06-04 17:14:36 +00:00
plp
2021-06-05 15:48:54 +00:00
ldy #0
bcs .1
iny
.1 sta IO.CLRPAGE2,y Select proper BANK
2021-06-05 15:48:54 +00:00
lda CB.Cache+S.CB.OP
* cmp #S.CB.OP.XOR
beq SETPIXEL.MONO.XOR
2020-06-09 13:40:21 +00:00
lda CB.Cache+S.CB.COLOR
bne SETPIXEL.MONO.WHITE
2019-10-03 06:25:27 +00:00
SETPIXEL.MONO.BLACK
lda (ZPBasePtr)
and Mono.NMasks,x
2017-11-15 07:27:12 +00:00
sta (ZPBasePtr)
rts
SETPIXEL.MONO.WHITE
lda (ZPBasePtr)
and #$7f Clear Color Bit
ora Mono.Masks,x
2017-11-15 07:27:12 +00:00
sta (ZPBasePtr)
rts
2019-10-03 06:25:27 +00:00
SETPIXEL.MONO.XOR
lda (ZPBasePtr)
and #$7f Clear Color Bit
eor Mono.Masks,x
2017-11-15 07:27:12 +00:00
sta (ZPBasePtr)
rts
2023-11-04 14:42:28 +00:00
*--------------------------------------
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)
2019-07-30 08:57:25 +00:00
ldx CB.Cache+S.CB.Y1
2023-11-04 14:42:28 +00:00
*--------------------------------------
2019-07-30 08:57:25 +00:00
* Y = PixelX (0,139), X = PixelY (0,191)
2023-11-04 14:42:28 +00:00
*--------------------------------------
2019-07-30 08:57:25 +00:00
SETPIXEL.C16.YX lda DIV7.0,y PixelX MOD 7 (range 0->19)
asl times 2 (range 0->38)
2019-10-03 06:25:27 +00:00
* clc
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...
lda BASEH,x
2017-11-15 07:27:12 +00:00
sta ZPBasePtr+1 ...the 4 columns
2019-07-30 08:57:25 +00:00
lda MOD7.0,y get pixelX MOD7
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
2019-07-30 08:57:25 +00:00
sta IO.SETPAGE2
2020-09-01 15:38:55 +00:00
jsr .81
.10 inx
iny
lda Color.Masks,x
beq .11
2020-06-09 13:40:21 +00:00
2020-09-01 15:38:55 +00:00
jsr .80
2020-06-09 13:40:21 +00:00
2017-11-15 07:27:12 +00:00
.11 inc ZPBasePtr
inx
iny
lda Color.Masks,x
beq .12
2020-06-09 13:40:21 +00:00
sta IO.SETPAGE2
2020-09-01 15:38:55 +00:00
jsr .81
2020-06-09 13:40:21 +00:00
.12 inx
iny
lda Color.Masks,x
2020-09-01 15:38:55 +00:00
beq .88
2020-06-09 13:40:21 +00:00
.80 sta IO.CLRPAGE2
2020-09-01 15:38:55 +00:00
.81 and Color.Pixels,y apply color
sta ZPTmpByte
2017-11-15 07:27:12 +00:00
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora ZPTmpByte
2017-11-15 07:27:12 +00:00
sta (ZPBasePtr)
2020-06-09 13:40:21 +00:00
2020-09-01 15:38:55 +00:00
.88 rts
*--------------------------------------
* GETPIXEL
*--------------------------------------
GETPIXEL rts
*--------------------------------------
MAN
2020-06-09 13:40:21 +00:00
SAVE usr/src/drv/dhgr.drv.s.pix
LOAD usr/src/drv/dhgr.drv.s
ASM