Kernel 0.9.1 : GUI.....

This commit is contained in:
Rémy GIBERT 2017-11-15 08:27:12 +01:00
parent 0cb5d401f7
commit f5da545c4a
7 changed files with 112 additions and 65 deletions

Binary file not shown.

Binary file not shown.

View File

@ -22,19 +22,18 @@ HLINE.MONO >LDYA CB.Cache+S.CB.X1
bit #S.CB.MODE.C16
bne HLINE.C16
lda CB.Cache+S.CB.COLOR
ldy CB.Cache+S.CB.COLOR
beq .1
lda #%01111111
ldy #%01111111
.1 ldy LBUF.C1
.1 ldx LBUF.C1
.2 pha
and LBUF.AND,y
sta LBUF.ORA,y
pla
iny
cpy LBUF.C2
.2 tya
and LBUF.AND,x
sta LBUF.ORA,x
inx
cpx LBUF.C2
bcs .2
ldy CB.Cache+S.CB.Y1
@ -54,7 +53,33 @@ HLINE.C16 lda CB.Cache+S.CB.X1
jsr LBUF.SetBounds2YA
lda CB.Cache+S.CB.COLOR
asl
asl
clc
adc L.Color.Pixels
sta ZPPalettePtr
lda L.Color.Pixels+1
adc #0
sta ZPPalettePtr+1
ldx LBUF.C1
.1 txa
and #3 Compute index in Palette (Mod 4)
tay
lda (ZPPalettePtr),y
and LBUF.AND,x
sta LBUF.ORA,x
inx
cpx LBUF.C2
bcs .1
ldy CB.Cache+S.CB.Y1
jmp LBUF.DrawAtY
rts
*--------------------------------------
* VLINE Y1,Y2 at X1
@ -73,13 +98,13 @@ VLINE.XOR jsr VLINE.DIVMOD7
ldx CB.Cache+S.CB.Y1
.1 lda BASEL,x
sta ZPBase
sta ZPBasePtr
lda BASEH,x
sta ZPBase+1
sta ZPBasePtr+1
lda (ZPBase),y XOR
lda (ZPBasePtr),y XOR
.2 eor #$ff
sta (ZPBase),y
sta (ZPBasePtr),y
inx
cpx CB.Cache+S.CB.Y2
@ -108,14 +133,14 @@ VLINE.MONO jsr VLINE.DIVMOD7
ldx CB.Cache+S.CB.Y1
.2 lda BASEL,x
sta ZPBase
sta ZPBasePtr
lda BASEH,x
sta ZPBase+1
sta ZPBasePtr+1
lda (ZPBase),y
lda (ZPBasePtr),y
.3 and #$ff
.4 ora #$ff
sta (ZPBase),y
sta (ZPBasePtr),y
inx
cpx CB.Cache+S.CB.Y2
@ -136,9 +161,9 @@ VLINE.C16 lda CB.Cache+S.CB.X1
ldx CB.Cache+S.CB.Y1
adc BASEL,x setup line Base Ptr (cc by asl)
sta ZPBase ZPBase now point to first of...
sta ZPBasePtr ZPBasePtr now point to first of...
lda BASEH,x
sta ZPBase+1 ...the 4 columns
sta ZPBasePtr+1 ...the 4 columns
lda MOD7.0,y get MOD
@ -159,10 +184,10 @@ VLINE.C16 lda CB.Cache+S.CB.X1
sta SETPAGE2
lda (ZPBase)
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora GBYTE
sta (ZPBase)
sta (ZPBasePtr)
.10 inx
iny
@ -174,12 +199,12 @@ VLINE.C16 lda CB.Cache+S.CB.X1
sta CLRPAGE2
lda (ZPBase)
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora GBYTE
sta (ZPBase)
sta (ZPBasePtr)
.11 inc ZPBase
.11 inc ZPBasePtr
inx
iny
@ -190,10 +215,10 @@ VLINE.C16 lda CB.Cache+S.CB.X1
sta SETPAGE2
lda (ZPBase)
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora GBYTE
sta (ZPBase)
sta (ZPBasePtr)
.12 inx
iny
@ -205,10 +230,10 @@ VLINE.C16 lda CB.Cache+S.CB.X1
sta CLRPAGE2
lda (ZPBase)
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora GBYTE
sta (ZPBase)
sta (ZPBasePtr)
.13 rts
*--------------------------------------

View File

