A2osX/LIB/LIBGUI.S.FON.txt

186 lines
2.8 KiB
Plaintext
Raw Normal View History

2018-05-16 06:02:57 +00:00
NEW
2019-07-30 08:57:25 +00:00
AUTO 3,1
2018-05-16 06:02:57 +00:00
*--------------------------------------
2020-09-02 15:47:23 +00:00
FON.Init >LDYA L.SYSX7
jsr .1
2018-05-16 06:02:57 +00:00
bcs .9
2020-09-11 20:54:15 +00:00
stx hSYSFON
2019-01-08 16:29:26 +00:00
>LDYA L.SYSX7B
jsr .1
2018-05-16 06:02:57 +00:00
bcs .9
2020-09-11 20:54:15 +00:00
stx hSYSFONB
* ldy #S.FON.PixH
* >SYSCALL2 GetStkObjProp
2020-09-11 20:54:15 +00:00
lda #7
sta SYSFON.H
2020-09-13 19:05:38 +00:00
inc
2022-10-25 06:05:54 +00:00
sta SYSFON.Hp1
2020-09-13 19:05:38 +00:00
inc
2020-09-15 14:48:35 +00:00
sta SYSFON.Hp2
2019-01-08 16:29:26 +00:00
2018-05-16 06:02:57 +00:00
.9 rts
.1 >PUSHYA
>PUSHBI O.RDONLY
>PUSHBI S.FI.T.FON
>PUSHWZ Aux type
>SYSCALL LoadStkObj
rts
2018-05-16 06:02:57 +00:00
*--------------------------------------
FON.GetTextSize >STYA CB.Cache+S.CB.TxtPtr
stx CB.Cache+S.CB.hFont
2020-09-29 15:37:26 +00:00
lda #S.CB.CMD.GETTEXTSIZE+S.CB.CMD.OSD
sta CB.Cache+S.CB.CMD
ldx #0 Select CB.Cache
jmp CB.GFXWriteX
*--------------------------------------
FON.GetTextSize2
>STYA ZPPtr1
stx CB.Cache+S.CB.hFont
lda #S.CB.CMD.GETTEXTSIZE+S.CB.CMD.OSD
sta CB.Cache+S.CB.CMD
jsr FON.GetBuf
bcs .9
stz DX
stz DX+1
stz DY
stz DY+1
.1 jsr FON.GetLine
beq .8
ldx #0 Select CB.Cache
jsr CB.GFXWriteX
ldx CB.Cache+S.CB.SrcW
cpx DX
lda CB.Cache+S.CB.SrcW+1
tay
sbc DX+1
bcc .2
stx DX
sty DX+1
.2 lda CB.Cache+S.CB.SrcH
clc
adc DY
sta DY
lda CB.Cache+S.CB.SrcH+1
adc DY+1
sta DY+1
lda (ZPPtr1)
bne .1
.8 >LDYA ZPPtr2
>SYSCALL2 Free
.9 rts
*--------------------------------------
FON.DrawText2 >STYA ZPPtr1
stx CB.Cache+S.CB.hFont
lda #S.CB.OP.XOR
sta CB.Cache+S.CB.OP
lda #S.CB.M.MONO
sta CB.Cache+S.CB.M
jsr CB.ResetSrcXY
jsr FON.GetBuf
bcs .9
jsr PTR.Disable
* >DEBUG
.1 jsr FON.GetLine
beq .8
lda #S.CB.CMD.DRAWTEXT+S.CB.CMD.OSD
sta CB.Cache+S.CB.CMD
ldx #0
jsr CB.GFXWriteX
bcs .9
* ldx #0
* jsr CB.GFXWriteX Clip
jsr CB.GFXWriteClip
lda CB.Cache+S.CB.SrcPtr
>SYSCALL2 FreeStkObj
lda CB.Cache+S.CB.SrcH
clc
adc CB.Cache+S.CB.Y1
sta CB.Cache+S.CB.Y1
bcc .1
inc CB.Cache+S.CB.Y1+1
bra .1
.8 >LDYA ZPPtr2
>SYSCALL2 Free
jmp PTR.Enable
.9 rts
*--------------------------------------
FON.GetBuf >LDYAI 256
>SYSCALL2 GetMem
bcs .9
>STYA ZPPtr2
>STYA CB.Cache+S.CB.TxtPtr
.9 rts
*--------------------------------------
FON.GetLine ldy #0
.1 lda (ZPPtr1)
beq .8
.2 cmp #C.SPACE
bcs .3
eor #C.CR
beq .7
bne .4
.3 sta (ZPPtr2),y
iny
.4 inc ZPPtr1
bne .1
inc ZPPtr1+1
bra .1
.7 inc ZPPtr1
bne .8
inc ZPPtr1+1
.8 sta (ZPPtr2),y
tya set Z flag
rts
2020-09-29 15:37:26 +00:00
*--------------------------------------
2018-05-16 06:02:57 +00:00
MAN
2020-06-30 15:32:23 +00:00
SAVE usr/src/lib/libgui.s.fon
LOAD usr/src/lib/libgui.s
2018-05-16 06:02:57 +00:00
ASM