A2osX/SBIN/GUI.S.txt
burniouf 9a7d20a7e1 ProDOS 203 / FX:TC mod for year 2022-2026
FORMAT: new switches & checks
SH:BREAK in FOR and WHILE
ASM / S-C MASM: new directives, CString support and .HX
LC / UC:bugfix
DHGR.DRV:bugfix
LIBGUI:wip
CC:wip
2022-12-07 08:02:29 +01:00

137 lines
2.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF sbin/gui
*--------------------------------------
.INB inc/io.i
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/gfx.i
.INB inc/libgui.i
*--------------------------------------
* Zero Page Segment, up to 32 bytes
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
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
.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
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.LIBGUI .DA LIBGUI
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
>SYSCALL LoadLib
bcs .9
sta hLIBGUI
* clc
.9
CS.INIT.RTS rts
*--------------------------------------
CS.RUN >SLEEP
>PUSHW L.MSG
>LIBCALL hLIBGUI,LIBGUI.MSG.Get
bcs CS.RUN
lda MSG+S.MSG.T
cmp #S.MSG.T.ID
bne CS.RUN
lda MSG+S.MSG.ID
cmp #2
bne .1
jsr CS.RUN.MsgBox
bra CS.RUN
.1 cmp #42
bne .2
>LDYA L.GUITEST1
jsr CS.RUN.Exec
bra CS.RUN
.2 cmp #44
bne CS.RUN
>LDYA L.GUITEST2
jsr CS.RUN.Exec
bra CS.RUN
clc
rts
*--------------------------------------
CS.RUN.MsgBox >PUSHW L.ABOUT.T
>PUSHWI BM.ID.INFO
>PUSHW L.ABOUT.M
>PUSHBI 63 BUT.ID.OK
>LIBCALL hLIBGUI,LIBGUI.MBOX.MsgBox
rts
*--------------------------------------
CS.RUN.Exec >PUSHYA
>PUSHBI 0
>SYSCALL ExecL
rts
*--------------------------------------
CS.DOEVENT lda (pEvent)
bpl .9
>LIBCALL hLIBGUI,LIBGUI.PTR.Update
.9 sec
rts
*--------------------------------------
CS.QUIT clc
CS.QUIT.RTS rts
*--------------------------------------
CS.END
LIBGUI .AZ "libgui"
hLIBGUI .BS 1
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"
GUITEST1 .AZ "${ROOT}root/asmtest/testgui"
GUITEST2 .AZ "${ROOT}root/ctest/testgui"
*--------------------------------------
MSG .BS S.MSG
*--------------------------------------
.DUMMY
.OR 0
DS.START
DS.END .ED
MAN
SAVE usr/src/sbin/gui.s
ASM