Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-09-01 17:38:55 +02:00
parent b8e761fdbb
commit d43a064a59
8 changed files with 123 additions and 64 deletions

Binary file not shown.

View File

@ -146,11 +146,6 @@ COL.BANK .DA #SETPAGE2,#CLRPAGE2,#SETPAGE2,#CLRPAGE2
.DA #SETPAGE2,#CLRPAGE2,#SETPAGE2,#CLRPAGE2
.DA #SETPAGE2,#CLRPAGE2,#SETPAGE2,#CLRPAGE2
*--------------------------------------
COL.OFS .DA #00,#00,#01,#01,#02,#02,#03,#03,#04,#04,#05,#05,#06,#06,#07,#07,#08,#08,#09,#09
.DA #10,#10,#11,#11,#12,#12,#13,#13,#14,#14,#15,#15,#16,#16,#17,#17,#18,#18,#19,#19
.DA #20,#20,#21,#21,#22,#22,#23,#23,#24,#24,#25,#25,#26,#26,#27,#27,#28,#28,#29,#29
.DA #30,#30,#31,#31,#32,#32,#33,#33,#34,#34,#35,#35,#36,#36,#37,#37,#38,#38,#39,#39
*--------------------------------------
DIV7.0 .HS 00
DIV7.512 .HS 000000
DIV7.256 .HS 000000

View File

@ -154,6 +154,7 @@ BITBLT.1 ldy #S.BM-1
BITBLT.LOOP0 lda CB.Cache+S.CB.OP
bit #S.CB.OP.MASK
beq .2
>LDYA BLT.BMMaskPtr
>STYA ZPBMDataPtr
@ -169,8 +170,10 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
inc BLT.ScrColIdx
cpx LBUF.C2
bne .1
.2 >LDYA BLT.BMDataPtr
>STYA ZPBMDataPtr
lda BLT.BMBitOfs
sta BLT.BMBitOfsL
ldx LBUF.C1
@ -184,14 +187,17 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
inc BLT.ScrColIdx
cpx LBUF.C2
bne .3
ldy CB.Cache+S.CB.DstY
jsr LBUF.DrawAtY
inc CB.Cache+S.CB.DstY
dec CB.Cache+S.CB.SrcH
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
@ -205,6 +211,7 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
adc BM.Cache+S.BM.RowBytes
sta BLT.BMDataPtr
bcc .5
inc BLT.BMDataPtr+1
.5 jmp BITBLT.LOOP0
@ -215,6 +222,7 @@ BITBLT.LOOP0 lda CB.Cache+S.CB.OP
BITBLT.LOOPx lda CB.Cache+S.CB.OP X = BLT.ScrBitOfs
bit #S.CB.OP.MASK
beq BITBLT.LOOPx.4
>LDYA BLT.BMMaskPtr
>STYA ZPBMDataPtr
@ -269,14 +277,17 @@ BITBLT.LOOPx.7 and #$ff SELF MODIFIED : #%01110000 get only col2 bites
inc BLT.ScrColIdx
cpx LBUF.C2
bne BITBLT.LOOPx.5
ldy CB.Cache+S.CB.DstY
jsr LBUF.DrawAtY
inc CB.Cache+S.CB.DstY
dec CB.Cache+S.CB.SrcH
beq .8
lda CB.Cache+S.CB.OP
bit #S.CB.OP.MASK
beq .1
lda BLT.BMMaskPtr
clc
adc BM.Cache+S.BM.RowBytes

View File

