mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-27 02:32:51 +00:00
Kernel version 0.9 : Mouse.DRV Migration
This commit is contained in:
parent
3fdde86098
commit
9c457ceed4
BIN
A2OSX.BOOT.po
BIN
A2OSX.BOOT.po
Binary file not shown.
BIN
A2OSX.DEV.po
BIN
A2OSX.DEV.po
Binary file not shown.
BIN
A2OSX.SRC.po
BIN
A2OSX.SRC.po
Binary file not shown.
@ -798,7 +798,7 @@ EscSeqParam .BS 4
|
||||
STAT .DA #S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
|
||||
.DA #0,#0,#0
|
||||
>PSTR "ANSI 80c Console"
|
||||
.DA #0
|
||||
.DA #S.DEVSTAT.TYPE.CHAR
|
||||
.DA #0
|
||||
.DA $0900
|
||||
*--------------------------------------
|
||||
|
@ -9,8 +9,8 @@ AUTO 6
|
||||
.TF /A2OSX.BOOT/DRV/MOUSE.DRV
|
||||
*--------------------------------------
|
||||
.INB /A2OSX.DEV/INC/MACROS.I
|
||||
.INB /A2OSX.DEV/INC/IO.I
|
||||
.INB /A2OSX.DEV/INC/A2OSX.I
|
||||
.INB /A2OSX.DEV/INC/PRODOS.I
|
||||
*--------------------------------------
|
||||
ZPGoMouse .EQ ZPDRV
|
||||
ZPTmpPtr1 .EQ ZPDRV+2
|
||||
@ -38,10 +38,20 @@ MOUSEXLOx .EQ $0478
|
||||
MOUSEYLOx .EQ $04F8
|
||||
MOUSEXHIx .EQ $0578
|
||||
MOUSEYHIx .EQ $05F8
|
||||
* .EQ $0678
|
||||
* .EQ $06F8
|
||||
MOUSESTSx .EQ $0778
|
||||
MOUSESTSx.DOWN .EQ %10000000
|
||||
MOUSESTSx.LDOWN .EQ %01000000
|
||||
MOUSESTSx.MOVED .EQ %00100000
|
||||
MOUSESTSx.DOWN .EQ %10000000
|
||||
MOUSESTSx.LDOWN .EQ %01000000
|
||||
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)
|
||||
*--------------------------------------
|
||||
@ -70,7 +80,7 @@ Dev.Detect >LDYA L.MSG.DETECT
|
||||
lda #$C1
|
||||
sta ZPTmpPtr1+1
|
||||
|
||||
.1 ldx #DEVSIG.Length-1
|
||||
.1 ldx #DEVSIG.Value-DEVSIG.Offset-1
|
||||
|
||||
.2 ldy DEVSIG.Offset,x
|
||||
lda (ZPTmpPtr1),y
|
||||
@ -88,7 +98,7 @@ Dev.Detect >LDYA L.MSG.DETECT
|
||||
>LDYA L.MSG.DETECT.KO
|
||||
>SYSCALL CPrintFYA
|
||||
|
||||
lda #DEVMGR.ERRNOHW Not Found in any slot, exiting
|
||||
lda #MLI.ERR.NODEV
|
||||
sec
|
||||
rts
|
||||
|
||||
@ -116,36 +126,46 @@ MSG.DETECT.OK >CSTR "Mouse Installed As Device : %S\n"
|
||||
MSG.DETECT.KO >CSTR "No Mouse Found.\n"
|
||||
DEVSIG.Offset .HS 05070B0CFB
|
||||
DEVSIG.Value .HS 38180120D6
|
||||
DEVSIG.Length .EQ DEVSIG.Value-DEVSIG.Offset
|
||||
*--------------------------------------
|
||||
* Device Header (16 Bytes)
|
||||
*--------------------------------------
|
||||
DEV.HEADER cld
|
||||
jmp (DRV.CS.START,x)
|
||||
.HS 00 DevID
|
||||
.DA #S.DEV.F.EVENT
|
||||
DEV.HEADER.NAME >PSTR "MOU1" NAME
|
||||
.HS 00
|
||||
.HS 00.00.00.00
|
||||
DEV.HEADER .DA DRV.CS.START
|
||||
.DA #0
|
||||
DEV.HEADER.NAME >PSTR "MOUx"
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
DRV.CS.START .DA OPEN
|
||||
.DA GETEVENT
|
||||
.DA COUT
|
||||
DRV.CS.START cld
|
||||
jmp (.1,x)
|
||||
.1 .DA STATUS
|
||||
.DA READBLOCK
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA OPEN
|
||||
.DA CLOSE
|
||||
.DA GETINFO
|
||||
.DA IRQ
|
||||
.DA SELECT
|
||||
L.DEVINFO .DA DEVINFO
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
L.DEVSTAT .DA DEVSTAT
|
||||
L.READBLOCK.FLAGS .DA READBLOCK.FLAGS
|
||||
.DA 0 end or relocation
|
||||
*--------------------------------------
|
||||
OPEN
|
||||
* bit RROMBNK2 Renable ROM to allow MOUSE II firmware
|
||||
|
||||
php to read IIe ROM ID bytes
|
||||
BADCALL lda #MLI.ERR.BADCALL
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
STATUS >LDYA L.DEVSTAT
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
OPEN php to read IIe ROM ID bytes
|
||||
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
|
||||
jsr GOMOUSE
|
||||
|
||||
@ -182,18 +202,15 @@ OPEN
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
GETEVENT lda A2osX.ASCREEN
|
||||
cmp #3 is DHGR screen active?
|
||||
bne .9
|
||||
|
||||
php
|
||||
READBLOCK php
|
||||
sei
|
||||
|
||||
ldy #READMOUSE
|
||||
jsr GOMOUSE
|
||||
|
||||
stz READBLOCK.FLAGS
|
||||
|
||||
ldx DEVSLOT0n
|
||||
ldy #S.EVT.DATALO
|
||||
|
||||
lda MOUSESTSx,x
|
||||
and #MOUSESTSx.DOWN+MOUSESTSx.LDOWN
|
||||
@ -209,61 +226,50 @@ GETEVENT lda A2osX.ASCREEN
|
||||
|
||||
.1 lda #EVENT.MOUSEDOWN
|
||||
|
||||
.2 sta (pEvent),y
|
||||
.2 sta READBLOCK.FLAGS
|
||||
|
||||
.3 lda MOUSESTSx,x
|
||||
and #MOUSESTSx.MOVED
|
||||
beq .4
|
||||
|
||||
lda (pEvent),y
|
||||
lda READBLOCK.FLAGS
|
||||
ora #EVENT.MOUSEMOVE
|
||||
sta (pEvent),y
|
||||
sta READBLOCK.FLAGS
|
||||
|
||||
.4 ldy #S.EVT.DATAW1
|
||||
lda MOUSEXLOx,x
|
||||
sta (pEvent),y
|
||||
iny
|
||||
.4 lda MOUSEXLOx,x
|
||||
sta READBLOCK.XY
|
||||
lda MOUSEXHIx,x
|
||||
sta (pEvent),y
|
||||
iny
|
||||
sta READBLOCK.XY+1
|
||||
lda MOUSEYLOx,x
|
||||
sta (pEvent),y
|
||||
iny
|
||||
sta READBLOCK.XY+2
|
||||
lda MOUSEYHIx,x
|
||||
sta (pEvent),y
|
||||
|
||||
sta READBLOCK.XY+3
|
||||
|
||||
plp
|
||||
ldy #S.EVT.DATALO
|
||||
lda (pEvent),y
|
||||
|
||||
|
||||
lda READBLOCK.FLAGS
|
||||
beq .9
|
||||
|
||||
lda #S.EVT.F.MOUSE
|
||||
sta (pEvent)
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #0 Error = no event
|
||||
.9 lda #MLI.ERR.EOF
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
COUT
|
||||
IRQ
|
||||
SELECT lda #DEVMGR.ERRUNSUP
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
CLOSE php
|
||||
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
|
||||
jsr GOMOUSE
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
GETINFO >LDYA L.DEVINFO
|
||||
clc
|
||||
rts
|
||||
* PRIVATE
|
||||
*--------------------------------------
|
||||
GOMOUSE pha
|
||||
stz ZPGoMouse
|
||||
@ -280,7 +286,17 @@ DEVSLOT0n .BS 1
|
||||
DEVSLOTn0 .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
|
||||
SAVE DRV/MOUSE.DRV.S
|
||||
ASM
|
||||
|
@ -459,6 +459,8 @@ S.DEVSTAT.TYPE.PRINTER .EQ $0D Printer
|
||||
S.DEVSTAT.TYPE.CLOCK .EQ $0E Clock
|
||||
S.DEVSTAT.TYPE.MODEM .EQ $0F Modem
|
||||
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.EXT .EQ $80
|
||||
S.DEVSTAT.SUBTYPE.DSKSW .EQ $40
|
||||
|
@ -76,9 +76,9 @@ In Progress : moving TCPIP to socket API
|
||||
| INSDRV | Working | | 0.9 |
|
||||
| GETTY | Working | | 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 |
|
||||
| DHCPCLNT | Working | rewritten to use new Socket API | 0.9 |
|
||||
| SHELL | Working | (See Internal Shell commands) | 0.9 |
|
||||
| TELNETD | | | |
|
||||
| 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 |
|
||||
| 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 |
|
||||
| Mouse.DRV | Working | | 0.8 |
|
||||
| Mouse.DRV | Working | Apple Mouse Card,//c Mouse Port | 0.9 |
|
||||
| DHGR.DRV | In Progress | except bitblt... | 0.8 |
|
||||
| LanCeGS.DRV | Working | | 0.8 |
|
||||
| Uthernet.DRV | Working | | 0.9 |
|
||||
| Uthernet2.DRV | Working | | 0.8 |
|
||||
| Uther2.AI.DRV | In Progress | With ARP/IP Offloading | 0.8 |
|
||||
| LanCeGS.DRV | Working | | 0.8 |
|
||||
|
||||
## BIN,External Shell commands:
|
||||
| Name | Status | Comment | K.Ver |
|
||||
|
@ -7,6 +7,8 @@ AUTO 6
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.BASL0 .EQ $800
|
||||
*--------------------------------------
|
||||
DevMgr.LoMem .EQ *
|
||||
*--------------------------------------
|
||||
DevMgr.NUL.Code cld
|
||||
jmp (.1,x)
|
||||
.1 .DA DevMgr.NUL.Status
|
||||
@ -29,8 +31,8 @@ DevMgr.NUL.Status
|
||||
*--------------------------------------
|
||||
DevMgr.NUL.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
|
||||
.DA #0,#0,#0
|
||||
>PSTR "NUL DEVICE "
|
||||
.DA #0
|
||||
>PSTR "NULL DEVICE "
|
||||
.DA #S.DEVSTAT.TYPE.CHAR
|
||||
.DA #0
|
||||
.DA $0900
|
||||
*--------------------------------------
|
||||
@ -59,7 +61,7 @@ DevMgr.SYS.Status
|
||||
DevMgr.SYS.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
|
||||
.DA #0,#0,#0
|
||||
>PSTR "A2osX SYS Screen"
|
||||
.DA #0
|
||||
.DA #S.DEVSTAT.TYPE.CHAR
|
||||
.DA #0
|
||||
.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.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
|
||||
SAVE SYS/KERNEL.S.D01
|
||||
LOAD SYS/KERNEL.S
|
||||
|
@ -5,8 +5,8 @@ INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
DevMgr.Stat .DA DevMgr.LoMem Lomem
|
||||
DevMgr.Free .DA DevMgr.LoMem Free
|
||||
DevMgr.Stat .DA DevMgr.LoMem
|
||||
DevMgr.Free .DA DevMgr.FreeMem
|
||||
.DA DevMgr.HiMem
|
||||
DevMgr.Count .DA #2 NUL,SYS
|
||||
*--------------------------------------
|
||||
|
@ -143,14 +143,17 @@ DevMgr.SYS .DA DevMgr.SYS.Code
|
||||
* Setup AuxLC $FFFE->Kernel IRQ Handler
|
||||
* 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
|
||||
sei
|
||||
>LDYA $FFFE
|
||||
>STYA K.IrqMgrOldFFFE
|
||||
>LDYAI K.IrqHandlerAuxLC
|
||||
>STYA $FFFE
|
||||
plp
|
||||
|
||||
|
||||
>LDYAI IrqHandler
|
||||
>STYA MLICALL.PARAMS+2
|
||||
>MLICALL MLIALLOCIRQ
|
||||
@ -158,8 +161,74 @@ IrqMgrInit php
|
||||
|
||||
lda MLICALL.PARAMS+1
|
||||
sta ProDOS.INTNUM
|
||||
|
||||
stz ZPPtr1 Try finding a Mouse Card...
|
||||
lda #$C1
|
||||
sta ZPPtr1+1
|
||||
|
||||
.1 ldx #DEVSIG.Value-DEVSIG.Offset-1
|
||||
|
||||
.9 rts
|
||||
.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
|
||||
lda #$C1
|
||||
|
Loading…
Reference in New Issue
Block a user