2015-03-23 07:28:03 +00:00
|
|
|
|
PR#3
|
2015-06-03 18:30:57 +00:00
|
|
|
|
PREFIX /A2OSX.SRC
|
2015-03-23 07:28:03 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.TF /A2OSX.BOOT/SBIN/DESKTOP
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2016-06-15 06:21:42 +00:00
|
|
|
|
.INB INC/LIBGFX.I
|
2015-03-23 07:28:03 +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
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
.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
|
2016-06-15 06:21:42 +00:00
|
|
|
|
L.LIBGFX .DA LIBGFX
|
2015-03-23 07:28:03 +00:00
|
|
|
|
L.DEVNAME.GFX .DA DEVNAME.GFX
|
2015-06-03 18:30:57 +00:00
|
|
|
|
L.DEVNAME.MOUSE .DA DEVNAME.MOUSE
|
2016-06-07 06:10:18 +00:00
|
|
|
|
L.MSG.INIT .DA MSG.INIT
|
2016-07-22 14:11:13 +00:00
|
|
|
|
L.SetPixel.X .DA SetPixel.X
|
|
|
|
|
L.DrawLine.X1 .DA DrawLine.X1
|
2015-03-23 07:28:03 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2016-06-07 06:10:18 +00:00
|
|
|
|
CS.INIT >LDYA L.MSG.INIT
|
|
|
|
|
>SYSCALL SYS.PSTROutYA
|
|
|
|
|
|
2016-06-15 06:21:42 +00:00
|
|
|
|
>LDYA L.LIBGFX
|
|
|
|
|
>SYSCALL SYS.LoadLibYA
|
|
|
|
|
sta hLIBGFX
|
|
|
|
|
|
2016-06-07 06:10:18 +00:00
|
|
|
|
>LDYA L.DEVNAME.GFX
|
2015-03-23 07:28:03 +00:00
|
|
|
|
>SYSCALL SYS.GetDevByNameYA
|
|
|
|
|
bcc .10
|
|
|
|
|
rts
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.10 stx hDevGFX
|
2016-07-22 14:11:13 +00:00
|
|
|
|
|
|
|
|
|
ldx pDev
|
|
|
|
|
phx
|
|
|
|
|
ldx pDev+1
|
|
|
|
|
phx
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
>STYA pDevGFX
|
2016-07-22 14:11:13 +00:00
|
|
|
|
>STYA pDev
|
|
|
|
|
|
|
|
|
|
ldx #DEVMGR.OPEN
|
|
|
|
|
jsr GoDevGFX
|
2016-06-07 06:10:18 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.11 >LDYA L.DEVNAME.MOUSE
|
|
|
|
|
>SYSCALL SYS.GetDevByNameYA
|
|
|
|
|
bcc .20
|
|
|
|
|
|
|
|
|
|
inc DEVNAME.MOUSE+4
|
|
|
|
|
lda DEVNAME.MOUSE+4
|
|
|
|
|
cmp #'8'
|
|
|
|
|
bne .11
|
2016-07-22 14:11:13 +00:00
|
|
|
|
beq .21 No mouse found, skip mouse init
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
.20 stx hDevMouse
|
|
|
|
|
>STYA pDevMouse
|
2016-07-22 14:11:13 +00:00
|
|
|
|
>STYA pDev
|
2016-06-07 06:10:18 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
ldx #DEVMGR.OPEN
|
|
|
|
|
jsr GoDevMouse
|
2016-06-07 06:10:18 +00:00
|
|
|
|
|
2016-07-22 14:11:13 +00:00
|
|
|
|
.21 pla
|
2016-06-07 06:10:18 +00:00
|
|
|
|
sta pDev+1
|
|
|
|
|
pla
|
|
|
|
|
sta pDev
|
2015-11-23 14:54:30 +00:00
|
|
|
|
|
2016-06-15 06:21:42 +00:00
|
|
|
|
lda hDevGFX
|
2016-07-22 14:11:13 +00:00
|
|
|
|
>LIBCALL hLibGFX,LIBGFX.InitGFXA
|
2015-03-23 07:28:03 +00:00
|
|
|
|
|
2016-07-22 14:11:13 +00:00
|
|
|
|
lda (pPs)
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
|
|
|
|
sta (pPs)
|
|
|
|
|
|
2016-07-22 14:11:13 +00:00
|
|
|
|
jsr Destop.Paint
|
|
|
|
|
|
2015-03-23 07:28:03 +00:00
|
|
|
|
clc
|
2015-06-03 18:30:57 +00:00
|
|
|
|
rts
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-07-22 14:11:13 +00:00
|
|
|
|
CS.DOEVENT lda hDevMouse Mouse is active ?
|
|
|
|
|
beq .1 go check KB
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-07-22 14:11:13 +00:00
|
|
|
|
ldy #S.EVT.hDEV
|
|
|
|
|
cmp (pEvent),y Event coming from Mouse ?
|
|
|
|
|
bne .1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-07-22 14:11:13 +00:00
|
|
|
|
lda A2osX.ASCREEN GUI screen active ?
|
|
|
|
|
cmp #3
|
|
|
|
|
bne .98 no, discard mouse event & exit
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #S.EVT.DATALO
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
and #4 mouse move
|
2016-06-15 06:21:42 +00:00
|
|
|
|
beq .98
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATAW2
|
|
|
|
|
lda (pEvent),y
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.Y
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (pEvent),y X.HI
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.X+1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
dey
|
2016-07-22 14:11:13 +00:00
|
|
|
|
lda (pEvent),y X.LO
|
|
|
|
|
sta SetPixel.X
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-07-22 14:11:13 +00:00
|
|
|
|
lda #4
|
|
|
|
|
sta SetPixel.Mode
|
|
|
|
|
|
|
|
|
|
lda #15
|
|
|
|
|
sta SetPixel.Color
|
|
|
|
|
|
|
|
|
|
>LDYA L.SetPixel.X
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldx #DEVMGR.GFX.SETPIXEL
|
|
|
|
|
jsr GoDevGFX
|
|
|
|
|
|
2016-06-15 06:21:42 +00:00
|
|
|
|
.98 clc
|
2015-03-23 07:28:03 +00:00
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-07-22 14:11:13 +00:00
|
|
|
|
.1 lda (pEvent)
|
|
|
|
|
cmp #S.EVT.F.KEY
|
|
|
|
|
bne .99
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATAHI
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
bne .99 Open Apple ?
|
|
|
|
|
|
|
|
|
|
lda A2osX.ASCREEN
|
|
|
|
|
cmp #3
|
|
|
|
|
bne .98
|
|
|
|
|
|
|
|
|
|
jsr Destop.Paint
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.99 sec
|
|
|
|
|
rts
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.QUIT clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-07-22 14:11:13 +00:00
|
|
|
|
Destop.Paint lda #4
|
|
|
|
|
sta SetPixel.Mode
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta SetPixel.Color
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta SetPixel.Y
|
|
|
|
|
|
|
|
|
|
.1 lda #0
|
|
|
|
|
sta SetPixel.X
|
|
|
|
|
lda /0
|
|
|
|
|
sta SetPixel.X+1
|
|
|
|
|
|
|
|
|
|
.2 >LDYA L.SetPixel.X
|
|
|
|
|
|
|
|
|
|
ldx #DEVMGR.GFX.SETPIXEL
|
|
|
|
|
jsr GoDevGFX
|
|
|
|
|
|
|
|
|
|
lda SetPixel.X
|
|
|
|
|
clc
|
|
|
|
|
adc #4
|
|
|
|
|
sta SetPixel.X
|
|
|
|
|
bcc .3
|
|
|
|
|
inc SetPixel.X+1
|
|
|
|
|
|
|
|
|
|
.3 lda SetPixel.X
|
|
|
|
|
cmp #279
|
|
|
|
|
lda SetPixel.X+1
|
|
|
|
|
sbc /279
|
|
|
|
|
bcc .2
|
|
|
|
|
|
|
|
|
|
inc SetPixel.Y
|
|
|
|
|
lda SetPixel.Y
|
|
|
|
|
cmp #192
|
|
|
|
|
beq .8
|
|
|
|
|
and #$7
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
inc SetPixel.Color
|
|
|
|
|
lda SetPixel.Color
|
|
|
|
|
cmp #16
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
GoDevGFX jmp (pDevGFX)
|
|
|
|
|
GoDevMouse jmp (pDevMouse)
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
|
|
|
|
DEVNAME.GFX >PSTRING "GFX"
|
2015-06-03 18:30:57 +00:00
|
|
|
|
DEVNAME.MOUSE >PSTRING "MOU1"
|
2016-06-15 06:21:42 +00:00
|
|
|
|
LIBGFX >PSTRING "libgfx.o"
|
2016-06-07 06:10:18 +00:00
|
|
|
|
MSG.INIT >PSTRING "DESKTOP:Init...\n"
|
2016-06-15 06:21:42 +00:00
|
|
|
|
hLibGFX .BS 1
|
2015-03-23 07:28:03 +00:00
|
|
|
|
hDevGFX .BS 1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
pDevGFX .BS 2
|
|
|
|
|
hDevMouse .BS 1
|
|
|
|
|
pDevMouse .BS 2
|
2016-07-22 14:11:13 +00:00
|
|
|
|
SetPixel.X .BS 2
|
|
|
|
|
SetPixel.Y .BS 2
|
|
|
|
|
SetPixel.Mode .BS 1
|
|
|
|
|
SetPixel.Color .BS 1
|
|
|
|
|
DrawLine.X1 .BS 2
|
|
|
|
|
DrawLine.Y1 .BS 2
|
|
|
|
|
DrawLine.X2 .BS 2
|
|
|
|
|
DrawLine.Y2 .BS 2
|
|
|
|
|
DrawLine.Mode .BS 1
|
|
|
|
|
DrawLine.Color .BS 1
|
2015-03-23 07:28:03 +00:00
|
|
|
|
MAN
|
2015-11-29 22:19:10 +00:00
|
|
|
|
SAVE SBIN/DESKTOP.S
|
2015-03-23 07:28:03 +00:00
|
|
|
|
ASM
|