A2osX/SBIN/GUI.S.txt

237 lines
4.8 KiB
Plaintext
Raw Normal View History

PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 6
.LIST OFF
.OP 65C02
.OR $2000
2017-11-14 16:57:34 +00:00
.TF /A2OSX.BUILD/SBIN/GUI
*--------------------------------------
.INB /A2OSX.BUILD/INC/IO.I
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
2017-11-14 16:57:34 +00:00
.INB /A2OSX.BUILD/INC/LIBGUI.I
*--------------------------------------
ZPPtr1 .EQ ZPBIN
*--------------------------------------
2015-06-03 18:30:57 +00:00
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
2015-06-03 18:30:57 +00:00
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA 0
2017-11-15 16:29:23 +00:00
.DA CS.END-CS.START CS
.DA DS.END-DS.START DS
.DA #16 SS
.DA #2 ZP
2015-06-03 18:30:57 +00:00
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
2016-06-07 06:10:18 +00:00
L.MSG.INIT .DA MSG.INIT
L.LIBGUI .DA LIBGUI
L.Filename .DA Filename
L.MouseData .DA MouseData
L.CB.Rect .DA CB.Rect
L.CB.BitBlt .DA CB.BitBlt
L.CB.DrawLine .DA CB.DrawLine
L.GC.Clip .DA GC.Clip
.DA 0
*--------------------------------------
2016-06-07 06:10:18 +00:00
CS.INIT >LDYA L.MSG.INIT
>SYSCALL PrintF.YA
2017-11-15 16:29:23 +00:00
>LDYA L.LIBGUI
>SYSCALL LoadLib.YA
bcs .9
2017-11-15 16:29:23 +00:00
sta hLIBGUI
2016-06-15 06:21:42 +00:00
>LIBCALL hLIBGUI,LIBGUI.InitGUI
bcs .9
>PUSHWI 0 Aux type
>PUSHBI $CB Type
>PUSHBI SYS.FOpen.R
>PUSHW L.FILENAME
>SYSCALL LoadStkObj
bcs .9
sta CB.BitBlt+S.CB.SrcPtr
2017-12-05 07:09:16 +00:00
jsr Destop.Paint
2017-12-05 07:09:16 +00:00
lda #CUR.T.ARROW
>STA.G CUR.T
2017-12-04 07:18:24 +00:00
>LIBCALL hLIBGUI,LIBGUI.SetCursor.A
>LIBCALL hLIBGUI,LIBGUI.ShowCursor
lda (pPs)
ora #S.PS.F.EVENT Now accept events
sta (pPs)
clc
.9 rts
*--------------------------------------
CS.RUN lda A2osX.ASCREEN GUI screen active ?
2016-07-22 14:11:13 +00:00
cmp #3
bne .8 no, exit....
2016-07-22 14:11:13 +00:00
>PUSHW L.MouseData
>LIBCALL hLIBGUI,LIBGUI.ReadMouse
bcs .4
2015-06-03 18:30:57 +00:00
lda MouseData+S.MOUSE.S
bit #S.MOUSE.S.MOVE
beq .1
>PUSHW L.MouseData
>LIBCALL hLIBGUI,LIBGUI.SetCursorPos
2015-06-03 18:30:57 +00:00
lda MouseData+S.MOUSE.S
2017-12-04 16:42:08 +00:00
.1 bit #S.MOUSE.S.CLK
beq .4
2017-12-06 07:28:30 +00:00
>LDA.G CUR.T
inc
inc
cmp #CUR.T.WAIT+2
bne .2
2017-12-06 07:28:30 +00:00
lda #CUR.T.ARROW
.2 >STA.G CUR.T
>LIBCALL hLIBGUI,LIBGUI.SetCursor.A
2017-12-05 07:09:16 +00:00
2017-12-04 16:42:08 +00:00
lda MouseData+S.MOUSE.X1
sta CB.BitBlt+S.CB.DstX
2017-12-04 16:42:08 +00:00
lda MouseData+S.MOUSE.X1+1
sta CB.BitBlt+S.CB.DstX+1
2017-12-04 16:42:08 +00:00
lda MouseData+S.MOUSE.Y1
sta CB.BitBlt+S.CB.DstY
2017-12-04 16:42:08 +00:00
lda MouseData+S.MOUSE.Y1+1
sta CB.BitBlt+S.CB.DstY+1
2017-12-04 16:42:08 +00:00
jsr Destop.Paint
.4
.8 clc
2015-06-03 18:30:57 +00:00
rts
*--------------------------------------
2017-12-04 07:18:24 +00:00
CS.DOEVENT lda (pEvent)
bpl .9
2017-12-04 16:42:08 +00:00
asl
bpl .9
2017-12-04 07:18:24 +00:00
>LIBCALL hLIBGUI,LIBGUI.UpdateCursor
.9 sec
rts
*--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
2017-12-04 16:42:08 +00:00
Destop.Paint >LIBCALL hLIBGUI,LIBGUI.HideCursor
>LIBCALL hLIBGUI,LIBGUI.GetScreenGC
>PUSHYA
2017-12-04 16:42:08 +00:00
>PUSHW L.CB.Rect
2017-11-15 16:29:23 +00:00
>LIBCALL hLIBGUI,LIBGUI.Draw
* >LIBCALL hLIBGUI,LIBGUI.GetScreenGC
* >PUSHYA
>PUSHW L.GC.Clip
>PUSHW L.CB.BitBlt
>LIBCALL hLIBGUI,LIBGUI.Draw
2017-12-04 16:42:08 +00:00
>LIBCALL hLIBGUI,LIBGUI.ShowCursor
2017-11-20 06:59:59 +00:00
rts
2016-07-22 14:11:13 +00:00
*--------------------------------------
CS.END
2017-11-15 16:29:23 +00:00
LIBGUI >CSTR "libgui.o"
2017-11-16 07:12:03 +00:00
MSG.INIT >CSTR "GUI:Init...\r\n"
2017-11-15 16:29:23 +00:00
hLIBGUI .BS 1
*--------------------------------------
Filename >CSTR "/A2OSX.BUILD/MARILYN"
*--------------------------------------
2017-12-04 16:42:08 +00:00
MouseData .BS S.MOUSE
*--------------------------------------
CB.Rect .DA #S.CB.CMD.FILLRECT
2017-11-20 06:59:59 +00:00
.DA #S.CB.OP.SET
2017-11-15 16:29:23 +00:00
.DA #S.CB.MODE.C16
2017-12-06 07:28:30 +00:00
.DA #1
.DA 0 X1
.DA 0 Y1
.DA 559 X2
.DA 191 Y2
2017-12-06 07:28:30 +00:00
.DA #S.CB.CMD.FILLRECT
.DA #S.CB.OP.SET
.DA #S.CB.MODE.MONO
2017-12-06 07:28:30 +00:00
.DA #0
.DA 40 X1
.DA 40 Y1
.DA 519 X2
.DA 151 Y2
2017-12-06 07:28:30 +00:00
.DA #0
*--------------------------------------
CB.BitBlt .DA #S.CB.CMD.BITBLT
.DA #S.CB.OP.SET
.DA #S.CB.MODE.MONO
.DA #0
.DA 0 X1
.DA 0 Y1
.DA 141 W
.DA 150 H
.DA 200 DestX
.DA 60 DestY
.BS 2 SrcPtr
.DA 0
2017-11-15 16:29:23 +00:00
.DA #0
*--------------------------------------
CB.DrawLine .DA #0
.DA #S.CB.CMD.DRAWLINE
.DA #S.CB.OP.XOR
.DA #S.CB.MODE.MONO
.DA #1
.BS 2 X1
.BS 2 Y1
.BS 2 X2
.BS 2 Y2
2017-11-15 16:29:23 +00:00
.DA #0
*--------------------------------------
GC.Clip .DA #0
.DA #0
.DA #0
.DA #0
.DA 40 X1
.DA 40 Y1
.DA 519 X2
.DA 151 Y2
2017-11-15 16:29:23 +00:00
*--------------------------------------
.DUMMY
.OR 0
DS.START
2017-12-05 07:09:16 +00:00
CUR.T .BS 1
2017-11-15 16:29:23 +00:00
DS.END
.ED
MAN
2017-11-14 16:57:34 +00:00
SAVE /A2OSX.SRC/SBIN/GUI.S
ASM