A2osX/SBIN/GUI.S.txt
2018-07-23 17:28:42 +02:00

137 lines
2.7 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
PREFIX /A2OSX.BUILD
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 /A2OSX.SRC/SBIN/GUI.S
ASM