2015-03-23 07:28:03 +00:00
|
|
|
|
NEW
|
2017-12-22 21:24:30 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
|
|
|
|
AUTO 4,1
|
2015-03-23 07:28:03 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2017-11-15 16:29:23 +00:00
|
|
|
|
.TF /A2OSX.BUILD/LIB/LIBGUI.O
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
2017-12-22 21:24:30 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/GUI.I
|
2017-11-15 16:29:23 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/LIBGUI.I
|
2017-11-30 16:33:33 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/GFX.I
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-06-09 15:36:05 +00:00
|
|
|
|
.MA SWAP16
|
|
|
|
|
lda ]1
|
|
|
|
|
ldx ]2
|
|
|
|
|
stx ]1
|
|
|
|
|
sta ]2
|
|
|
|
|
lda ]1+1
|
|
|
|
|
ldx ]2+1
|
|
|
|
|
stx ]1+1
|
|
|
|
|
sta ]2+1
|
|
|
|
|
.EM
|
|
|
|
|
.MA NOT16
|
|
|
|
|
sec
|
|
|
|
|
lda #0
|
|
|
|
|
sbc ]1
|
|
|
|
|
sta ]1
|
|
|
|
|
lda #0
|
|
|
|
|
sbc ]1+1
|
|
|
|
|
sta ]1+1
|
|
|
|
|
.EM
|
2017-11-29 16:28:13 +00:00
|
|
|
|
.MA SCMPAX
|
|
|
|
|
sec
|
|
|
|
|
sbc ]1
|
|
|
|
|
txa
|
|
|
|
|
sbc ]1+1
|
|
|
|
|
bvc :1
|
|
|
|
|
eor #$80
|
|
|
|
|
:1 .EQ *
|
|
|
|
|
.EM
|
2017-06-09 15:36:05 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-30 16:33:33 +00:00
|
|
|
|
ZPPtr1 .EQ ZPLIB
|
2017-12-04 07:18:24 +00:00
|
|
|
|
ZPGCPtr .EQ ZPLIB+2
|
|
|
|
|
ZPCBPtr .EQ ZPLIB+4
|
2016-06-15 06:21:42 +00:00
|
|
|
|
*--------------------------------------
|
2015-08-05 20:38:05 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
2015-03-23 07:28:03 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START
|
|
|
|
|
.DA 0
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 .DA LIB.LOAD
|
|
|
|
|
.DA LIB.UNLOAD
|
2017-11-30 16:33:33 +00:00
|
|
|
|
.DA InitGUI
|
2017-12-04 07:18:24 +00:00
|
|
|
|
.DA CloseGUI
|
2017-11-15 16:29:23 +00:00
|
|
|
|
.DA Draw
|
|
|
|
|
.DA SetCursor.A
|
|
|
|
|
.DA SetCursorPos
|
2016-06-15 15:58:45 +00:00
|
|
|
|
.DA HideCursor
|
|
|
|
|
.DA ShowCursor
|
2017-12-04 07:18:24 +00:00
|
|
|
|
.DA UpdateCursor
|
2017-11-30 16:33:33 +00:00
|
|
|
|
.DA ReadMouse
|
2017-12-05 16:33:06 +00:00
|
|
|
|
.DA GetScreenGC
|
2017-12-04 07:18:24 +00:00
|
|
|
|
J.Cmds .DA DrawLine
|
|
|
|
|
.DA DrawText
|
2017-11-30 16:33:33 +00:00
|
|
|
|
L.DEVNAME.GFX .DA DEVNAME.GFX
|
|
|
|
|
L.DEVNAME.MOUSE .DA DEVNAME.MOUSE
|
|
|
|
|
L.MouseClamp .DA MouseClamp
|
2017-12-04 07:18:24 +00:00
|
|
|
|
L.GC.Screen .DA GC.Screen
|
2017-06-09 15:36:05 +00:00
|
|
|
|
L.CB.Cache .DA CB.Cache
|
2017-11-30 16:33:33 +00:00
|
|
|
|
L.CUR.CB .DA CUR.CB
|
|
|
|
|
L.CUR.SaveBuf .DA CUR.SaveBuf
|
|
|
|
|
L.Cursors .DA CUR.Arrow
|
2017-12-04 07:18:24 +00:00
|
|
|
|
.DA CUR.ResizeX
|
|
|
|
|
.DA CUR.ResizeY
|
2017-12-05 07:09:16 +00:00
|
|
|
|
.DA CUR.ResizeXY1
|
|
|
|
|
.DA CUR.ResizeXY2
|
2017-12-04 07:18:24 +00:00
|
|
|
|
.DA CUR.Cross
|
|
|
|
|
.DA CUR.Text
|
|
|
|
|
.DA CUR.Wait1
|
|
|
|
|
.DA CUR.Wait2
|
|
|
|
|
.DA CUR.Wait3
|
|
|
|
|
.DA CUR.Wait4
|
|
|
|
|
.DA CUR.Wait5
|
|
|
|
|
.DA CUR.Wait6
|
2017-12-01 15:53:29 +00:00
|
|
|
|
J.Clip .DA CLIP.Point SETPIXEL
|
|
|
|
|
.DA CLIP.Point GETPIXEL
|
|
|
|
|
.DA CLIP.HLine
|
|
|
|
|
.DA CLIP.VLine
|
|
|
|
|
.DA CLIP.Rect FILLRECT
|
|
|
|
|
.DA CLIP.BitBlt
|
|
|
|
|
.DA CLIP.Rect GETRECTBUFSIZE
|
|
|
|
|
.DA CLIP.Line
|
2017-12-30 22:14:05 +00:00
|
|
|
|
.DA CLIP.Text
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.DA 0
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
LIB.LOAD
|
|
|
|
|
LIB.UNLOAD clc
|
|
|
|
|
rts
|
2016-06-15 06:21:42 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-30 16:33:33 +00:00
|
|
|
|
InitGUI lda GC.Screen+S.GC.hDev
|
2017-12-01 06:52:55 +00:00
|
|
|
|
bne .8
|
2017-11-30 16:33:33 +00:00
|
|
|
|
|
2017-12-01 06:52:55 +00:00
|
|
|
|
>LDYA L.DEVNAME.GFX
|
2017-11-30 16:33:33 +00:00
|
|
|
|
>SYSCALL GetDevByName.YA
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
stx GC.Screen+S.GC.hDev
|
|
|
|
|
>STYA GoDevGfx.Jmp+1
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
ldx #DEVMGR.OPEN
|
|
|
|
|
jsr GoDevGfx.Jmp
|
|
|
|
|
|
|
|
|
|
ldx #DEVMGR.STATUS get graphic mode and resolution....
|
|
|
|
|
jsr GoDevGfx.Jmp
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
2017-12-06 16:26:36 +00:00
|
|
|
|
ldy #S.DSTAT.GFX.W
|
2017-11-30 16:33:33 +00:00
|
|
|
|
|
|
|
|
|
lda (ZPPtr1),y
|
2017-12-06 16:26:36 +00:00
|
|
|
|
clc
|
|
|
|
|
sbc #0
|
|
|
|
|
sta GC.Screen+S.GC.X2
|
|
|
|
|
iny
|
2017-11-30 16:33:33 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2017-12-06 16:26:36 +00:00
|
|
|
|
sbc #0
|
|
|
|
|
sta GC.Screen+S.GC.X2+1
|
2017-11-30 16:33:33 +00:00
|
|
|
|
|
2017-12-06 16:26:36 +00:00
|
|
|
|
iny #S.DSTAT.GFX.H
|
|
|
|
|
|
2017-11-30 16:33:33 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2017-12-06 16:26:36 +00:00
|
|
|
|
clc
|
|
|
|
|
sbc #0
|
|
|
|
|
sta GC.Screen+S.GC.Y2
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sbc #0
|
|
|
|
|
sta GC.Screen+S.GC.Y2+1
|
2017-12-04 07:18:24 +00:00
|
|
|
|
|
|
|
|
|
.1 >LDYA L.DEVNAME.MOUSE
|
|
|
|
|
>SYSCALL GetDevByName.YA
|
|
|
|
|
bcc .2
|
|
|
|
|
|
|
|
|
|
inc DEVNAME.MOUSE+3
|
|
|
|
|
lda DEVNAME.MOUSE+3
|
|
|
|
|
cmp #'8'
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 ldx #DEVMGR.CONTROL Mouse driver disturb graphic screen....
|
|
|
|
|
jsr GoDevGfx.Jmp
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
|
2017-12-06 16:26:36 +00:00
|
|
|
|
* Mouse Setup
|
|
|
|
|
|
2017-12-04 07:18:24 +00:00
|
|
|
|
.2 stx hDevMouse
|
|
|
|
|
>STYA GoDevMouse+1
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
ldx #DEVMGR.OPEN
|
|
|
|
|
jsr GoDevMouse
|
2017-12-06 16:26:36 +00:00
|
|
|
|
|
|
|
|
|
lda GC.Screen+S.GC.X2+1
|
|
|
|
|
sta MouseClamp+3
|
|
|
|
|
lsr
|
|
|
|
|
sta CUR.Pos+S.POINT.X+1
|
|
|
|
|
|
|
|
|
|
lda GC.Screen+S.GC.X2
|
|
|
|
|
sta MouseClamp+2
|
|
|
|
|
ror
|
|
|
|
|
sta CUR.Pos+S.POINT.X
|
|
|
|
|
|
|
|
|
|
lda GC.Screen+S.GC.Y2+1
|
|
|
|
|
sta MouseClamp+7
|
|
|
|
|
lsr
|
|
|
|
|
sta CUR.Pos+S.POINT.Y+1
|
|
|
|
|
|
|
|
|
|
lda GC.Screen+S.GC.Y2
|
|
|
|
|
sta MouseClamp+6
|
|
|
|
|
ror
|
|
|
|
|
sta CUR.Pos+S.POINT.Y
|
|
|
|
|
|
2017-11-30 16:33:33 +00:00
|
|
|
|
>LDYA L.MouseClamp
|
|
|
|
|
ldx #DEVMGR.CONTROL
|
|
|
|
|
jsr GoDevMouse
|
|
|
|
|
|
|
|
|
|
>LDYA L.CUR.SaveBuf
|
|
|
|
|
>STYA CUR.CB+S.CB.DstPtr
|
|
|
|
|
|
|
|
|
|
lda #CUR.T.ARROW
|
|
|
|
|
jsr SetCursor.A
|
2017-12-04 07:18:24 +00:00
|
|
|
|
bra .8
|
2017-06-09 15:36:05 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-30 16:33:33 +00:00
|
|
|
|
CloseGUI lda hDevMouse
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
ldx #DEVMGR.CLOSE
|
|
|
|
|
jsr GoDevMouse
|
|
|
|
|
|
|
|
|
|
.1 stz GC.Screen+S.GC.hDev
|
2016-06-15 06:21:42 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2016-10-07 06:09:25 +00:00
|
|
|
|
*--------------------------------------
|
2017-12-04 16:42:08 +00:00
|
|
|
|
GC.Get >STYA .1+1
|
|
|
|
|
|
|
|
|
|
ldx #S.GC-1
|
|
|
|
|
|
|
|
|
|
.1 lda $ffff,x SELF MODIFIED
|
|
|
|
|
sta GC.Cache,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CB.Get >STYA .1+1
|
|
|
|
|
|
|
|
|
|
ldx #S.CB-1
|
|
|
|
|
|
|
|
|
|
.1 lda $ffff,x SELF MODIFIED
|
|
|
|
|
sta CB.Cache,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2017-12-04 07:18:24 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-12-01 15:53:29 +00:00
|
|
|
|
ReadMouse >PULLYA
|
2017-11-30 16:33:33 +00:00
|
|
|
|
|
2017-12-01 15:53:29 +00:00
|
|
|
|
ldx hDevMouse Mouse is active ?
|
2017-11-30 16:33:33 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
ldx #DEVMGR.READBLOCK
|
|
|
|
|
jmp GoDevMouse
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-12-05 16:33:06 +00:00
|
|
|
|
GetScreenGC >LDYA L.GC.Screen
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-11-30 16:33:33 +00:00
|
|
|
|
GoDevGfx >LDYA L.CB.Cache
|
2017-12-14 16:25:03 +00:00
|
|
|
|
ldx #DEVMGR.WRITE
|
2017-11-30 16:33:33 +00:00
|
|
|
|
GoDevGfx.Jmp jmp $ffff
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GoDevMouse jmp $ffff
|
2017-11-29 16:28:13 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBGUI.S.DRAW
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBGUI.S.CLIP
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBGUI.S.CUR
|
2018-01-10 16:34:57 +00:00
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBGUI.S.PAT
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBGUI.S.WND
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2017-11-30 16:33:33 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBGUI.G.CUR
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DEVNAME.GFX >CSTR "GFX"
|
|
|
|
|
DEVNAME.MOUSE >CSTR "MOU1"
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
hDevMouse .BS 1
|
2016-06-15 06:21:42 +00:00
|
|
|
|
*--------------------------------------
|
2017-06-09 15:36:05 +00:00
|
|
|
|
DX .BS 2
|
|
|
|
|
DY .BS 2
|
|
|
|
|
IY .BS 1
|
2017-06-15 15:36:25 +00:00
|
|
|
|
IE .BS 2
|
|
|
|
|
D .BS 2
|
|
|
|
|
INE .BS 2
|
2017-06-09 15:36:05 +00:00
|
|
|
|
Counter .BS 2
|
2017-12-01 15:53:29 +00:00
|
|
|
|
CLIP.Line.P1 .BS 1
|
|
|
|
|
CLIP.Line.P2 .BS 1
|
2017-06-09 15:36:05 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-15 16:29:23 +00:00
|
|
|
|
CB.CmdLen .DA S.CB.Y1+1 SETPIXEL
|
|
|
|
|
.DA S.CB.Y1+1 GETPIXEL
|
|
|
|
|
.DA S.CB.X2+1 HLINE
|
|
|
|
|
.DA S.CB.Y2+1 VLINE
|
|
|
|
|
.DA S.CB.Y2+1 FILLRECT
|
|
|
|
|
.DA S.CB.DstPtr+1 BITBLT
|
2017-11-20 06:59:59 +00:00
|
|
|
|
.DA S.CB.DstPtr+1 GETRECTBUFSIZE
|
2017-11-15 16:29:23 +00:00
|
|
|
|
.DA S.CB.Y2+1 DRAWLINE
|
2017-12-30 22:14:05 +00:00
|
|
|
|
.DA S.CB.TxtPtr+1 DRAWTEXT
|
2017-11-15 16:29:23 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-30 16:33:33 +00:00
|
|
|
|
MouseClamp .BS 8
|
|
|
|
|
*--------------------------------------
|
2017-11-29 16:28:13 +00:00
|
|
|
|
GC.Screen .BS S.GC
|
2017-12-04 07:18:24 +00:00
|
|
|
|
GC.Desktop .BS S.GC
|
2017-12-05 16:33:06 +00:00
|
|
|
|
GC.TaskBar .BS S.GC
|
2017-12-04 07:18:24 +00:00
|
|
|
|
*--------------------------------------
|
2018-01-10 16:34:57 +00:00
|
|
|
|
PAT.Buf .BS 1 S.BM.F
|
|
|
|
|
.DA #1 S.BM.RowBytes
|
|
|
|
|
.DA 8 S.BM.W
|
|
|
|
|
.DA 8 S.BM.H
|
|
|
|
|
.DA 0 S.BM.MASK.OFS
|
|
|
|
|
.BS 8 (data)
|
|
|
|
|
*--------------------------------------
|
2017-11-29 16:28:13 +00:00
|
|
|
|
GC.Cache .BS S.GC
|
2017-06-09 15:36:05 +00:00
|
|
|
|
CB.Cache .BS S.CB
|
2017-12-30 22:14:05 +00:00
|
|
|
|
BM.Cache .BS S.BM
|
2018-01-10 16:34:57 +00:00
|
|
|
|
WND.Cache .BS S.WND
|
2017-06-09 15:36:05 +00:00
|
|
|
|
*--------------------------------------
|
2015-03-23 07:28:03 +00:00
|
|
|
|
MAN
|
2017-11-14 16:57:34 +00:00
|
|
|
|
SAVE /A2OSX.SRC/LIB/LIBGUI.S
|
2015-03-23 07:28:03 +00:00
|
|
|
|
ASM
|