@ -40,9 +40,9 @@ SETPIXEL.MONO ldx CB.Cache+S.CB.X1+1 Get X Hi byte....
ldy CB.Cache+S.CB.Y1
clc
adc BASEL,y setup line Base Ptr (A=Col)
sta ZPBase
sta ZPBasePtr
lda BASEH,y
sta ZPBase+1
sta ZPBasePtr+1
ply
lda COL.BANK,y
tay
@ -53,23 +53,23 @@ SETPIXEL.MONO ldx CB.Cache+S.CB.X1+1 Get X Hi byte....
lda CB.Cache+S.CB.OP
beq .5
lda (ZPBase) XOR
lda (ZPBasePtr) XOR
eor Mono.Masks,y y = mod 7
sta (ZPBase)
sta (ZPBasePtr)
rts
.5 lda (ZPBase)
.5 lda (ZPBasePtr)
ldx CB.Cache+S.CB.COLOR get color
bne .6
and Mono.NMasks,y includes And $7F for mono
sta (ZPBase)
sta (ZPBasePtr)
rts
.6 and #$7F switch back this byte to mono
ora Mono.Masks,y
sta (ZPBase)
sta (ZPBasePtr)
rts
SETPIXEL.C16 lda CB.Cache+S.CB.X1
@ -84,9 +84,9 @@ SETPIXEL.C16 lda CB.Cache+S.CB.X1
ldx CB.Cache+S.CB.Y1
adc BASEL,x setup line Base Ptr (cc by asl)
sta ZPBase ZPBase now point to first of...
sta ZPBasePtr ZPBasePtr now point to first of...
lda BASEH,x
sta ZPBase+1 ...the 4 columns
sta ZPBasePtr+1 ...the 4 columns
lda MOD7.0,y get MOD
@ -107,10 +107,10 @@ SETPIXEL.C16 lda CB.Cache+S.CB.X1
sta SETPAGE2
lda (ZPBase)
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora GBYTE
sta (ZPBase)
sta (ZPBasePtr)
.10 inx
iny
@ -122,12 +122,12 @@ SETPIXEL.C16 lda CB.Cache+S.CB.X1
sta CLRPAGE2
lda (ZPBase)
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora GBYTE
sta (ZPBase)
sta (ZPBasePtr)
.11 inc ZPBase
.11 inc ZPBasePtr
inx
iny
@ -138,10 +138,10 @@ SETPIXEL.C16 lda CB.Cache+S.CB.X1
sta SETPAGE2
lda (ZPBase)
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora GBYTE
sta (ZPBase)
sta (ZPBasePtr)
.12 inx
iny
@ -153,10 +153,10 @@ SETPIXEL.C16 lda CB.Cache+S.CB.X1
sta CLRPAGE2
lda (ZPBase)
lda (ZPBasePtr)
and Color.NMasks,x reset existing pixel,
ora GBYTE
sta (ZPBase)
sta (ZPBasePtr)
.13 rts
*--------------------------------------

View File

@ -13,15 +13,19 @@ AUTO 6
* 8 : SrcX2
* 10 : SrcY2
*--------------------------------------
FILLRECT
.2 jsr HLINE
FILLRECT jsr HLINE
lda CB.Cache+S.CB.Y1
cmp CB.Cache+S.CB.Y2
beq .8
inc CB.Cache+S.CB.Y1
bra .2
ldy CB.Cache+S.CB.Y1
cpy CB.Cache+S.CB.Y2
bcc .8
.2 jsr LBUF.DrawAtY
inc CB.Cache+S.CB.Y1
ldy CB.Cache+S.CB.Y1
cpy CB.Cache+S.CB.Y2
bcs .2
.8 rts
*--------------------------------------
MAN

View File

@ -14,10 +14,8 @@ AUTO 6
.INB /A2OSX.BUILD/INC/LIBGUI.I
*--------------------------------------
ZPCmdPtr .EQ ZPDRV
ZPBase .EQ ZPDRV+2
ZPCount .EQ ZPDRV+4
ZPBasePtr .EQ ZPDRV+2
ZPPalettePtr .EQ ZPDRV+4
*--------------------------------------
@ -84,6 +82,7 @@ L.DIV7.0 .DA DIV7.0
L.MOD7.0 .DA MOD7.0
.DA MOD7.256
.DA MOD7.512
L.Color.Pixels .DA Color.Pixels
.DA 0 end or relocation
*--------------------------------------
STATUS >LDYA L.DSTAT
@ -149,7 +148,7 @@ WRITE >STYA ZPCmdPtr
.1 tax
ldy CB.CmdLen,x
.2 lda (ZPBase),y
.2 lda (ZPBasePtr),y
sta CB.Cache,y
dey
bpl .2
@ -212,26 +211,45 @@ LBUF.SetBounds2YA
sta LBUF.AND,y
.8 rts
*--------------------------------------
LBUF.SetOPA
*--------------------------------------
LBUF.DrawAtY lda BASEL,y setup line Base Ptr
sta ZPBase
sta ZPBasePtr
lda BASEH,y
sta ZPBase+1
sta ZPBasePtr+1
ldy LBUF.C1 y C1->C2
.1 ldx COL.BANK,y
sta $C000,x
lda (ZPBase),y
lda (ZPBasePtr),y
and LBUF.AND,y
ora LBUF.ORA,y
sta (ZPBase),y
sta (ZPBasePtr),y
iny
cpy LBUF.C2
bcs .1
rts
*--------------------------------------
LBUF.DrawAtY.XOR
.1 ldx COL.BANK,y
sta $C000,x
lda (ZPBasePtr),y
and LBUF.AND,y
eor LBUF.ORA,y
sta (ZPBasePtr),y
iny
cpy LBUF.C2
bcs .1
rts
*--------------------------------------
* IN:
* Y = LO

View File

@ -337,15 +337,15 @@ CSH.UNSIGNED jsr CSH.GetChar
*--------------------------------------
CSH.CHAR lda #CSH.T.CHAR
bra CSH.TYPE
CSH.UCHAR lda #CSH.T.CHAR
CSH.UCHAR lda #CSH.T.UCHAR
bra CSH.TYPE
CSH.INT lda #CSH.T.INT
bra CSH.TYPE
CSH.UINT lda #CSH.T.INT
CSH.UINT lda #CSH.T.UINT
bra CSH.TYPE
CSH.LONG lda #CSH.T.LONG
bra CSH.TYPE
CSH.ULONG lda #CSH.T.LONG
CSH.ULONG lda #CSH.T.ULONG
bra CSH.TYPE
CSH.FLOAT lda #CSH.T.FLOAT