A2osX/LIB/LIBGUI.S.MBAR.txt

126 lines
1.7 KiB
Plaintext
Raw Normal View History

2020-10-23 15:23:19 +00:00
NEW
AUTO 3,1
*--------------------------------------
2020-10-28 16:35:04 +00:00
* MBAR.New(*S.MBITEM mbitems)
*--------------------------------------
MBAR.New >LDYAI S.MBAR
>SYSCALL2 getmem
bcs .99
2020-10-29 07:22:39 +00:00
>STYA ZPObjPtr
2020-10-28 16:35:04 +00:00
lda #S.OBJ.T.MBAR
2020-10-29 07:22:39 +00:00
sta (ZPObjPtr) S.OBJ.T
2020-10-28 16:35:04 +00:00
lda #0
ldy #S.MBAR-1
2020-10-29 07:22:39 +00:00
.1 sta (ZPObjPtr),y
2020-10-28 16:35:04 +00:00
dey
bne .1
>PULLA
ldy #S.MBAR.MBITEMS
2020-10-29 07:22:39 +00:00
sta (ZPObjPtr),y
2020-10-28 16:35:04 +00:00
>PULLA
iny
2020-10-29 07:22:39 +00:00
sta (ZPObjPtr),y
2020-10-28 16:35:04 +00:00
clc
rts
*--------------------------------------
2020-10-23 15:23:19 +00:00
MBAR.Init >STYA ZPMENUPtr
>STYA ZPPtr1
ldy #S.MBITEM.S
lda (ZPPtr1),y
bmi .80
stz DX
stz DX+1
.1 lda (ZPPtr1)
beq .8
lda #S.MBITEM.TEXT
clc
adc ZPPtr1
tay
lda ZPPtr1+1
adc #0
2020-10-28 16:35:04 +00:00
ldx hSYSFON
2020-10-23 15:23:19 +00:00
jsr FON.GetTextSize
ldy #S.MBITEM.X1
lda DX
sta (ZPPtr1),y
iny
lda DX+1
sta (ZPPtr1),y
iny #S.MBITEM.XT
lda DX
clc
adc PREFS.MBARXMARGIN
sta DX
sta (ZPPtr1),y
iny
lda DX+1
adc #0
sta DX+1
sta (ZPPtr1),y
lda DX
clc
adc CB.CACHE+S.CB.SrcW
sta DX
lda DX+1
adc CB.CACHE+S.CB.SrcW+1
sta DX+1
iny #S.MBITEM.X2
lda DX
clc
adc PREFS.MBARXMARGIN
sta DX
sta (ZPPtr1),y
iny
lda DX+1
adc #0
sta DX+1
sta (ZPPtr1),y
lda (ZPPtr1)
clc
adc ZPPtr1
sta ZPPtr1
bcc .1
inc ZPPtr1+1
bra .1
.8 lda #$80
ldy #S.MBITEM.S
sta (ZPMENUPtr),y
.80 clc
rts
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s.mbar
LOAD usr/src/lib/libgui.s
ASM