mirror of
https://github.com/A2osX/A2osX.git
synced 2024-06-09 00:29:28 +00:00
Start Implementing Mouse Support
This commit is contained in:
parent
f1135c8478
commit
87bb6efe1f
BIN
A2OSX.BUILD.HDV
BIN
A2OSX.BUILD.HDV
Binary file not shown.
|
@ -18,5 +18,6 @@ EXEC DHCPCLNT
|
||||||
*EXEC TELNETD
|
*EXEC TELNETD
|
||||||
*MOUNT TFTP 192.168.1.5:/AO2SX /TFTP
|
*MOUNT TFTP 192.168.1.5:/AO2SX /TFTP
|
||||||
LOAD DHGR.DRV
|
LOAD DHGR.DRV
|
||||||
|
LOAD MOUSE.DRV
|
||||||
MAN
|
MAN
|
||||||
TEXT A2OSX.STARTUP
|
TEXT A2OSX.STARTUP
|
||||||
|
|
151
DRV/MOUSE.DRV.S.txt
Normal file
151
DRV/MOUSE.DRV.S.txt
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
PR#3
|
||||||
|
PREFIX /A2OSX.BUILD
|
||||||
|
NEW
|
||||||
|
INC 1
|
||||||
|
AUTO 6
|
||||||
|
.LIST OFF
|
||||||
|
.OP 65C02
|
||||||
|
.OR $2000
|
||||||
|
.TF DRV/MOUSE.DRV
|
||||||
|
*--------------------------------------
|
||||||
|
.INB INC/MACROS.I
|
||||||
|
.INB INC/A2OSX.I
|
||||||
|
*--------------------------------------
|
||||||
|
ZPGoMouse .EQ ZPDRV
|
||||||
|
ZPTmpPtr1 .EQ ZPDRV+2
|
||||||
|
*--------------------------------------
|
||||||
|
SETMOUSE .EQ $12 Sets mouse mode
|
||||||
|
SERVEMOUSE .EQ $13 Services mouse interrupt
|
||||||
|
READMOUSE .EQ $14 Reads mouse position
|
||||||
|
CLEARMOUSE .EQ $15 Clears mouse position to 0 (for delta mode)
|
||||||
|
POSMOUSE .EQ $16 Sets mouse position to a user-defined pos
|
||||||
|
CLAMPMOUSE .EQ $17 Sets mouse bounds in a window
|
||||||
|
HOMEMOUSE .EQ $18 Sets mouse to upper-left corner of clamp win
|
||||||
|
INITMOUSE .EQ $19 Resets mouse clamps to default values,sets mouse position to 0,0
|
||||||
|
XCLAMPLO .EQ $0478 low byte of low clamp.
|
||||||
|
XCLAMPHI .EQ $04F8 low byte of high clamp.
|
||||||
|
YCLAMPLO .EQ $0578 high byte of low clamp.
|
||||||
|
YCLAMPHI .EQ $05F8 high byte of high clamp.
|
||||||
|
*--------------------------------------
|
||||||
|
* Main DRV entry point
|
||||||
|
* input :
|
||||||
|
* X = CMD
|
||||||
|
* 0 : OPEN
|
||||||
|
* 2 : GETEVENT
|
||||||
|
* 4 : OUT
|
||||||
|
* 6 : CLOSE
|
||||||
|
*--------------------------------------
|
||||||
|
* CLD $D8
|
||||||
|
* JMP (*,x) $7C
|
||||||
|
* #JMPTABLE
|
||||||
|
* /JMPTABLE
|
||||||
|
*--------------------------------------
|
||||||
|
CS.START cld
|
||||||
|
jmp (.1,x)
|
||||||
|
.1 .DA OPEN
|
||||||
|
.DA GETEVENT
|
||||||
|
.DA OUT
|
||||||
|
.DA CLOSE
|
||||||
|
.DA 0 end or relocation
|
||||||
|
.DA CS.END-CS.START
|
||||||
|
*--------------------------------------
|
||||||
|
OPEN stz ZPTmpPtr1
|
||||||
|
lda #$C1
|
||||||
|
sta ZPTmpPtr1+1
|
||||||
|
|
||||||
|
.1 ldx #DEVSIG.Length-1
|
||||||
|
|
||||||
|
.2 ldy DEVSIG.Offset,x
|
||||||
|
lda (ZPTmpPtr1),y
|
||||||
|
cmp DEVSIG.Value,x
|
||||||
|
beq .3
|
||||||
|
|
||||||
|
inc ZPTmpPtr1+1 no match, try next slot....
|
||||||
|
lda ZPTmpPtr1+1
|
||||||
|
cmp #$C8
|
||||||
|
bne .1
|
||||||
|
beq .99 Not Found in any slot, exiting
|
||||||
|
|
||||||
|
.3 dex
|
||||||
|
bpl .2
|
||||||
|
|
||||||
|
lda ZPTmpPtr1+1
|
||||||
|
and #$0F
|
||||||
|
pha
|
||||||
|
ora #$30
|
||||||
|
sta DEVNAME+4
|
||||||
|
pla
|
||||||
|
ora #$C0
|
||||||
|
sta DEVSLOTCn
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
sta DEVSLOTn0
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
ldy #S.DEV.NAME
|
||||||
|
|
||||||
|
.7 lda DEVNAME,x
|
||||||
|
sta (pDevContext),y
|
||||||
|
cpx DEVNAME
|
||||||
|
beq .8
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
bne .7
|
||||||
|
|
||||||
|
lda #1 Enable, Polling mode
|
||||||
|
ldy #SETMOUSE
|
||||||
|
jsr GOMOUSE
|
||||||
|
|
||||||
|
ldy #INITMOUSE Reset
|
||||||
|
jsr GOMOUSE
|
||||||
|
|
||||||
|
* lda #0 set X
|
||||||
|
* ldy #CLAMPMOUSE
|
||||||
|
* jsr GOMOUSE
|
||||||
|
|
||||||
|
* lda #1 set Y
|
||||||
|
* ldy #CLAMPMOUSE
|
||||||
|
* jsr GOMOUSE
|
||||||
|
|
||||||
|
.8 lda #S.DEV.F.MOUSE+S.DEV.F.EVENT
|
||||||
|
sta (pDevContext)
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.99 lda #DEVMGR.ERRNOHW
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
GETEVENT >PULLW pEvent
|
||||||
|
lda #0
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
OUT clc
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
CLOSE clc
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
GOMOUSE pha
|
||||||
|
stz ZPGoMouse
|
||||||
|
lda DEVSLOTCn
|
||||||
|
sta ZPGoMouse+1
|
||||||
|
lda (ZPGoMouse),y
|
||||||
|
sta ZPGoMouse
|
||||||
|
pla
|
||||||
|
jmp (ZPGoMouse)
|
||||||
|
*--------------------------------------
|
||||||
|
CS.END
|
||||||
|
DEVSIG.Offset .HS 05070B0CFB
|
||||||
|
DEVSIG.Value .HS 38180120D6
|
||||||
|
DEVSIG.Length .EQ DEVSIG.Value-DEVSIG.Offset
|
||||||
|
DEVNAME >PSTRING "MOU0"
|
||||||
|
DEVSLOTCn .BS 1
|
||||||
|
DEVSLOTn0 .BS 1
|
||||||
|
*--------------------------------------
|
||||||
|
MAN
|
||||||
|
SAVE DRV/MOUSE.DRV.S
|
||||||
|
ASM
|
|
@ -197,7 +197,7 @@ S.DEV.F .EQ 0
|
||||||
S.DEV.F.INUSE .EQ %10000000
|
S.DEV.F.INUSE .EQ %10000000
|
||||||
S.DEV.F.EVENT .EQ %01000000
|
S.DEV.F.EVENT .EQ %01000000
|
||||||
S.DEV.F.OUT .EQ %00100000
|
S.DEV.F.OUT .EQ %00100000
|
||||||
S.DEV.F.XYP .EQ %00010000
|
S.DEV.F.MOUSE .EQ %00010000
|
||||||
S.DEV.F.GFX .EQ %00001000
|
S.DEV.F.GFX .EQ %00001000
|
||||||
S.DEV.F.NET .EQ %00000100
|
S.DEV.F.NET .EQ %00000100
|
||||||
S.DEV.F.BLOCK .EQ %00000010
|
S.DEV.F.BLOCK .EQ %00000010
|
||||||
|
|
Loading…
Reference in New Issue
Block a user