Kernel 0.9.1 : LibGui, Fonts.....

This commit is contained in:
Rémy GIBERT 2017-12-19 16:45:39 +01:00
parent 1d652f3ecb
commit 1543eeb518
4 changed files with 114 additions and 64 deletions

Binary file not shown.

Binary file not shown.

View File

@ -37,13 +37,13 @@ Shift7BitsCol2 .DA #%00000000 Useless
.DA #%01111100
.DA #%01111110
*--------------------------------------
C1.MASK .DA #%10000000 Clear (AND) Col 1 bits
.DA #%10000001
.DA #%10000011
.DA #%10000111
.DA #%10001111
.DA #%10011111
.DA #%10111111
C1.MASK .DA #%00000000 Clear (AND) Col 1 bits
.DA #%00000001
.DA #%00000011
.DA #%00000111
.DA #%00001111
.DA #%00011111
.DA #%00111111
C1.DATA .DA #%11111111 set (ORA) COL 1 bits
.DA #%11111110
@ -53,13 +53,13 @@ C1.DATA .DA #%11111111 set (ORA) COL 1 bits
.DA #%11100000
.DA #%11000000
*--------------------------------------
C2.MASK .DA #%11111110 Clear (AND) Col 2 bits
.DA #%11111100
.DA #%11111000
.DA #%11110000
.DA #%11100000
.DA #%11000000
.DA #%10000000
C2.MASK .DA #%01111110 Clear (AND) Col 2 bits
.DA #%01111100
.DA #%01111000
.DA #%01110000
.DA #%01100000
.DA #%01000000
.DA #%00000000
C2.DATA .DA #%10000001 set (ORA) COL 2 bits
.DA #%10000011

View File

