Kernel version 0.9 : Mouse.DRV Migration

This commit is contained in:
Rémy GIBERT 2017-01-27 17:26:09 +01:00
parent 3fdde86098
commit 9c457ceed4
10 changed files with 163 additions and 74 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -798,7 +798,7 @@ EscSeqParam .BS 4
STAT .DA #S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ STAT .DA #S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
.DA #0,#0,#0 .DA #0,#0,#0
>PSTR "ANSI 80c Console" >PSTR "ANSI 80c Console"
.DA #0 .DA #S.DEVSTAT.TYPE.CHAR
.DA #0 .DA #0
.DA $0900 .DA $0900
*-------------------------------------- *--------------------------------------

View File

@ -9,8 +9,8 @@ AUTO 6
.TF /A2OSX.BOOT/DRV/MOUSE.DRV .TF /A2OSX.BOOT/DRV/MOUSE.DRV
*-------------------------------------- *--------------------------------------
.INB /A2OSX.DEV/INC/MACROS.I .INB /A2OSX.DEV/INC/MACROS.I
.INB /A2OSX.DEV/INC/IO.I
.INB /A2OSX.DEV/INC/A2OSX.I .INB /A2OSX.DEV/INC/A2OSX.I
.INB /A2OSX.DEV/INC/PRODOS.I
*-------------------------------------- *--------------------------------------
ZPGoMouse .EQ ZPDRV ZPGoMouse .EQ ZPDRV
ZPTmpPtr1 .EQ ZPDRV+2 ZPTmpPtr1 .EQ ZPDRV+2
@ -38,10 +38,20 @@ MOUSEXLOx .EQ $0478
MOUSEYLOx .EQ $04F8 MOUSEYLOx .EQ $04F8
MOUSEXHIx .EQ $0578 MOUSEXHIx .EQ $0578
MOUSEYHIx .EQ $05F8 MOUSEYHIx .EQ $05F8
* .EQ $0678
* .EQ $06F8
MOUSESTSx .EQ $0778 MOUSESTSx .EQ $0778
MOUSESTSx.DOWN .EQ %10000000 MOUSESTSx.DOWN .EQ %10000000
MOUSESTSx.LDOWN .EQ %01000000 MOUSESTSx.LDOWN .EQ %01000000
MOUSESTSx.MOVED .EQ %00100000 MOUSESTSx.MOVED .EQ %00100000
MOUSESTSx.INTVBL .EQ %00001000
MOUSESTSx.INTBUT .EQ %00000100
MOUSESTSx.INTMOVE .EQ %00000010
MOUSEMODx .EQ $07F8
MOUSEMODx.INTVBL .EQ %00001000
MOUSEMODx.INTBUT .EQ %00000100
MOUSEMODx.INTMOVE .EQ %00000010
MOUSEMODx.ACTIVE .EQ %00000001
*-------------------------------------- *--------------------------------------
* File Header (16 Bytes) * File Header (16 Bytes)
*-------------------------------------- *--------------------------------------
@ -70,7 +80,7 @@ Dev.Detect >LDYA L.MSG.DETECT
lda #$C1 lda #$C1
sta ZPTmpPtr1+1 sta ZPTmpPtr1+1
.1 ldx #DEVSIG.Length-1 .1 ldx #DEVSIG.Value-DEVSIG.Offset-1
.2 ldy DEVSIG.Offset,x .2 ldy DEVSIG.Offset,x
lda (ZPTmpPtr1),y lda (ZPTmpPtr1),y
@ -88,7 +98,7 @@ Dev.Detect >LDYA L.MSG.DETECT
>LDYA L.MSG.DETECT.KO >LDYA L.MSG.DETECT.KO
>SYSCALL CPrintFYA >SYSCALL CPrintFYA
lda #DEVMGR.ERRNOHW Not Found in any slot, exiting lda #MLI.ERR.NODEV
sec sec
rts rts
@ -116,36 +126,46 @@ MSG.DETECT.OK >CSTR "Mouse Installed As Device : %S\n"
MSG.DETECT.KO >CSTR "No Mouse Found.\n" MSG.DETECT.KO >CSTR "No Mouse Found.\n"
DEVSIG.Offset .HS 05070B0CFB DEVSIG.Offset .HS 05070B0CFB
DEVSIG.Value .HS 38180120D6 DEVSIG.Value .HS 38180120D6
DEVSIG.Length .EQ DEVSIG.Value-DEVSIG.Offset
*-------------------------------------- *--------------------------------------
* Device Header (16 Bytes) * Device Header (16 Bytes)
*-------------------------------------- *--------------------------------------
DEV.HEADER cld DEV.HEADER .DA DRV.CS.START
jmp (DRV.CS.START,x) .DA #0
.HS 00 DevID DEV.HEADER.NAME >PSTR "MOUx"
.DA #S.DEV.F.EVENT
DEV.HEADER.NAME >PSTR "MOU1" NAME
.HS 00
.HS 00.00.00.00
*-------------------------------------- *--------------------------------------
* Driver Code * Driver Code
*-------------------------------------- *--------------------------------------
DRV.CS.START .DA OPEN DRV.CS.START cld
.DA GETEVENT jmp (.1,x)
.DA COUT .1 .DA STATUS
.DA READBLOCK
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA OPEN
.DA CLOSE .DA CLOSE
.DA GETINFO .DA BADCALL
.DA IRQ .DA BADCALL
.DA SELECT L.DEVSTAT .DA DEVSTAT
L.DEVINFO .DA DEVINFO L.READBLOCK.FLAGS .DA READBLOCK.FLAGS
.DA 0 end or relocation .DA 0 end or relocation
*-------------------------------------- *--------------------------------------
OPEN BADCALL lda #MLI.ERR.BADCALL
* bit RROMBNK2 Renable ROM to allow MOUSE II firmware sec
rts
php to read IIe ROM ID bytes *--------------------------------------
STATUS >LDYA L.DEVSTAT
clc
rts
*--------------------------------------
OPEN php to read IIe ROM ID bytes
sei sei
lda #1 Enable, Polling mode
ldx DEVSLOT0n
lda MOUSEMODx,x keep if VBLInt already activated by kernel
and #MOUSEMODx.INTVBL
ora #MOUSEMODx.ACTIVE Enable, Polling mode
ldy #SETMOUSE ldy #SETMOUSE
jsr GOMOUSE jsr GOMOUSE
@ -182,18 +202,15 @@ OPEN
clc clc
rts rts
*-------------------------------------- *--------------------------------------
GETEVENT lda A2osX.ASCREEN READBLOCK php
cmp #3 is DHGR screen active?
bne .9
php
sei sei
ldy #READMOUSE ldy #READMOUSE
jsr GOMOUSE jsr GOMOUSE
stz READBLOCK.FLAGS
ldx DEVSLOT0n ldx DEVSLOT0n
ldy #S.EVT.DATALO
lda MOUSESTSx,x lda MOUSESTSx,x
and #MOUSESTSx.DOWN+MOUSESTSx.LDOWN and #MOUSESTSx.DOWN+MOUSESTSx.LDOWN
@ -209,61 +226,50 @@ GETEVENT lda A2osX.ASCREEN
.1 lda #EVENT.MOUSEDOWN .1 lda #EVENT.MOUSEDOWN
.2 sta (pEvent),y .2 sta READBLOCK.FLAGS
.3 lda MOUSESTSx,x .3 lda MOUSESTSx,x
and #MOUSESTSx.MOVED and #MOUSESTSx.MOVED
beq .4 beq .4
lda (pEvent),y lda READBLOCK.FLAGS
ora #EVENT.MOUSEMOVE ora #EVENT.MOUSEMOVE
sta (pEvent),y sta READBLOCK.FLAGS
.4 ldy #S.EVT.DATAW1 .4 lda MOUSEXLOx,x
lda MOUSEXLOx,x sta READBLOCK.XY
sta (pEvent),y
iny
lda MOUSEXHIx,x lda MOUSEXHIx,x
sta (pEvent),y sta READBLOCK.XY+1
iny
lda MOUSEYLOx,x lda MOUSEYLOx,x
sta (pEvent),y sta READBLOCK.XY+2
iny
lda MOUSEYHIx,x lda MOUSEYHIx,x
sta (pEvent),y sta READBLOCK.XY+3
plp plp
ldy #S.EVT.DATALO
lda (pEvent),y
lda READBLOCK.FLAGS
beq .9 beq .9
lda #S.EVT.F.MOUSE
sta (pEvent)
clc clc
rts rts
.9 lda #0 Error = no event .9 lda #MLI.ERR.EOF
sec
rts
*--------------------------------------
COUT
IRQ
SELECT lda #DEVMGR.ERRUNSUP
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CLOSE php CLOSE php
sei sei
lda #0 Disable ldx DEVSLOT0n
lda MOUSEMODx,x keep if VBLInt already activated by kernel
and #MOUSEMODx.INTVBL Disable ALL but VBLInt if previously active
ldy #SETMOUSE ldy #SETMOUSE
jsr GOMOUSE jsr GOMOUSE
plp plp
clc clc
rts rts
*-------------------------------------- *--------------------------------------
GETINFO >LDYA L.DEVINFO * PRIVATE
clc
rts
*-------------------------------------- *--------------------------------------
GOMOUSE pha GOMOUSE pha
stz ZPGoMouse stz ZPGoMouse
@ -280,7 +286,17 @@ DEVSLOT0n .BS 1
DEVSLOTn0 .BS 1 DEVSLOTn0 .BS 1
DEVSLOTCn .BS 1 DEVSLOTCn .BS 1
*-------------------------------------- *--------------------------------------
DEVINFO .DA #S.DEVINFO.TYPE.XY DEVSTAT .DA #0
.DA #0,#0,#0 size
>PSTR "Apple II Mouse"
.BS 2
.DA #S.DEVSTAT.TYPE.XY
.DA #0
.DA $0900
*--------------------------------------
READBLOCK.FLAGS .BS 1
READBLOCK.XY .BS 4
*--------------------------------------
MAN MAN
SAVE DRV/MOUSE.DRV.S SAVE DRV/MOUSE.DRV.S
ASM ASM

