mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-26 11:30:07 +00:00
Kernel version 0.9 : ....More IRQ/VBL enhancement
This commit is contained in:
parent
24137e69bf
commit
0442bf83c2
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.
@ -1,6 +1,6 @@
|
|||||||
PR#3
|
PR#3
|
||||||
PREFIX /A2OSX.SRC
|
PREFIX /A2OSX.SRC
|
||||||
NEW
|
LOMEM $A00
|
||||||
INC 1
|
INC 1
|
||||||
AUTO 6
|
AUTO 6
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
@ -10,6 +10,7 @@ AUTO 6
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.INB /A2OSX.DEV/INC/MACROS.I
|
.INB /A2OSX.DEV/INC/MACROS.I
|
||||||
.INB /A2OSX.DEV/INC/A2OSX.I
|
.INB /A2OSX.DEV/INC/A2OSX.I
|
||||||
|
.INB /A2OSX.DEV/INC/PRODOS.I
|
||||||
.INB /A2OSX.DEV/INC/IO.I
|
.INB /A2OSX.DEV/INC/IO.I
|
||||||
.INB /A2OSX.DEV/INC/LIBGFX.I
|
.INB /A2OSX.DEV/INC/LIBGFX.I
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -127,24 +128,25 @@ MSG.DETECT >CSTR "\nApple IIe/IIc DHGR Driver.\n"
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* 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
|
|
||||||
.DA #S.DEV.F.EVENT
|
|
||||||
>PSTR "GFX" NAME
|
>PSTR "GFX" NAME
|
||||||
.HS 00 NAME must Be 5 bytes long
|
.HS 00 NAME must Be 5 bytes long
|
||||||
.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 BADCALL
|
||||||
|
.DA BADCALL
|
||||||
|
.DA BADCALL
|
||||||
|
.DA BADCALL
|
||||||
|
.DA BADCALL
|
||||||
|
.DA OPEN
|
||||||
.DA CLOSE
|
.DA CLOSE
|
||||||
.DA GETINFO
|
.DA BADCALL
|
||||||
.DA IRQ
|
.DA BADCALL
|
||||||
.DA SELECT
|
|
||||||
.DA SETPIXEL
|
.DA SETPIXEL
|
||||||
.DA GETPIXEL
|
.DA GETPIXEL
|
||||||
.DA HLINE
|
.DA HLINE
|
||||||
@ -155,22 +157,23 @@ DRV.CS.START .DA OPEN
|
|||||||
.DA SETCUR
|
.DA SETCUR
|
||||||
.DA HIDECUR
|
.DA HIDECUR
|
||||||
.DA SHOWCUR
|
.DA SHOWCUR
|
||||||
L.DEVINFO .DA DEVINFO
|
L.DEVSTAT .DA DEVSTAT
|
||||||
L.DIV7.0 .DA DIV7.0
|
L.DIV7.0 .DA DIV7.0
|
||||||
L.MOD7.0 .DA MOD7.0
|
L.MOD7.0 .DA MOD7.0
|
||||||
L.Shift0.Lo .DA Shift0.lo
|
L.Shift0.Lo .DA Shift0.lo
|
||||||
L.Shift0.Hi .DA Shift0.hi
|
L.Shift0.Hi .DA Shift0.hi
|
||||||
.DA 0 end or relocation
|
.DA 0 end or relocation
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
OPEN ldy #S.DEV.ID
|
BADCALL lda #MLI.ERR.BADCALL
|
||||||
lda (pDev),y
|
sec
|
||||||
sta A2osX.SCRNDEVS+2
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
STATUS >LDYA L.DEVSTAT
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
OPEN sta A2osX.SCRNDEVS+2 DEV.ID in A
|
||||||
|
|
||||||
lda #3
|
|
||||||
sta A2osX.ASCREEN
|
|
||||||
|
|
||||||
jsr SELECT
|
|
||||||
|
|
||||||
lda L.DIV7.0+1
|
lda L.DIV7.0+1
|
||||||
sta DIV7.hi
|
sta DIV7.hi
|
||||||
inc
|
inc
|
||||||
@ -208,26 +211,7 @@ OPEN ldy #S.DEV.ID
|
|||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
GETEVENT lda A2osX.ASCREEN
|
CONTROL sta CLRTEXT
|
||||||
cmp #3 is HGR1 screen active?
|
|
||||||
bne .9 no....exit
|
|
||||||
|
|
||||||
.9 lda #0 Error = no event
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
COUT
|
|
||||||
IRQ sec
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
CLOSE clc
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
GETINFO >LDYA L.DEVINFO
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
SELECT sta CLRTEXT
|
|
||||||
sta CLRMIXED
|
sta CLRMIXED
|
||||||
sta SETHIRES
|
sta SETHIRES
|
||||||
sta CLR80STORE
|
sta CLR80STORE
|
||||||
@ -242,9 +226,16 @@ SELECT sta CLRTEXT
|
|||||||
* sta SETDHIRES
|
* sta SETDHIRES
|
||||||
* sta CLRDHIRES
|
* sta CLRDHIRES
|
||||||
* sta SETDHIRES
|
* sta SETDHIRES
|
||||||
|
|
||||||
|
lda #3
|
||||||
|
sta A2osX.ASCREEN
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
CLOSE clc
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
* SETPIXEL
|
* SETPIXEL
|
||||||
* In : YA = Ptr to CtrlBlk :
|
* In : YA = Ptr to CtrlBlk :
|
||||||
* 0 : X
|
* 0 : X
|
||||||
@ -637,10 +628,17 @@ SB.Page .BS 1
|
|||||||
SB.StartCol .BS 1
|
SB.StartCol .BS 1
|
||||||
SB.Col .BS 1
|
SB.Col .BS 1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DEVINFO .DA #S.DEVINFO.TYPE.GFX type of DEVINFO STRUCT
|
DEVSTAT .DA #0
|
||||||
DEVINFO.MODES .DA #%10000011 XOR,16 & B/W
|
.DA #0,#0,#0 size
|
||||||
DEVINFO.W .DA 560 X.SIZE
|
>PSTR "Apple II Mouse"
|
||||||
DEVINFO.H .DA 192 Y.SIZE
|
.BS 2
|
||||||
|
.DA #0
|
||||||
|
.DA #0
|
||||||
|
.DA $0900
|
||||||
|
*--------------------------------------
|
||||||
|
DEVSTAT.MODES .DA #%10000011 XOR,16 & B/W
|
||||||
|
DEVSTAT.W .DA 560 X.SIZE
|
||||||
|
DEVSTAT.H .DA 192 Y.SIZE
|
||||||
.LIST ON
|
.LIST ON
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.SIZE .EQ *-DRV.CS.START
|
DRV.SIZE .EQ *-DRV.CS.START
|
||||||
|
@ -159,9 +159,9 @@ STATUS >LDYA L.DEVSTAT
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
OPEN php to read IIe ROM ID bytes
|
OPEN php
|
||||||
sei
|
sei
|
||||||
|
|
||||||
ldx DEVSLOT0n
|
ldx DEVSLOT0n
|
||||||
lda MOUSEMODx,x keep if VBLInt already activated by kernel
|
lda MOUSEMODx,x keep if VBLInt already activated by kernel
|
||||||
and #MOUSEMODx.INTVBL
|
and #MOUSEMODx.INTVBL
|
||||||
|
@ -243,7 +243,6 @@ S.TCP.DSTPORT .EQ S.IP+2
|
|||||||
S.TCP.SEQ.NUMBER .EQ S.IP+4
|
S.TCP.SEQ.NUMBER .EQ S.IP+4
|
||||||
S.TCP.ACK.NUMBER .EQ S.IP+8
|
S.TCP.ACK.NUMBER .EQ S.IP+8
|
||||||
S.TCP.DATAOFFSET .EQ S.IP+12
|
S.TCP.DATAOFFSET .EQ S.IP+12
|
||||||
S.TCP.DATAOFFSET20 .EQ $50
|
|
||||||
S.TCP.OPTIONS .EQ S.IP+13
|
S.TCP.OPTIONS .EQ S.IP+13
|
||||||
S.TCP.OPTIONS.URG .EQ %00100000
|
S.TCP.OPTIONS.URG .EQ %00100000
|
||||||
S.TCP.OPTIONS.ACK .EQ %00010000
|
S.TCP.OPTIONS.ACK .EQ %00010000
|
||||||
|
@ -163,10 +163,25 @@ SKT.SEND.UDP lda #S.IP.PROTOCOL.UDP
|
|||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SKT.SEND.TCP
|
SKT.SEND.TCP lda #S.IP.PROTOCOL.TCP
|
||||||
bra *
|
jsr FRM.NewA
|
||||||
sec
|
bcs .9
|
||||||
rts
|
|
||||||
|
>LDAXI S.TCP-2
|
||||||
|
jsr SKT.SetFrameOutLenAX
|
||||||
|
|
||||||
|
>LDAXI S.TCP
|
||||||
|
jsr SKT.SetDataOutPtrAX
|
||||||
|
|
||||||
|
jsr SKT.SetFrameOutDstIP
|
||||||
|
|
||||||
|
jsr SKT.SetFrameOutPorts
|
||||||
|
|
||||||
|
jsr SKT.CopyDataInToOut
|
||||||
|
|
||||||
|
jmp FRM.SendTCP
|
||||||
|
|
||||||
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SKT.SEND.RAW ldy #S.SOCKET.RAW.PROTO
|
SKT.SEND.RAW ldy #S.SOCKET.RAW.PROTO
|
||||||
lda (ZPPtrSKT),y
|
lda (ZPPtrSKT),y
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
PR#3
|
PR#3
|
||||||
PREFIX /A2OSX.SRC
|
PREFIX /A2OSX.SRC
|
||||||
NEW
|
LOMEM $A00
|
||||||
INC 1
|
INC 1
|
||||||
AUTO 6
|
AUTO 6
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
@ -15,7 +15,17 @@ AUTO 6
|
|||||||
EVT.GetEvents stz pEvent point to start of event list
|
EVT.GetEvents stz pEvent point to start of event list
|
||||||
stz EvtMgr.Count reset Size
|
stz EvtMgr.Count reset Size
|
||||||
|
|
||||||
lda VBL get VLINE status
|
lda K.IrkMgr.VBL do we have IRQ enabled for VBL ?
|
||||||
|
beq .10 no, regular poll
|
||||||
|
|
||||||
|
lda K.IrkMgr.VBLINT
|
||||||
|
beq EVT.GetEvents.DEV no
|
||||||
|
|
||||||
|
dec K.IrkMgr.VBLINT
|
||||||
|
stz K.IrkMgr.VBLINT
|
||||||
|
bra .11
|
||||||
|
|
||||||
|
.10 lda VBL get VLINE status
|
||||||
tax
|
tax
|
||||||
eor EvtMgr.VBLState
|
eor EvtMgr.VBLState
|
||||||
bpl EVT.GetEvents.DEV no change,no tick
|
bpl EVT.GetEvents.DEV no change,no tick
|
||||||
@ -23,10 +33,7 @@ EVT.GetEvents stz pEvent point to start of event list
|
|||||||
sta EvtMgr.VBLState save new
|
sta EvtMgr.VBLState save new
|
||||||
bpl EVT.GetEvents.DEV Up2down transition,no tick
|
bpl EVT.GetEvents.DEV Up2down transition,no tick
|
||||||
|
|
||||||
* sta PDLTRIG clr VBL (IIc)
|
.11 inc A2osX.TIMER16
|
||||||
* lda RDIOUDIS clr VBL (IIc)
|
|
||||||
|
|
||||||
inc A2osX.TIMER16
|
|
||||||
bne .1
|
bne .1
|
||||||
inc A2osX.TIMER16+1
|
inc A2osX.TIMER16+1
|
||||||
|
|
||||||
@ -50,12 +57,12 @@ EVT.GetEvents stz pEvent point to start of event list
|
|||||||
jsr EVT.GetEvents.Add
|
jsr EVT.GetEvents.Add
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EVT.GetEvents.DEV
|
EVT.GetEvents.DEV
|
||||||
>LDYAI DevMgr.Table
|
* >LDYAI DevMgr.Table
|
||||||
>STYA pDev
|
* >STYA pDev
|
||||||
|
|
||||||
stz EvtMgr.Idx
|
* stz EvtMgr.Idx
|
||||||
|
|
||||||
.1 ldy #S.DEV.F
|
*.1 ldy #S.DEV.F
|
||||||
* lda (pDev),y get S.DEV.F
|
* lda (pDev),y get S.DEV.F
|
||||||
* bit #S.DEV.F.EVENT
|
* bit #S.DEV.F.EVENT
|
||||||
* beq .2 EVENT enabled ?
|
* beq .2 EVENT enabled ?
|
||||||
@ -73,18 +80,18 @@ EVT.GetEvents.DEV
|
|||||||
|
|
||||||
* bcs .8 Event Q is full, exit now with CC
|
* bcs .8 Event Q is full, exit now with CC
|
||||||
|
|
||||||
.2 lda pDev
|
*.2 lda pDev
|
||||||
clc
|
* clc
|
||||||
adc #S.DEV
|
* adc #S.DEV
|
||||||
sta pDev
|
* sta pDev
|
||||||
bcc .3
|
* bcc .3
|
||||||
inc pDev+1
|
* inc pDev+1
|
||||||
|
*
|
||||||
.3 lda EvtMgr.Idx
|
*.3 lda EvtMgr.Idx
|
||||||
inc EvtMgr.Idx
|
* inc EvtMgr.Idx
|
||||||
cmp DevMgr.Count
|
* cmp DevMgr.Count
|
||||||
bne .1
|
* bne .1
|
||||||
|
sec
|
||||||
lda EvtMgr.Count if 0, exit with CS (from cmp), and A=0 "no event"
|
lda EvtMgr.Count if 0, exit with CS (from cmp), and A=0 "no event"
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ IrqHandler cld
|
|||||||
stx A2osX.SaveSM
|
stx A2osX.SaveSM
|
||||||
ldx A2osX.SaveSX
|
ldx A2osX.SaveSX
|
||||||
txs
|
txs
|
||||||
|
|
||||||
jsr K.IrqHandler
|
jsr K.IrqHandler
|
||||||
|
|
||||||
tsx
|
tsx
|
||||||
|
@ -143,9 +143,9 @@ 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
|
SETMOUSE .EQ $12 Sets mouse mode
|
||||||
|
SERVEMOUSE .EQ $13 Services mouse interrupt
|
||||||
INITMOUSE .EQ $19 Resets mouse clamps to default values,sets mouse position to 0,0
|
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
|
||||||
@ -181,7 +181,7 @@ IrqMgrInit php
|
|||||||
cmp #$C8
|
cmp #$C8
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
.8 plp
|
plp
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -190,45 +190,51 @@ IrqMgrInit php
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
.4 lda ZPPtr1+1
|
.4 lda ZPPtr1+1
|
||||||
sta DEVSLOTCn
|
sta GOMOUSE.JMP+2 DEVSLOTCn
|
||||||
|
sta K.IrqMgrVBL.JMP+2
|
||||||
and #$0F
|
and #$0F
|
||||||
sta DEVSLOT0n
|
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
sta DEVSLOTn0
|
sta GOMOUSE.n0+1
|
||||||
|
|
||||||
ldx DEVSLOT0n
|
ldy #SERVEMOUSE
|
||||||
lda #MOUSEMODx.INTVBL
|
lda (ZPPtr1),y
|
||||||
ldy #SETMOUSE
|
sta K.IrqMgrVBL.JMP+1
|
||||||
jsr GOMOUSE
|
|
||||||
|
|
||||||
bit RROMBNK2 Renable ROM to allow MOUSE II firmware
|
bit RROMBNK2 Renable ROM to allow MOUSE II firmware works properly
|
||||||
|
|
||||||
ldy #INITMOUSE Reset
|
ldy #INITMOUSE Reset
|
||||||
jsr GOMOUSE
|
jsr GOMOUSE
|
||||||
|
bcs *
|
||||||
|
|
||||||
|
lda #8
|
||||||
|
ldy #SETMOUSE
|
||||||
|
jsr GOMOUSE
|
||||||
|
bcs *
|
||||||
|
|
||||||
bit RRAMWRAMBNK1 Back To LC Ram
|
bit RRAMWRAMBNK1 Back To LC Ram
|
||||||
bit RRAMWRAMBNK1
|
bit RRAMWRAMBNK1
|
||||||
|
|
||||||
bra .8
|
inc K.IrkMgr.VBL
|
||||||
|
|
||||||
|
plp
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
GOMOUSE pha
|
GOMOUSE pha
|
||||||
stz ZPPtr1
|
stz ZPPtr1
|
||||||
ldx DEVSLOTCn
|
ldx GOMOUSE.JMP+2 DEVSLOTCn
|
||||||
stx ZPPtr1+1
|
stx ZPPtr1+1
|
||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
sta ZPPtr1
|
sta GOMOUSE.JMP+1
|
||||||
ldy DEVSLOTn0
|
GOMOUSE.n0 ldy #$ff
|
||||||
pla
|
pla
|
||||||
jmp (ZPPtr1)
|
GOMOUSE.JMP jmp $ffff Self Modified
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DEVSIG.Offset .HS 05070B0CFB
|
DEVSIG.Offset .HS 05070B0CFB
|
||||||
DEVSIG.Value .HS 38180120D6
|
DEVSIG.Value .HS 38180120D6
|
||||||
DEVSLOT0n .BS 1
|
|
||||||
DEVSLOTn0 .BS 1
|
|
||||||
DEVSLOTCn .BS 1
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DevMgrInit stz ZPPtr1
|
DevMgrInit stz ZPPtr1
|
||||||
lda #$C1
|
lda #$C1
|
||||||
|
@ -53,12 +53,24 @@ K.IrqMgrOldFFFE .BS 2
|
|||||||
K.IrqMgr.A .BS 1
|
K.IrqMgr.A .BS 1
|
||||||
K.IrqMgr.X .BS 1
|
K.IrqMgr.X .BS 1
|
||||||
K.IrqMgr.Y .BS 1
|
K.IrqMgr.Y .BS 1
|
||||||
|
K.IrkMgr.VBL .BS 1
|
||||||
|
K.IrkMgr.VBLINT .BS 1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Called by ProDOS IRQ Manager (GP)
|
* Called by ProDOS IRQ Manager (GP)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.IrqHandler >LDYAI DevMgr.Table
|
K.IrqHandler lda K.IrkMgr.VBL
|
||||||
>STYA $fe
|
beq .10
|
||||||
|
|
||||||
|
jsr K.IrqMgrVBL.JMP
|
||||||
|
bcs .10 Not From Mouse VBL
|
||||||
|
|
||||||
|
inc K.IrkMgr.VBLINT
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.10 >LDYAI DevMgr.Table
|
||||||
|
>STYA $fe
|
||||||
|
|
||||||
ldx DevMgr.Count
|
ldx DevMgr.Count
|
||||||
|
|
||||||
.1 ldy #S.DEV.S
|
.1 ldy #S.DEV.S
|
||||||
@ -85,6 +97,8 @@ K.IrqHandler >LDYAI DevMgr.Table
|
|||||||
|
|
||||||
.8 rts
|
.8 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
K.IrqMgrVBL.JMP jmp $0000
|
||||||
|
*--------------------------------------
|
||||||
K.IrqHandlerJMP lda ($fe)
|
K.IrqHandlerJMP lda ($fe)
|
||||||
sta .1+1
|
sta .1+1
|
||||||
ldy #1
|
ldy #1
|
||||||
|
Loading…
Reference in New Issue
Block a user