A2osX/ROOT/asmtest/TESTGUI.S.txt

355 lines
6.8 KiB
Plaintext
Raw Normal View History

2020-10-27 07:09:20 +00:00
NEW
AUTO 3,1
.LIST OFF
2020-10-27 07:09:20 +00:00
.OP 65C02
.OR $2000
2022-10-25 06:05:54 +00:00
.TF root/asmtest/testgui
2020-10-27 07:09:20 +00:00
*--------------------------------------
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.i
2022-11-02 06:54:30 +00:00
.INB inc/gfx.i
.INB inc/libgui.i
2020-10-27 07:09:20 +00:00
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
hLogo .BS 2 00xx
hWND .BS 1
hMBAR .BS 1
2022-11-02 06:54:30 +00:00
TmpWord .BS 2
2020-10-27 07:09:20 +00:00
ZS.END .ED
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA #S.PS.F.EVENT S.PS.F
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data Segment Size
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.LIBGUI .DA LIBGUI
L.LOGOFILE .DA LOGOFILE
L.WND.TITLE .DA WND.TITLE
L.WND.MBAR .DA WND.MBAR
L.WND.STATUS .DA WND.STATUS
L.WND.Test.fPaint .DA WND.Test.fPaint
2022-10-27 06:20:09 +00:00
L.MENU.FILE .DA MENU.FILE
L.MENU.EDIT .DA MENU.EDIT
L.MENU.OPTIONS .DA MENU.OPTIONS
L.MENU.HELP .DA MENU.HELP
L.MENU.SUBMENU .DA MENU.SUBMENU
2020-10-27 07:09:20 +00:00
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBGUI
>SYSCALL LoadLib
bcs .9
sta hLIBGUI
* clc
.9 rts
*--------------------------------------
CS.RUN >PUSHW L.LOGOFILE
>PUSHBI O.RDONLY
>PUSHBI S.FI.T.PIX
>PUSHWZ Aux type
2020-10-27 07:09:20 +00:00
>SYSCALL LoadStkObj
bcs .9
stx hLogo
2020-10-27 07:09:20 +00:00
jsr WND.Test
bcs .9
2020-10-27 07:09:20 +00:00
.1 >SLEEP
bra .1
2020-10-27 07:09:20 +00:00
clc
.9 rts
*--------------------------------------
CS.DOEVENT lda (pEvent)
bpl .9
.9 sec never discard TIME event
rts
*--------------------------------------
CS.QUIT clc
CS.QUIT.RTS rts
*--------------------------------------
WND.Test >PUSHBI S.WND.F.RESIZE+S.WND.F.MOVE+S.WND.F.CLOSE+S.WND.F.MAX+S.WND.F.MIN
2022-10-25 06:05:54 +00:00
>PUSHWI 40
2022-11-02 06:54:30 +00:00
>PUSHWI 40
>PUSHWI 400
>PUSHWI 120
2020-10-27 07:09:20 +00:00
>LIBCALL hLIBGUI,LIBGUI.WND.New
bcs CS.QUIT.RTS
sta hWND
>PUSHA A = hWND
>PUSHBI S.WND.BGCOLOR
>PUSHWI C.WHITE
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
2022-11-02 06:54:30 +00:00
* >PUSHB hWND
* >PUSHBI S.WND.BGBM
* >PUSHW hLogo
* >LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
2020-10-27 07:09:20 +00:00
>PUSHB hWND
>PUSHBI S.WND.hPTR
>PUSHWI PTR.T.WAIT
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
2020-10-27 07:09:20 +00:00
>PUSHB hWND
>PUSHBI S.WND.pTITLE
2020-10-27 07:09:20 +00:00
>PUSHW L.WND.TITLE
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
2022-10-27 06:20:09 +00:00
>LDYA L.MENU.FILE
>STYA WND.MBAR.1
>LDYA L.MENU.EDIT
>STYA WND.MBAR.2
>LDYA L.MENU.OPTIONS
>STYA WND.MBAR.3
>LDYA L.MENU.HELP
>STYA WND.MBAR.4
>LDYA L.MENU.SUBMENU
>STYA MENU.OPTIONS.2
2020-10-27 07:09:20 +00:00
>PUSHB hWND
>PUSHW L.WND.MBAR
>LIBCALL hLIBGUI,LIBGUI.WND.SetMBar
>PUSHB hWND
>PUSHBI S.WND.pSTATUS
2020-10-27 07:09:20 +00:00
>PUSHW L.WND.STATUS
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
>PUSHB hWND
>PUSHBI S.WND.fPaint
>PUSHW L.WND.Test.fPaint
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
>STYA WND.Test.fPaint1+1
lda hWND
>LIBCALL hLIBGUI,LIBGUI.WND.Show
rts
*--------------------------------------
WND.Test.fPaint sta hWND
WND.Test.fPaint1
jsr $ffff Default WND.fPaint
2022-11-02 06:54:30 +00:00
.1 jsr WND.Test.1
>PUSHW TmpWord
>PUSHWI 0
jsr WND.Test.2
jsr WND.Test.1
>PUSHW TmpWord
>PUSHWI 94
jsr WND.Test.2
jsr WND.Test.3
lda TmpWord
cmp #400
lda TmpWord+1
sbc /400
bcc .1
stz TmpWord
stz TmpWord+1
.3
jsr WND.Test.1
>PUSHWI 0
>PUSHW TmpWord
jsr WND.Test.2
jsr WND.Test.1
>PUSHWI 399
>PUSHW TmpWord
jsr WND.Test.2
jsr WND.Test.4
lda TmpWord
cmp #94
lda TmpWord+1
sbc /94
bcc .3
clc
2020-10-27 07:09:20 +00:00
rts
*--------------------------------------
2022-11-02 06:54:30 +00:00
WND.Test.1 >PUSHB hWND
>PUSHBI S.CB.OP.SET +S.CB.OP.COLOR
>PUSHBI C.BLACK C16.D.GREEN
rts
WND.Test.2 >PUSHWI 240
2022-11-02 06:54:30 +00:00
>PUSHWI 60
>LIBCALL hLIBGUI,LIBGUI.DRAW.Line
rts
WND.Test.3 lda TmpWord
clc
adc #4
sta TmpWord
bcc .1
inc TmpWord+1
.1 rts
WND.Test.4 lda TmpWord
clc
2022-11-02 16:14:19 +00:00
adc #4
2022-11-02 06:54:30 +00:00
sta TmpWord
bcc .1
inc TmpWord+1
.1 rts
*--------------------------------------
2020-10-27 07:09:20 +00:00
CS.END
LIBGUI .AZ "libgui"
hLIBGUI .BS 1
*--------------------------------------
LOGOFILE .AZ "${ROOT}A2osX.logo"
2022-10-25 06:05:54 +00:00
WND.TITLE .AZ "Libgui ASM API test"
2020-10-27 07:09:20 +00:00
WND.STATUS .AZ "Window status bar message"
*--------------------------------------
WND.MBAR .AZ "File"
2022-10-27 06:20:09 +00:00
WND.MBAR.1 .DA MENU.FILE
2020-10-27 07:09:20 +00:00
.AZ "Edit"
2022-10-27 06:20:09 +00:00
WND.MBAR.2 .DA MENU.EDIT
2020-10-27 07:09:20 +00:00
.AZ "Options"
2022-10-27 06:20:09 +00:00
WND.MBAR.3 .DA MENU.OPTIONS
2020-10-27 07:09:20 +00:00
.AZ "?"
2022-10-27 06:20:09 +00:00
WND.MBAR.4 .DA MENU.HELP
.DA #0
2020-10-27 07:09:20 +00:00
*--------------------------------------
2022-10-27 06:20:09 +00:00
MENU.FILE .DA #S.MITEM.T.ITEM
.DA #02 ID
.DA #KEYMOD.CTRL,#'N'
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "New"
.DA #S.MITEM.T.ITEM
.DA #04 ID
.DA #KEYMOD.CTRL,#'O'
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "Open..."
.DA #S.MITEM.T.ITEM
.DA #06 ID
.DA #KEYMOD.CTRL,#'S'
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "Save"
.DA #S.MITEM.T.ITEM
.DA #08 ID
.DA #KEYMOD.OA+KEYMOD.CTRL,#'S'
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "Save As..."
.DA #S.MITEM.T.ITEM
.DA #10 ID
.DA #KEYMOD.CTRL,#'Q'
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "Quit"
2020-10-27 07:09:20 +00:00
.DA #0
*--------------------------------------
2022-10-27 06:20:09 +00:00
MENU.EDIT .DA #S.MITEM.T.ITEM
.DA #12 ID
.DA #KEYMOD.CTRL,#'X'
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "Cut"
.DA #S.MITEM.T.ITEM
.DA #14 ID
.DA #KEYMOD.CTRL,#'C'
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "Copy"
.DA #S.MITEM.T.ITEM
.DA #16 ID
.DA #KEYMOD.CTRL,#'V'
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "Paste"
2020-10-27 07:09:20 +00:00
.DA #0
*--------------------------------------
2022-10-27 06:20:09 +00:00
MENU.OPTIONS .DA #S.MITEM.T.ITEM
.DA #18 ID
.DA #0,#0
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "Check Me"
.DA #S.MITEM.T.SEP
.DA #S.MITEM.T.SUBMENU
2022-10-27 06:20:09 +00:00
MENU.OPTIONS.2 .DA MENU.SUBMENU
.DA 0 pICON
.AZ "Sub Menu"
2020-10-27 07:09:20 +00:00
.DA #0
*--------------------------------------
2022-10-27 06:20:09 +00:00
MENU.HELP .DA #S.MITEM.T.ITEM
.DA #20 ID
.DA #0,#0
.DA 0 pICON
2020-10-27 07:09:20 +00:00
.AZ "About..."
.DA #0
*--------------------------------------
2022-10-27 06:20:09 +00:00
MENU.SUBMENU .DA #S.MITEM.T.ITEM
.DA #18 ID
.DA #0,#0
.DA 0 pICON
.AZ "Sub 1"
.DA #S.MITEM.T.ITEM
.DA #18 ID
.DA #0,#0
.DA 0 pICON
.AZ "Sub 2"
.DA #S.MITEM.T.ITEM
.DA #18 ID
.DA #0,#0
.DA 0 pICON
.AZ "Sub 3"
2020-10-27 07:09:20 +00:00
.DA #0
*--------------------------------------
.DUMMY
.OR 0
DS.START
2020-10-27 07:09:20 +00:00
DS.END .ED
*--------------------------------------
MAN
2022-10-25 06:05:54 +00:00
SAVE root/asmtest/testgui.s
2020-10-27 07:09:20 +00:00
ASM