NEW AUTO 3,1 *-------------------------------------- * Y,A = ptr to menu definition *-------------------------------------- MENU.New >STYA ZPPtr1 lda #2 1px Border sta DX sta DY stz DX+1 stz DY+1 clc rts *-------------------------------------- MENU.Paint MENU.Close *-------------------------------------- MENU.MBarInit >STYA ZPPtr1 stz DX stz DX+1 .1 lda (ZPPtr1) beq .8 ldy #S.MBAR.TEXT lda (ZPPtr1),y pha iny lda (ZPPtr1),y ply ldx hSYSFONB jsr FON.GetTextSize ldy #S.MBAR.X1 lda DX sta (ZPPtr1),y iny lda DX+1 sta (ZPPtr1),y iny #S.MBAR.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.SrcX sta DX lda DX+1 adc CB.CACHE+S.CB.SrcX+1 sta DX+1 iny #S.MBAR.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) sec adc ZPPtr1 sta ZPPtr1 bcc .1 inc ZPPtr1+1 bra .1 .8 lda #$80 ldy #S.MBAR.S sta (ZPMENUPtr),y clc rts *-------------------------------------- MBAR.New MBAR.Paint MBAR.Close *-------------------------------------- MITEM.New MITEM.Paint MITEM.Close clc rts *-------------------------------------- MAN SAVE usr/src/lib/libgui.s.menu LOAD usr/src/lib/libgui.s ASM