mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-27 04:49:20 +00:00
137 lines
2.6 KiB
Plaintext
137 lines
2.6 KiB
Plaintext
NEW
|
||
PREFIX
|
||
AUTO 4,1
|
||
.LIST OFF
|
||
.OP 65C02
|
||
.OR $2000
|
||
.TF SBIN/GUI/GUI
|
||
*--------------------------------------
|
||
.INB INC/IO.I
|
||
.INB INC/MACROS.I
|
||
.INB INC/A2OSX.I
|
||
.INB INC/GUI.I
|
||
.INB INC/LIBGUI.I
|
||
*--------------------------------------
|
||
ZPPtr1 .EQ ZPBIN
|
||
*--------------------------------------
|
||
* File Header (16 Bytes)
|
||
*--------------------------------------
|
||
CS.START cld
|
||
jmp (.1,x)
|
||
.DA #$61 6502,Level 1 (65c02)
|
||
.DA #1 BIN Layout Version 1
|
||
.DA 0
|
||
.DA CS.END-CS.START CS
|
||
.DA DS.END-DS.START DS
|
||
.DA #16 SS
|
||
.DA #2 ZP
|
||
.DA 0
|
||
*--------------------------------------
|
||
* Relocation Table
|
||
*--------------------------------------
|
||
.1 .DA CS.INIT
|
||
.DA CS.RUN
|
||
.DA CS.DOEVENT
|
||
.DA CS.QUIT
|
||
L.LIBGUI .DA LIBGUI
|
||
L.MouseData .DA MouseData
|
||
.DA 0
|
||
*--------------------------------------
|
||
CS.INIT >LDYA L.LIBGUI
|
||
>SYSCALL LoadLib
|
||
bcs .98
|
||
sta hLIBGUI
|
||
|
||
lda (pPs)
|
||
ora #S.PS.F.EVENT Now accept events
|
||
sta (pPs)
|
||
|
||
clc
|
||
CS.INIT.RTS rts
|
||
*--------------------------------------
|
||
CS.RUN lda A2osX.ASCREEN GUI screen active ?
|
||
cmp #3
|
||
bne .8 no, exit....
|
||
|
||
>PUSHW L.MouseData
|
||
>LIBCALL hLIBGUI,LIBGUI.ReadMouse
|
||
bcs .4
|
||
|
||
lda MouseData+S.MOUSE.S
|
||
bit #S.MOUSE.S.MOVE
|
||
beq .1
|
||
|
||
>PUSHW L.MouseData
|
||
>LIBCALL hLIBGUI,LIBGUI.SetCursorPos
|
||
|
||
lda MouseData+S.MOUSE.S
|
||
|
||
.1 bit #S.MOUSE.S.CLK
|
||
beq .4
|
||
|
||
>LDA.G CUR.T
|
||
inc
|
||
inc
|
||
cmp #CUR.T.WAIT+2
|
||
bne .2
|
||
|
||
lda #CUR.T.ARROW
|
||
|
||
.2 >STA.G CUR.T
|
||
>LIBCALL hLIBGUI,LIBGUI.SetCursor.A
|
||
|
||
|
||
jsr Destop.Paint
|
||
|
||
.4
|
||
|
||
.8 clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.DOEVENT lda (pEvent)
|
||
bpl .9
|
||
asl
|
||
bpl .9
|
||
|
||
>LIBCALL hLIBGUI,LIBGUI.UpdateCursor
|
||
|
||
.9 sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.QUIT clc
|
||
rts
|
||
*--------------------------------------
|
||
Destop.Paint >LIBCALL hLIBGUI,LIBGUI.HideCursor
|
||
|
||
>LIBCALL hLIBGUI,LIBGUI.GetScreenGC
|
||
>PUSHYA
|
||
>PUSHW L.CB.Paint
|
||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||
|
||
* >LIBCALL hLIBGUI,LIBGUI.GetScreenGC
|
||
* >PUSHYA
|
||
|
||
>PUSHW L.GC.Clip
|
||
|
||
>PUSHW L.CB.Marylin
|
||
>LIBCALL hLIBGUI,LIBGUI.Draw
|
||
|
||
>LIBCALL hLIBGUI,LIBGUI.ShowCursor
|
||
rts
|
||
*--------------------------------------
|
||
CS.END
|
||
LIBGUI .AZ "libgui.o"
|
||
hLIBGUI .BS 1
|
||
*--------------------------------------
|
||
MouseData .BS S.MOUSE
|
||
*--------------------------------------
|
||
.DUMMY
|
||
.OR 0
|
||
DS.START
|
||
CUR.T .BS 1
|
||
DS.END
|
||
.ED
|
||
MAN
|
||
SAVE USR/SRC/SBIN/GUI.S
|
||
ASM
|