A2osX/SBIN/DESKTOP.S.txt

185 lines
3.0 KiB
Plaintext
Raw Normal View History

PR#3
2015-06-03 18:30:57 +00:00
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
.OP 65C02
.OR $2000
.TF /A2OSX.BOOT/SBIN/DESKTOP
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
*--------------------------------------
2015-06-03 18:30:57 +00:00
* File Header (16 Bytes)
*--------------------------------------
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
*--------------------------------------
.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
.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
ldx #DEVMGR.OPEN
jsr GoDevMouse
bcs *
2015-06-03 18:30:57 +00:00
ldx #DEVMGR.OPEN
jsr GoDevGFX
bcs *
lda #A2osX.SCREENS.G
>SYSCALL SYS.ScreenSelectA
* jmp .8
2015-06-03 18:30:57 +00:00
lda #15
sta C
lda #0
sta Y
.1 lda #0
2015-06-03 18:30:57 +00:00
sta X
lda /0
2015-06-03 18:30:57 +00:00
sta X+1
.2 >PUSHB C
2015-06-03 18:30:57 +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
lda X
clc
adc #4
sta X
bcc .3
inc X+1
.3 lda X
sec
sbc #559
lda X+1
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-06-03 18:30:57 +00:00
.8 lda (pPs)
ora #S.PS.F.EVENT Now accept events
sta (pPs)
clc
2015-06-03 18:30:57 +00:00
rts
*--------------------------------------
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
rts
2015-06-03 18:30:57 +00:00
.99 sec
rts
*--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
2015-06-03 18:30:57 +00:00
GoDevGFX jmp (pDevGFX)
GoDevMouse jmp (pDevMouse)
*--------------------------------------
CS.END
DEVNAME.GFX >PSTRING "GFX"
2015-06-03 18:30:57 +00:00
DEVNAME.MOUSE >PSTRING "MOU1"
hDevGFX .BS 1
2015-06-03 18:30:57 +00:00
pDevGFX .BS 2
hDevMouse .BS 1
pDevMouse .BS 2
X .BS 2
Y .BS 1
C .BS 1
MAN
SAVE SBIN/DESKTOP.S
ASM