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
|
|
|
|
|
*--------------------------------------
|
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
|
|
|
|
|
L.DEVNAME.GFX .DA DEVNAME.GFX
|
2015-06-03 18:30:57 +00:00
|
|
|
|
L.DEVNAME.MOUSE .DA DEVNAME.MOUSE
|
2015-03-23 07:28:03 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.INIT >LDYA L.DEVNAME.GFX
|
|
|
|
|
>SYSCALL SYS.GetDevByNameYA
|
|
|
|
|
bcc .10
|
|
|
|
|
rts
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.10 stx hDevGFX
|
|
|
|
|
>STYA pDevGFX
|
|
|
|
|
|
|
|
|
|
.11 >LDYA L.DEVNAME.MOUSE
|
|
|
|
|
>SYSCALL SYS.GetDevByNameYA
|
|
|
|
|
bcc .20
|
|
|
|
|
|
|
|
|
|
inc DEVNAME.MOUSE+4
|
|
|
|
|
lda DEVNAME.MOUSE+4
|
|
|
|
|
cmp #'8'
|
|
|
|
|
bne .11
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.20 stx hDevMouse
|
|
|
|
|
>STYA pDevMouse
|
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
ldx #DEVMGR.OPEN
|
|
|
|
|
jsr GoDevMouse
|
|
|
|
|
bcs *
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldx #DEVMGR.OPEN
|
|
|
|
|
jsr GoDevGFX
|
|
|
|
|
bcs *
|
2015-03-23 07:28:03 +00:00
|
|
|
|
|
2015-11-23 14:54:30 +00:00
|
|
|
|
lda #A2osX.SCREENS.G
|
|
|
|
|
>SYSCALL SYS.ScreenSelectA
|
|
|
|
|
|
|
|
|
|
* jmp .8
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
lda #15
|
|
|
|
|
sta C
|
2015-03-23 07:28:03 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sta Y
|
|
|
|
|
|
|
|
|
|
.1 lda #0
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta X
|
2015-11-29 22:19:10 +00:00
|
|
|
|
lda /0
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta X+1
|
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.2 >PUSHB C
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2015-03-23 07:28:03 +00:00
|
|
|
|
>PUSHB Y
|
|
|
|
|
>PUSHW X
|
2015-06-03 18:30:57 +00:00
|
|
|
|
>PUSHBI 2 Mode:1=B/W,2=16 colors,...,128=XOR
|
|
|
|
|
|
|
|
|
|
ldx #DEVMGR.GFX.SETPIXEL
|
|
|
|
|
jsr GoDevGFX
|
2015-03-23 07:28:03 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
lda X
|
2015-03-23 07:28:03 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #4
|
|
|
|
|
sta X
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcc .3
|
2015-03-23 07:28:03 +00:00
|
|
|
|
inc X+1
|
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.3 lda X
|
|
|
|
|
sec
|
|
|
|
|
sbc #559
|
2015-03-23 07:28:03 +00:00
|
|
|
|
lda X+1
|
2015-11-29 22:19:10 +00:00
|
|
|
|
sbc /559
|
|
|
|
|
bcc .2
|
|
|
|
|
|
|
|
|
|
.4 inc Y
|
|
|
|
|
lda Y
|
|
|
|
|
cmp #192
|
|
|
|
|
beq .8
|
|
|
|
|
and #$7
|
|
|
|
|
bne .1
|
|
|
|
|
dec C
|
|
|
|
|
bpl .1
|
|
|
|
|
lda #15
|
|
|
|
|
sta C
|
|
|
|
|
bra .1
|
2015-03-23 07:28:03 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.8 lda (pPs)
|
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
|
|
|
|
sta (pPs)
|
|
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.DOEVENT ldy #S.EVT.hDEV
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
|
|
|
|
|
cmp hDevMouse
|
|
|
|
|
bne .99
|
|
|
|
|
|
|
|
|
|
lda (pEvent)
|
|
|
|
|
and #S.EVT.F.MOUSE
|
|
|
|
|
beq .99
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATALO
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
and #4 mouse move
|
|
|
|
|
beq .99
|
|
|
|
|
|
|
|
|
|
>PUSHBI 15 COLOR
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATAW2
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
>PUSHA Y
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (pEvent),y X.HI
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
>PUSHA X.LO
|
|
|
|
|
|
|
|
|
|
>PUSHBI 2 Mode:1=B/W,2=16 colors,...,128=XOR
|
|
|
|
|
ldx #DEVMGR.GFX.SETPIXEL
|
|
|
|
|
jsr GoDevGFX
|
|
|
|
|
|
|
|
|
|
clc
|
2015-03-23 07:28:03 +00:00
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
.99 sec
|
|
|
|
|
rts
|
2015-03-23 07:28:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.QUIT clc
|
|
|
|
|
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"
|
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
|
2015-03-23 07:28:03 +00:00
|
|
|
|
X .BS 2
|
|
|
|
|
Y .BS 1
|
|
|
|
|
C .BS 1
|
|
|
|
|
MAN
|
2015-11-29 22:19:10 +00:00
|
|
|
|
SAVE SBIN/DESKTOP.S
|
2015-03-23 07:28:03 +00:00
|
|
|
|
ASM
|