View File

@ -459,6 +459,8 @@ S.DEVSTAT.TYPE.PRINTER .EQ $0D Printer
S.DEVSTAT.TYPE.CLOCK .EQ $0E Clock S.DEVSTAT.TYPE.CLOCK .EQ $0E Clock
S.DEVSTAT.TYPE.MODEM .EQ $0F Modem S.DEVSTAT.TYPE.MODEM .EQ $0F Modem
S.DEVSTAT.TYPE.NET .EQ $10 Network board S.DEVSTAT.TYPE.NET .EQ $10 Network board
S.DEVSTAT.TYPE.XY .EQ $11 X,Y Pointing Device
S.DEVSTAT.TYPE.CHAR .EQ $12
S.DEVSTAT.SUBTYPE .EQ 22 S.DEVSTAT.SUBTYPE .EQ 22
S.DEVSTAT.SUBTYPE.EXT .EQ $80 S.DEVSTAT.SUBTYPE.EXT .EQ $80
S.DEVSTAT.SUBTYPE.DSKSW .EQ $40 S.DEVSTAT.SUBTYPE.DSKSW .EQ $40

View File

@ -76,9 +76,9 @@ In Progress : moving TCPIP to socket API
| INSDRV | Working | | 0.9 | | INSDRV | Working | | 0.9 |
| GETTY | Working | | 0.9 | | GETTY | Working | | 0.9 |
| LOGIN | In Progress | no auth using /etc/passd yet | 0.9 | | LOGIN | In Progress | no auth using /etc/passd yet | 0.9 |
| SHELL | Working | (See Internal Shell commands) | 0.9 |
| TCPIP | In Progress | New Socket API. ARP,IP,ICMP,UDP ok, TCP in progress | 0.9 | | TCPIP | In Progress | New Socket API. ARP,IP,ICMP,UDP ok, TCP in progress | 0.9 |
| DHCPCLNT | Working | rewritten to use new Socket API | 0.9 | | DHCPCLNT | Working | rewritten to use new Socket API | 0.9 |
| SHELL | Working | (See Internal Shell commands) | 0.9 |
| TELNETD | | | | | TELNETD | | | |
| HTTPD | | | | | HTTPD | | | |
@ -118,12 +118,12 @@ note : '$VAR' does NOT expand Variable
| PIC.DRV | In Progress | Apple "Parallel Interface Card" Driver, renamed from PPIC.DRV | 0.8 | | PIC.DRV | In Progress | Apple "Parallel Interface Card" Driver, renamed from PPIC.DRV | 0.8 |
| SSC.DRV | In Progress | Apple "Super Serial Card" Driver | 0.8 | | SSC.DRV | In Progress | Apple "Super Serial Card" Driver | 0.8 |
| SSC.I.DRV | In Progress | Apple "Super Serial Card" Driver (IRQ enabled) | 0.8 | | SSC.I.DRV | In Progress | Apple "Super Serial Card" Driver (IRQ enabled) | 0.8 |
| Mouse.DRV | Working | | 0.8 | | Mouse.DRV | Working | Apple Mouse Card,//c Mouse Port | 0.9 |
| DHGR.DRV | In Progress | except bitblt... | 0.8 | | DHGR.DRV | In Progress | except bitblt... | 0.8 |
| LanCeGS.DRV | Working | | 0.8 |
| Uthernet.DRV | Working | | 0.9 | | Uthernet.DRV | Working | | 0.9 |
| Uthernet2.DRV | Working | | 0.8 | | Uthernet2.DRV | Working | | 0.8 |
| Uther2.AI.DRV | In Progress | With ARP/IP Offloading | 0.8 | | Uther2.AI.DRV | In Progress | With ARP/IP Offloading | 0.8 |
| LanCeGS.DRV | Working | | 0.8 |
## BIN,External Shell commands: ## BIN,External Shell commands:
| Name | Status | Comment | K.Ver | | Name | Status | Comment | K.Ver |

