2015-03-23 07:28:03 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2015-03-23 07:28:03 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2020-06-30 15:32:23 +00:00
|
|
|
|
.TF sbin/gui
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2020-06-30 15:32:23 +00:00
|
|
|
|
.INB inc/io.i
|
|
|
|
|
.INB inc/macros.i
|
|
|
|
|
.INB inc/a2osx.i
|
2020-09-03 15:19:25 +00:00
|
|
|
|
.INB inc/gfx.i
|
2020-06-30 15:32:23 +00:00
|
|
|
|
.INB inc/libgui.i
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-08 16:29:26 +00:00
|
|
|
|
* Zero Page Segment, up to 32 bytes
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPBIN
|
|
|
|
|
ZS.START
|
|
|
|
|
* MyPtr .BS 2
|
|
|
|
|
ZS.END
|
|
|
|
|
.ED
|
2017-06-02 15:14:42 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
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
|
2019-01-08 16:29:26 +00:00
|
|
|
|
.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
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
2015-03-23 07:28:03 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
2017-11-30 16:33:33 +00:00
|
|
|
|
L.LIBGUI .DA LIBGUI
|
2017-06-02 15:14:42 +00:00
|
|
|
|
L.MouseData .DA MouseData
|
2020-09-03 15:19:25 +00:00
|
|
|
|
L.CB.Paint .DA CB.Paint
|
2015-03-23 07:28:03 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2018-05-04 14:55:29 +00:00
|
|
|
|
CS.INIT >LDYA L.LIBGUI
|
2018-07-19 15:33:55 +00:00
|
|
|
|
>SYSCALL LoadLib
|
2019-01-09 16:42:20 +00:00
|
|
|
|
bcs .9
|
2017-11-15 16:29:23 +00:00
|
|
|
|
sta hLIBGUI
|
2016-06-15 06:21:42 +00:00
|
|
|
|
|
2019-01-09 16:42:20 +00:00
|
|
|
|
* clc
|
|
|
|
|
.9 rts
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2020-09-04 15:21:15 +00:00
|
|
|
|
CS.RUN jsr Destop.Paint
|
|
|
|
|
|
|
|
|
|
CS.RUN.LOOP >SLEEP
|
|
|
|
|
|
|
|
|
|
>PUSHW L.MouseData
|
2017-11-30 16:33:33 +00:00
|
|
|
|
>LIBCALL hLIBGUI,LIBGUI.ReadMouse
|
2020-09-04 15:21:15 +00:00
|
|
|
|
bcs .8
|
2020-09-02 15:47:23 +00:00
|
|
|
|
|
2017-11-30 16:33:33 +00:00
|
|
|
|
lda MouseData+S.MOUSE.S
|
2017-11-28 16:32:38 +00:00
|
|
|
|
bit #S.MOUSE.S.MOVE
|
2017-06-02 15:14:42 +00:00
|
|
|
|
beq .1
|
2017-12-01 15:53:29 +00:00
|
|
|
|
|
2017-11-30 16:33:33 +00:00
|
|
|
|
>PUSHW L.MouseData
|
|
|
|
|
>LIBCALL hLIBGUI,LIBGUI.SetCursorPos
|
2020-09-04 15:21:15 +00:00
|
|
|
|
|
|
|
|
|
lda MouseData+S.MOUSE.X1
|
|
|
|
|
sta CB.Paint+S.CB.X1
|
|
|
|
|
clc
|
|
|
|
|
adc #39
|
|
|
|
|
sta CB.Paint+S.CB.X2
|
|
|
|
|
|
|
|
|
|
lda MouseData+S.MOUSE.X1+1
|
|
|
|
|
sta CB.Paint+S.CB.X1+1
|
|
|
|
|
adc #0
|
|
|
|
|
sta CB.Paint+S.CB.X2+1
|
|
|
|
|
|
|
|
|
|
lda MouseData+S.MOUSE.Y1
|
|
|
|
|
sta CB.Paint+S.CB.Y1
|
|
|
|
|
clc
|
|
|
|
|
adc #29
|
|
|
|
|
sta CB.Paint+S.CB.Y2
|
|
|
|
|
|
|
|
|
|
lda MouseData+S.MOUSE.Y1+1
|
|
|
|
|
sta CB.Paint+S.CB.Y1+1
|
|
|
|
|
adc #0
|
|
|
|
|
sta CB.Paint+S.CB.Y2+1
|
|
|
|
|
|
2017-11-30 16:33:33 +00:00
|
|
|
|
lda MouseData+S.MOUSE.S
|
2020-09-02 15:47:23 +00:00
|
|
|
|
|
2017-12-04 16:42:08 +00:00
|
|
|
|
.1 bit #S.MOUSE.S.CLK
|
2017-06-02 15:14:42 +00:00
|
|
|
|
beq .4
|
2020-09-04 15:21:15 +00:00
|
|
|
|
|
2017-12-06 07:28:30 +00:00
|
|
|
|
>LDA.G CUR.T
|
|
|
|
|
inc
|
|
|
|
|
inc
|
|
|
|
|
cmp #CUR.T.WAIT+2
|
|
|
|
|
bne .2
|
2017-12-06 16:26:36 +00:00
|
|
|
|
|
2017-12-06 07:28:30 +00:00
|
|
|
|
lda #CUR.T.ARROW
|
2020-09-04 15:21:15 +00:00
|
|
|
|
|
2017-12-06 07:28:30 +00:00
|
|
|
|
.2 >STA.G CUR.T
|
2019-01-08 16:29:26 +00:00
|
|
|
|
>LIBCALL hLIBGUI,LIBGUI.SetCursor
|
2017-12-05 07:09:16 +00:00
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
jsr Destop.Paint
|
|
|
|
|
|
|
|
|
|
.4
|
2017-06-02 15:14:42 +00:00
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
.8 jmp CS.RUN.LOOP
|
|
|
|
|
|
|
|
|
|
clc
|
2015-06-03 18:30:57 +00:00
|
|
|
|
rts
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-12-04 07:18:24 +00:00
|
|
|
|
CS.DOEVENT lda (pEvent)
|
|
|
|
|
bpl .9
|
2020-09-03 15:27:28 +00:00
|
|
|
|
|
2017-12-04 07:18:24 +00:00
|
|
|
|
>LIBCALL hLIBGUI,LIBGUI.UpdateCursor
|
2020-09-03 15:27:28 +00:00
|
|
|
|
|
2017-12-04 07:18:24 +00:00
|
|
|
|
.9 sec
|
2017-06-02 15:14:42 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-03-23 07:28:03 +00:00
|
|
|
|
CS.QUIT clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-12-04 16:42:08 +00:00
|
|
|
|
Destop.Paint >LIBCALL hLIBGUI,LIBGUI.HideCursor
|
|
|
|
|
|
2020-09-03 15:19:25 +00:00
|
|
|
|
>LIBCALL hLIBGUI,LIBGUI.GetScreenGC
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHW L.CB.Paint
|
|
|
|
|
>LIBCALL hLIBGUI,LIBGUI.Draw
|
2020-09-04 15:21:15 +00:00
|
|
|
|
|
2017-12-04 16:42:08 +00:00
|
|
|
|
>LIBCALL hLIBGUI,LIBGUI.ShowCursor
|
2019-10-03 06:25:27 +00:00
|
|
|
|
rts
|
2016-07-22 14:11:13 +00:00
|
|
|
|
*--------------------------------------
|
2015-03-23 07:28:03 +00:00
|
|
|
|
CS.END
|
2020-06-30 15:32:23 +00:00
|
|
|
|
LIBGUI .AZ "libgui"
|
2017-11-15 16:29:23 +00:00
|
|
|
|
hLIBGUI .BS 1
|
2017-12-14 16:25:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-12-04 16:42:08 +00:00
|
|
|
|
MouseData .BS S.MOUSE
|
2020-09-03 15:19:25 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CB.Paint .DA #S.CB.CMD.FILLRECT
|
|
|
|
|
.DA #S.CB.OP.SET
|
|
|
|
|
.DA #S.CB.M.C16
|
|
|
|
|
.DA #11 Color
|
2020-09-04 15:21:15 +00:00
|
|
|
|
.DA 540 X1
|
|
|
|
|
.DA 160 Y1
|
|
|
|
|
.DA 579 X2
|
|
|
|
|
.DA 199 Y2
|
2020-09-03 15:19:25 +00:00
|
|
|
|
.DA #0
|
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
|
2020-09-04 15:21:15 +00:00
|
|
|
|
DS.END .ED
|
2015-03-23 07:28:03 +00:00
|
|
|
|
MAN
|
2020-06-30 15:32:23 +00:00
|
|
|
|
SAVE usr/src/sbin/gui.s
|
2015-03-23 07:28:03 +00:00
|
|
|
|
ASM
|