mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-24 05:35:33 +00:00
Kernel 0.9.1 : LibGui, Off Screen Driver
This commit is contained in:
parent
47c6d59784
commit
cdc1660aee
@ -15,13 +15,12 @@ AUTO 6
|
||||
* S.CB.DstY : Destination Y (screen)
|
||||
|
||||
* S.CB.SrcPtr : pointer to S.BM
|
||||
* S.CB.SrcPtr+1 = 0, hMem in S.CB.SrcPtr
|
||||
* S.CB.DstPtr : pointer to Save Buffer
|
||||
*--------------------------------------
|
||||
BITBLT >LDYA CB.CACHE+S.CB.SrcPtr
|
||||
bne BITBLT.1
|
||||
|
||||
* CB.CACHE+S.CB.SrcPtr+1 = 0, AUX Handle in CB.CACHE+S.CB.SrcPtr
|
||||
|
||||
tya
|
||||
>SYSCALL GetStkObj.A
|
||||
|
||||
|
@ -46,15 +46,11 @@ S.CB.OP.MASK .EQ %00001000 Apply BitMap mask before painting
|
||||
S.CB.OP.SAVE .EQ %00010000 Save Screen to DstPtr before painting
|
||||
S.CB.OP.RESTORE .EQ %00100000 Restore Screen From DstPtr
|
||||
S.CB.OP.COLOR .EQ %01000000 Assume BitMap is COLOR
|
||||
S.CB.OP.F.LEFT .EQ 0
|
||||
S.CB.OP.F.RIGHT .EQ 2
|
||||
S.CB.OP.F.CENTERED .EQ 4
|
||||
S.CB.OP.F.JUSTIFIED .EQ 6
|
||||
|
||||
S.CB.OP.F.BOLD .EQ %00010000
|
||||
S.CB.OP.F.ITALIC .EQ %00100000
|
||||
S.CB.OP.F.UNDERLINE .EQ %01000000
|
||||
S.CB.OP.F.GRAYED .EQ %10000000
|
||||
|
||||
S.CB.MODE .EQ 2
|
||||
S.CB.MODE.MONO .EQ %00000001 b/w (1 bit/pixel)
|
||||
*S.CB.MODE.C4 .EQ %00000010
|
||||
@ -67,14 +63,14 @@ S.CB.X1 .EQ 4 xPIXEL,xLINE,FILLRECT,BITBLT,GETRECTBUFSIZE,DRAWLINE
|
||||
S.CB.Y1 .EQ 6 xPIXEL,xLINE,FILLRECT,BITBLT,GETRECTBUFSIZE,DRAWLINE
|
||||
S.CB.X2 .EQ 8 VLINE,FILLRECT,DRAWLINE
|
||||
S.CB.Y2 .EQ 10 HLINE,FILLRECT,DRAWLINE
|
||||
S.CB.SrcW .EQ 8 BITBLT,GETRECTBUFSIZE
|
||||
S.CB.SrcH .EQ 10 BITBLT,GETRECTBUFSIZE
|
||||
S.CB.DstX .EQ 12 BITBLT,DRAWTEXT
|
||||
S.CB.DstY .EQ 14 BITBLT,DRAWTEXT
|
||||
S.CB.SrcPtr .EQ 16 BITBLT,DRAWTEXT
|
||||
S.CB.DstPtr .EQ 18 BITBLT
|
||||
S.CB.SrcW .EQ 12 BITBLT,GETRECTBUFSIZE
|
||||
S.CB.SrcH .EQ 14 BITBLT,GETRECTBUFSIZE
|
||||
S.CB.DstX .EQ 16 BITBLT,DRAWTEXT
|
||||
S.CB.DstY .EQ 18 BITBLT,DRAWTEXT
|
||||
S.CB.SrcPtr .EQ 20 BITBLT,DRAWTEXT
|
||||
S.CB.DstPtr .EQ 22 BITBLT
|
||||
*
|
||||
S.CB .EQ 20
|
||||
S.CB .EQ 24
|
||||
*--------------------------------------
|
||||
CUR.T.ARROW .EQ 0
|
||||
CUR.T.RESIZEX .EQ 2
|
||||
|
@ -14,6 +14,7 @@ Draw >PULLW ZPCBPtr Get CB
|
||||
|
||||
ldx CB.Cache+S.CB.CMD Get Cmd
|
||||
beq .8
|
||||
|
||||
jsr CLIP.X
|
||||
bcs .7
|
||||
|
||||
|
@ -6,7 +6,7 @@ AUTO 6
|
||||
.LIST OFF
|
||||
.OP 65C02
|
||||
.OR $2000
|
||||
.TF /A2OSX.BUILD/SBIN/GUIOSD
|
||||
.TF /A2OSX.BUILD/SBIN/GUI/GUIOSD
|
||||
*--------------------------------------
|
||||
.INB /A2OSX.BUILD/INC/MACROS.I
|
||||
.INB /A2OSX.BUILD/INC/A2OSX.I
|
||||
@ -63,7 +63,7 @@ ZPDestBMPtr .EQ ZPDRV+2
|
||||
ZPFontPtr .EQ ZPDRV+4
|
||||
ZPCharPtr .EQ ZPDRV+6
|
||||
*--------------------------------------
|
||||
* YA =Ptr to S.CB in MAIN****
|
||||
* YA =Ptr to S.CB in MAIN
|
||||
* X = DestBM hMem
|
||||
*--------------------------------------
|
||||
GUIOSD >STYA A1L Src Start Address (MAIN)
|
||||
@ -84,6 +84,8 @@ GUIOSD >STYA A1L Src Start Address (MAIN)
|
||||
jsr MoveAux
|
||||
|
||||
txa
|
||||
beq .1
|
||||
|
||||
ldx #SYS.GetMemPtr.A Get AUX Stock Object
|
||||
jsr $E000 with GetMem
|
||||
|
||||
@ -186,7 +188,26 @@ VLINE
|
||||
*--------------------------------------
|
||||
FILLRECT
|
||||
*--------------------------------------
|
||||
BITBLT
|
||||
* BitBlt
|
||||
* S.CB.X1 : SrcX1 in bitmap/mask
|
||||
* S.CB.Y1 : SrcY1
|
||||
* S.CB.SrcW : width
|
||||
* S.CB.SrcH : height
|
||||
|
||||
* S.CB.DstX : Destination X (screen)
|
||||
* S.CB.DstY : Destination Y (screen)
|
||||
|
||||
* S.CB.SrcPtr : pointer to S.BM
|
||||
* S.CB.SrcPtr+1 = 0, hMem in S.CB.SrcPtr
|
||||
* S.CB.DstPtr : pointer to Save Buffer
|
||||
*--------------------------------------
|
||||
BITBLT >LDYA CB.CACHE+S.CB.SrcPtr
|
||||
bne BITBLT.1
|
||||
|
||||
tya
|
||||
GO.GetMemPtr.A
|
||||
|
||||
BITBLT.1 >STYA ZPSrcBMDataPtr
|
||||
*--------------------------------------
|
||||
* In:
|
||||
* S.CB.SrcW
|
||||
@ -201,17 +222,140 @@ GETRECTBUFSIZE
|
||||
* S.CB.SrcPtr : Ptr to Text
|
||||
* S.CB.DstPtr : Buffer Size (in bytes)
|
||||
*--------------------------------------
|
||||
GETTEXTSIZE lda CB.Cache+S.CB.FONT
|
||||
ldx #SYS.GetMemPtr.A
|
||||
jsr GO.Kernel
|
||||
DRAWTEXT lda CB.Cache+S.CB.FONT
|
||||
GO.GetMemPtr.A
|
||||
>STYA ZPFontPtr
|
||||
|
||||
ldy #S.FON-1
|
||||
|
||||
.1 lda (ZPFontPtr),y
|
||||
sta FON.Cache,y
|
||||
dey
|
||||
bpl .1
|
||||
|
||||
lda ZPFontPtr
|
||||
clc
|
||||
adc #S.FON
|
||||
sta ZPFontPtr
|
||||
bcc .2
|
||||
inc ZPFontPtr+1
|
||||
|
||||
.2 >LDYA CB.Cache+S.CB.SrcPtr
|
||||
>STYA TXTPTR
|
||||
|
||||
lda S.BM.F.BBP1
|
||||
sta DestBM.Cache+S.BM.F
|
||||
|
||||
stz DestBM.Cache+S.BM.W
|
||||
stz DestBM.Cache+S.BM.W+1
|
||||
|
||||
lda FON.Cache+S.FON.PixH
|
||||
sta DestBM.Cache+S.BM.H
|
||||
stz DestBM.Cache+S.BM.H+1
|
||||
|
||||
.3 jsr TXTPTR.GetNext
|
||||
beq .4
|
||||
|
||||
jsr FON.GetChar
|
||||
lda (ZPCharPtr) Get Char PixelW
|
||||
sec
|
||||
adc DestBM.Cache+S.BM.W
|
||||
sta DestBM.Cache+S.BM.W
|
||||
bcc .3
|
||||
|
||||
inc DestBM.Cache+S.BM.W+1
|
||||
bra .3
|
||||
|
||||
.4 jsr BM.Create
|
||||
bcs .9
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
* In:
|
||||
* S.CB.S.CB.FONT : hFont
|
||||
* S.CB.SrcPtr : Ptr to Text
|
||||
* S.CB.DstPtr : Buffer Size (in bytes)
|
||||
FON.GetChar cmp FON.Cache+S.FON.Last
|
||||
bcc .1
|
||||
bne .2
|
||||
|
||||
.1 sec
|
||||
sbc FON.Cache+S.FON.First
|
||||
bcs .3
|
||||
|
||||
.2 lda FON.Cache+S.FON.Default
|
||||
|
||||
.3 asl
|
||||
php
|
||||
clc
|
||||
adc ZPFontPtr
|
||||
sta ZPCharPtr
|
||||
|
||||
adc ZPFontPtr+1
|
||||
sta ZPCharPtr+1
|
||||
plp
|
||||
bcc .8
|
||||
inc ZPCharPtr+1
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
DRAWTEXT
|
||||
BM.Create lda DestBM.Cache+S.BM.W
|
||||
ldx DestBM.Cache+S.BM.W+1
|
||||
bit #7
|
||||
beq .1
|
||||
and #7
|
||||
clc
|
||||
adc #8
|
||||
bcc .1
|
||||
inx
|
||||
|
||||
.1 sta DestBM.Cache+S.BM.RowBytes
|
||||
txa
|
||||
|
||||
lsr
|
||||
ror DestBM.Cache+S.BM.RowBytes
|
||||
lsr
|
||||
ror DestBM.Cache+S.BM.RowBytes
|
||||
lsr
|
||||
ror DestBM.Cache+S.BM.RowBytes
|
||||
|
||||
>LDYA DestBM.Cache+S.BM.H
|
||||
ldx DestBM.Cache+S.BM.RowBytes
|
||||
|
||||
jsr YAMultX
|
||||
|
||||
pha
|
||||
tya
|
||||
clc
|
||||
adc #S.BM
|
||||
tay
|
||||
pla
|
||||
adc /S.BM
|
||||
jsr GO.GetMem.YA
|
||||
bcs .9
|
||||
|
||||
>STYA ZPDestBMPtr
|
||||
|
||||
ldy #S.BM-1
|
||||
|
||||
.2 lda DestBM.Cache,y
|
||||
sta (ZPDestBMPtr),y
|
||||
dey
|
||||
bpl .2
|
||||
|
||||
clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
* to move in LC or ZP/STK
|
||||
*--------------------------------------
|
||||
TXTPTR.GetNext sta CLRREADAUX
|
||||
lda (TXTPTR)
|
||||
sta SETREADAUX
|
||||
beq .9
|
||||
inc TXTPTR
|
||||
bne .9
|
||||
inc TXTPTR+1
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
* IN:
|
||||
* Y,A = num1 (16)
|
||||
@ -245,6 +389,9 @@ YAMultX stx GBYTE
|
||||
bne .2
|
||||
rts
|
||||
*--------------------------------------
|
||||
GO.GetMem.YA ldx #SYS.GetMem.YA
|
||||
.HS 2C BIT ABS
|
||||
GO.GetMemPtr.A ldx #SYS.GetMemPtr.A
|
||||
GO.Kernel jmp ($E000,x)
|
||||
*--------------------------------------
|
||||
Mono.NMasks .DA #%11111110
|
||||
@ -266,11 +413,13 @@ Mono.Masks .DA #%00000001
|
||||
.DA #%10000000
|
||||
*--------------------------------------
|
||||
CB.Cache .BS S.CB
|
||||
FON.Cache .BS S.FON
|
||||
DestBM.Cache .BS S.BM
|
||||
GBYTE .BS 1
|
||||
GWORD .BS 2
|
||||
*--------------------------------------
|
||||
.EP
|
||||
GUIOSD.END .EQ *
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user