mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-22 16:31:07 +00:00
159 lines
2.2 KiB
Plaintext
159 lines
2.2 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
MENU.MBarInit >STYA ZPMENUPtr
|
||
>STYA ZPPtr1
|
||
|
||
ldy #S.MBAR.S
|
||
lda (ZPPtr1),y
|
||
bmi .80
|
||
|
||
stz DX
|
||
stz DX+1
|
||
|
||
.1 lda (ZPPtr1)
|
||
beq .8
|
||
|
||
lda #S.MBAR.TEXT
|
||
clc
|
||
adc ZPPtr1
|
||
tay
|
||
lda ZPPtr1+1
|
||
adc #0
|
||
|
||
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.SrcW
|
||
sta DX
|
||
|
||
lda DX+1
|
||
adc CB.CACHE+S.CB.SrcW+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)
|
||
clc
|
||
adc ZPPtr1
|
||
sta ZPPtr1
|
||
bcc .1
|
||
inc ZPPtr1+1
|
||
bra .1
|
||
|
||
.8 lda #$80
|
||
|
||
ldy #S.MBAR.S
|
||
sta (ZPPtr1),y
|
||
|
||
.80 clc
|
||
rts
|
||
*--------------------------------------
|
||
* MENU.New(int X, int Y, *MITEM mitems)
|
||
*--------------------------------------
|
||
MENU.New >LDYAI S.MENU
|
||
>SYSCALL2 getmem
|
||
bcs .9
|
||
|
||
>STYA ZPMENUPtr
|
||
* stx
|
||
|
||
lda #S.OBJ.T.MENU
|
||
sta (ZPMENUPtr) S.OBJ.T
|
||
|
||
lda #0
|
||
|
||
ldy #S.MENU-1
|
||
|
||
.1 sta (ZPMENUPtr),y
|
||
dey
|
||
bne .1
|
||
|
||
>PULLA
|
||
ldy #S.OBJ.S.MENU.DEFS
|
||
sta (ZPMENUPtr),y
|
||
sta ZPPtr1
|
||
>PULLA
|
||
iny
|
||
sta (ZPMENUPtr),y
|
||
sta ZPPtr1+1
|
||
|
||
>PULLA
|
||
ldy #S.OBJ.Y1
|
||
sta (ZPMENUPtr),y
|
||
>PULLA
|
||
iny
|
||
sta (ZPMENUPtr),y
|
||
|
||
>PULLA
|
||
ldy #S.OBJ.X1
|
||
and PREFS.BESTVIEWEDX
|
||
sta (ZPMENUPtr),y
|
||
>PULLA
|
||
iny
|
||
sta (ZPMENUPtr),y
|
||
|
||
lda #2 1px Border
|
||
sta DX
|
||
sta DY
|
||
stz DX+1
|
||
stz DY+1
|
||
|
||
.2 lda (ZPPtr1)
|
||
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
.9 >POP 6
|
||
|
||
rts
|
||
*--------------------------------------
|
||
MENU.Paint
|
||
MENU.Close
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/lib/libgui.s.menu
|
||
LOAD usr/src/lib/libgui.s
|
||
ASM
|