View File

@ -7,6 +7,8 @@ AUTO 6
*-------------------------------------- *--------------------------------------
DevMgr.SYS.BASL0 .EQ $800 DevMgr.SYS.BASL0 .EQ $800
*-------------------------------------- *--------------------------------------
DevMgr.LoMem .EQ *
*--------------------------------------
DevMgr.NUL.Code cld DevMgr.NUL.Code cld
jmp (.1,x) jmp (.1,x)
.1 .DA DevMgr.NUL.Status .1 .DA DevMgr.NUL.Status
@ -29,8 +31,8 @@ DevMgr.NUL.Status
*-------------------------------------- *--------------------------------------
DevMgr.NUL.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ DevMgr.NUL.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
.DA #0,#0,#0 .DA #0,#0,#0
>PSTR "NUL DEVICE " >PSTR "NULL DEVICE "
.DA #0 .DA #S.DEVSTAT.TYPE.CHAR
.DA #0 .DA #0
.DA $0900 .DA $0900
*-------------------------------------- *--------------------------------------
@ -59,7 +61,7 @@ DevMgr.SYS.Status
DevMgr.SYS.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ DevMgr.SYS.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
.DA #0,#0,#0 .DA #0,#0,#0
>PSTR "A2osX SYS Screen" >PSTR "A2osX SYS Screen"
.DA #0 .DA #S.DEVSTAT.TYPE.CHAR
.DA #0 .DA #0
.DA $0900 .DA $0900
*-------------------------------------- *--------------------------------------
@ -289,7 +291,7 @@ DevMgr.SYS.TITLE >CSTR "A2osX System Screen"
DevMgr.SYS.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0 DevMgr.SYS.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
DevMgr.SYS.BASEH .HS 08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B DevMgr.SYS.BASEH .HS 08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B
*-------------------------------------- *--------------------------------------
DevMgr.LoMem .EQ * DevMgr.FreeMem .EQ *
MAN MAN
SAVE SYS/KERNEL.S.D01 SAVE SYS/KERNEL.S.D01
LOAD SYS/KERNEL.S LOAD SYS/KERNEL.S

