A2osX/LIB/LIBTUI.S.txt

142 lines
2.7 KiB
Plaintext
Raw Normal View History

2021-04-15 20:52:08 +00:00
NEW
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF lib/libtui
*--------------------------------------
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/kernel.i
.INB inc/libtui.i
*--------------------------------------
.DUMMY
.OR ZPLIB
2021-04-29 11:56:34 +00:00
hCtx .BS 1
.BS 1
ZPCtxPtr .BS 2
2021-04-15 20:52:08 +00:00
ZPObjPtr .BS 2
ZPPtr1 .BS 2
.ED
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA 0
.DA CS.END-CS.START
.DA 0
.DA 0
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA LIB.LOAD
.DA LIB.UNLOAD
.DA LIBTUI.Init
.DA LIBTUI.Close
2021-04-29 11:56:34 +00:00
*--------------------------------------
L.SEQ.INIT .DA SEQ.INIT
2021-04-15 20:52:08 +00:00
.DA 0
*--------------------------------------
LIB.LOAD clc
rts
*--------------------------------------
LIB.UNLOAD clc
rts
*--------------------------------------
2021-04-29 11:56:34 +00:00
LIBTUI.Init >LDYAI 256
>SYSCALL GetMem
bcs .9
txa
* clc
.9 rts
2021-04-15 20:52:08 +00:00
*--------------------------------------
LIBTUI.Close clc
rts
*--------------------------------------
2021-04-29 11:56:34 +00:00
LIBTUI.LBOXNew >PULLB hCtx
>SYSCALL GetMemPtr
>STYA ZPCtxPtr
>PULLW ZPPtr1
2021-04-15 20:52:08 +00:00
>LDYAI S.LBOX
>SYSCALL GetMem
bcs .9
>STYA ZPObjPtr
lda #S.OBJ.T.LBOX
sta (ZPObjPtr)
2021-04-29 11:56:34 +00:00
ldy #S.OBJ.P
lda hCtx
sta (ZPObjPtr),y
iny #S.OBJ.F
2021-04-15 20:52:08 +00:00
.1 lda (ZPPtr1),y
sta (ZPObjPtr),y
cpy #S.OBJ.H+1
bne .1
.8 txa
clc
.9 rts
*--------------------------------------
2021-04-29 11:56:34 +00:00
LIBTUI.LBOXLoad >SYSCALL GetMemPtr
>STYA ZPObjPtr
rts
2021-04-15 20:52:08 +00:00
*--------------------------------------
LIBTUI.LBOXFocus
*--------------------------------------
LIBTUI.LBOXRun
*--------------------------------------
LIBTUI.LBOXClose
clc
rts
*--------------------------------------
LIBGUI.SetupX2Y2
ldy #S.OBJ.X1
jsr .1
ldy #S.OBJ.Y1
.1 clc
lda (ZPObjPtr),y
iny
iny S.OBJ.W/H
adc (ZPObjPtr),y
iny
iny S.OBJ.X2/Y2
sta (ZPObjPtr),y
rts
*--------------------------------------
LIBTUI.DrawFrame
*--------------------------------------
CS.END
*--------------------------------------
2021-04-29 11:56:34 +00:00
SEQ.INIT .AS "\ec\e(B\e)0"
SEQ.SCROLLRGN .AZ "\e[?7l\e[2;%dr"
SEQ.SCROLLCURUP .AS "\e[?7l\e[%d;%dr"
SEQ.SCROLLUP .AZ "\eD"
SEQ.SCROLLCURDN .AS "\e[?7l\e[%d;%dr"
SEQ.SCROLLDN .AZ "\eM"
SEQ.CLOSE .AZ "\ec"
2021-04-15 20:52:08 +00:00
*--------------------------------------
MAN
SAVE usr/src/lib/libtui.s
ASM