@ -47,7 +47,10 @@ LBUF.DrawAtY lda BASEL,y setup line Base Ptr
.1 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda (ZPBasePtr),y
sta (ZPBMSavePtr)
inc ZPBMSavePtr
@ -60,6 +63,7 @@ LBUF.DrawAtY lda BASEL,y setup line Base Ptr
bcc .1
lda CB.Cache+S.CB.OP
.3 and #$F
tax
jmp (J.LBUF.DrawAtY,x)
@ -68,7 +72,10 @@ LBUF.DrawAtY lda BASEL,y setup line Base Ptr
.5 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda (ZPBMSavePtr)
sta (ZPBasePtr),y
inc ZPBMSavePtr
@ -85,9 +92,13 @@ LBUF.DrawAtY lda BASEL,y setup line Base Ptr
LBUF.DrawAtY.SET
LBUF.DrawAtY.AND.SET
ldx LBUF.C1 x C1->C2
ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda (ZPBasePtr),y Clear screen at C1
and LBUF.C1.MASK with MASK bits
sta ZPTmpByte
@ -96,6 +107,7 @@ LBUF.DrawAtY.AND.SET
and LBUF.C1.DATA set ONLY bits starting at X1 mod 7
ora ZPTmpByte ora with screen bits
sta (ZPBasePtr),y update screen
inx
cpx LBUF.C2
beq .2 C1=C2, go setup C2
@ -104,7 +116,10 @@ LBUF.DrawAtY.AND.SET
.1 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda LBUF.DATA,x set all bytes between C1+1 & C2-1
sta (ZPBasePtr),y
@ -114,16 +129,19 @@ LBUF.DrawAtY.AND.SET
.2 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda (ZPBasePtr),y Get C2
and LBUF.C2.MASK clear ONLY bits ending at X2 mod 7
sta ZPTmpByte
lda LBUF.DATA,x get DATA bits
and LBUF.C2.DATA set ONLY bits ending at X2 mod 7
ora ZPTmpByte
sta (ZPBasePtr),y update screen
.8 rts
*--------------------------------------
LBUF.DrawAtY.XOR
@ -142,7 +160,10 @@ LBUF.DrawAtY.XXX
ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda (ZPBasePtr),y Get C1
and LBUF.C1.MASK clear ONLY bits starting at X1 mod 7
sta ZPTmpByte
@ -160,7 +181,10 @@ LBUF.DrawAtY.XXX
.1 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda LBUF.DATA,x set all bytes between C1+1 & C2-1
.20 ora (ZPBasePtr),y
sta (ZPBasePtr),y
@ -171,7 +195,10 @@ LBUF.DrawAtY.XXX
.2 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda (ZPBasePtr),y Get C2
and LBUF.C2.MASK clear ONLY bits ending at X2 mod 7
sta ZPTmpByte
@ -189,7 +216,10 @@ LBUF.DrawAtY.AND.ORA
ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda LBUF.MASK,x get MASK bits
ora LBUF.C1.MASK clear ONLY bits starting at X1 mod 7
and (ZPBasePtr),y Clear screen at C1
@ -207,7 +237,10 @@ LBUF.DrawAtY.AND.ORA
.1 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda (ZPBasePtr),y
and LBUF.MASK,x
ora LBUF.DATA,x set all bytes between C1+1 & C2-1
@ -219,7 +252,10 @@ LBUF.DrawAtY.AND.ORA
.2 ldy COL.BANK,x
sta $C000,y
ldy COL.OFS,x
txa
lsr
tay
lda LBUF.MASK,x get MASK bits
ora LBUF.C2.MASK
and (ZPBasePtr),y
@ -229,6 +265,7 @@ LBUF.DrawAtY.AND.ORA
and LBUF.C2.DATA set ONLY bits ending at X2 mod 7
ora ZPTmpByte
sta (ZPBasePtr),y update screen
.8 rts
*--------------------------------------
MAN

View File

@ -74,8 +74,9 @@ VLINE.MONO >LDYA CB.Cache+S.CB.X1
jsr DIVMOD7YA X = MOD 7
tay
lda COL.OFS,y
lsr
sta ZPTmpByte Save COL (DIV)
lda COL.BANK,y
tay
sta $C000,y Select proper BANK
@ -109,6 +110,7 @@ VLINE.MONO.WHITE
VLINE.MONO.XOR
lda #$5D EOR abs,x
sta .2
.1 lda BASEL,y
adc ZPTmpByte
sta ZPBasePtr

View File

@ -16,7 +16,7 @@ SETPIXEL.MONO >LDYA CB.Cache+S.CB.X1
jsr DIVMOD7YA
tay
lda COL.OFS,y
lsr
phy
ldy CB.Cache+S.CB.Y1
clc
@ -85,26 +85,16 @@ SETPIXEL.C16.YX lda DIV7.0,y PixelX MOD 7 (range 0->19)
lda Color.Masks,x bits in 1st byte to light?
beq .10
and Color.Pixels,y apply color
sta ZPTmpByte
sta SETPAGE2
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora ZPTmpByte
sta (ZPBasePtr)
jsr .81
.10 inx
iny
lda Color.Masks,x
beq .11
and Color.Pixels,y apply color
sta ZPTmpByte
sta CLRPAGE2
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora ZPTmpByte
sta (ZPBasePtr)
jsr .80
.11 inc ZPBasePtr
inx
@ -112,28 +102,25 @@ SETPIXEL.C16.YX lda DIV7.0,y PixelX MOD 7 (range 0->19)
lda Color.Masks,x
beq .12
and Color.Pixels,y apply color
sta ZPTmpByte
sta SETPAGE2
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora ZPTmpByte
sta (ZPBasePtr)
jsr .81
.12 inx
iny
lda Color.Masks,x
beq .13
beq .88
and Color.Pixels,y apply color
.80 sta CLRPAGE2
.81 and Color.Pixels,y apply color
sta ZPTmpByte
sta CLRPAGE2
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora ZPTmpByte
sta (ZPBasePtr)
.13 rts
.88 rts
*--------------------------------------
* GETPIXEL
*--------------------------------------

View File

