A2osX/SBIN/GUI.S.txt
2022-10-25 08:05:54 +02:00

119 lines
2.3 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
lda MSG+S.MSG.T
cmp #S.MSG.T.ID
bne CS.RUN
lda MSG+S.MSG.ID
cmp #2
bne .1
.1 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/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