@ -17,7 +17,7 @@ AUTO 6
A1L .EQ $3C
A2L .EQ $3E
A4L .EQ $42
TXTPTR .EQ $B8
MoveAux .EQ $C311
XFer .EQ $C314
*--------------------------------------
@ -59,9 +59,11 @@ CS.END
.PH $0C00
*--------------------------------------
ZPCmdPtr .EQ ZPDRV
ZPDestBMPtr .EQ ZPDRV+2
ZPDstBMPtr .EQ ZPDRV+2
ZPFontPtr .EQ ZPDRV+4
ZPCharPtr .EQ ZPDRV+6
ZPSrcBMPtr .EQ ZPDRV+8
ZPTmpPtr .EQ ZPDRV+10
*--------------------------------------
* YA =Ptr to S.CB in MAIN
* X = DestBM hMem
@ -86,18 +88,17 @@ GUIOSD >STYA A1L Src Start Address (MAIN)
txa
beq .1
ldx #SYS.GetMemPtr.A Get AUX Stock Object
jsr $E000 with GetMem
jsr GO.GetMemPtr.A
>STYA ZPDestBMPtr
>STYA ZPDstBMPtr
ldx #0
.1 lda (ZPDestBMPtr)
sta DestBM.Cache,x
inc ZPDestBMPtr
.1 lda (ZPDstBMPtr)
sta DstBM.Cache,x
inc ZPDstBMPtr
bne .2
inc ZPDestBMPtr+1
inc ZPDstBMPtr+1
.2 inx
cpx #S.BM
bne .1
@ -115,18 +116,18 @@ J.Cmds .DA SETPIXEL
.DA GETRECTBUFSIZE
*--------------------------------------
SETPIXEL >LDYA CB.Cache+S.CB.Y1
ldx DestBM.Cache+S.BM.RowBytes
ldx DstBM.Cache+S.BM.RowBytes
jsr YAMultX
pha
tya
clc
adc ZPDestBMPtr
sta ZPDestBMPtr
adc ZPDstBMPtr
sta ZPDstBMPtr
pla
adc ZPDestBMPtr+1
sta ZPDestBMPtr+1
adc ZPDstBMPtr+1
sta ZPDstBMPtr+1
lda CB.Cache+S.CB.MODE
bit #S.CB.MODE.C16
@ -144,12 +145,12 @@ SETPIXEL.MONO lda CB.Cache+S.CB.X1
lsr CB.Cache+S.CB.X1
ror
clc
adc ZPDestBMPtr
sta ZPDestBMPtr
adc ZPDstBMPtr
sta ZPDstBMPtr
lda CB.Cache+S.CB.X1
adc ZPDestBMPtr+1
sta ZPDestBMPtr+1
adc ZPDstBMPtr+1
sta ZPDstBMPtr+1
lda CB.Cache+S.CB.OP
* cmp #S.CB.OP.XOR
@ -159,23 +160,23 @@ SETPIXEL.MONO lda CB.Cache+S.CB.X1
bne SETPIXEL.MONO.WHITE
SETPIXEL.MONO.BLACK
lda (ZPDestBMPtr)
lda (ZPDstBMPtr)
and Mono.NMasks,x
sta (ZPDestBMPtr)
sta (ZPDstBMPtr)
rts
SETPIXEL.MONO.WHITE
lda (ZPDestBMPtr)
lda (ZPDstBMPtr)
ora Mono.Masks,x
sta (ZPDestBMPtr)
sta (ZPDstBMPtr)
rts
SETPIXEL.MONO.XOR
lda (ZPDestBMPtr)
lda (ZPDstBMPtr)
eor Mono.Masks,x
sta (ZPDestBMPtr)
sta (ZPDstBMPtr)
rts
SETPIXEL.C16
@ -205,9 +206,9 @@ BITBLT >LDYA CB.CACHE+S.CB.SrcPtr
bne BITBLT.1
tya
GO.GetMemPtr.A
jsr GO.GetMemPtr.A
BITBLT.1 >STYA ZPSrcBMDataPtr
BITBLT.1 >STYA ZPSrcBMPtr
*--------------------------------------
* In:
* S.CB.SrcW
@ -221,9 +222,11 @@ GETRECTBUFSIZE
* S.CB.S.CB.FONT : hFont
* S.CB.SrcPtr : Ptr to Text
* S.CB.DstPtr : Buffer Size (in bytes)
* Out:
* A=hBM
*--------------------------------------
DRAWTEXT lda CB.Cache+S.CB.FONT
GO.GetMemPtr.A
DRAWTEXT lda CB.Cache+S.CB.hFONT
jsr GO.GetMemPtr.A
>STYA ZPFontPtr
ldy #S.FON-1
@ -244,14 +247,14 @@ DRAWTEXT lda CB.Cache+S.CB.FONT
>STYA TXTPTR
lda S.BM.F.BBP1
sta DestBM.Cache+S.BM.F
sta DstBM.Cache+S.BM.F
stz DestBM.Cache+S.BM.W
stz DestBM.Cache+S.BM.W+1
stz DstBM.Cache+S.BM.W
stz DstBM.Cache+S.BM.W+1
lda FON.Cache+S.FON.PixH
sta DestBM.Cache+S.BM.H
stz DestBM.Cache+S.BM.H+1
sta DstBM.Cache+S.BM.H
stz DstBM.Cache+S.BM.H+1
.3 jsr TXTPTR.GetNext
beq .4
@ -259,21 +262,57 @@ DRAWTEXT lda CB.Cache+S.CB.FONT
jsr FON.GetChar
lda (ZPCharPtr) Get Char PixelW
sec
adc DestBM.Cache+S.BM.W
sta DestBM.Cache+S.BM.W
adc DstBM.Cache+S.BM.W
sta DstBM.Cache+S.BM.W
bcc .3
inc DestBM.Cache+S.BM.W+1
inc DstBM.Cache+S.BM.W+1
bra .3
.4 jsr BM.Create
bcs .9
sta .8+1 save hBM, ZPDstBMPtr=BMData
>LDYA CB.Cache+S.CB.SrcPtr
>STYA TXTPTR
stz GWORD reset Col index in BM
stz GWORD+1 reset Bit index in Col
.5 jsr TXTPTR.GetNext
beq .8
jsr FON.GetChar
lda (ZPCharPtr) Char PixW
sta GBYTE
ldy #1 Char ByteW
lda (ZPCharPtr),y
sta GBYTE2
>LDYA ZPDstBMPtr
>STYA ZPTmpPtr
lda FON.Cache+S.FON.PixH
.6 pha
ldx GWORD+1 Get Bit Index for shifting
ldy #2
lda (ZPCharPtr),y
pla
dec
bne .6
bra .5
.8 lda #$ff SELF MODIFIED
clc
.9 rts
*--------------------------------------
FON.GetChar cmp FON.Cache+S.FON.Last
@ -299,8 +338,8 @@ FON.GetChar cmp FON.Cache+S.FON.Last
inc ZPCharPtr+1
.8 rts
*--------------------------------------
BM.Create lda DestBM.Cache+S.BM.W
ldx DestBM.Cache+S.BM.W+1
BM.Create lda DstBM.Cache+S.BM.W
ldx DstBM.Cache+S.BM.W+1
bit #7
beq .1
and #7
@ -309,18 +348,18 @@ BM.Create lda DestBM.Cache+S.BM.W
bcc .1
inx
.1 sta DestBM.Cache+S.BM.RowBytes
.1 sta DstBM.Cache+S.BM.RowBytes
txa
lsr
ror DestBM.Cache+S.BM.RowBytes
ror DstBM.Cache+S.BM.RowBytes
lsr
ror DestBM.Cache+S.BM.RowBytes
ror DstBM.Cache+S.BM.RowBytes
lsr
ror DestBM.Cache+S.BM.RowBytes
ror DstBM.Cache+S.BM.RowBytes
>LDYA DestBM.Cache+S.BM.H
ldx DestBM.Cache+S.BM.RowBytes
>LDYA DstBM.Cache+S.BM.H
ldx DstBM.Cache+S.BM.RowBytes
jsr YAMultX
@ -334,15 +373,25 @@ BM.Create lda DestBM.Cache+S.BM.W
jsr GO.GetMem.YA
bcs .9
>STYA ZPDestBMPtr
>STYA ZPDstBMPtr
ldy #S.BM-1
.2 lda DestBM.Cache,y
sta (ZPDestBMPtr),y
.2 lda DstBM.Cache,y
sta (ZPDstBMPtr),y
dey
bpl .2
lda ZPDstBMPtr
* clc
adc #S.BM
sta ZPDstBMPtr
bcc .8
inc ZPDstBMPtr+1
.8 txa hBM
clc
.9 rts
*--------------------------------------
@ -414,8 +463,9 @@ Mono.Masks .DA #%00000001
*--------------------------------------
CB.Cache .BS S.CB
FON.Cache .BS S.FON
DestBM.Cache .BS S.BM
DstBM.Cache .BS S.BM
GBYTE .BS 1
GBYTE2 .BS 1
GWORD .BS 2
*--------------------------------------
.EP
@ -428,5 +478,5 @@ DS.END
.ED
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SBIN/GUIOSD
SAVE /A2OSX.SRC/SBIN/GUI/GUIOSD
ASM