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
|
||||
PREFIX /A2OSX.SRC
|
||||
NEW
|
||||
LOMEM $A00
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
@ -10,6 +10,7 @@ AUTO 6
|
||||
*--------------------------------------
|
||||
.INB /A2OSX.DEV/INC/MACROS.I
|
||||
.INB /A2OSX.DEV/INC/A2OSX.I
|
||||
.INB /A2OSX.DEV/INC/PRODOS.I
|
||||
.INB /A2OSX.DEV/INC/IO.I
|
||||
.INB /A2OSX.DEV/INC/LIBGFX.I
|
||||
*--------------------------------------
|
||||
@ -127,24 +128,25 @@ MSG.DETECT >CSTR "\nApple IIe/IIc DHGR Driver.\n"
|
||||
*--------------------------------------
|
||||
* Device Header (16 Bytes)
|
||||
*--------------------------------------
|
||||
DEV.HEADER cld
|
||||
jmp (DRV.CS.START,x)
|
||||
.HS 00 DevID
|
||||
.DA #S.DEV.F.EVENT
|
||||
DEV.HEADER .DA DRV.CS.START
|
||||
.DA #0
|
||||
>PSTR "GFX" NAME
|
||||
.HS 00 NAME must Be 5 bytes long
|
||||
.HS 00
|
||||
.HS 00.00.00.00
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
DRV.CS.START .DA OPEN
|
||||
.DA GETEVENT
|
||||
.DA COUT
|
||||
DRV.CS.START cld
|
||||
jmp (.1,x)
|
||||
.1 .DA STATUS
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA OPEN
|
||||
.DA CLOSE
|
||||
.DA GETINFO
|
||||
.DA IRQ
|
||||
.DA SELECT
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA SETPIXEL
|
||||
.DA GETPIXEL
|
||||
.DA HLINE
|
||||
@ -155,21 +157,22 @@ DRV.CS.START .DA OPEN
|
||||
.DA SETCUR
|
||||
.DA HIDECUR
|
||||
.DA SHOWCUR
|
||||
L.DEVINFO .DA DEVINFO
|
||||
L.DEVSTAT .DA DEVSTAT
|
||||
L.DIV7.0 .DA DIV7.0
|
||||
L.MOD7.0 .DA MOD7.0
|
||||
L.Shift0.Lo .DA Shift0.lo
|
||||
L.Shift0.Hi .DA Shift0.hi
|
||||
.DA 0 end or relocation
|
||||
*--------------------------------------
|
||||
OPEN ldy #S.DEV.ID
|
||||
lda (pDev),y
|
||||
sta A2osX.SCRNDEVS+2
|
||||
|
||||
lda #3
|
||||
sta A2osX.ASCREEN
|
||||
|
||||
jsr SELECT
|
||||
BADCALL lda #MLI.ERR.BADCALL
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
STATUS >LDYA L.DEVSTAT
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
OPEN sta A2osX.SCRNDEVS+2 DEV.ID in A
|
||||
|
||||
lda L.DIV7.0+1
|
||||
sta DIV7.hi
|
||||
@ -208,26 +211,7 @@ OPEN ldy #S.DEV.ID
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
GETEVENT lda A2osX.ASCREEN
|
||||
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
|
||||
CONTROL sta CLRTEXT
|
||||
sta CLRMIXED
|
||||
sta SETHIRES
|
||||
sta CLR80STORE
|
||||
@ -242,9 +226,16 @@ SELECT sta CLRTEXT
|
||||
* sta SETDHIRES
|
||||
* sta CLRDHIRES
|
||||
* sta SETDHIRES
|
||||
|
||||
lda #3
|
||||
sta A2osX.ASCREEN
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CLOSE clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
* SETPIXEL
|
||||
* In : YA = Ptr to CtrlBlk :
|
||||
* 0 : X
|
||||
@ -637,10 +628,17 @@ SB.Page .BS 1
|
||||
SB.StartCol .BS 1
|
||||
SB.Col .BS 1
|
||||
*--------------------------------------
|
||||
DEVINFO .DA #S.DEVINFO.TYPE.GFX type of DEVINFO STRUCT
|
||||
DEVINFO.MODES .DA #%10000011 XOR,16 & B/W
|
||||
DEVINFO.W .DA 560 X.SIZE
|
||||
DEVINFO.H .DA 192 Y.SIZE
|
||||
DEVSTAT .DA #0
|
||||
.DA #0,#0,#0 size
|
||||
>PSTR "Apple II Mouse"
|
||||
.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
|
||||
*--------------------------------------
|
||||
DRV.SIZE .EQ *-DRV.CS.START
|
||||
|
@ -159,7 +159,7 @@ STATUS >LDYA L.DEVSTAT
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
OPEN php to read IIe ROM ID bytes
|
||||
OPEN php
|
||||
sei
|
||||
|
||||
ldx DEVSLOT0n
|
||||
|
@ -243,7 +243,6 @@ S.TCP.DSTPORT .EQ S.IP+2
|
||||
S.TCP.SEQ.NUMBER .EQ S.IP+4
|
||||
S.TCP.ACK.NUMBER .EQ S.IP+8
|
||||
S.TCP.DATAOFFSET .EQ S.IP+12
|
||||
S.TCP.DATAOFFSET20 .EQ $50
|
||||
S.TCP.OPTIONS .EQ S.IP+13
|
||||
S.TCP.OPTIONS.URG .EQ %00100000
|
||||
S.TCP.OPTIONS.ACK .EQ %00010000
|
||||
|
@ -163,10 +163,25 @@ SKT.SEND.UDP lda #S.IP.PROTOCOL.UDP
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
SKT.SEND.TCP
|
||||
bra *
|
||||
sec
|
||||
rts
|
||||
SKT.SEND.TCP lda #S.IP.PROTOCOL.TCP
|
||||
jsr FRM.NewA
|
||||
bcs .9
|
||||
|
||||
>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
|
||||
lda (ZPPtrSKT),y
|
||||
|
@ -1,6 +1,6 @@
|
||||
PR#3
|
||||
PREFIX /A2OSX.SRC
|
||||
NEW
|
||||
LOMEM $A00
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
@ -15,7 +15,17 @@ AUTO 6
|
||||
EVT.GetEvents stz pEvent point to start of event list
|
||||
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
|
||||
eor EvtMgr.VBLState
|
||||
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
|
||||
bpl EVT.GetEvents.DEV Up2down transition,no tick
|
||||
|
||||
* sta PDLTRIG clr VBL (IIc)
|
||||
* lda RDIOUDIS clr VBL (IIc)
|
||||
|
||||
inc A2osX.TIMER16
|
||||
.11 inc A2osX.TIMER16
|
||||
bne .1
|
||||
inc A2osX.TIMER16+1
|
||||
|
||||
@ -50,12 +57,12 @@ EVT.GetEvents stz pEvent point to start of event list
|
||||
jsr EVT.GetEvents.Add
|
||||
*--------------------------------------
|
||||
EVT.GetEvents.DEV
|
||||
>LDYAI DevMgr.Table
|
||||
>STYA pDev
|
||||
* >LDYAI DevMgr.Table
|
||||
* >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
|
||||
* bit #S.DEV.F.EVENT
|
||||
* beq .2 EVENT enabled ?
|
||||
@ -73,18 +80,18 @@ EVT.GetEvents.DEV
|
||||
|
||||
* bcs .8 Event Q is full, exit now with CC
|
||||
|
||||
.2 lda pDev
|
||||
clc
|
||||
adc #S.DEV
|
||||
sta pDev
|
||||
bcc .3
|
||||
inc pDev+1
|
||||
|
||||
.3 lda EvtMgr.Idx
|
||||
inc EvtMgr.Idx
|
||||
cmp DevMgr.Count
|
||||
bne .1
|
||||
|
||||
*.2 lda pDev
|
||||
* clc
|
||||
* adc #S.DEV
|
||||
* sta pDev
|
||||
* bcc .3
|
||||
* inc pDev+1
|
||||
*
|
||||
*.3 lda EvtMgr.Idx
|
||||
* inc EvtMgr.Idx
|
||||
* cmp DevMgr.Count
|
||||
* bne .1
|
||||
sec
|
||||
lda EvtMgr.Count if 0, exit with CS (from cmp), and A=0 "no event"
|
||||
beq .9
|
||||
|
||||
|
@ -144,8 +144,8 @@ DevMgr.SYS .DA DevMgr.SYS.Code
|
||||
* if irq not handled, jmp (S.IrqMgrOldFFFE)
|
||||
*--------------------------------------
|
||||
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
|
||||
MOUSEMODx.INTVBL .EQ %00001000
|
||||
*--------------------------------------
|
||||
IrqMgrInit php
|
||||
sei
|
||||
@ -181,7 +181,7 @@ IrqMgrInit php
|
||||
cmp #$C8
|
||||
bne .1
|
||||
|
||||
.8 plp
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
|
||||
@ -190,45 +190,51 @@ IrqMgrInit php
|
||||
rts
|
||||
|
||||
.4 lda ZPPtr1+1
|
||||
sta DEVSLOTCn
|
||||
sta GOMOUSE.JMP+2 DEVSLOTCn
|
||||
sta K.IrqMgrVBL.JMP+2
|
||||
and #$0F
|
||||
sta DEVSLOT0n
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
sta DEVSLOTn0
|
||||
sta GOMOUSE.n0+1
|
||||
|
||||
ldx DEVSLOT0n
|
||||
lda #MOUSEMODx.INTVBL
|
||||
ldy #SETMOUSE
|
||||
jsr GOMOUSE
|
||||
ldy #SERVEMOUSE
|
||||
lda (ZPPtr1),y
|
||||
sta K.IrqMgrVBL.JMP+1
|
||||
|
||||
bit RROMBNK2 Renable ROM to allow MOUSE II firmware
|
||||
bit RROMBNK2 Renable ROM to allow MOUSE II firmware works properly
|
||||
|
||||
ldy #INITMOUSE Reset
|
||||
jsr GOMOUSE
|
||||
bcs *
|
||||
|
||||
lda #8
|
||||
ldy #SETMOUSE
|
||||
jsr GOMOUSE
|
||||
bcs *
|
||||
|
||||
bit RRAMWRAMBNK1 Back To LC Ram
|
||||
bit RRAMWRAMBNK1
|
||||
|
||||
bra .8
|
||||
inc K.IrkMgr.VBL
|
||||
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
GOMOUSE pha
|
||||
stz ZPPtr1
|
||||
ldx DEVSLOTCn
|
||||
ldx GOMOUSE.JMP+2 DEVSLOTCn
|
||||
stx ZPPtr1+1
|
||||
lda (ZPPtr1),y
|
||||
sta ZPPtr1
|
||||
ldy DEVSLOTn0
|
||||
sta GOMOUSE.JMP+1
|
||||
GOMOUSE.n0 ldy #$ff
|
||||
pla
|
||||
jmp (ZPPtr1)
|
||||
GOMOUSE.JMP jmp $ffff Self Modified
|
||||
*--------------------------------------
|
||||
DEVSIG.Offset .HS 05070B0CFB
|
||||
DEVSIG.Value .HS 38180120D6
|
||||
DEVSLOT0n .BS 1
|
||||
DEVSLOTn0 .BS 1
|
||||
DEVSLOTCn .BS 1
|
||||
*--------------------------------------
|
||||
DevMgrInit stz ZPPtr1
|
||||
lda #$C1
|
||||
|
@ -53,10 +53,22 @@ K.IrqMgrOldFFFE .BS 2
|
||||
K.IrqMgr.A .BS 1
|
||||
K.IrqMgr.X .BS 1
|
||||
K.IrqMgr.Y .BS 1
|
||||
K.IrkMgr.VBL .BS 1
|
||||
K.IrkMgr.VBLINT .BS 1
|
||||
*--------------------------------------
|
||||
* Called by ProDOS IRQ Manager (GP)
|
||||
*--------------------------------------
|
||||
K.IrqHandler >LDYAI DevMgr.Table
|
||||
K.IrqHandler lda K.IrkMgr.VBL
|
||||
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
|
||||
@ -85,6 +97,8 @@ K.IrqHandler >LDYAI DevMgr.Table
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
K.IrqMgrVBL.JMP jmp $0000
|
||||
*--------------------------------------
|
||||
K.IrqHandlerJMP lda ($fe)
|
||||
sta .1+1
|
||||
ldy #1
|
||||
|
Loading…
Reference in New Issue
Block a user