A2osX/SBIN/GUI.S.txt
2020-06-30 17:32:23 +02:00

127 lines
2.6 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
AUTO 4,1
.LIST OFF
.OP 65C02
.OR $2000
.TF sbin/gui
*--------------------------------------
.INB inc/io.i
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/libgui.i
*--------------------------------------
* Zero Page Segment, up to 32 bytes
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
* MyPtr .BS 2
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.MouseData .DA MouseData
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBGUI
>SYSCALL LoadLib
bcs .9
sta hLIBGUI
* clc
.9 rts
*--------------------------------------
CS.RUN >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
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"
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