A2osX/SBIN/DESKTOP.S.txt
Rémy GIBERT 6ae2016154 Added ANSI support in CONSOLE.DRV
for EDIT.S.txt
2015-11-29 23:19:10 +01:00

185 lines
3.0 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

PR#3
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
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.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
L.DEVNAME.MOUSE .DA DEVNAME.MOUSE
.DA 0
*--------------------------------------
CS.INIT >LDYA L.DEVNAME.GFX
>SYSCALL SYS.GetDevByNameYA
bcc .10
rts
.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 *
ldx #DEVMGR.OPEN
jsr GoDevGFX
bcs *
lda #A2osX.SCREENS.G
>SYSCALL SYS.ScreenSelectA
* jmp .8
lda #15
sta C
lda #0
sta Y
.1 lda #0
sta X
lda /0
sta X+1
.2 >PUSHB C
>PUSHB Y
>PUSHW X
>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
.8 lda (pPs)
ora #S.PS.F.EVENT Now accept events
sta (pPs)
clc
rts
*--------------------------------------
CS.RUN clc
rts
*--------------------------------------
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
.99 sec
rts
*--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
GoDevGFX jmp (pDevGFX)
GoDevMouse jmp (pDevMouse)
*--------------------------------------
CS.END
DEVNAME.GFX >PSTRING "GFX"
DEVNAME.MOUSE >PSTRING "MOU1"
hDevGFX .BS 1
pDevGFX .BS 2
hDevMouse .BS 1
pDevMouse .BS 2
X .BS 2
Y .BS 1
C .BS 1
MAN
SAVE SBIN/DESKTOP.S
ASM