A2osX/SBIN/GUI.S.txt
burniouf dad22dfc30 CC:SWITCH/CASE
ASM:added \%
KERNEL:BUGFIX in DevMgr
LIBGUI:New API
2022-10-18 07:56:59 +02:00

114 lines
2.2 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.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
.1 lda MSG+S.MSG.T
cmp #S.MSG.T.ID
bne CS.RUN
lda MSG+S.MSG.ID
cmp #42
bne .2
>PUSHW L.GUITEST1
>PUSHBI 0
>SYSCALL ExecL
bra CS.RUN
.2 cmp #44
bne CS.RUN
>PUSHW L.GUITEST2
>PUSHBI 0
>SYSCALL ExecL
bra CS.RUN
clc
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
GUITEST1 .AZ "${ROOT}root/asmtest/guitest1"
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