A2osX/SBIN/GUI.S.txt

139 lines
2.8 KiB
Plaintext
Raw Normal View History

NEW
2020-10-02 14:57:05 +00:00
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
2020-06-30 15:32:23 +00:00
.TF sbin/gui
*--------------------------------------
2020-06-30 15:32:23 +00:00
.INB inc/io.i
.INB inc/macros.i
.INB inc/a2osx.i
2020-09-03 15:19:25 +00:00
.INB inc/gfx.i
2020-06-30 15:32:23 +00:00
.INB inc/libgui.i
*--------------------------------------
2019-01-08 16:29:26 +00:00
* Zero Page Segment, up to 32 bytes
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
ZS.END
.ED
*--------------------------------------
2015-06-03 18:30:57 +00:00
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
2015-06-03 18:30:57 +00:00
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
2019-01-08 16:29:26 +00:00
.DA #S.PS.F.EVENT
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
2015-06-03 18:30:57 +00:00
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.LIBGUI .DA LIBGUI
2022-11-02 06:54:30 +00:00
L.ABOUT.T .DA ABOUT.T
L.ABOUT.M .DA ABOUT.M
L.GUITEST1 .DA GUITEST1
L.GUITEST2 .DA GUITEST2
L.MSG .DA MSG
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBGUI
2018-07-19 15:33:55 +00:00
>SYSCALL LoadLib
2019-01-09 16:42:20 +00:00
bcs .9
2020-10-26 06:38:50 +00:00
2017-11-15 16:29:23 +00:00
sta hLIBGUI
2016-06-15 06:21:42 +00:00
2020-10-26 06:38:50 +00:00
* clc
.9 rts
*--------------------------------------
2020-10-27 16:33:10 +00:00
CS.RUN >SLEEP
>PUSHW L.MSG
>LIBCALL hLIBGUI,LIBGUI.MSG.Get
2020-10-27 16:33:10 +00:00
bcs CS.RUN
2020-09-02 15:47:23 +00:00
2022-10-25 06:05:54 +00:00
lda MSG+S.MSG.T
cmp #S.MSG.T.ID
bne CS.RUN
lda MSG+S.MSG.ID
2022-10-25 06:05:54 +00:00
cmp #2
bne .1
2022-11-02 06:54:30 +00:00
jsr CS.RUN.MsgBox
bra CS.RUN
2022-10-25 06:05:54 +00:00
.1 cmp #42
bne .2
2020-09-04 15:21:15 +00:00
2022-11-02 06:54:30 +00:00
>LDYA L.GUITEST1
jsr CS.RUN.Exec
bra CS.RUN
2020-10-26 06:38:50 +00:00
.2 cmp #44
bne CS.RUN
2020-10-26 06:38:50 +00:00
2022-11-02 06:54:30 +00:00
>LDYA L.GUITEST2
jsr CS.RUN.Exec
2020-10-27 16:33:10 +00:00
bra CS.RUN
*--------------------------------------
2022-11-02 06:54:30 +00:00
CS.RUN.MsgBox >PUSHW L.ABOUT.T
>PUSHWI BM.ID.INFO
>PUSHW L.ABOUT.M
>PUSHBI 63 BUT.ID.OK
2022-11-02 06:54:30 +00:00
>LIBCALL hLIBGUI,LIBGUI.MBOX.MsgBox
rts
*--------------------------------------
CS.RUN.Exec >PUSHYA
>PUSHBI 0
>SYSCALL ExecL
rts
*--------------------------------------
2017-12-04 07:18:24 +00:00
CS.DOEVENT lda (pEvent)
bpl .9
2020-09-03 15:27:28 +00:00
>LIBCALL hLIBGUI,LIBGUI.PTR.Update
2020-09-03 15:27:28 +00:00
2017-12-04 07:18:24 +00:00
.9 sec
rts
*--------------------------------------
CS.QUIT lda hLIBGUI
beq .8
>SYSCALL UnloadLib
.8 clc
rts
*--------------------------------------
CS.END
2020-06-30 15:32:23 +00:00
LIBGUI .AZ "libgui"
2017-11-15 16:29:23 +00:00
hLIBGUI .BS 1
2022-11-02 06:54:30 +00:00
ABOUT.T .AZ "About GUI"
ABOUT.M .CS "MsgBox demo with all possible buttons.\r\n"
.CS "...Line 2...\r\n"
.CZ "...Line 3.\r\n"
2022-10-25 06:05:54 +00:00
GUITEST1 .AZ "${ROOT}root/asmtest/testgui"
GUITEST2 .AZ "${ROOT}root/ctest/testgui"
2017-12-14 16:25:03 +00:00
*--------------------------------------
MSG .BS S.MSG
2017-11-15 16:29:23 +00:00
*--------------------------------------
.DUMMY
.OR 0
DS.START
2020-10-26 16:32:51 +00:00
2020-09-04 15:21:15 +00:00
DS.END .ED
MAN
2020-06-30 15:32:23 +00:00
SAVE usr/src/sbin/gui.s
ASM