@ -1,5 +1,5 @@
NEW
AUTO 4,1
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
@ -41,6 +41,7 @@ Dev.Detect >LDYA L.MSG.DETECT
stz ZPSlotPtr
lda #$C1
.1 sta ZPSlotPtr+1
ldx #DEVSIG.Value-DEVSIG.Offset-1
@ -115,7 +116,7 @@ FD.DEV .DA #S.FD.T.CDEV
.BS 2 DRVPTR
.DA 0 DCBPTR
.DA 0 BUFPTR
FD.DEV.NAME .AZ "MOUx"
FD.DEV.NAME .AZ "moux"
*--------------------------------------
* Driver Code
*--------------------------------------
@ -148,15 +149,20 @@ STATUS >STYA ZPIOCTL
ldy #S.IOCTL.STATCODE
lda (ZPIOCTL),y
beq .1
cmp #S.IOCTL.STATCODE.GETDIB
bne STATUS.DCB
ldy #S.DIB-1
.HS 2C bit abs
.1 ldy #3
.2 lda DIB,y
sta (ZPBufPtr),y
dey
bpl .2
clc
rts
@ -169,46 +175,47 @@ CONTROL >STYA ZPBufPtr NON STANDARD
php
sei
ldy #0
ldx #0 set X
jsr SETCLAMP
ldy #4
ldx #1 set Y
jsr SETCLAMP
ldy #HOMEMOUSE
jsr GOMOUSE
plp
clc
rts
ldy #HOMEMOUSE
bra EXIT
*--------------------------------------
OPEN php
sei
lda #S.DIB.S.OPENED
tsb DIB+S.DIB.S
ldx DEVSLOT0n
lda MOUSEMODx,x keep if VBLInt already activated by kernel
and #MOUSEMODx.INTVBL
ora #MOUSEMODx.ACTIVE Enable, Polling mode
ldy #SETMOUSE
jsr GOMOUSE
ldy #INITMOUSE Reset
jsr GOMOUSE
lda #S.DIB.S.OPENED
tsb DIB+S.DIB.S
plp
clc
rts
ldy #INITMOUSE Reset
bra EXIT
*--------------------------------------
CLOSE php
sei
lda #S.DIB.S.OPENED
trb DIB+S.DIB.S
ldx DEVSLOT0n
lda MOUSEMODx,x keep if VBLInt already activated by kernel
and #MOUSEMODx.INTVBL Disable ALL but VBLInt if previously active
ldy #SETMOUSE
jsr GOMOUSE
lda #S.DIB.S.OPENED
trb DIB+S.DIB.S
EXIT jsr GOMOUSE
plp
clc
rts
@ -220,14 +227,17 @@ READ >STYA ZPBufPtr NON STANDARD
php
sei
sta SET80STORE
* sta SET80STORE
sta CLRPAGE2
* ldy #READMOUSE DONE BY IRQ MANAGER
* jsr GOMOUSE
ldx DEVSLOT0n
lda MOUSESTSx,x
and #MOUSESTSx.MOVED
beq .1
ldy #S.MOUSE.X1
lda MOUSEXLOx,x
@ -249,12 +259,16 @@ READ >STYA ZPBufPtr NON STANDARD
.1 lda MOUSESTSx,x
and #MOUSESTSx.DOWN+MOUSESTSx.LDOWN
beq .8 no button state change:up & previously up
cmp #MOUSESTSx.DOWN+MOUSESTSx.LDOWN
beq .8 no button state change:down & previously down
asl if CS, down & previously up
bcc .2
lda #S.MOUSE.S.DOWN
tsb READ.S+1 button has been pressed, start drag...
lda MOUSEXLOx,x
sta SrcDrag
lda MOUSEXHIx,x
@ -264,29 +278,38 @@ READ >STYA ZPBufPtr NON STANDARD
lda MOUSEYHIx,x
sta SrcDrag+3
bra .8
.2 lda READ.S+1
pha save move state
ora #S.MOUSE.S.UP
sta READ.S+1
pla get back move state
bne .4 no move...click!
lda #S.MOUSE.S.CLK
bit bDblClick
bpl .3
lda #S.MOUSE.S.DCLK
ldy #1
sty bDblClick
.3 dec bDblClick
tsb READ.S+1
bra .8
.4 lda #S.MOUSE.S.DRAGSTART
tsb READ.S+1
ldy #S.MOUSE.X2+3
.5 lda SrcDrag-S.MOUSE.X2,y
sta (ZPBufPtr),y
dey
bpl .5
.8 plp
READ.S lda #$ff SELF MODIFIED
@ -305,6 +328,7 @@ READ.S lda #$ff SELF MODIFIED
*--------------------------------------
SETCLAMP lda (ZPBufPtr),y
sta LOCLAMPLO
iny
lda (ZPBufPtr),y
sta LOCLAMPHI
@ -316,6 +340,7 @@ SETCLAMP lda (ZPBufPtr),y
iny
lda (ZPBufPtr),y
sta HICLAMPHI
txa
ldy #CLAMPMOUSE
*--------------------------------------
@ -339,6 +364,11 @@ DIB .DA #0
.DA K.VER
*--------------------------------------
DRV.END
*--------------------------------------
.LIST ON
DRV.CS.SIZE .EQ DRV.CS.END-DRV.CS.START
DRV.SIZE .EQ DRV.END-DRV.CS.START
.LIST OFF
MAN
SAVE usr/src/drv/mouse.drv.s
ASM

View File

@ -262,10 +262,7 @@ DrawLine.IncX lda DX
bra .1
.8 rts
*--------------------------------------
DrawText >LDYA L.CB.Cache
ldx #0
>SYSCALL2 OSD
DrawText jsr GFXWrite.CB
bcs .9
jsr GFXWrite.CB
lda CB.Cache+S.CB.SrcPtr