View File

@ -5,8 +5,8 @@ INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
DevMgr.Stat .DA DevMgr.LoMem Lomem DevMgr.Stat .DA DevMgr.LoMem
DevMgr.Free .DA DevMgr.LoMem Free DevMgr.Free .DA DevMgr.FreeMem
.DA DevMgr.HiMem .DA DevMgr.HiMem
DevMgr.Count .DA #2 NUL,SYS DevMgr.Count .DA #2 NUL,SYS
*-------------------------------------- *--------------------------------------

View File

@ -143,13 +143,16 @@ DevMgr.SYS .DA DevMgr.SYS.Code
* Setup AuxLC $FFFE->Kernel IRQ Handler * Setup AuxLC $FFFE->Kernel IRQ Handler
* if irq not handled, jmp (S.IrqMgrOldFFFE) * if irq not handled, jmp (S.IrqMgrOldFFFE)
*-------------------------------------- *--------------------------------------
SETMOUSE .EQ $12 Sets mouse mode
INITMOUSE .EQ $19 Resets mouse clamps to default values,sets mouse position to 0,0
MOUSEMODx.INTVBL .EQ %00001000
*--------------------------------------
IrqMgrInit php IrqMgrInit php
sei sei
>LDYA $FFFE >LDYA $FFFE
>STYA K.IrqMgrOldFFFE >STYA K.IrqMgrOldFFFE
>LDYAI K.IrqHandlerAuxLC >LDYAI K.IrqHandlerAuxLC
>STYA $FFFE >STYA $FFFE
plp
>LDYAI IrqHandler >LDYAI IrqHandler
>STYA MLICALL.PARAMS+2 >STYA MLICALL.PARAMS+2
@ -159,7 +162,73 @@ IrqMgrInit php
lda MLICALL.PARAMS+1 lda MLICALL.PARAMS+1
sta ProDOS.INTNUM sta ProDOS.INTNUM
.9 rts stz ZPPtr1 Try finding a Mouse Card...
lda #$C1
sta ZPPtr1+1
.1 ldx #DEVSIG.Value-DEVSIG.Offset-1
.2 ldy DEVSIG.Offset,x
lda (ZPPtr1),y
cmp DEVSIG.Value,x
bne .3
dex
bpl .2
bra .4
.3 inc ZPPtr1+1 no match, try next slot....
lda ZPPtr1+1
cmp #$C8
bne .1
.8 plp
clc
rts
.9 plp
sec
rts
.4 lda ZPPtr1+1
sta DEVSLOTCn
and #$0F
sta DEVSLOT0n
asl
asl
asl
asl
sta DEVSLOTn0
ldx DEVSLOT0n
lda #MOUSEMODx.INTVBL
ldy #SETMOUSE
jsr GOMOUSE
bit RROMBNK2 Renable ROM to allow MOUSE II firmware
ldy #INITMOUSE Reset
jsr GOMOUSE
bit RRAMWRAMBNK1 Back To LC Ram
bit RRAMWRAMBNK1
bra .8
GOMOUSE pha
stz ZPPtr1
ldx DEVSLOTCn
stx ZPPtr1+1
lda (ZPPtr1),y
sta ZPPtr1
ldy DEVSLOTn0
pla
jmp (ZPPtr1)
*--------------------------------------
DEVSIG.Offset .HS 05070B0CFB
DEVSIG.Value .HS 38180120D6
DEVSLOT0n .BS 1
DEVSLOTn0 .BS 1
DEVSLOTCn .BS 1
*-------------------------------------- *--------------------------------------
DevMgrInit stz ZPPtr1 DevMgrInit stz ZPPtr1
lda #$C1 lda #$C1