2015-03-23 07:28:03 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2015-03-23 07:28:03 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.TF /A2OSX.BUILD/SBIN/DESKTOP
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/IO.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/LIBGFX.I
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-06-02 15:14:42 +00:00
|
|
|
|
ZPPtr1 .EQ ZPBIN
|
|
|
|
|
*--------------------------------------
|
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
|
2017-06-02 15:14:42 +00:00
|
|
|
|
L.MouseClamp .DA MouseClamp
|
|
|
|
|
L.MouseData .DA MouseData
|
2017-06-09 15:36:05 +00:00
|
|
|
|
L.SetPixel.CB .DA SetPixel.CB
|
|
|
|
|
L.DrawLine1.CB .DA DrawLine1.CB
|
|
|
|
|
L.DrawLine2.CB .DA DrawLine2.CB
|
2017-06-15 15:36:25 +00:00
|
|
|
|
L.DrawLine3.CB .DA DrawLine3.CB
|
|
|
|
|
L.DrawLine4.CB .DA DrawLine4.CB
|
2017-06-16 15:27:48 +00:00
|
|
|
|
L.DrawLine5.CB .DA DrawLine5.CB
|
|
|
|
|
L.DrawLine6.CB .DA DrawLine6.CB
|
2015-03-23 07:28:03 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2016-06-07 06:10:18 +00:00
|
|
|
|
CS.INIT >LDYA L.MSG.INIT
|
2016-11-03 16:23:46 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-06-07 06:10:18 +00:00
|
|
|
|
|
2016-06-15 06:21:42 +00:00
|
|
|
|
>LDYA L.LIBGFX
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL LoadLibYA
|
2016-06-15 06:21:42 +00:00
|
|
|
|
sta hLIBGFX
|
|
|
|
|
|
2016-06-07 06:10:18 +00:00
|
|
|
|
>LDYA L.DEVNAME.GFX
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetDevByNameYA
|
2015-03-23 07:28:03 +00:00
|
|
|
|
bcc .10
|
|
|
|
|
rts
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.10 stx hDevGFX
|
2016-07-22 14:11:13 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>STYA GoDevGFX+1
|
2016-07-22 14:11:13 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
txa
|
2016-07-22 14:11:13 +00:00
|
|
|
|
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
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetDevByNameYA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
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
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>STYA GoDevMouse+1
|
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
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
ldx #DEVMGR.CONTROL Mouse driver disturb graphic screen....
|
2016-10-08 20:53:45 +00:00
|
|
|
|
jsr GoDevGFX
|
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
ldx #DEVMGR.STATUS get graphic mode and resolution....
|
|
|
|
|
jsr GoDevGFX
|
2016-10-08 20:53:45 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
ldy #S.DEVSTAT+1
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta MouseClamp+2
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta MouseClamp+3
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta MouseClamp+6
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta MouseClamp+7
|
|
|
|
|
|
|
|
|
|
>LDYA L.MouseClamp
|
|
|
|
|
ldx #DEVMGR.CONTROL
|
|
|
|
|
jsr GoDevMouse
|
2015-11-23 14:54:30 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
.21 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
|
|
|
|
*--------------------------------------
|
2017-06-09 15:36:05 +00:00
|
|
|
|
CS.RUN lda A2osX.ASCREEN GUI screen active ?
|
2016-07-22 14:11:13 +00:00
|
|
|
|
cmp #3
|
2017-06-02 15:14:42 +00:00
|
|
|
|
bne .8 no, exit....
|
2016-07-22 14:11:13 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
lda hDevMouse Mouse is active ?
|
|
|
|
|
beq .4 go check KB
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
>LDYA L.MouseData
|
|
|
|
|
ldx #DEVMGR.READBLOCK
|
|
|
|
|
jsr GoDevMouse
|
|
|
|
|
bcs .4 go check KB
|
|
|
|
|
|
|
|
|
|
lda MouseData
|
|
|
|
|
bit #4 mouse move
|
|
|
|
|
beq .1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
lda MouseData+1
|
|
|
|
|
sta SetPixel.X
|
|
|
|
|
|
|
|
|
|
lda MouseData+2
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.X+1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
lda MouseData+3
|
|
|
|
|
sta SetPixel.Y
|
|
|
|
|
|
|
|
|
|
lda MouseData+4
|
|
|
|
|
sta SetPixel.Y+1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-06-09 15:36:05 +00:00
|
|
|
|
lda #0 S.CB.OP.XOR
|
|
|
|
|
sta SetPixel.OP
|
|
|
|
|
lda #S.CB.MODE.MONO
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.Mode
|
|
|
|
|
|
2017-06-09 15:36:05 +00:00
|
|
|
|
lda #1
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.Color
|
|
|
|
|
|
2017-06-09 15:36:05 +00:00
|
|
|
|
>LDYA L.SetPixel.CB
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldx #DEVMGR.GFX.SETPIXEL
|
|
|
|
|
jsr GoDevGFX
|
2017-06-02 15:14:42 +00:00
|
|
|
|
clc
|
2015-03-23 07:28:03 +00:00
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
.1 bit #$20
|
|
|
|
|
beq .4
|
2016-11-27 21:59:46 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
jsr Destop.Paint
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.4
|
|
|
|
|
|
|
|
|
|
.8 clc
|
2015-06-03 18:30:57 +00:00
|
|
|
|
rts
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-06-02 15:14:42 +00:00
|
|
|
|
CS.DOEVENT sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-03-23 07:28:03 +00:00
|
|
|
|
CS.QUIT clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-06-09 15:36:05 +00:00
|
|
|
|
Destop.Paint lda #S.CB.MODE.C16
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.Mode
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta SetPixel.Color
|
|
|
|
|
|
2017-06-09 15:36:05 +00:00
|
|
|
|
lda #20
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.Y
|
|
|
|
|
|
2017-06-16 15:27:48 +00:00
|
|
|
|
.1 lda #28
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.X
|
2017-06-16 15:27:48 +00:00
|
|
|
|
lda /28
|
2016-07-22 14:11:13 +00:00
|
|
|
|
sta SetPixel.X+1
|
|
|
|
|
|
2017-06-09 15:36:05 +00:00
|
|
|
|
.2 >LDYA L.SetPixel.CB
|
2016-07-22 14:11:13 +00:00
|
|
|
|
|
|
|
|
|
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
|
2017-06-16 15:27:48 +00:00
|
|
|
|
cmp #84
|
2016-07-22 14:11:13 +00:00
|
|
|
|
lda SetPixel.X+1
|
2017-06-16 15:27:48 +00:00
|
|
|
|
sbc /84
|
2016-07-22 14:11:13 +00:00
|
|
|
|
bcc .2
|
|
|
|
|
|
|
|
|
|
inc SetPixel.Y
|
|
|
|
|
lda SetPixel.Y
|
|
|
|
|
cmp #192
|
2017-06-16 15:27:48 +00:00
|
|
|
|
beq .4
|
2016-07-22 14:11:13 +00:00
|
|
|
|
and #$7
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
inc SetPixel.Color
|
|
|
|
|
lda SetPixel.Color
|
|
|
|
|
cmp #16
|
|
|
|
|
bne .1
|
|
|
|
|
|
2017-06-16 15:27:48 +00:00
|
|
|
|
.4 >PUSHW L.DrawLine1.CB
|
2017-06-09 15:36:05 +00:00
|
|
|
|
>LIBCALL hLibGFX,LIBGFX.DrawLine
|
|
|
|
|
>PUSHW L.DrawLine2.CB
|
|
|
|
|
>LIBCALL hLibGFX,LIBGFX.DrawLine
|
2017-06-15 15:36:25 +00:00
|
|
|
|
>PUSHW L.DrawLine3.CB
|
|
|
|
|
>LIBCALL hLibGFX,LIBGFX.DrawLine
|
|
|
|
|
>PUSHW L.DrawLine4.CB
|
|
|
|
|
>LIBCALL hLibGFX,LIBGFX.DrawLine
|
2017-06-16 15:27:48 +00:00
|
|
|
|
>PUSHW L.DrawLine5.CB
|
|
|
|
|
>LIBCALL hLibGFX,LIBGFX.DrawLine
|
|
|
|
|
>PUSHW L.DrawLine6.CB
|
|
|
|
|
>LIBCALL hLibGFX,LIBGFX.DrawLine
|
2017-06-09 15:36:05 +00:00
|
|
|
|
|
2017-06-16 15:27:48 +00:00
|
|
|
|
rts
|
2016-07-22 14:11:13 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
*--------------------------------------
|
2016-10-08 20:53:45 +00:00
|
|
|
|
GoDevGFX jmp $ffff
|
|
|
|
|
GoDevMouse jmp $ffff
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2016-10-24 15:54:43 +00:00
|
|
|
|
DEVNAME.GFX >PSTR "GFX"
|
|
|
|
|
DEVNAME.MOUSE >PSTR "MOU1"
|
|
|
|
|
LIBGFX >PSTR "libgfx.o"
|
2017-06-02 15:14:42 +00:00
|
|
|
|
MSG.INIT >CSTR "DESKTOP:Init...\r\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
|
|
|
|
hDevMouse .BS 1
|
2017-06-02 15:14:42 +00:00
|
|
|
|
MouseClamp .BS 8
|
|
|
|
|
MouseData .BS 5
|
2017-06-09 15:36:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SetPixel.CB .BS 1 hDC
|
|
|
|
|
SetPixel.OP .BS 1
|
2016-07-22 14:11:13 +00:00
|
|
|
|
SetPixel.Mode .BS 1
|
|
|
|
|
SetPixel.Color .BS 1
|
2017-06-09 15:36:05 +00:00
|
|
|
|
SetPixel.X .BS 2
|
|
|
|
|
SetPixel.Y .BS 2
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DrawLine1.CB .BS 1 hDC
|
2017-06-16 15:27:48 +00:00
|
|
|
|
.DA #0
|
|
|
|
|
.DA #S.CB.MODE.C16
|
|
|
|
|
.DA #1
|
|
|
|
|
.DA 80
|
|
|
|
|
.DA 191
|
|
|
|
|
.DA 80+191
|
|
|
|
|
.DA 0
|
2017-06-09 15:36:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
DrawLine2.CB .BS 1 hDC
|
2017-06-16 15:27:48 +00:00
|
|
|
|
.DA #0
|
|
|
|
|
.DA #S.CB.MODE.MONO
|
|
|
|
|
.DA #1
|
|
|
|
|
.DA 90
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 140
|
|
|
|
|
.DA 191
|
2017-06-15 15:36:25 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
DrawLine3.CB .BS 1 hDC
|
2017-06-16 15:27:48 +00:00
|
|
|
|
.DA #0
|
|
|
|
|
.DA #S.CB.MODE.MONO
|
|
|
|
|
.DA #1
|
|
|
|
|
.DA 100
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 100+191
|
|
|
|
|
.DA 191
|
2017-06-15 15:36:25 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
DrawLine4.CB .BS 1 hDC
|
2017-06-16 15:27:48 +00:00
|
|
|
|
.DA #0
|
|
|
|
|
.DA #S.CB.MODE.MONO
|
|
|
|
|
.DA #1
|
|
|
|
|
.DA 110
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 559
|
|
|
|
|
.DA 191
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DrawLine5.CB .BS 1 hDC
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA #S.CB.MODE.MONO
|
|
|
|
|
.DA #1
|
|
|
|
|
.DA 28
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 28
|
|
|
|
|
.DA 191
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DrawLine6.CB .BS 1 hDC
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA #S.CB.MODE.MONO
|
|
|
|
|
.DA #1
|
|
|
|
|
.DA 84
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 84
|
|
|
|
|
.DA 191
|
2015-03-23 07:28:03 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/SBIN/DESKTOP.S
|
2015-03-23 07:28:03 +00:00
|
|
|
|
ASM
|